query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// Equal reports whether this cluster is equal to the given cluster. | [
"func (c *Cluster) Equal(other *Cluster) bool {\n\treturn reflect.DeepEqual(c, other)\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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Register the application bindings.
@return void | [
"private function registerLaratrust()\n {\n $this->app->bind('laratrust', function ($app) {\n return new Laratrust($app);\n });\n\n $this->app->alias('laratrust', 'Laratrust\\Laratrust');\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
How many rows in a table. | [
"def count_entries(self, table=None):\n \"\"\"\"\"\"\n if table is None: table = self.main_table\n self.own_cursor.execute('SELECT COUNT(1) FROM \"%s\";' % table)\n return int(self.own_cursor.fetchone()[0])"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetJobSuccessLogURI sets the JobSuccessLogURI field's value. | [
"func (s *JobLogs) SetJobSuccessLogURI(v string) *JobLogs {\n\ts.JobSuccessLogURI = &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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Configure the Curl Options based for a specific HTTP Method
@param $method
@return bool | [
"protected function configureHTTPMethod($method)\n {\n switch ($method) {\n case self::HTTP_GET:\n break;\n case self::HTTP_POST:\n return $this->addCurlOption(CURLOPT_POST, TRUE);\n default:\n return $this->addCurlOption(CURLOP... | [
"@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:"
} |
Captures user input for the "jumpstart templates directory options" menu and calls the appropriate method. | [
"def templates_dir_options\n input = gets.chomp.strip.downcase\n case\n when input == \"1\"\n puts \" Please enter the absolute path for the directory that you would like to contain your jumpstart templates.\".yellow\n puts \" e.g. /Users/your_name/projects/jumpstart_templat... | [
"@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:"
} |
Create a Like expression that evaluates whether or not the current expression is LIKE
the given expression.
@param expression the expression to compare with the current expression.
@return a Like expression. | [
"@NonNull\n public Expression like(@NonNull Expression expression) {\n if (expression == null) {\n throw new IllegalArgumentException(\"expression cannot be null.\");\n }\n return new BinaryExpression(this, expression, BinaryExpression.OpType.Like);\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return an array of databases
@return array | [
"public function getDatabases ()\n\t{\n\t\t\n\t\t// Get tables\n\t\t\n\t\tif ($this->databases === FALSE)\n\t\t{\n\t\t\t\n\t\t\tif (isset (\\Sonic\\Sonic::$resources['db']))\n\t\t\t{\n\t\t\t\tforeach (\\Sonic\\Sonic::$resources['db'] as $key => $db)\n\t\t\t\t{\n\t\t\t\t\t$this->databases[$key]\t= $db->getDatabaseNa... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction about database:",
"pos": "Represent the code about database:",
"neg": "Represent the code:"
} |
/*
Executes a function synchronously and returns a rejected Promise if it throws | [
"function tryReject( func, context ) {\n try {\n for( var _len2 = arguments.length, args = Array( _len2 > 2 ? _len2 - 2 : 0 ), _key2 = 2; _key2 < _len2; _key2++ ) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n return tryPromise( func.apply( context, args ) );\n } catch( err ) ... | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
either data or error should be non-null | [
"private void writeSlot(T data, Throwable error) {\n dataLock.lock();\n try {\n this.error = error;\n this.data = data;\n availableCondition.signalAll();\n } finally {\n dataLock.unlock();\n }\n }"
] | [
"def push(self, stream, value):\n \n\n raise ArgumentError(\"Attempting to push reading to an invalid stream walker that cannot hold data\", selector=self.selector, stream=stream)"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Data processing:"
} |
@param Configuration $configuration
@param Parameter $parameter
@return $this | [
"protected function setDefaultIfNull(Configuration $configuration, Parameter $parameter)\n {\n $this->dispatcher->dispatch(\n TransformerEvents::PREPARE_DEFAULT,\n new TransformerEvent($configuration, $parameter)\n );\n\n if ($parameter->getValue() === null)\n {\n $value = $configuration... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Drop membership of IPv6 multicast group | [
"static void drop6(FileDescriptor fd, byte[] group, int index, byte[] source)\n throws IOException\n {\n joinOrDrop6(false, fd, group, index, source);\n }"
] | [
"public void removeLinks(ServiceReference<D> declarationSRef) {\n D declaration = getDeclaration(declarationSRef);\n for (ServiceReference serviceReference : declaration.getStatus().getServiceReferencesBounded()) {\n // FIXME : In case of multiples Linker, we will remove the link of all the... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
validates a specific certificate inside of the keystore being passed in
@param keyStore
@param cert
@throws CertificateException | [
"public void validate(KeyStore keyStore, Certificate cert) throws CertificateException {\n Certificate[] certChain = null;\n\tif (cert != null && cert instanceof X509Certificate) {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = null;\n try {\n ... | [
"@Deprecated // Android-changed added \"Deprecated.\"\n public java.security.cert.Certificate[] getCerts(String name)\n {\n return mapSignersToCertArray(getCodeSigners(name));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Encryption:",
"pos": "Represent the Github code about Encryption:",
"neg": "Represent the Github code about programming:"
} |
Return a compiled Groovy script for this expression.
@return compiled Groovy script | [
"protected Script getCompiledScript() {\n if (getScript == null) {\n GroovyShell shell = new GroovyShell();\n getScript = shell.parse(getExpression());\n }\n return getScript;\n }"
] | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Apply the zip operator to a set of variables.
This uses the python zip iterator to combine multiple lists of variables such that
the nth variable in each list is aligned.
Args:
variables: The variables object
parent: Unused | [
"def iterator_zip(variables: VarType, parent: str = None) -> Iterable[VarMatrix]:\n \n\n logger.debug(\"Yielding from zip iterator\")\n if isinstance(variables, list):\n for item in variables:\n yield list(variable_matrix(item, parent, \"zip\"))\n else:\n yield list(variable_mat... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
On contextInitialized additional obtain the WebSocket ServerContainer. | [
"@Override\n public void contextInitialized(ServletContextEvent event) {\n this.event = event;\n this.serverContainer = getServerContainer(event);\n super.contextInitialized(event);\n }"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds an overlay as the specified layer.
@param overlay the overlay to add
@param layer the layer to add the overlay to; higher layers are on top of lower layers;
the image resides in layer 0 | [
"public void addOverlay(Overlay overlay, int layer) {\n\t\tif (overlay==null) throw new NullPointerException();\n\t\tOverlayComponent c=new OverlayComponent(overlay, theImage);\n\t\toverlay.addOverlayComponent(c);\n\t\tlayeredPane.add(c, Integer.valueOf(layer));\n\t\tlayeredPane.revalidate();\n\t\tlayeredPane.repai... | [
"function(terria) {\n CatalogMember.call(this, terria);\n\n this._enabledDate = undefined;\n this._shownDate = undefined;\n this._loadForEnablePromise = undefined;\n this._lastLoadInfluencingValues = undefined;\n\n // The catalog item to show in the Now Viewing when this item is enabled, instead of this item.... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// TimeNow creates a TracerOption that gives the tracer a function
// used to generate timestamps for spans. | [
"func (tracerOptions) TimeNow(timeNow func() time.Time) TracerOption {\n\treturn func(tracer *Tracer) {\n\t\ttracer.timeNow = timeNow\n\t}\n}"
] | [
"func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Computer Science:"
} |
// GetSuite returns a new instance of the software-based BCCSP
// set at the passed security level, hash family and KeyStore. | [
"func GetSuite(securityLevel int, hashFamily string, keyStore bccsp.KeyStore) (core.CryptoSuite, error) {\n\tbccsp, err := sw.NewWithParams(securityLevel, hashFamily, keyStore)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn wrapper.NewCryptoSuite(bccsp), nil\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
returns a list of absolute filepaths for all files found in the given
directory. | [
"def abslistdir(directory):\n \n abs_dir = os.path.abspath(directory)\n filenames = os.listdir(abs_dir)\n return [os.path.join(abs_dir, filename) for filename in filenames]"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Defined by FilterInterface
Decompresses the content $value with the defined settings
@param string $value Content to decompress
@return string The decompressed content | [
"public function filter($value)\n {\n if (!is_string($value) && $value !== null) {\n return $value;\n }\n\n return $this->getAdapter()->decompress($value);\n }"
] | [
"public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
@param string|Condition $condition
@return self | [
"public static function basedOn($condition): self\n {\n $name = $condition instanceof Condition ? $condition->name() : $condition;\n\n return new self($name, '');\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Return an immutable list of Pattern columns
@return | [
"public List<Pattern52> getPatterns() {\n final List<Pattern52> patterns = new ArrayList<Pattern52>();\n for (CompositeColumn<?> cc : conditionPatterns) {\n if (cc instanceof Pattern52) {\n patterns.add((Pattern52) cc);\n }\n }\n return Collections.un... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Returns the previous chunk and updates the chunker's internal pointer
@return int
@since 0.1.0 | [
"public function getPreviousChunk()\n\t{\n\t\t$offset = --$this->index * $this->size;\n\t\t\n\t\tif ($offset >= 0) {\n\t\t\t$chunk = $this->getChunk($offset);\n\t\t} else {\n\t\t\t$chunk = false;\n\t\t}\n\t\t\n\t\treturn $chunk;\n\t}"
] | [
"def get_pad content_rows, content_cols\n pad = FFI::NCurses.newpad(content_rows, content_cols)\n @pads ||= []\n @pads << pad\n ## added 2013-03-05 - 19:21 without next line how was pad being returned\n return pad\n end"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// filteredModelUUIDs returns all model uuids that match the filter. | [
"func (st *State) filteredModelUUIDs(filter bson.D) ([]string, error) {\n\tmodels, closer := st.db().GetCollection(modelsC)\n\tdefer closer()\n\n\tvar docs []bson.M\n\terr := models.Find(filter).Sort(\"name\", \"owner\").Select(bson.M{\"_id\": 1}).All(&docs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tout := ma... | [
"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 description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Write characters.
@param ch character data array
@param start start index
@param length length data to write
@throws SAXException if processing the event failed
@throws IllegalStateException if start element is not open | [
"public void writeCharacters(final char[] ch, final int start, final int length) throws SAXException {\n if (elementStack.isEmpty()) {\n throw new IllegalStateException(\"Current state does not allow Character writing\");\n }\n processStartElement();\n transformer.characters(c... | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
return base and rel.
you can modify `base', but can not `rel'. | [
"def merge0(oth)\n oth = parser.send(:convert_to_uri, oth)\n\n if self.relative? && oth.relative?\n raise BadURIError,\n \"both URI are relative\"\n end\n\n if self.absolute? && oth.absolute?\n #raise BadURIError,\n # \"both URI are absolute\"\n # hmm... sho... | [
"def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Internal function used by gammaCdf
@param x
@param A
@return | [
"private static double gSer(double x, double A) {\n // Good for X<A+1.\n double T9=1/A;\n double G=T9;\n double I=1;\n while (T9>G*0.00001) {\n T9=T9*x/(A+I);\n G=G+T9;\n ++I;\n }\n G=G*Math.exp(A*Math.log(x)-x-logGamma(A));\n\n ... | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Accepts the current edit for this label. | [
"def acceptEdit(self):\r\n \r\n if not self._lineEdit:\r\n return\r\n \r\n self.setText(self._lineEdit.text())\r\n self._lineEdit.hide()\r\n \r\n if not self.signalsBlocked():\r\n self.editingFinished.emit(self._lineEdit.text())"
] | [
"@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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *ListResourceDelegatesOutput) SetNextToken(v string) *ListResourceDelegatesOutput {\n\ts.NextToken = &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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Return the dictionary of OpenAPI field attributes for a set of
:class:`Range <marshmallow.validators.Range>` validators.
:param Field field: A marshmallow field.
:rtype: dict | [
"def field2range(self, field, **kwargs):\n \n validators = [\n validator\n for validator in field.validators\n if (\n hasattr(validator, \"min\")\n and hasattr(validator, \"max\")\n and not hasattr(validator, \"equal\")\n ... | [
"def __store_config(self, args, kwargs):\n \n signature = (\n 'schema',\n 'ignore_none_values',\n 'allow_unknown',\n 'require_all',\n 'purge_unknown',\n 'purge_readonly',\n )\n for i, p in enumerate(signature[: len(args)])... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Delete evidence of prior learning.
@param int $userid The user ID.
@return void | [
"protected static function delete_user_evidence_of_prior_learning($userid) {\n global $DB;\n\n $usercontext = context_user::instance($userid);\n $ueids = $DB->get_fieldset_select(user_evidence::TABLE, 'id', 'userid = :userid', ['userid' => $userid]);\n if (empty($ueids)) {\n r... | [
"public function remove($entity)\n {\n if ($entity->isValid() && is_numeric($entity['id']->value)) {\n $query = 'DELETE FROM `' . $this->tableName . '` WHERE `id`=:id';\n $statement = $this->database->prepare($query);\n $statement->bindParam(':id', $entity['id']->value);\n... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Work management:"
} |
// rootResponse returns the CC API root document. | [
"func (client *Client) rootResponse() (Info, Warnings, error) {\n\trequest, err := client.newHTTPRequest(requestOptions{\n\t\tMethod: http.MethodGet,\n\t\tURL: client.cloudControllerURL,\n\t})\n\tif err != nil {\n\t\treturn Info{}, nil, err\n\t}\n\n\tvar rootResponse Info\n\tresponse := cloudcontroller.Response{... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Print all devices as JSON | [
"def print_all_devices():\n \"\"\"\"\"\"\n print(\"Printing information about all devices paired to the Gateway\")\n if len(devices) == 0:\n exit(bold(\"No devices paired\"))\n\n container = []\n for dev in devices:\n container.append(dev.raw)\n print(jsonify(container))"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
设置请求头的数组
@param array $headers [请求头]
@param boolean $isClean [是否清除原有的]
@return AuthSha256 $this [请求对象] | [
"public function setHeaders($headers, $isClean = false){\n if ($isClean !==false) {\n $this->headers = array();\n }\n if (is_array($headers)) {\n foreach ($headers as $key => $value) {\n $this->headers[$key] = is_array($value) ? implode('; ', $value) : $value;\n }\n }\n return... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Sets the targeted action method of the resulting route.
@param controller the controller object, must not be {@literal null}.
@param method the method name, must not be {@literal null}.
@return the current route builder | [
"public Route to(Controller controller, String method) {\n Preconditions.checkNotNull(controller);\n Preconditions.checkNotNull(method);\n this.controller = controller;\n try {\n this.controllerMethod = verifyThatControllerAndMethodExists(controller.getClass(),\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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Opens a process for input/output. | [
"private function establishProcessConnection()\n {\n $command = $this->params['command'];\n $descriptorSpec = [\n 0 => ['pipe', 'r'],\n 1 => ['pipe', 'w'],\n 2 => ['pipe', 'w'],\n ];\n $pipes = [];\n $this->stream = proc_open($command, $desc... | [
"def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Finds the highest sum of height for each possible alignment (left, center, right)
@param aligments
@return | [
"protected int findTotalOffset(ArrayList aligments, byte position) {\n\t\tint total = 0;\n\t\tfor (Object aligment : aligments) {\n\t\t\tHorizontalBandAlignment currentAlignment = (HorizontalBandAlignment) aligment;\n\t\t\tint aux = 0;\n\t\t\tfor (AutoText autotext : getReport().getAutoTexts()) {\n\t\t\t\tif (autot... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Verifica se ci sono argument con la classe. | [
"def has_argument(arg, arguments):\n \n try:\n if not isinstance(arguments, list):\n arguments = arguments.__arguments__\n for idx, (args, kwargs) in enumerate(arguments):\n arg_name = kwargs.get(\n 'dest', args[-1].lstrip('-').replace('-', '_'))\n ... | [
"def create_card\n raise StandardError, 'Cliente null' if @client.nil?\n # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta\n card = PayuLatam::Card.new(@client)\n # hay un metodo card_params que genera el objeto a enviar con los datos correctos\n # s... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Get wraps GoSNMP.GET().
// If any error is encountered, it will just once reconnect and try again. | [
"func (gsw gosnmpWrapper) Get(oids []string) (*gosnmp.SnmpPacket, error) {\n\tvar err error\n\tvar pkt *gosnmp.SnmpPacket\n\tfor i := 0; i < 2; i++ {\n\t\tpkt, err = gsw.GoSNMP.Get(oids)\n\t\tif err == nil {\n\t\t\treturn pkt, nil\n\t\t}\n\t\tif err := gsw.GoSNMP.Connect(); err != nil {\n\t\t\treturn nil, Errorf(er... | [
"function execute(exec, req, res) {\n\n // start timing slow logs before execution\n // validation time is not included nor i/o\n this.state.slowlog.start(req.cmd, req.raw);\n\n // ensure the slowlog stop is called\n // before encoding and sending the response\n res.before = this.state.slowlog.stop;\n\n // e... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Writes '<elementName'. | [
"public void beginElement(String elementName) throws IOException {\t\t\n\t\taddElementName(elementName);\n\t\tindent();\n\t\twriter.write(\"<\");\n\t\twriter.write(elementName);\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Checks that the directory exists and has the correct permissions set. | [
"def EnsureTempDirIsSane(directory):\n \"\"\"\"\"\"\n\n if not os.path.isabs(directory):\n raise ErrorBadPath(\"Directory %s is not absolute\" % directory)\n\n if os.path.isdir(directory):\n # The temp dir already exists, we probably created it already but\n # let's check to make sure.\n if not clien... | [
"def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Helper to get path of image from a definition in resource directory.
:param definition: A definition (hazard, exposure).
:type definition: dict
:returns: The definition's image path.
:rtype: str | [
"def get_image_path(definition):\n \n path = resources_path(\n 'img', 'wizard', 'keyword-subcategory-%s.svg' % definition['key'])\n if os.path.exists(path):\n return path\n else:\n return not_set_image_path"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *SSMMaintenanceWindowTaskMaintenanceWindowAutomationParametersList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := SSMMaintenanceWindowTaskMaintenanceWindowAutomationParameters{}\n\tif err := json.Unmarshal(buf, &item); err == nil... | [
"@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:"
} |
Get the results as a JDBC ResultSet
@return results as ResultSet | [
"public ResultSet getResults() {\n final SQLListenerContextImpl context = startContext(connection(), queryMixin.getMetadata());\n String queryString = null;\n List<Object> constants = ImmutableList.of();\n\n try {\n listeners.preRender(context);\n SQLSerializer seri... | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
TODO: docstring in public method. | [
"def generic_visit(self, node):\n \"\"\"\"\"\"\n if node.__class__.__name__ == 'Name':\n if node.ctx.__class__ == ast.Load and node.id not in self.names:\n self.names.append(node.id)\n ast.NodeVisitor.generic_visit(self, node)"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Update Attributes
@param array $attrs
@return \Orion\Utils\HttpRequest | [
"public function updateAttributes(array $attrs) {\n $url = \"entities/{$this->_id}/attrs\";\n\n if ($this->_type) {\n $url .= \"?type={$this->_type}\";\n }\n\n $updateEntity = new ContextFactory($attrs);\n return $this->_orion->patch($url, $updateEntity);\n }"
] | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
将实例转为依存树
@param data 实例
@param dependency 输出的依存树
@param with_dependencies 是否输出依存关系(仅在解析后才有意义) | [
"void transduce_instance_to_dependency(final Instance data,\n Dependency dependency, boolean with_dependencies)\n {\n int L = data.forms.size();\n for (int i = 0; i < L; ++i)\n {\n Integer form = forms_alphabet.idOf(data.forms.get(i));\n ... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Set the HTML element target of this transition.
@param {HTMLNode} targetElement - The target of the transition. | [
"function setElement( targetElement ) {\n // If the element has already been set,\n // clear the transition classes from the old element.\n if ( _dom ) {\n remove();\n animateOn();\n }\n _dom = targetElement;\n _dom.classList.add( _classes.BASE_CLASS );\n _transitionEndEvent = _getTra... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
apply prop to get right vendor prefix inCSS false=camelcase; true=dashed | [
"function prefixProp (name, inCSS) {\n // $prop will skip\n if(name[0]=='$') return ''\n // find name and cache the name for next time use\n var retName = cssProps[ name ] ||\n ( cssProps[ name ] = vendorPropName( name ) || name);\n return inCSS // if hasPrefix in prop\n ? dashify(cssPrefixesReg.test... | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Create a CSV file for the latest usage stats.
:param path: path to output CSV file
:param dbconn_master: master database connection
:param dbconn_part: partial database connection
:param tableinfo: table header information | [
"def database_to_csv(self, path, orderby='type'):\n \n tableinfo = self.get_table_info()\n stats_master = database_to_json(self.dbcon_master, tableinfo)\n stats_partial = database_to_json(self.dbcon_part, tableinfo)\n with open(path, 'w') as f:\n csvfile = csv.writer(f)... | [
"def get_cursor(self, instance, db_key, db_name=None):\n '''\n \n '''\n conn_key = self._conn_key(instance, db_key, db_name)\n try:\n conn = self.connections[conn_key]['conn']\n except KeyError:\n # We catch KeyError to avoid leaking the auth info used... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Check that all modules are ready to be built, calling check_ready on
each of those configured to be built and not already installed
(see shutit.is_installed). | [
"def check_ready(self, throw_error=True):\n\t\t\n\t\tshutit_global.shutit_global_object.yield_to_draw()\n\t\tcfg = self.cfg\n\t\tself.log('PHASE: check_ready', level=logging.DEBUG)\n\t\terrs = []\n\t\tself.pause_point('\\nNow checking whether we are ready to build modules configured to be built', print_input=False,... | [
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns the list of field names of the model. | [
"def fields(self):\n \"\"\"\"\"\"\n return (self.attributes.values() + self.lists.values()\n + self.references.values())"
] | [
"@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:"
} |
Reimplements the :meth:`QAbstractItemModel.sort` method.
:param column: Column.
:type column: int
:param order: Order. ( Qt.SortOrder ) | [
"def sort(self, column, order=Qt.AscendingOrder):\n \n\n if column > self.columnCount():\n return\n\n self.beginResetModel()\n if column == 0:\n self.__root_node.sort_children(reverse_order=order)\n else:\n self.__root_node.sort_children(\n ... | [
"def indexTupleFromItem(self, treeItem): # TODO: move to BaseTreeItem?\n \n if not treeItem:\n return (QtCore.QModelIndex(), QtCore.QModelIndex())\n\n if not treeItem.parentItem: # TODO: only necessary because of childNumber?\n return (QtCore.QModelIndex(), QtCore.QModelIn... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Reads a number token from the source file, either a float
// or an int depending on whether a decimal point appears.
// Int: -?(0|[1-9][0-9]*)
// Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? | [
"func readNumber(s *source.Source, start int, firstCode rune, codeLength int) (Token, error) {\n\tcode := firstCode\n\tbody := s.Body\n\tposition := start\n\tisFloat := false\n\tif code == '-' { // -\n\t\tposition += codeLength\n\t\tcode, codeLength = runeAt(body, position)\n\t}\n\tif code == '0' { // 0\n\t\tpositi... | [
"function isDataBinaryRobust(data) {\n // console.log('data is binary ?')\n var patternVertex = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n var text = ensureString(data);\n var isBinary =... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Return the first day of week for Pesach. | [
"def pesach_dow(self):\n \"\"\"\"\"\"\n jdn = conv.hdate_to_jdn(HebrewDate(self.hdate.year, Months.Nisan, 15))\n return (jdn + 1) % 7 + 1"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Insure `stwcs.wcsutil.HSTWCS` includes all attributes of a full image WCS.
For headerlets, the WCS does not contain information about the size of the
image, as the image array is not present in the headerlet. | [
"def read_hlet_wcs(filename, ext):\n \n hstwcs = wcsutil.HSTWCS(filename, ext=ext)\n if hstwcs.naxis1 is None:\n hstwcs.naxis1 = int(hstwcs.wcs.crpix[0] * 2.) # Assume crpix is center of chip\n hstwcs.naxis2 = int(hstwcs.wcs.crpix[1] * 2.)\n\n return hstwcs"
] | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Init function with "orta", "project"
Will do some magic to try and pull out a reasonable search query
for an exception, then searches with that | [
"def search_exception(exception, delegate = nil)\n query = ExceptionHound.new(exception).query\n search_query(query, delegate)\n end"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
<p>
Summary information about the operations that match the specified criteria.
</p>
@param operations
Summary information about the operations that match the specified criteria. | [
"public void setOperations(java.util.Collection<OperationSummary> operations) {\n if (operations == null) {\n this.operations = null;\n return;\n }\n\n this.operations = new java.util.ArrayList<OperationSummary>(operations);\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github text about document management:",
"pos": "Represent the Github code about document management:",
"neg": "Represent the Github code about Software development:"
} |
Encode a number of consecutive primitives | [
"function encodeArray_PRIM_RAW( encoder, data ) {\n\n\t//\n\t// Raw Primitive Array (PRIM_RAW)\n\t//\n\t// ....... . + Signature ID\n\t// 0110101 [LN] [16-bit]\n\t//\n\n\t// Write chunk header\n\tencoder.counters.arr_prim_raw+=1;\n\tencoder.log(LOG.ARR, \"array.prim.raw, len=\"+data.length+\n\t\t\", peek=\"+... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Commit the given types to this {@link TypeSystem} instance.
This step should be called only after the types have been committed to the backend stores successfully.
@param typesAdded newly added types.
@throws AtlasException | [
"public void commitTypes(Map<String, IDataType> typesAdded) throws AtlasException {\n for (Map.Entry<String, IDataType> typeEntry : typesAdded.entrySet()) {\n IDataType type = typeEntry.getValue();\n //Add/replace the new type in the typesystem\n typeCache.put(type);\n ... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Add comment about the attribute (variable) that stores column values
@param string &$script The script will be modified in this method.
@param Column $col | [
"protected function addColumnAttributeComment(&$script, Column $col)\n {\n $cptype = $col->getPhpType();\n $clo = strtolower($col->getName());\n\n $script .= \"\n /**\n * The value for the $clo field.\";\n if ($col->getDefaultValue()) {\n if ($col->getDefaultValue()-... | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets the spinner as progress indicator. | [
"public void showValidationInProgress() {\n validationIcon.setValue(null);\n validationIcon.addStyleName(\"show-status-label\");\n validationIcon.setStyleName(SPUIStyleDefinitions.TARGET_FILTER_SEARCH_PROGRESS_INDICATOR_STYLE);\n }"
] | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Evaluate optional additional args
@param array $args
@return void | [
"public function additionalArgs(array $args) : void\n {\n foreach ($args as $a) {\n //match --extends\n if (substr($a, 0, strlen(\"--extends=\")) == \"--extends=\") {\n $this->extends = explode(\"=\", $a);\n $this->extends = $this->extends[1];\n ... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Custom find function
use : complexFindOneBy(["hidden"=>"= 0", "startDate"=>">= 01-01-2017"])
@param array $criteria
@param array|null $orderBy
@return object|null The entity instance or NULL if the entity can not be found. | [
"public function complexFindOneBy(array $criteria, array $orderBy = [])\n {\n $qb = $this->createQueryBuilder(\"p\");\n\n foreach($criteria as $c => $v){\n $qb->andWhere(\"p.$c $v\");\n }\n foreach($orderBy as $c => $v){\n $qb->addOrderBy(\"p.\".$c,$v);\n ... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
/* (non-Javadoc)
@see com.abubusoft.kripton.BinderContext#serializeCollection(java.util.Collection, java.lang.Class, java.io.File) | [
"@Override\n\tpublic <E> void serializeCollection(Collection<E> collection, Class<E> objectClazz, File output) {\n\t\tif (collection == null)\n\t\t\treturn;\n\n\t\ttry (SerializerWrapper serializer = createSerializer(output)) {\n\t\t\tmapperFor(objectClazz).serializeCollection(this, serializer, collection);\n\t\t} ... | [
"public static <T> void registerWriter(Class<?> cls, JsonWriterI<T> writer) {\n\t\tdefaultWriter.registerWriter(writer, cls);\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Convenience methods ------------------------------------------------------ | [
"@Override\r\n public boolean isAllowed(int code, long vendorId) {\r\n AvpRepresentation avpRep = new AvpRepresentationImpl(code, vendorId);\r\n avpRep = this.unmuttableMessageAvps.get(avpRep);\r\n if (avpRep == null) {\r\n return true;\r\n }\r\n return avpRep.isAllowed();\r\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/*
Start built-in ØMQ device
see: http://api.zeromq.org/2-2:zmq-device#toc2
*/ | [
"func Device(device Dev, frontend, backend *Socket) error {\n\tif !(frontend.opened && backend.opened) {\n\t\treturn ErrorSocketClosed\n\t}\n\t_, err := C.zmq_device(C.int(device), frontend.soc, backend.soc)\n\treturn errget(err)\n}"
] | [
"def open(self):\n \"\"\"\"\"\"\n if not self.proxy:\n if not config.scgi_url:\n config.engine.load_config()\n if not config.scgi_url:\n self.LOG.error(\"You need to configure a XMLRPC connection, read\"\n \" https://pyrocore.readt... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// SetOutput implements the method for the KayveeLogger interface. | [
"func (l *Logger) SetOutput(output io.Writer) {\n\tl.fLogger.setOutput(output)\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// SetIsTruncated sets the IsTruncated field's value. | [
"func (s *ListVirtualMFADevicesOutput) SetIsTruncated(v bool) *ListVirtualMFADevicesOutput {\n\ts.IsTruncated = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// FromProtoBytes deserializes protobytes into 'TxPvtReadWriteSet' proto message and populates 'TxPvtRwSet' | [
"func (txPvtRwSet *TxPvtRwSet) FromProtoBytes(protoBytes []byte) error {\n\tprotoMsg := &rwset.TxPvtReadWriteSet{}\n\tvar err error\n\tvar txPvtRwSetTemp *TxPvtRwSet\n\tif err = proto.Unmarshal(protoBytes, protoMsg); err != nil {\n\t\treturn err\n\t}\n\tif txPvtRwSetTemp, err = TxPvtRwSetFromProtoMsg(protoMsg); err... | [
"def DeserializeExclusiveData(self, reader):\n \n self.Type = TransactionType.StateTransaction\n\n self.Descriptors = reader.ReadSerializableArray('neo.Core.State.StateDescriptor.StateDescriptor')"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Copies a content type. The identifier of the copy is changed to
copy_of_<originalBaseIdentifier>_<newTypeId> and a new remoteId is generated.
@param $contentTypeId
@return \eZ\Publish\Core\REST\Server\Values\ResourceCreated | [
"public function copyContentType($contentTypeId)\n {\n $copiedContentType = $this->contentTypeService->copyContentType(\n $this->contentTypeService->loadContentType($contentTypeId)\n );\n\n return new Values\\ResourceCreated(\n $this->router->generate(\n ... | [
"public function createUrlAlias(URLAlias $urlAlias): UIValue\\Content\\UrlAlias\n {\n return new UIValue\\Content\\UrlAlias($urlAlias);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Return threshold based on current state. | [
"def get_threshold(self):\n \"\"\"\"\"\"\n value_map = dict()\n for key, value in list(self.threshold_classes.items()):\n value_map[key] = [\n value[0].value(),\n value[1].value(),\n ]\n return value_map"
] | [
"@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:"
} |
Regular expression which defines the rule.
Generated from protobuf field <code>.google.privacy.dlp.v2.CustomInfoType.Regex regex = 2;</code>
@param \Google\Cloud\Dlp\V2\CustomInfoType\Regex $var
@return $this | [
"public function setRegex($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2\\CustomInfoType_Regex::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }"
] | [
"public function setCommonAlphabet($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dlp\\V2\\CryptoReplaceFfxFpeConfig_FfxCommonNativeAlphabet::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Encryption:"
} |
// helper for SourceFileFunction recursion | [
"func (env *Zlisp) sourceItem(item Sexp) error {\n\tswitch t := item.(type) {\n\tcase *SexpArray:\n\t\tfor _, v := range t.Val {\n\t\t\tif err := env.sourceItem(v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase *SexpPair:\n\t\texpr := item\n\t\tfor expr != SexpNull {\n\t\t\tlist := expr.(*SexpPair)\n\t\t... | [
"public QueryContext with( Problems problems ) {\n return new QueryContext(context, repositoryCache, workspaceNames, overriddenNodeCachesByWorkspaceName, schemata,\n indexDefns, nodeTypes, bufferManager, hints, problems, variables);\n }"
] | codesearchnet | {
"query": "Represent the text about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code about Go programming language:"
} |
私钥解密
@param data
@param privateKey
@param fillMode
填充模式
@return
@throws Exception | [
"public static String decryptByPrivateKey(String data, String privateKey, String fillMode) throws Exception {\n\t\tbyte[] encryptedData = base64.decode(data);\n\t\tbyte[] keyBytes = base64.decode(privateKey);\n\t\tPKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);\n\t\tKeyFactory keyFactory = Key... | [
"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 text about Encryption:",
"pos": "Represent the Github code about Encryption:",
"neg": "Represent the Github code about programming:"
} |
Render a template
@param {String} filename The path to the file
@param {Object} options The model to pass to the view
@param {Function} callback (Optional) The async node style callback | [
"function render(filename, options, callback) {\n var isAsync = callback && typeof callback === 'function';\n\n if (!isAsync) {\n return renderSync(filename, options)\n }\n\n getTemplate(filename, options, function(err, template) {\n if (err) {\n return callback(err);\n }\n\n template.render({ ... | [
"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 Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Adopted from jquery's extend method. Under the terms of MIT License.
http://code.jquery.com/jquery-1.4.2.js
Modified by Brian White to use Array.isArray instead of the custom isArray method | [
"function extend() {\n // copy reference to target object\n var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;\n // Handle a deep copy situation\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[1] || {};\n // skip the b... | [
"function(attributes, options){\n var t = this;\n\n // Override instance level constants\n t.CONST = CONST;\n\n // This is the same as a PagesProbe except for the constants (above)\n PagesProbe.prototype.initialize.apply(t, arguments);\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Validate non-optional parameters and return new instance. | [
"public function build(): SetRuleSelectorRequest\n\t{\n\t\t$instance = new SetRuleSelectorRequest();\n\t\tif ($this->styleSheetId === null) {\n\t\t\tthrow new BuilderException('Property [styleSheetId] is required.');\n\t\t}\n\t\t$instance->styleSheetId = $this->styleSheetId;\n\t\tif ($this->range === null) {\n\t\t\... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Handle an exception from a transaction beginning.
@param \Throwable $e
@return void
@throws \Exception | [
"protected function handleBeginTransactionException($e)\n {\n if ($this->causedByLostConnection($e)) {\n $this->reconnect();\n\n $this->pdo->beginTransaction();\n } else {\n throw $e;\n }\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
<p>Add a set definition string to the {@code CharSet}.</p>
@param str set definition string | [
"protected void add(final String str) {\n if (str == null) {\n return;\n }\n\n final int len = str.length();\n int pos = 0;\n while (pos < len) {\n final int remainder = len - pos;\n if (remainder >= 4 && str.charAt(pos) == '^' && str.charAt(pos + ... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
/* (non-Javadoc)
@see org.joml.Vector4fc#normalize3(org.joml.Vector4f) | [
"public Vector4f normalize3(Vector4f dest) {\n float invLength = 1.0f / (float) Math.sqrt(x * x + y * y + z * z);\n dest.x = x * invLength;\n dest.y = y * invLength;\n dest.z = z * invLength;\n dest.w = w * invLength;\n return dest;\n }"
] | [
"public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Detects if a systemd service is enabled or not. | [
"def is_systemd_service_enabled(conn, service='ceph'):\n \n _, _, returncode = remoto.process.check(\n conn,\n [\n 'systemctl',\n 'is-enabled',\n '--quiet',\n '{service}'.format(service=service),\n ]\n )\n return returncode == 0"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Set the additional field types.
@param spec field=String,field1=Double, ... See {@link GelfMessage} for supported types.
@param gelfMessageAssembler the Gelf message assembler to apply the configuration | [
"public static void setAdditionalFieldTypes(String spec, GelfMessageAssembler gelfMessageAssembler) {\n if (null != spec) {\n String[] properties = spec.split(MULTI_VALUE_DELIMITTER);\n\n for (String field : properties) {\n final int index = field.indexOf(EQ);\n ... | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlockerVolumeSource. | [
"func (in *FlockerVolumeSource) DeepCopy() *FlockerVolumeSource {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(FlockerVolumeSource)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (resource *Provenance) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Provenance\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Provenance), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*res... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
////////////////////////////////////////////////////////////////////////////////
//
// Tail the cloudwatch logs for the active function
// | [
"func newCloudWatchLogTailView(awsSession *session.Session,\n\tapp *tview.Application,\n\tlambdaAWSInfos []*LambdaAWSInfo,\n\tsettings map[string]string,\n\tfunctionSelectedBroadcaster broadcast.Broadcaster,\n\tlogger *logrus.Logger) (tview.Primitive, []tview.Primitive) {\n\n\tosEmojiSet := progressEmoji\n\tswitch ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Get artifact by name.
Args:
name: artifact name string.
Returns:
artifact object.
Raises:
ArtifactNotRegisteredError: if artifact doesn't exist in the registy. | [
"def GetArtifact(self, name):\n \n self._CheckDirty()\n result = self._artifacts.get(name)\n if not result:\n raise rdf_artifacts.ArtifactNotRegisteredError(\n \"Artifact %s missing from registry. You may need to sync the \"\n \"artifact repo by running make in the artifact direct... | [
"def interface_required(interface):\n \n def _interface_required(func):\n \"\"\"Internal decorator that wraps around the decorated function.\n\n Args:\n func (function): function being decorated\n\n Returns:\n The wrapper function.\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
currently context is only needed in case of EBlock mode | [
"public DataChannelReader getDataChannelSource(TransferContext context)\n\tthrows Exception {\n\tString id = getHandlerID(session.transferMode, session.transferType, SOURCE);\n\tlogger.debug(\"type/mode: \" + id);\n\tClass clazz = (Class)dataHandlers.get(id);\n\tif (clazz == null) {\n\t throw new Exception(\"No ... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// FromPeerConfig creates a new EventEndpoint from the given config | [
"func FromPeerConfig(config fab.EndpointConfig, peer fab.Peer, peerCfg *fab.PeerConfig) *EventEndpoint {\n\topts := comm.OptsFromPeerConfig(peerCfg)\n\topts = append(opts, comm.WithConnectTimeout(config.Timeout(fab.PeerConnection)))\n\n\treturn &EventEndpoint{\n\t\tPeer: peer,\n\t\topts: opts,\n\t}\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// NewReadOnlyConfig creates a new confguration that returns an error if an
// attempt to write to the configuration is made. | [
"func NewReadOnlyConfig(workdir, gitdir string) *Configuration {\n\tcfg := NewConfig(workdir, gitdir)\n\tcfg.readOnly = true\n\treturn cfg\n\n}"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
// SetMicroseconds is a convinience method which allows easy servo control. | [
"func (d *PCA9685) setMicroseconds(channel, us int) error {\n\toffTime := us * d.Freq * pwmControlPoints / 1000000\n\treturn d.SetPwm(channel, 0, offTime)\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:"
} |
Validates against additionalItems
@param array $subject
@param array $schema
@return bool | [
"private function validateAdditionalItems(array $subject, array $schema): bool\n {\n $subject = \\array_slice($subject, count($schema['items']));\n\n if (\\is_bool($schema['additionalItems'])) {\n return $this->validateAdditionalItemsSchemaBoolean($subject, $schema);\n }\n ... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Delete a post.
@param int $id
@return RedirectResponse | [
"public function deleteAction($id)\n {\n /** @var PostInterface $post */\n $post = $this->get('opifer.form.post_manager')->getRepository()->find($id);\n\n if (!$post) {\n return $this->createNotFoundException();\n }\n \n $form = $post->getForm();\n\n $e... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
This method returns a list of validation errors. If there are no errors
an empty list is returned | [
"def get_validation_errors(self, xml_input):\n \n errors = []\n try:\n parsed_xml = etree.parse(self._handle_xml(xml_input))\n self.xmlschema.assertValid(parsed_xml)\n except (etree.DocumentInvalid, etree.XMLSyntaxError), e:\n errors = self._handle_errors... | [
"function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Get the name of a {@link CacheManager} based on its {@code beanName}.
@param beanName the name of the {@link CacheManager} bean
@return a name for the given cache manager | [
"private String getCacheManagerName(String beanName) {\n\t\tif (beanName.length() > CACHE_MANAGER_SUFFIX.length()\n\t\t\t\t&& StringUtils.endsWithIgnoreCase(beanName, CACHE_MANAGER_SUFFIX)) {\n\t\t\treturn beanName.substring(0,\n\t\t\t\t\tbeanName.length() - CACHE_MANAGER_SUFFIX.length());\n\t\t}\n\t\treturn beanNa... | [
"private <T> T create(Class<T> pluginType, String className) {\n if (className == null) {\n throw new IllegalStateException(\n \"No default implementation for requested Mockito plugin type: \" + pluginType.getName() + \"\\n\"\n + \"Is this a valid Mockito plugin t... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
%prog random fasta 100 > random100.fasta
Take number of records randomly from fasta | [
"def random(args):\n \n from random import sample\n\n p = OptionParser(random.__doc__)\n opts, args = p.parse_args(args)\n\n if len(args) != 2:\n sys.exit(not p.print_help())\n\n fastafile, N = args\n N = int(N)\n assert N > 0\n\n f = Fasta(fastafile)\n fw = must_open(\"stdout\"... | [
"def genms(self, scans=[]):\n \n\n if len(scans):\n scanstr = string.join([str(ss) for ss in sorted(scans)], ',')\n else:\n scanstr = self.allstr\n\n print 'Splitting out all cal scans (%s) with 1s int time' % scanstr\n newname = ps.sdm2ms(self.sdmfile, self.... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Adds data into the `Collection` instance.
@param mixed $data An array or an entity instance to set.
@return self Return `this`. | [
"public function push($data = [])\n {\n $name = $this->_through;\n $this->_parent->{$name}->push($offset, $this->_item($data));\n return $this;\n }"
] | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Finds the six sites with the maximum and minimum coordinates along x, y, and z.
Args:
None
Returns:
(List(List)): In the order [ +x, -x, +y, -y, +z, -z ] | [
"def sites_at_edges( self ):\n \n min_x = min( [ s.r[0] for s in self.sites ] )\n max_x = max( [ s.r[0] for s in self.sites ] )\n min_y = min( [ s.r[1] for s in self.sites ] )\n max_y = max( [ s.r[1] for s in self.sites ] )\n min_z = min( [ s.r[2] for s in self.sites ] )\n ... | [
"def controlPoints(cmd, data):\n \n cmd = cmd.lower()\n if cmd in ['c', 's', 'q']:\n indices = range(len(data))\n if cmd == 'c': # c: (x1 y1 x2 y2 x y)+\n return [index for index in indices if (index % 6) < 4]\n elif cmd in ['s', 'q']: # s: (x2 y2 x y)+ q: (x1 y1 x y)+\n... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Sets and returns the access token.
@param string $code
@param string $grant
@return AccessToken
@see Elogram\Helpers\RedirectLoginHelper::getAccessToken()
@codeCoverageIgnore | [
"public function getAccessToken($code, $grant = 'authorization_code')\n {\n $token = $this->container->get(RedirectLoginHelper::class)\n ->getAccessToken($code, $grant);\n $this->setAccessToken($token);\n return $token;\n }"
] | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Sets the {@code "Slug"} header, properly escaping the header value. See <a
href="http://tools.ietf.org/html/rfc5023#section-9.7">The Slug Header</a>.
@since 1.14 | [
"public static void setSlugHeader(HttpHeaders headers, String value) {\n if (value == null) {\n headers.remove(\"Slug\");\n } else {\n headers.set(\"Slug\", Lists.newArrayList(Arrays.asList(SLUG_ESCAPER.escape(value))));\n }\n }"
] | [
"func (this *Request) Get(f string) string {\n\n\t/*\n\t Possible future bug.\n\t http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n\t Message headers are case-insensitive.\n\t*/\n\n\treturn this.Header.Get(f)\n}"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Web development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.