query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// SetObjectId sets the ObjectId field's value.
[ "func (s *EvaluateExpressionInput) SetObjectId(v string) *EvaluateExpressionInput {\n\ts.ObjectId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Simple function to get the prefix of an logchannel name.<p> @param logname the full name of the logging channel @return a string array with different package prefixes
[ "private String[] buildsufix(String logname) {\r\n\r\n // help String array to store all combination\r\n String[] prefix_temp = new String[logname.length()];\r\n int count = 0;\r\n while (logname.indexOf(\".\") > 1) {\r\n // separate the name of the logger into pieces of name ...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
文件每一行为一条路径 @param file @param alphabet @throws IOException
[ "public void loadFromFileWithPath(String file, LabelAlphabet alphabet) throws IOException {\r\n\t\tFile f = new File(file);\r\n\t\tFileInputStream in = new FileInputStream(f);\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in, \"UTF-8\"));\r\n\t\tString line;\r\n\t\twhile((line=reader.readL...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github text about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code:" }
takes an event for which messages should be generated, works out the type of notification, updates the notification history in redis, generates the notifications
[ "def process_notification(notification)\n Flapjack.logger.debug { \"Processing notification: #{notification.inspect}\" }\n\n check = notification.check\n check_name = check.name\n\n # TODO check whether time should come from something stored in the notification\n alerts = alerts_for(...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the parameter matching the passed key or null if non existent @param string $key
[ "public function getParameter($key) {\n\t\tif (array_key_exists ( $key, $this->parameters ))\n\t\t\treturn $this->parameters [$key];\n\t\telse\n\t\t\treturn null;\n\t}" ]
[ "def apply(self, search, field, value):\n \"\"\"\"\"\"\n # We assume that the field in question has a \"raw\" counterpart.\n return search.query('match', **{'{}.raw'.format(field): value})" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// SetFleetArn sets the FleetArn field's value.
[ "func (s *UpdateFleetMetadataInput) SetFleetArn(v string) *UpdateFleetMetadataInput {\n\ts.FleetArn = &v\n\treturn s\n}" ]
[ "@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
/* (non-PHPdoc) @see CrudGenerator\Generators\Strategies.StrategyInterface::generateFile()
[ "public function generateFile(array $datas, $skeletonDir, $pathTemplate, $pathTo)\n {\n $continue = true;\n while ($continue) {\n $results = $this->view->render(\n $skeletonDir,\n $pathTemplate,\n $datas\n );\n\n $this->c...
[ "public static function getDescription()\n {\n $pdoDriver = \\CrudGenerator\\Metadata\\Driver\\Pdo\\PdoDriverFactory::getDescription();\n $pdoDriver->getConfig()->response('dsn', \\CrudGenerator\\Metadata\\Driver\\Pdo\\PdoDriver::POSTGRESQL);\n\n $dataObject = new MetaDataSource();\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Objectify turns the node and all its children into a go type. // If a node was created from a slice initially, a slice will be return. // If a node has child nodes, a map will be returned. // Otherwise, a primitive type will be returned.
[ "func (n *Node) Objectify() interface{} {\n\tn.mtx.RLock()\n\tdefer n.mtx.RUnlock()\n\n\tif n.isNil() {\n\t\treturn nil\n\t}\n\n\tif n.Value != nil {\n\t\treturn n.Value\n\t}\n\n\tif n.sliceKids {\n\t\tobj := make([]interface{}, len(n.Children))\n\t\tfor k, v := range n.Children {\n\t\t\tindex, err := strconv.Atoi(...
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parses a scheme. @since 1.0.0 @param string $scheme The scheme. @return SchemeInterface|null The Scheme instance if the $scheme parameter is a valid scheme, null otherwise.
[ "public static function tryParse(string $scheme): ?SchemeInterface\n {\n if (!self::myParse($scheme, $result, $type, $defaultPort)) {\n return null;\n }\n\n return new self($result, $type, $defaultPort);\n }" ]
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Write tag. @param tag the tag @throws IOException Signals that an I/O exception has occurred.
[ "private void writeTagValue(TagValue tag) throws IOException {\n int id = tag.getId();\n\n // Write tag value\n for (abstractTiffType tt : tag.getValue()) {\n if (id == 700) {\n // XMP\n XMP xmp = (XMP)tt;\n try {\n xmp.write(data);\n }catch (Exception ex) {\n ...
[ "private void closeStreams(final Process process) throws IOException {\n IOException caught = null;\n\n try {\n process.getOutputStream().close();\n }\n catch (IOException e) {\n if (e.getMessage().equals(\"Stream closed\")) {\n /**\n * OutputStream's contract for the close() me...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Hooks into WordPress to start, commit and run garbage collector. @return void
[ "public function hooks() {\n\t\t// Start and commit the session.\n\t\tadd_action( 'plugins_loaded', [ $this, 'start_session' ] );\n\t\tadd_action( 'shutdown', [ $this, 'commit_session' ] );\n\n\t\t// Register the garbage collector.\n\t\tadd_action( 'wp', [ $this, 'register_garbage_collection' ] );\n\t\tadd_action( ...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns a new UnfilledDependency whose object is {@code newObject} and whose subject is equal to {@code this}'s subject. @param newObject @return
[ "public UnfilledDependency replaceObject(IndexedPredicate newObject) {\n return new UnfilledDependency(subject, subjectSyntax, subjectFunctionVarIndex,\n subjectArgIndex, newObject, -1);\n }" ]
[ "@Override\n public void isEqualTo(@NullableDecl Object other) {\n if (Objects.equal(actual(), other)) {\n return;\n }\n\n // Fail but with a more descriptive message:\n\n if (!(other instanceof Map)) {\n super.isEqualTo(other);\n return;\n }\n\n boolean mapEquals = containsEntries...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova
[ "def service_delete(service_id=None, name=None, profile=None, **connection_args):\n '''\n \n '''\n kstone = auth(profile, **connection_args)\n if name:\n service_id = service_get(name=name, profile=profile,\n **connection_args)[name]['id']\n kstone.services.d...
[ "def run():\n \"\"\"\"\"\"\n\n # NOTE(kiennt): Until now, this example isn't finished yet,\n # because we don't have any completed driver\n\n # Get a network client with openstack driver.\n\n network_client = client.Client(version=_VERSION,\n resource=_RESOURCES[0...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
removes a remote directory on server @return FTPCLient @throws IOException @throws PageException
[ "private AFTPClient actionRemoveDir() throws IOException, PageException {\n\trequired(\"directory\", directory);\n\n\tAFTPClient client = getClient();\n\tif (recursive) {\n\t removeRecursive(client, directory, FTPFile.DIRECTORY_TYPE);\n\t}\n\telse client.removeDirectory(directory);\n\n\twriteCfftp(client);\n\tre...
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about N/A:" }
Throws an exception if the argument is not null. @param argument the object to check @param name the name of the parameter
[ "public static void notNull(final Object argument, final String name) {\n if (argument == null) {\n s_logger.error(\"Argument {} was null\", name);\n throw new QuandlRuntimeException(\"Value \" + name + \" was null\");\n }\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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns an array of all minimum cycles in a graph This is not an efficient implementation O(n^4) and could be done using Minimum Spanning Trees. Hint. Hint.
[ "def cycles\n g = self.clone\n self.inject([]) do |acc, v| \n acc = acc.concat(g.cycles_with_vertex(v))\n g.remove_vertex(v); acc\n end\n end" ]
[ "def __is_subgraph_planar(graph):\n \"\"\"\"\"\"\n # --First pass: Determine edge and vertex counts validate Euler's Formula\n num_nodes = graph.num_nodes()\n num_edges = graph.num_edges()\n\n # --We can guarantee that if there are 4 or less nodes, then the graph is planar\n # --A 4-node simple gr...
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Create batch subrequest. For more detail @link https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/requests_composite_batch.htm @param record @return
[ "private JsonObject newSubrequest(RestEntry<JsonObject> record) {\n Preconditions.checkArgument(record.getResourcePath().isPresent(), \"Resource path is not defined\");\n JsonObject subReq = new JsonObject();\n subReq.addProperty(\"url\", record.getResourcePath().get());\n subReq.add(\"richInput\", reco...
[ "def describeSObject(self, sObjectsType):\n '''\n \n '''\n self._setHeaders('describeSObject')\n return self._sforce.service.describeSObject(sObjectsType)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
Retrieve multiple records by id. :param ids: List of record IDs. :param with_deleted: If `True` then it includes deleted records. :returns: A list of :class:`Record` instances.
[ "def get_records(cls, ids, with_deleted=False):\n \n with db.session.no_autoflush:\n query = RecordMetadata.query.filter(RecordMetadata.id.in_(ids))\n if not with_deleted:\n query = query.filter(RecordMetadata.json != None) # noqa\n\n return [cls(obj.js...
[ "def _viewset_results(self):\n \"\"\"\"\"\"\n results = []\n try:\n response = self._viewset_method(\n self._viewset.request, *self._request.args, **self._request.kwargs\n )\n\n if response.status_code == 200:\n results = response.d...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Extract thread name if available (lazy).
[ "def thread(self):\n \"\"\"\"\"\"\n if not self._thread_calculated:\n self._thread_calculated = True\n\n split_tokens = self.split_tokens\n\n if not self.datetime_nextpos:\n return None\n if len(split_tokens) <= self.datetime_nextpos:\n ...
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a Callback and register it to the queue Convenience method to allow for a fluent interface @var string $function @var mixed $params Parameters sent to the callback function @return Callback
[ "public function callback($function, $params = null)\n {\n $callback = new Callback($function, $params);\n $this->register($callback);\n\n return $callback;\n }" ]
[ "function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// Clone creates an identical copy of the given Seesaw Node.
[ "func (n *Node) Clone() *Node {\n\tvar c Node\n\tc.Copy(n)\n\treturn &c\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Rank-1 operation on real symmetric-packed matrix.
[ "def cublasSspr(handle, uplo, n, alpha, x, incx, AP):\n \n \n status = _libcublas.cublasSspr_v2(handle, \n _CUBLAS_FILL_MODE[uplo], n, \n ctypes.byref(ctypes.c_float(alpha)), \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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
add a value to the aggregator @param val a string.
[ "public void addNextValue(Object val) {\n String newVal = val.toString();\n if (this.minVal == null || this.minVal.compareTo(newVal) > 0) {\n this.minVal = newVal;\n }\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
For problems encountered while in driver DLL
[ "function DriverOperationError(code,description) {\n this.code = code;\n this.description = description;\n console.log('in DriverOperationError',code,description);\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:" }
Detect egg distributions located in the given folder. Only direct folder content is considered and subfolders are not searched recursively.
[ "def _detect_eggs_in_folder(folder):\r\n \r\n eggs = {}\r\n for x in os.listdir(folder):\r\n zip = x.endswith(_zip_ext)\r\n if zip:\r\n root = x[:-len(_zip_ext)]\r\n egg = _Egg.NONE\r\n elif x.endswith(_egg_ext):\r\n root = x[:-len(_egg_ext)]\r\n ...
[ "def setuptools_install_options(local_storage_folder):\r\n \r\n if local_storage_folder is None:\r\n return []\r\n # setuptools expects its find-links parameter to contain a list of link\r\n # sources (either local paths, file: URLs pointing to folders or URLs\r\n # pointing to a file containi...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set menu and submenu admin. @since 1.0.1 @param string $type → menu|submenu. @param string $slug → menu|submenu slug.
[ "private static function set( $type, $slug ) {\n\n\t\tglobal $pagenow;\n\n\t\t$data = self::$data[ $type ][ $slug ];\n\n\t\tdo_action( 'wp_menu_pre_add_' . $type . '_page' );\n\n\t\tif ( 'menu' === $type ) {\n\n\t\t\t$page = add_menu_page(\n\t\t\t\t$data['title'],\n\t\t\t\t$data['name'],\n\t\t\t\t$data['capability'...
[ "function init() {\n parent::init();\n // Set own core attributes\n $this->can_subaction = ACTION_NONE;\n //$this->can_subaction = ACTION_HAVE_SUBACTIONS;\n\n // Set own custom attributes\n $this->sesskey_protected = false; // This action doesn't need sesskey protection\n\n...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
This comes from the Apache Hive ORC code
[ "private void readValues()\n throws IOException\n {\n lastReadInputCheckpoint = input.getCheckpoint();\n\n int control = input.read();\n if (control == -1) {\n throw new OrcCorruptionException(input.getOrcDataSourceId(), \"Read past end of RLE integer\");\n }\n\n...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
// parseGracePeriods parses the grace period statements
[ "func parseGracePeriods(statements map[string]string) (map[evictionapi.Signal]time.Duration, error) {\n\tif len(statements) == 0 {\n\t\treturn nil, nil\n\t}\n\tresults := map[evictionapi.Signal]time.Duration{}\n\tfor signal, val := range statements {\n\t\tsignal := evictionapi.Signal(signal)\n\t\tif !validSignal(si...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
<p> Determines whether the target object and the specified object are equal by calling the <tt>equals</tt> method on the target object. </p> @param object the {@link Integer} to compare to the target @return true if both objects are equal, false if not.
[ "public static final Function<Integer,Boolean> eq(final Integer object) {\r\n return (Function<Integer,Boolean>)((Function)FnObject.eq(object));\r\n }" ]
[ "@Override\n public void putAll(Map<? extends TypeK, ? extends TypeV> m) {\n for (Map.Entry<? extends TypeK, ? extends TypeV> e : m.entrySet())\n put(e.getKey(), e.getValue());\n }\n\n /** Removes all of the mappings from this map. */\n @Override\n public void clear() { // Smack a new empty tab...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
TODO: Remove this function once the PR is merged https://github.com/apollographql/subscriptions-transport-ws/pull/477
[ "function getWrappedWebsocket() {\n const NativeWebSocket = window.WebSocket || window.MozWebSocket;\n const customWs = url => {\n const bearerToken = builder.getBearerToken();\n const token = bearerToken ? bearerToken.split(' ')[1] : null;\n const protocols = ['graphql-ws', token];\n return new Nativ...
[ "func IsNotFoundError(err error) bool {\n\tes := err.Error()\n\tif strings.Contains(es, \"does not exist\") {\n\t\t// set with the same name already exists\n\t\t// xref: https://github.com/Olipro/ipset/blob/master/lib/errcode.c#L32-L33\n\t\treturn true\n\t}\n\tif strings.Contains(es, \"element is missing\") {\n\t\t...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the distance between two points @param int $X1 @param int $Y1 @param int $X2 @param int $Y2 @return int|float
[ "public function getDistance($X1, $Y1, $X2, $Y2)\n {\n return sqrt(($X2 - $X1) * ($X2 - $X1) + ($Y2 - $Y1) * ($Y2 - $Y1));\n }" ]
[ "public function createLine(float $x1, float $y1, float $x2, float $y2): ReportBaseLine\n {\n return new ReportPdfLine($x1, $y1, $x2, $y2);\n }" ]
codesearchnet
{ "query": "Represent the post about mathematics:", "pos": "Represent the code about mathematics:", "neg": "Represent the code:" }
Set the callback function to consume on extra data changed events. Callback receives a IExtraDataChangedEvent object. Returns the callback_id
[ "def register_on_extra_data_changed(self, callback):\n \n event_type = library.VBoxEventType.on_extra_data_changed\n return self.event_source.register_callback(callback, event_type)" ]
[ "def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Tests the equality of two numbers. If you need to see if one number is greater than or less than another number, use Math_BigInteger::compare() @param Math_BigInteger $x @return bool @access public @see self::compare()
[ "function equals($x)\r\n {\r\n switch (MATH_BIGINTEGER_MODE) {\r\n case MATH_BIGINTEGER_MODE_GMP:\r\n return gmp_cmp($this->value, $x->value) == 0;\r\n default:\r\n return $this->value === $x->value && $this->is_negative == $x->is_negative;\r\n }\...
[ "@Pure /* not guaranteed pure , since toString() is invoked on the argument a*/\n\t@Inline(\"($1 + $2)\")\n\tpublic static String operator_plus(Object a, String b) {\n\t\treturn a + b;\n\t}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
Determine whether an exception can be fixed by logging in again. @param e [ApiError] the exception to check @return [Boolean] true if re-login is appropriate
[ "def re_login?(e)\n auth_error =\n (e.response_code == 403 && e.message =~ %r(.*cookie is expired or invalid)) ||\n e.response_code == 401\n\n renewable_creds =\n (@instance_token || (@email && (@password || @password_base64)) || @refresh_token)\n\n auth_error && renewable_creds\...
[ "def renew_access_token(access_token = nil, access_secret = nil, session_handle = nil)\n access_token ||= @atoken\n access_secret ||= @asecret\n session_handle ||= @session_handle\n\n old_token = ::OAuth::RequestToken.new(consumer, access_token, access_secret)\n\n # Underlying oauth cons...
codesearchnet
{ "query": "Represent the sentence about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
显示运行时间和内存占用 @return string
[ "protected function showTime()\n {\n $runtime = $this->swoole->runtime();\n // 显示运行时间\n $showTime = '执行时间: ' . $runtime['time'];\n // 显示内存占用\n $showTime .= ' | 内存占用:' . $runtime['memory'];\n return $showTime;\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// Nodes - returns number of unique servers.
[ "func (endpoints EndpointList) Nodes() int {\n\tuniqueNodes := set.NewStringSet()\n\tfor _, endpoint := range endpoints {\n\t\tif uniqueNodes.Contains(endpoint.Host) {\n\t\t\tcontinue\n\t\t}\n\t\tuniqueNodes.Add(endpoint.Host)\n\t}\n\treturn len(uniqueNodes)\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:" }
{@inheritdoc} @throws SQLSrvException
[ "public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0)\n {\n // do not try fetching from the statement if it's not expected to contain result\n // in order to prevent exceptional situation\n if ($this->stmt === null || ! $this->result) {\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Create a new virtualvenv with the requirements of this script.
[ "def create_venv(requested_deps, interpreter, is_current, options, pip_options):\n \"\"\"\"\"\"\n # create virtualenv\n env = _FadesEnvBuilder()\n env_path, env_bin_path, pip_installed = env.create_env(interpreter, is_current, options)\n venv_data = {}\n venv_data['env_path'] = env_path\n venv_...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Returns the JSON passed in wrapped within a <pre> tag. @param string $content The code you want to render @param boolean $dark Do you want the dark theme? @return string The HTML to render
[ "public function renderJson($json, $dark = true)\n {\n if (is_object($json)) {\n $jsonCode = json_encode($json, JSON_PRETTY_PRINT);\n } else if (is_array($json)) {\n $jsonCode = json_encode(($json) ? $json : (object) $json, JSON_PRETTY_PRINT);\n } else {\n $j...
[ "def javascript(value = nil, attributes = {})\n if value.is_a?(Hash)\n attributes = value\n value = nil\n elsif block_given? && value\n raise ArgumentError, \"You can't pass both a block and a value to javascript -- please choose one.\"\n end\n\n script(attributes.merge...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Creates the treeview stuff
[ "def setup_columns(self):\n \"\"\"\"\"\"\n tv = self.view['tv_categories']\n\n # sets the model\n tv.set_model(self.model)\n \n # creates the columns\n cell = gtk.CellRendererText()\n tvcol = gtk.TreeViewColumn('Name', cell)\n\n def cell_data_func(col, ...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Shutdown shuts down this manager.
[ "func (am *AutogitManager) Shutdown() {\n\tam.registryLock.Lock()\n\tdefer am.registryLock.Unlock()\n\tam.shutdown = true\n\tfor _, cancel := range am.deleteCancels {\n\t\tcancel()\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 Github sentence about Container management:", "pos": "Represent the Github code about Container management:", "neg": "Represent the Github code about programming:" }
appends blanks to the string if its shorter than <code>len</code>. @param s the string to pad @param len the minimum length for the string to have @return the padded string
[ "protected String fillUp(String s, int len) {\n while (s.length() < len)\n s += \" \";\n return s;\n }" ]
[ "def _clean_suffix(string, suffix):\n \n suffix_len = len(suffix)\n\n if len(string) < suffix_len:\n # the string param was shorter than the suffix\n raise ValueError(\"A suffix can not be bigger than string argument.\")\n if string.endswith(suffix):\n # return from the beginning up...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
/* Quarter Format to format and parse quarter dates A quarter is the month%3 Follows format: YYYYqQ: 2015q4, 5847q1, 0040q2
[ "function quarterFormat() {\n\n const format = function(d) {\n return formats.year.data(d) + \"q\" + formatQuarter(d);\n };\n\n format.parse = function(dateString) {\n const matchedDate = dateString.match(/^(\\d{4})q(\\d)$/);\n return matchedDate ? getDateFromQuarter(matchedDate[1], matchedDate[2]) : nu...
[ "function fidjDateParse(date) {\n if (!date || typeof date != 'string' || date == '') return false;\n // Date (choose 0 in date to force an error if parseInt fails)\n var yearS = parseInt(date.substr(0,4), 10) || 0;\n var monthS = parseInt(date.substr(5,2), 10) || 0;\n var dayS = parseInt(date.substr...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Sends an e-mail @param string|array $to @param string $subject @param string $message @param array|string $options @return mixed
[ "public function send($to, $subject, $message, $options)\n {\n if (!is_array($options)) {\n $options = array('from' => (string) $options);\n }\n\n settype($to, 'array');\n\n $result = null;\n $this->hook->attach('mail.send', $to, $subject, $message, $options, $result...
[ "public static function fromTemplate(string $strTemplate, string $subject, array $arrConfig=[])\n {\n return new static(file_get_contents($strTemplate), $subject, $arrConf);\n }" ]
codesearchnet
{ "query": "Represent the comment about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Software development:" }
// ANSIWriter returns an io.Writer which translates any ANSI escape codes // written to it into tview color tags. Other escape codes don't have an effect // and are simply removed. The translated text is written to the provided // writer.
[ "func ANSIWriter(writer io.Writer) io.Writer {\n\treturn &ansi{\n\t\tWriter: writer,\n\t\tbuffer: new(bytes.Buffer),\n\t\tcsiParameter: new(bytes.Buffer),\n\t\tcsiIntermediate: new(bytes.Buffer),\n\t\tstate: ansiText,\n\t}\n}" ]
[ "function createStreamTransport(req, res) {\n // A transport object.\n var self = createBaseTransport(req, res);\n // Any error on request-response should propagate to transport.\n req.on(\"error\", function(error) {\n self.emit(\"error\", error);\n });\n res.on(\"error\", function(error) {...
codesearchnet
{ "query": "Represent the Github summarization about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about Computer Science:" }
Throw up if kid exists and invalid.
[ "protected function validateKid(array $header)\n {\n if (!isset($header['kid'])) {\n return;\n }\n if (empty($this->keys[$header['kid']])) {\n throw new JWTException('Invalid token: Unknown key ID', static::ERROR_KID_UNKNOWN);\n }\n\n $this->key = $this->k...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Parse API version. @since 160625 ReST utils. @param string $action Action identifier. @return string API version from action identifier.
[ "protected function parseApiVersion(string $action): string\n {\n if (mb_strpos($action, 'api-v') === 0) {\n $version = preg_replace('/^api\\-v([0-9]+[0-9.]*)\\..+$/u', '${1}', $action);\n }\n return $version ?? ''; // API version from action identifier.\n }" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Get the current VRFs configured in the device. :return: A list of vrf names as string
[ "def _get_vrfs(self):\n \n vrfs = []\n ios_cfg = self._get_running_config()\n parse = HTParser(ios_cfg)\n vrfs_raw = parse.find_lines(\"^vrf definition\")\n for line in vrfs_raw:\n # raw format ['ip vrf <vrf-name>',....]\n vrf_name = line.strip().spli...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Technology:" }
Retrieve client version in PHP style @return string
[ "public function getClientVersion()\n {\n $this->_connect();\n try {\n $version = $this->_connection->getAttribute(PDO::ATTR_CLIENT_VERSION);\n $matches = null;\n if (preg_match('/((?:[0-9]{1,2}\\.){1,3}[0-9]{1,2})/', $version, $matches)) {\n return $...
[ "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 about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
// ReadResponse reads a server response into the recieved o.
[ "func (o *GetDhcpReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetDhcpOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn ...
[ "@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 Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
initialize attributes form
[ "public function init()\n {\n $this->setIsDisableCapable(false)\n ->setIsDisableElementsCapable(false)\n ->setAttribute('data-submit-on', 'checkbox');\n\n $this->add(\n array(\n 'type' => 'checkbox',\n 'name' => 'sendCarbonCopy',\n ...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Unzip zipfile to a temporary directory. The directory of the unzipped files is returned if success, otherwise None is returned.
[ "def unzip_to_temp_dir(zip_file_name):\n \n if not zip_file_name or not os.path.exists(zip_file_name):\n return None\n\n zf = zipfile.ZipFile(zip_file_name)\n\n if zf.testzip() is not None:\n return None\n\n # Unzip the files into a temporary directory\n LOGGER.info(\"Extracting zipp...
[ "def is_pathname_valid(pathname: str) -> bool:\n \n # If this pathname is either not a string or is but is empty, this pathname\n # is invalid.\n try:\n if not isinstance(pathname, str) or not pathname:\n return False\n\n # Strip this pathname's Windows-specific drive specifier ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Traverses over an item and its children recursively to determine if it is active or not @param array $item the item config @return bool true if active
[ "protected function activateItems(&$item)\n\t{\n\t\t$hasActiveChild = false;\n\t\tif (isset($item['items'])) {\n\t\t\tforeach ($item['items'] as &$childItem) {\n\t\t\t\tif ($this->activateItems($childItem)) $hasActiveChild = true;\n\t\t\t}\n\t\t}\n\n\t\t$isActive = isset($item['active']) ? $item['active'] : $this->...
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
{@inheritdoc} @see \Concrete\Core\System\Mutex\MutexInterface::isSupported()
[ "public static function isSupported(Application $app)\n {\n $result = false;\n if (PHP_VERSION_ID >= 50601) { // we need the $nowait parameter of sem_acquire, available since PHP 5.6.1\n $fi = $app->make(FunctionInspector::class);\n $result = $fi->functionAvailable('sem_get') ...
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
对密文进行解密 :param text: 需要解密的密文 :param app_id: 微信公众平台的 AppID :return: 解密后的字符串
[ "def decrypt(self, text, app_id):\n \n text = to_binary(text)\n decryptor = self.cipher.decryptor()\n plain_text = decryptor.update(base64.b64decode(text)\n ) + decryptor.finalize()\n\n padding = byte2int(plain_text, -1)\n content = plai...
[ "public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城...
codesearchnet
{ "query": "Represent the summarization about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Adds product stock test data.
[ "protected function _process()\n\t{\n\t\t$iface = 'MShop_Context_Item_Interface';\n\t\tif( !( $this->_additional instanceof $iface ) ) {\n\t\t\tthrow new MW_Setup_Exception( sprintf( 'Additionally provided object is not of type \"%1$s\"', $iface ) );\n\t\t}\n\n\t\t$this->_msg( 'Adding warehouse data', 0 );\n\n\t\t$...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetVideoContentSourceUrl sets the VideoContentSourceUrl field's value.
[ "func (s *PutPlaybackConfigurationInput) SetVideoContentSourceUrl(v string) *PutPlaybackConfigurationInput {\n\ts.VideoContentSourceUrl = &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:" }
Displays the contact page
[ "public function actionContact()\n\t{\n\t\t$model=new ContactForm;\n\t\tif(isset($_POST['ContactForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ContactForm'];\n\t\t\tif($model->validate())\n\t\t\t{\n\t\t\t\t$name='=?UTF-8?B?'.base64_encode($model->name).'?=';\n\t\t\t\t$subject='=?UTF-8?B?'.base64_encode($model->s...
[ "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:" }
Extends classes.
[ "function(fullName, klass, proto) {\n // Figure out what was passed and normalize it.\n if (typeof fullName !== 'string') {\n proto = klass;\n klass = fullName;\n fullName = null;\n }\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Filters the document AST.
[ "def main():\n \"\"\"\"\"\"\n\n # pylint: disable=global-statement\n global PANDOCVERSION\n global AttrTable\n\n # Get the output format and document\n fmt = args.fmt\n doc = json.loads(STDIN.read())\n\n # Initialize pandocxnos\n # pylint: disable=too-many-function-args\n PANDOCVERSION...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Flatten an array with depth. @param {Array} array @param {Array} result @param {number} depth @return {Array}
[ "function flattenDownDepth (array, result, depth) {\n depth--\n\n for (var i = 0; i < array.length; i++) {\n var value = array[i]\n\n if (depth > -1 && Array.isArray(value)) {\n flattenDownDepth(value, result, depth)\n } else {\n result.push(value)\n }\n }\n\n return result\n}" ]
[ "function anyBase(srcAlphabet, dstAlphabet) {\n var converter = new Converter(srcAlphabet, dstAlphabet);\n /**\n * Convert function\n *\n * @param {string|Array} number\n *\n * @return {string|Array} number\n */\n return function (number) {\n return converter.convert(number);...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getIfcStructuralLoadLinearForce() {\r\n\t\tif (ifcStructuralLoadLinearForceEClass == null) {\r\n\t\t\tifcStructuralLoadLinearForceEClass = (EClass) EPackage.Registry.INSTANCE\r\n\t\t\t\t\t.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(547);\r\n\t\t}\r\n\t\treturn ifcStructuralLoadLinear...
[ "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 description about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
@param null|array $group_by @param array $columns @return string
[ "private function build_group_by( $group_by, $columns ) {\n\t\t$sql = '';\n\t\tif ( ! empty( $group_by ) ) {\n\t\t\t$items = [];\n\t\t\tforeach ( $group_by as $k ) {\n\t\t\t\t$items[] = $this->get_field_name( $k, $columns );\n\t\t\t}\n\t\t\tif ( ! empty( $items ) ) {\n\t\t\t\t$sql .= ' GROUP BY ' . implode( ', ', $...
[ "protected function map() {return df_map_0(df_sort_a(df_map_r(df_cms_blocks(), function(B $b) {return [\n\t\t$b->getId(), $b->getTitle()\n\t];})), '-- select a CMS block --');}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
MultipleChoiceField uses its own field, but also uses a queryset.
[ "def render_multiplechoicefield(field, attrs, choices=None):\n\t\n\tchoices = format_html_join(\"\", wrappers.CHOICE_TEMPLATE, get_choices(field))\n\treturn wrappers.MULTIPLE_DROPDOWN_WRAPPER % {\n\t\t\"name\": field.html_name,\n\t\t\"field\": field,\n\t\t\"choices\": choices,\n\t\t\"placeholder\": attrs.get(\"plac...
[ "@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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
转换classloader @param loader 原classloader @return 转换后的classloader
[ "public static ProxyClassLoader convertClassloader(ClassLoader loader) {\n if (loader == null) {\n return ProxyClient.DEFAULT_LOADER;\n } else if (loader instanceof ProxyClassLoader) {\n return (ProxyClassLoader) loader;\n } else {\n return new ProxyClassLoader(...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SnapshotAttempted updates the number of snapshots attempted.
[ "func (t *compactionTracker) SnapshotAttempted(success bool, reason CacheStatus, duration time.Duration) {\n\tt.Attempted(0, success, reason.String(), duration)\n}" ]
[ "func (p *propertySet) setTargetAttributeWithCount(targetAttribute string, allowedCount uint64, taskGroup string) {\n\t// Store that this is for a task group\n\tif taskGroup != \"\" {\n\t\tp.taskGroup = taskGroup\n\t}\n\n\t// Store the constraint\n\tp.targetAttribute = targetAttribute\n\n\tp.allowedCount = allowedC...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
statreports can come with a value array instead of properties
[ "function flattenValues (report) {\n if (Object.prototype.toString.call(report.values) === '[object Array]') {\n report.values.forEach(function (value) {\n Object.assign(report, value)\n })\n }\n return report\n }" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the dead letter queue name for a given queue. If the given queue name belongs to a delayed queue, the dead letter queue name for the original queue is generated.
[ "def xq_name(queue_name):\n \n if queue_name.endswith(\".XQ\"):\n return queue_name\n\n if queue_name.endswith(\".DQ\"):\n queue_name = queue_name[:-3]\n return queue_name + \".XQ\"" ]
[ "function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Retrieve all Objects stored in this storage, filtered by the given collection name @param CollectionInterface $collection @internal param string $collectionName @return array<\Neos\Flow\ResourceManagement\Storage\StorageObject> @api
[ "public function getObjectsByCollection(CollectionInterface $collection)\n {\n $objects = array();\n $that = $this;\n $bucketName = $this->bucketName;\n $keyPrefix = $this->keyPrefix;\n $bucket = $this->getCurrentBucket();\n\n foreach ($this->resourceRepository->findByCo...
[ "protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Convert Toady's Gregorian date to Hijri date. @return array The hijri date.
[ "private function convertTodayToHijri()\n {\n list($arYear, $arMonth, $arDay) = (new Date())->hjConvert(date('Y'), date('m'), date('d'));\n \n return [\n 'arYear' => $arYear,\n 'arMonth' => $arMonth,\n 'arDay' => $arDay,\n ];\n }" ]
[ "def _evalDateStd(self, datetimeString, sourceTime):\n \n s = datetimeString.strip()\n sourceTime = self._evalDT(datetimeString, sourceTime)\n\n # Given string is in the format 07/21/2006\n return self.parseDate(s, sourceTime)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Add task to invoke processRecord method when the WakeableLooper is waken up
[ "private void addSinkTasks() {\n Runnable sinkTasks = new Runnable() {\n @Override\n public void run() {\n while (!metricsInSinkQueue.isEmpty()) {\n metricsSink.processRecord(metricsInSinkQueue.poll());\n }\n }\n };\n\n slaveLooper.addTasksOnWakeup(sinkTasks);\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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the annotation.
[ "public JAnnotation getAnnotation(String className)\n {\n JAnnotation []annList = getDeclaredAnnotations();\n\n for (int i = 0; i < annList.length; i++) {\n if (annList[i].getType().equals(className))\n return annList[i];\n }\n \n return null;\n }" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Open filename and return a corresponding file object.
[ "def openfile(filename, mode=\"rt\", *args, expanduser=False, expandvars=False,\n makedirs=False, **kwargs):\n \"\"\"\"\"\"\n if filename in (\"-\", None):\n return sys.stdin if \"r\" in mode else sys.stdout\n if expanduser:\n filename = os.path.expanduser(filename)\n if expand...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param array $serializedObject @return DomainMessage @throws \InvalidArgumentException
[ "public function deserialize(array $serializedObject)\n {\n $this->guardValidSerializedDomainMessage($serializedObject);\n\n return new DomainMessage(\n $serializedObject['id'],\n $serializedObject['playhead'],\n $this->metadataSerializer->deserialize($serializedObj...
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetName sets the Name field's value.
[ "func (s *LoadBalancerTlsCertificate) SetName(v string) *LoadBalancerTlsCertificate {\n\ts.Name = &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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Internal method that sets a variable without validating the script name. @param scriptName the name of the script. @param key the key of the variable. @param value the value of the variable.
[ "private static void setScriptVarImpl(String scriptName, String key, String value) {\t\n\t\tvalidateKey(key);\n\t\t\n\t\tMap<String, String> scVars = scriptVars\n\t\t\t\t.computeIfAbsent(scriptName, k -> Collections.synchronizedMap(new HashMap<String, String>()));\n\t\t\n\t\tif (value == null) {\n\t\t\tscVars.remov...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// ProposeConfigUpdate passes through to the underlying configtx.Validator
[ "func (cs *ChainSupport) ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error) {\n\tenv, err := cs.ConfigtxValidator().ProposeConfigUpdate(configtx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbundle, err := cs.CreateBundle(cs.ChainID(), env.Config)\n\tif err != nil {\n\t\treturn nil, err\n\t...
[ "func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Send request @return \Omnipay\Common\Message\ResponseInterface|void
[ "public function sendData($data)\n {\n $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();\n\n return $this->response = new Response($this, $httpResponse->getBody());\n }" ]
[ "public function setSubscriptionAddon(SetAddon\\RequestData $requestData)\n {\n $request = new SetAddon\\Request($requestData);\n\n return $this->sendRequest($request, SetAddon\\ApiResponse::class);\n }" ]
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
Get a link to a Member profile. @param string $urlSegment @return string
[ "public function ProfileLink($urlSegment)\n {\n $baseLink = $this->Link();\n if ($baseLink === '/') {\n // Handle homepage blogs\n $baseLink = RootURLController::get_homepage_link();\n }\n\n return Controller::join_links($baseLink, 'profile', $urlSegment);\n }...
[ "public function Base_GetAppSettingsMenuItems_Handler($Sender) {\n $Menu = &$Sender->EventArguments['SideMenu'];\n $Menu->AddItem('Forum', T('Forum'));\n $Menu->AddLink('Forum', T('Tagging'), 'settings/tagging', 'Garden.Settings.Manage');\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Takes the slice along a given dimension and index of a vertex :param input_vertex: the input vertex :param dimension: the dimension to extract along :param index: the index of extraction
[ "def BooleanSlice(input_vertex: vertex_constructor_param_types, dimension: int, index: int, label: Optional[str]=None) -> Vertex:\n \n return Boolean(context.jvm_view().BooleanSliceVertex, label, cast_to_vertex(input_vertex), cast_to_integer(dimension), cast_to_integer(index))" ]
[ "def _is_axis_allowed(self, axis):\n \n if axis is None:\n # If table direction was requested, we must ensure that each slice\n # doesn't have the CA items dimension (thus the [-2:] part). It's\n # OK for the 0th dimension to be items, since no calculation is\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
获得存储服务连接实例. @return \Owl\Service @throws \RuntimeException Data class没有配置存储服务
[ "public function getService()\n {\n $service = $this->getOption('service');\n\n return \\Owl\\Service\\Container::getInstance()->get($service);\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Edition of a item is successfully @return Forward
[ "public function editionOkAction()\n {\n $lng = \\Cmf\\Language\\Factory::get($this);\n HelperFactory::getMessageBox()->addSuccessMessage($lng[self::MSG_EDITION_OK]);\n\n return $this->forward('default');\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets the count of this PaginatedDatasetResults. :param count: The count of this PaginatedDatasetResults. :type: int
[ "def count(self, count):\n \n if count is None:\n raise ValueError(\"Invalid value for `count`, must not be `None`\")\n if count is not None and count < 0:\n raise ValueError(\"Invalid value for `count`, must be a value greater than or equal to `0`\")\n\n self._coun...
[ "def reset(self):\n \n self.getsCounter = 0\n\n # dictionary of processed requests for each client. Value for each\n # client is a dictionary with request id as key and transaction id as\n # value\n self.processedRequests = {} # type: Dict[str, Dict[int, str]]\n\n #...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Load builders. @param array $builders Builders @param ContainerBuilder $container Container @return $this self Object
[ "protected function loadBuilders(array $builders, ContainerBuilder $container)\n {\n foreach ($builders as $builderName => $builder) {\n $definition = $container\n ->register(\n 'elcodi.sitemap_builder.' . $builderName,\n 'Elcodi\\Component\\...
[ "protected function beforeInit()\n {\n parent::beforeInit();\n \n $this->isCli = true;\n \n // load default config\n Config::setDefault(DefaultConfig::console());\n \n // load default definition\n $this->definition = $this->getDefaultDefinition()...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// resolveGeneratedColumns resolves generated columns with their generation // expressions respectively. onDups indicates which columns are in on-duplicate list.
[ "func (b *PlanBuilder) resolveGeneratedColumns(columns []*table.Column, onDups map[string]struct{}, mockPlan LogicalPlan) (igc InsertGeneratedColumns, err error) {\n\tfor _, column := range columns {\n\t\tif !column.IsGenerated() {\n\t\t\tcontinue\n\t\t}\n\t\tcolumnName := &ast.ColumnName{Name: column.Name}\n\t\tco...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Checks if a given string is either 'nil' or empty string.
[ "def blank?(str)\n str.nil? or (str.is_a? String and str.strip.empty?)\n end" ]
[ "def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
addDateLabels, This adds a set of 42 date labels to the calendar, and ties each of those labels to a mouse click event handler. The date labels are reused any time that the calendar is redrawn. This function should not depend on any settings variables.
[ "private void addDateLabels() {\n dateLabels = new ArrayList<JLabel>();\n for (int i = 0; i < 42; ++i) {\n int dateLabelColumnX = ((i % 7)) + constantFirstDateLabelCell.x;\n int dateLabelRowY = ((i / 7) + constantFirstDateLabelCell.y);\n JLabel dateLabel = new JLabel()...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// WithTable sets the table to be used by the command
[ "func (builder *TsDeleteRowCommandBuilder) WithTable(table string) *TsDeleteRowCommandBuilder {\n\tbuilder.protobuf.Table = []byte(table)\n\treturn builder\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Finalize the case build by providing second required value for the Case.
[ "public final PCB produce(@Nonnull R directValue) {\n return this.evaluate(superContext().directToFunction.apply(directValue));\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* Ignores top bit of h.
[ "public static void fe_frombytes(int[] h,byte[] s)\n{\n long h0 = load_4(s, 0);\n long h1 = load_3(s, 4) << 6;\n long h2 = load_3(s, 7) << 5;\n long h3 = load_3(s, 10) << 3;\n long h4 = load_3(s, 13) << 2;\n long h5 = load_4(s, 16);\n long h6 = load_3(s, 20) << 7;\n long h7 = load_3(s, 23) << 5;\n long h8 ...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the local version of a signature
[ "def get_local_version(sigdir, sig):\n \"\"\"\"\"\"\n version = None\n filename = os.path.join(sigdir, '%s.cvd' % sig)\n if os.path.exists(filename):\n cmd = ['sigtool', '-i', filename]\n sigtool = Popen(cmd, stdout=PIPE, stderr=PIPE)\n while True:\n line = sigtool.stdout...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Split horizontally or vertically.
[ "def split_window(pymux, variables):\n \n executable = variables['<executable>']\n start_directory = variables['<start-directory>']\n\n # The tmux definition of horizontal is the opposite of prompt_toolkit.\n pymux.add_process(executable, vsplit=variables['-h'],\n start_directory...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Register a new path for given alias, trigger a warning if path already register @author Sam, sam@taotesting.com @param string $id @param string $newLibConfig
[ "public function register($id, $newLibConfig)\n {\n $registry = self::getRegistry();\n $libConfig = array();\n if ($registry->isRegistered($id)) {\n $libConfig = $registry->get($id);\n }\n\n $libConfig = array_replace_recursive($libConfig, $newLibConfig);\n $r...
[ "def value(self, value):\n \n self.client.nowait(\n 'set_field', (Literal('browser'), self.element, value))" ]
codesearchnet
{ "query": "Represent the post about Data management:", "pos": "Represent the code about Data management:", "neg": "Represent the code:" }
Command handler.
[ "def handle(self, **options):\n \n self.flushdb = options.get('flushdb')\n self._pre_tasks()\n self._create_users()\n self._create_badges()\n self._create_awards()" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Provides for the clone operation. Any clone is initially unfrozen.
[ "@Override\n public RuleBasedCollator cloneAsThawed() {\n try {\n RuleBasedCollator result = (RuleBasedCollator) super.clone();\n // since all collation data in the RuleBasedCollator do not change\n // we can safely assign the result.fields to this collator \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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Compile requested scss and serve css. Outputs HTTP response. @param string $salt Prefix a string to the filename for creating the cache name hash
[ "public function serve($salt = '')\n {\n $protocol = isset($_SERVER['SERVER_PROTOCOL'])\n ? $_SERVER['SERVER_PROTOCOL']\n : 'HTTP/1.0';\n\n if ($input = $this->findInput()) {\n $output = $this->cacheName($salt . $input);\n $etag = $noneMatch = trim($this-...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
r"""Makes sure that dtraj is a discrete trajectory (array of int)
[ "def ensure_dtraj(dtraj):\n \n\n \"\"\"\n if is_int_vector(dtraj):\n return dtraj\n elif is_list_of_int(dtraj):\n return np.array(dtraj, dtype=int)\n else:\n raise TypeError('Argument dtraj is not a discrete trajectory - only list of integers or int-ndarrays are allowed. Check ty...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
// Empty checks if CombinedStorage is empty.
[ "func (c *CombinedStorage) Empty() bool {\n\treturn len(c.StorageInstances) == 0 && len(c.Filesystems) == 0 && len(c.Volumes) == 0\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// BuildPressureStream returns a new PressureStream instance
[ "func BuildPressureStream(dataSignals, errorSignals chan interface{}) *PressureStream {\n\tps := PressureStream{\n\t\tSignals: dataSignals,\n\t\tErrors: errorSignals,\n\n\t\tsignalQueue: NewQueue(dataSignals),\n\t\terrorQueue: NewQueue(errorSignals),\n\t}\n\n\treturn &ps\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
[VARIABLE my_database_id]
[ "public List<String> getDatabaseDdl(String instanceId, String databaseId) {\n // [START getDatabaseDdl]\n List<String> statementsInDb = dbAdminClient.getDatabaseDdl(instanceId, databaseId);\n // [END getDatabaseDdl]\n return statementsInDb;\n }" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }