query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Create a new NotificationInstance
@param array|Options $options Optional Arguments
@return NotificationInstance Newly created NotificationInstance
@throws TwilioException When an HTTP error occurs. | [
"public function create($options = array()) {\n $options = new Values($options);\n\n $data = Values::of(array(\n 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }),\n 'Tag' => Serialize::map($options['tag'], function($e) { return $e; }),\n ... | [
"public static function createNotMerged(Envelope $envelope, \\Exception $e = null)\n {\n $message = 'The given DigiDoc envelope must be merged with Api (using Api::merge) before calling this method.';\n\n return new static($message, null, $e);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about API documentation:"
} |
Get fields as properties
@param obj the object to get fields for
@param clazzes the classes to use for reflection and properties.
T
@return the fields as properties | [
"public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {\n Properties props = new Properties();\n for (Field field : obj.getClass().getDeclaredFields()) {\n if (Modifier.isStatic(field.getModifiers()))\n continue;\n field.s... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetDefaultValue sets the DefaultValue field's value. | [
"func (s *IntArrayOptions) SetDefaultValue(v int64) *IntArrayOptions {\n\ts.DefaultValue = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Compares the content of the specified buffer to the content of this
buffer. This comparison is performed byte by byte using an unsigned
comparison. | [
"@SuppressWarnings(\"ObjectEquality\")\n @Override\n public int compareTo(Slice that)\n {\n if (this == that) {\n return 0;\n }\n return compareTo(0, size, that, 0, that.size);\n }"
] | [
"public FP64 extend(char c) {\n byte b1 = (byte)(c & 0xff);\n extend(b1);\n byte b2 = (byte) (c >>> 8);\n // NOTE pdalbora 23-Jul-2009 -- The following check is intentional. We don't extend the high order byte when it's\n // zero, in order to avoid \"weakening\" the fingerprint of primarily ASCII dat... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Resets order shipping date. | [
"public function resetOrder()\n {\n $oOrder = oxNew(\\OxidEsales\\Eshop\\Application\\Model\\Order::class);\n if ($oOrder->load($this->getEditObjectId())) {\n $oOrder->oxorder__oxsenddate = new \\OxidEsales\\Eshop\\Core\\Field(\"0000-00-00 00:00:00\");\n $oOrder->save();\n\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Load options from CONFIG if it exists | [
"def load_config\n (symbolise = lambda do |h|\n h.is_a?(Hash) ? Hash[h.map { |k, v| [k.intern, symbolise[v]] }] : h\n end)[YAML.load_file CONFIG] if File.readable? CONFIG\n rescue => e\n warn \"Failed to load #{ CONFIG }: #{ e }\"\n end"
] | [
"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:"
} |
BELScript.g:70:1: set_annotation : 'SET' OBJECT_IDENT '=' ( quoted_value | vl= VALUE_LIST | OBJECT_IDENT ) ; | [
"public final BELScriptParser.set_annotation_return set_annotation() throws RecognitionException {\n BELScriptParser.set_annotation_return retval = new BELScriptParser.set_annotation_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n Token vl=null;\n Token strin... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Indicates whether the document has a vote from particular voter object.
@param [Mongoid::Document] voted_by object from which the vote was done
@return [Boolean] | [
"def voted_by?(voted_by)\n !!votes.find_by(voted_by_id: voted_by.id)\n rescue NoMethodError, Mongoid::Errors::DocumentNotFound\n false\n end"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Register Providers | [
"function registerProviders () {\n Object.keys(settings.providers).forEach(function (id) {\n var providerConf = settings.providers[id]\n var provider = providers[id] ? providers[id] : providerConf\n\n var strategy = protocols.initialize(id, provider, providerConf)\n strategies[id] = strategy\n })\n}"
... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Adds a job to @jobs array
@param (Parser::Schedule) :schedule is object of Parser::Schedule class
@param (Parser::Command) :command is object of Parser::Command class | [
"def add_job(opts={})\n @jobs << Job.new( Parser::Schedule.new(opts[:schedule]), Parser::Command.new(opts[:command]))\n end"
] | [
"def create(parser: Parser, obj: PersistedObject = None):\n \n if obj is not None:\n return _InvalidParserException('Error ' + str(obj) + ' cannot be parsed using ' + str(parser) + ' since '\n + ' this parser does not support ' + obj.get_pretty_file... | 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:"
} |
--- RegistryClientV2
Create a new Docker Registry V2 client for a particular repository.
@param opts.insecure {Boolean} Optional. Default false. Set to true
to *not* fail on an invalid or self-signed server certificate.
... TODO: lots more to document | [
"function RegistryClientV2(opts) {\n var self = this;\n assert.object(opts, 'opts');\n // One of `opts.name` or `opts.repo`.\n assert.ok((opts.name || opts.repo) && !(opts.name && opts.repo),\n 'exactly one of opts.name or opts.repo must be given');\n if (opts.name) {\n assert.string(op... | [
"def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Executes given SQL statement.
@param string $queryString
@return mysqli_result|bool
@throws DriverException | [
"public function runQuery($queryString){\n\n\t\t$this->affectedRows = false;\n\t\t$result = $this->resource->query($queryString, $this->unbuffered ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT);\n\n\t\t$error = preg_replace('~You have an error in your SQL syntax; check the manual that corresponds to your \\w+ server ve... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Convert values to lowercase.
Parameters
----------
array : numpy.ndarray or WeldObject
Input data.
Returns
-------
WeldObject
Representation of this computation. | [
"def weld_str_lower(array):\n \n obj_id, weld_obj = create_weld_object(array)\n\n weld_template = \"\"\"map(\n {array},\n |e: vec[i8]|\n result(\n for(e,\n appender[i8],\n |c: appender[i8], j: i64, f: i8|\n if(f > 64c && f < 91c,\n ... | [
"def _maybe_dt_array(array):\n \n if not isinstance(array, DataTable) or array is None:\n return array\n\n if array.shape[1] > 1:\n raise ValueError('DataTable for label or weight cannot have multiple columns')\n\n # below requires new dt version\n # extract first column\n array = ar... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set the config.
@param array $config
@param string $section
@param string $table
@return array | [
"public function setConfig($config, $section, $table)\n {\n if (!empty($section)) {\n foreach ($config as $key => $value) {\n $config[$key] = str_replace('_table_', ucfirst($table), str_replace('_section_', ucfirst($section), str_replace('_sectionLowerCase_', strtolower($section)... | [
"public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about NLP:"
} |
Gets the splits from Stash for the given table. | [
"public Collection<String> getSplits(String table)\n throws StashNotAvailableException, TableNotStashedException {\n try {\n return FluentIterable.from(_stashReader.getSplits(table))\n .transform(Functions.toStringFunction())\n .toList();\n }... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
getParentMenu
0 = unpublish
1 = publish | [
"public static function getParentMenu($publish=null, $parent=null, $type=null) \n\t{\t\t\n\t\t$criteria=new CDbCriteria;\n\t\tif($publish != null)\n\t\t\t$criteria->compare('t.publish',$publish);\n\t\tif($parent != null)\n\t\t\t$criteria->compare('t.parent_id',$parent);\n\t\t\n\t\t$model = self::model()->findAll($c... | [
"function (p) {\n/*Line 57 - 'AtomPostButton.js' */ AtomBinder.setValue(caller, \"postResult\", p.value());\n/*Line 58 - 'AtomPostButton.js' */ caller.invokeAction(caller._next);\n/*Line 59 - 'AtomPostButton.js' */ }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(TagResourceRequest tagResourceRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (tagResourceRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(tagResource... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Monitor the original element for changes and update select2 accordingly
abstract | [
"function () {\n this.opts.element.bind(\"change.select2\", this.bind(function (e) {\n if (this.opts.element.data(\"select2-change-triggered\") !== true) {\n this.initSelection();\n }\n }));\n }"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Async resolve a files path using nodes module resolution.
@param {string} dir - the directory to look in.
@param {string} file - the file to find.
@return {Promise<string>} | [
"function resolveFile (dir, file) {\n return new Promise((resolve, reject) => {\n resolver.resolve({}, dir, file, (err, result) => {\n if (err) reject(err)\n else resolve(result)\n })\n })\n}"
] | [
"function define(File, utils) {\n return class JSONFile extends File {\n /**\n * Constructor\n * @param {String} id\n * @param {String} filepath\n * @param {Object} options\n * - {Function} buildFactory\n * - {Object} fileCache\n * - {Object} fileExtensions\n * - {Function} f... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Indent selected text
:param cursor: QTextCursor | [
"def indent_selection(self, cursor):\n \n doc = self.editor.document()\n tab_len = self.editor.tab_length\n cursor.beginEditBlock()\n nb_lines = len(cursor.selection().toPlainText().splitlines())\n c = self.editor.textCursor()\n if c.atBlockStart() and c.position() =... | [
"def check_arrange_act_spacing(self) -> typing.Generator[AAAError, None, None]:\n \n yield from self.check_block_spacing(\n LineType.arrange,\n LineType.act,\n 'AAA03 expected 1 blank line before Act block, found {}',\n )"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Unload all the CSS dependencies of a template. This function does not trigger a DOM update. CSS style
elements are only removed if not needed during the next CSS insertion.
@param {aria.templates.TemplateCtxt} tplCtxt template context | [
"function (tplCtxt) {\n this.$assert(169, tplCtxt.$TemplateCtxt);\n\n var unload = tplCtxt.getCSSDependencies();\n var tplClasspath = tplCtxt.tplClasspath;\n\n this.unloadClassPathDependencies(tplClasspath, unload);\n\n this.$raiseEvent({\n name ... | [
"function() {\n if (options.servePacked) {\n ss.bundler.forEach(function(bundler) {\n bundler.useLatestsPackedId();\n });\n }\n ss.bundler.load();\n //TODO convert options.dirs to relative paths stripping the lead '/' if present\n\n // Cache instances of code formatte... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Echo returns the same message | [
"func Echo(ctx *cli.Context) command.Command {\n\tusage := \"echo [text]\"\n\tdesc := \"Returns the [text]\"\n\n\treturn command.NewCommand(\"echo\", usage, desc, func(args ...string) ([]byte, error) {\n\t\tif len(args) < 2 {\n\t\t\treturn []byte(\"echo what?\"), nil\n\t\t}\n\t\treturn []byte(strings.Join(args[1:],... | [
"function Request(conn, cmd, args) {\n\n // current connection\n this.conn = conn;\n\n // command name\n this.cmd = cmd;\n\n // command arguments may be modified\n // during validation\n this.args = args;\n\n // raw command arguments, injected by the server\n this.raw = null;\n\n // server will inject thi... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Function get source and destination alphabet and return convert function
@param {string|Array} srcAlphabet
@param {string|Array} dstAlphabet
@returns {function(number|Array)} | [
"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);... | [
"function BinaryPacker_pack(source, // @arg Any - source data\n formatID) { // @arg Integer - 0x0001 - 0xffff\n // @ret Uint8Array|null\n//{@dev\n $valid(_isValidFormatID(formatID), BinaryPacker_pack, \"formatID\");\n//}@dev\n var moduleID = ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Java programming:"
} |
Return the number of cookies for the given domain. | [
"def count_cookies(self, domain):\n ''''''\n cookies = self.cookie_jar._cookies\n\n if domain in cookies:\n return sum(\n [len(cookie) for cookie in cookies[domain].values()]\n )\n else:\n return 0"
] | [
"public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d... | codesearchnet | {
"query": "Represent the Github summarization about database:",
"pos": "Represent the Github code about database:",
"neg": "Represent the Github code about programming:"
} |
// TagAttr returns the lower-cased key and unescaped value of the next unparsed
// attribute for the current tag token and whether there are more attributes.
// The contents of the returned slices may change on the next call to Next. | [
"func (z *Tokenizer) TagAttr() (key, val []byte, moreAttr bool) {\n\tif z.nAttrReturned < len(z.attr) {\n\t\tswitch z.tt {\n\t\tcase StartTagToken, SelfClosingTagToken:\n\t\t\tx := z.attr[z.nAttrReturned]\n\t\t\tz.nAttrReturned++\n\t\t\tkey = z.buf[x[0].start:x[0].end]\n\t\t\tval = z.buf[x[1].start:x[1].end]\n\t\t\... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Is a screenshot desired, based on the command and the test result. | [
"public boolean requireScreenshot(final ExtendedSeleniumCommand command,\n\t\t\tboolean result) {\n\t\treturn\n\t\t\t(!command.isAssertCommand()\n\t\t\t\t&& !command.isVerifyCommand()\n\t\t\t\t&& !command.isWaitForCommand()\n\t\t\t\t&& screenshotPolicy == ScreenshotPolicy.STEP)\n\t\t\t|| (!result\n\t\t\t\t&& (scree... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Copy a directory from one location to another.
@param string $directory
@param string $destination
@param int $options
@return bool | [
"public function copyDirectory( string $directory, string $destination, $options = null ): bool\n\t{\n\t\tif( !$this->isDirectory( $directory ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$options = $options ?: FilesystemIterator::SKIP_DOTS;\n\n\t\t// If the destination directory does not actually exist, we will go... | [
"public function run(array $args)\n {\n Index::info('Help Menu');\n Index::info('- `eve generate <schema*> <namespace>` Generates files based on schema');\n Index::info('- `eve database <schema*>` Generates database table/s schema');\n Index::info('- `eve install` ... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
Get the format module to use for optimizing the image. | [
"def _get_format_module(image_format):\n \"\"\"\"\"\"\n format_module = None\n nag_about_gifs = False\n\n if detect_format.is_format_selected(image_format,\n Settings.to_png_formats,\n png.PROGRAMS):\n format_module = p... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Flush right.
>>> _padleft(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430'
True | [
"def _padleft(width, s, has_invisible=True):\n \n iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width\n fmt = \"{0:>%ds}\" % iwidth\n return fmt.format(s)"
] | [
"def rl_marks(x):\n \n # простые замены, можно без регулярок\n replacements = (\n (u'(r)', u'\\u00ae'), # ®\n (u'(R)', u'\\u00ae'), # ®\n (u'(p)', u'\\u00a7'), # §\n (u'(P)', u'\\u00a7'), # §\n (u'(tm)', u'\\u2122'), # ™\n (u'(TM)', u'\\u2122'), # ™\n )\n pat... | codesearchnet | {
"query": "Represent the sentence about Python programming:",
"pos": "Represent the code about Python programming:",
"neg": "Represent the code:"
} |
Authenticate with token bytes.
@param tokenBytes
@return The authenticated subject. | [
"@Override\n public Subject authenticate(@Sensitive byte[] tokenBytes) throws AuthenticationException {\n AuthenticationData authenticationData = createAuthenticationData(tokenBytes);\n return authenticationService.authenticate(jaasEntryName, authenticationData, null);\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Displays a form to create a new Page entity.
@Route("/new", name="manage_page_new")
@Template() | [
"public function newAction()\n {\n $entity = new Page();\n $form = $this->createForm(new PageType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }"
] | [
"public function index()\n {\n $this->setData('homeUrl', $this->getServiceManager()->get(DefaultUrlService::SERVICE_ID)->getUrl('ProctoringHome'));\n $this->setData('logout', $this->getServiceManager()->get(DefaultUrlService::SERVICE_ID)->getUrl('ProctoringLogout'));\n $this->composeView('de... | codesearchnet | {
"query": "Represent the post about Symfony:",
"pos": "Represent the code about Symfony:",
"neg": "Represent the code:"
} |
// Input/output error | [
"func isSysErrIO(err error) bool {\n\tif err == syscall.EIO {\n\t\treturn true\n\t}\n\tpathErr, ok := err.(*os.PathError)\n\treturn ok && pathErr.Err == syscall.EIO\n}"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
The perpendicular distance squared from a point to a line
pt - point in question
l0 - one point on the line
l1 - another point on the line | [
"def distance2_to_line(pt, l0, l1):\n '''\n '''\n pt = np.atleast_1d(pt)\n l0 = np.atleast_1d(l0)\n l1 = np.atleast_1d(l1)\n reshape = pt.ndim == 1\n if reshape:\n pt.shape = l0.shape = l1.shape = (1, pt.shape[0])\n result = (((l0[:,0] - l1[:,0]) * (l0[:,1] - pt[:,1]) - \n ... | [
"def dihedral(array_of_xyzs):\n \n p1 = array_of_xyzs[0]\n p2 = array_of_xyzs[1]\n p3 = array_of_xyzs[2]\n p4 = array_of_xyzs[3]\n\n vector1 = -1.0 * (p2 - p1)\n vector2 = p3 - p2\n vector3 = p4 - p3\n\n # Normalize vector so as not to influence magnitude of vector\n # rejections\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
all fields are required by default unless otherwise stated | [
"def build_fields\n if @data.key?(:fields)\n @data[:fields].each do |k,v|\n v[:required] = true unless v.key?(:required)\n end\n else\n {city: {label:'City', required: true}, region: {label: 'Province', required: false}, postcode: {label: 'Post Code', required: false} }\n ... | [
"protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Data synchronization:"
} |
Runs the callback for the given request
@param DispatcherInterface|array $dispatcher
@param null|string $path
@param null|string $method
@return mixed
@throws \LogicException
@throws \Throwable | [
"public function dispatch($dispatcher = null, $path = null, $method = null)\n {\n if (!$dispatcher) {\n $dispatcher = new Dispatcher;\n } elseif (\\is_array($dispatcher)) {\n $dispatcher = new Dispatcher($dispatcher);\n }\n\n if (!$dispatcher instanceof Dispatche... | [
"public static function dispatch(string $className, object $object = null) : void\n {\n /** @var EventInterface $className */\n static::eventClassCheck($className);\n $className::dispatch($object);\n }"
] | codesearchnet | {
"query": "Represent the summarization about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
%prog freebayes prefix ref.fa *.bam
Call SNPs using freebayes. | [
"def freebayes(args):\n \n p = OptionParser(freebayes.__doc__)\n p.add_option(\"--mindepth\", default=3, type=\"int\",\n help=\"Minimum depth [default: %default]\")\n p.add_option(\"--minqual\", default=20, type=\"int\",\n help=\"Minimum quality [default: %default]\")\n ... | [
"def index_bowtie(self):\n \"\"\"\"\"\"\n # It returns exit code 1 if the fasta is empty #\n assert self\n # Call the bowtie executable #\n sh.bowtie2_build(self.path, self.path)\n return FilePath(self.path + '.1.bt2')"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Check if the extension is valid for loading, i.e has a class and is withing version constraints.
@param Composer $composer
@param string|null $class
@param string|null $constraint
@return bool | [
"private static function parseValid(Composer $composer, $class, $constraint)\n {\n if ($constraint === null) {\n return false;\n }\n\n $provides = $composer->getPackage()->getProvides();\n $boltVersion = isset($provides['bolt/bolt']) ? $provides['bolt/bolt'] : new Link('__r... | [
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Resize and return the image passing the new height and width
@param height
@param width
@return | [
"public BufferedImage getBufferedImage(int width, int height) {\n // using the new approach of Java 2D API\n BufferedImage buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n Graphics2D g2d = (Graphics2D) buf.getGraphics();\n g2d.setRenderingHint(RenderingHints.KEY_INT... | [
"public function isSmall() :bool {\n // Invoke cropToStyle, to get info about the size.\n $this->cropToStyle($this->configFactory->get('social_group.settings')->get('default_hero'));\n // Return info about the size.\n return $this->isSmall;\n }"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about NLP:"
} |
Take a node and return allowed attributes and check values | [
"private function wash_attribs($node)\n {\n $result = '';\n $washed = array();\n\n foreach ($node->attributes as $name => $attr) {\n $key = strtolower($name);\n $value = $attr->nodeValue;\n\n if ($key == 'style' && ($style = $this->wash_style($value))) {\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
A helper method to allow the dynamic evaluation of groovy expressions using this
scripts binding as the variable scope
@param expression is the Groovy script expression to evaluate | [
"public Object evaluate(String expression) throws CompilationFailedException {\n GroovyShell shell = new GroovyShell(getClass().getClassLoader(), binding);\n return shell.evaluate(expression);\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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Use a VirtualConnection rather than a InboundVirtualConnection for discrimination | [
"public int discriminate(VirtualConnection vc, Object discrimData, ConnectionLink prevChannelLink) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n Tr.debug(tc, \"discriminate: \" + vc);\n }\n ConnectionLink nextChannelLink = nextChannel.getConnectionLink(vc);... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Print a percent complete value.
@param value Double instance
@return percent complete value | [
"public static final String printPercent(Double value)\n {\n return value == null ? null : Double.toString(value.doubleValue() / 100.0);\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the ActiveWindow name based on its class short name.
@return string | [
"public function getName()\n {\n if ($this->_name === null) {\n $this->_name = ((new \\ReflectionClass($this))->getShortName());\n }\n \n return $this->_name;\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
A 2-by-2 matrix. Stored in column-major order. | [
"function Mat22(a, b, c, d) {\n if (typeof a === 'object' && a !== null) {\n this.ex = Vec2.clone(a);\n this.ey = Vec2.clone(b);\n } else if (typeof a === 'number') {\n this.ex = Vec2.neo(a, c);\n this.ey = Vec2.neo(b, d)\n } else {\n this.ex = Vec2.zero();\n this.ey = Vec2.zero()\n }\n}"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Skip skips a json object and positions to relatively the next json object | [
"func (iter *Iterator) Skip() {\n\tc := iter.nextToken()\n\tswitch c {\n\tcase '\"':\n\t\titer.skipString()\n\tcase 'n':\n\t\titer.skipThreeBytes('u', 'l', 'l') // null\n\tcase 't':\n\t\titer.skipThreeBytes('r', 'u', 'e') // true\n\tcase 'f':\n\t\titer.skipFourBytes('a', 'l', 's', 'e') // false\n\tcase '0':\n\t\tit... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// DescribeLiveStreamRecordIndexFile 查询单个录制索引文件
//
// https://help.aliyun.com/document_detail/35237.html?spm=5176.doc35236.6.230.XnsJuD | [
"func (l *Live) DescribeLiveStreamRecordIndexFile(streamName, recordID string, resp interface{}) (err error) {\n\treq := l.cloneRequest(DescribeLiveStreamRecordIndexFileAction)\n\tif global.EmptyString == req.AppName || global.EmptyString == streamName {\n\t\treturn errors.New(\" appName|streamName should not to be... | [
"public static ReplyDetailWarpper getDummyNewsReplyDetailWarpper() {\n ReplyDetail replyDetail1 = new ReplyDetail();\n replyDetail1.setTitle(\"fork me\");\n replyDetail1.setMediaUrl(\"http://c.hiphotos.baidu.com/baike/c%3DbaikeA4%2C10%2C95/sign=c1767bbf4b36acaf4de0c1ad15b2e851/29381f30e924b899a... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/ Functions ------------------------------------------------------------------ | [
"function main(){\n\n var argv = yargs\n .boolean( \"a\" )\n .boolean( \"r\" )\n .boolean( \"s\" )\n .boolean( \"c\" )\n .boolean( \"h\" )\n .boolean( \"v\" )\n .argv;\n\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Applies sorting on Iterator.
@param array $fields
@return $this | [
"public function order($fields)\n {\n $data = $this->get();\n\n // prepare arguments for array_multisort()\n $args = [];\n foreach ($fields as list($field, $desc)) {\n $args[] = array_column($data, $field);\n $args[] = $desc ? SORT_DESC : SORT_ASC;\n /... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Wraps around module loading for unexpected additions | [
"def detect_additions(options={}, &block)\n Util.detect(options, &block).tap do |detected|\n @commands.concat detected[:methods].map(&:to_s)\n end\n end"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
https://tools.ietf.org/html/rfc7946#section-3.1.5 | [
"function MultiLineString(multiLineString) {\n crs(multiLineString);\n bbox(multiLineString);\n if (!requiredProperty(multiLineString, 'coordinates', 'array')) {\n positionArray(multiLineString.coordinates, 'Line', 2);\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Web development:"
} |
// SetDescription sets the clients description. | [
"func (c *Client) SetDescription(description string) error {\n\treturn c.ClientUpdate(NewArg(ClientDescription, description))\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
get time from mavlink ATTITUDE | [
"def mavlink_packet(self, m):\n ''''''\n if m.get_type() == 'GLOBAL_POSITION_INT':\n if abs(m.lat) < 1000 and abs(m.lon) < 1000:\n return\n self.vehicle_pos = VehiclePos(m)"
] | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
calculate total size (include witness data.) | [
"def size\n 80 + Bitcoin.pack_var_int(transactions.size).bytesize +\n transactions.inject(0){|sum, tx| sum + (tx.witness? ? tx.serialize_witness_format.bytesize : tx.serialize_old_format.bytesize)}\n end"
] | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Launches a automated backup routine for the given course
@param stdClass $course
@param int $starttime
@param int $userid
@return bool | [
"public static function launch_automated_backup($course, $starttime, $userid) {\n\n $outcome = self::BACKUP_STATUS_OK;\n $config = get_config('backup');\n $dir = $config->backup_auto_destination;\n $storage = (int)$config->backup_auto_storage;\n\n $bc = new backup_controller(backu... | [
"final public function create()\n {\n\n $self = $this;\n\n $splash = $self->getSplash();\n $sessId = $this->generateId($splash);\n\n session_id($sessId); //Must be called before the sesion start to generate the Id\n session_cache_limiter('none');\n\n session_name(md5($se... | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
A Helper to materialize primitive data types | [
"public void materializeHelper(Materializer maker) throws IOException {\n if (!materialized) {\n ReaderWriterProfiler.start(ReaderWriterProfiler.Counter.DECODING_TIME);\n try {\n maker.materialize(treeReader, currentRow);\n materialized = true;\n writableCreated = false;\n 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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Connects this object to the specified source project. | [
"def load(self, project: typing.Union[projects.Project, None]):\n \"\"\"\"\"\"\n self._project = project"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Rewrite the error dictionary, so that its keys correspond to the model fields. | [
"def _post_clean(self):\n \n super(NgModelFormMixin, self)._post_clean()\n if self._errors and self.prefix:\n self._errors = ErrorDict((self.add_prefix(name), value) for name, value in self._errors.items())"
] | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the post about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
// To adds a route to the router with the given HTTP methods, route path, and handlers.
// Multiple HTTP methods should be separated by commas (without any surrounding spaces). | [
"func (rg *RouteGroup) To(methods, path string, handlers ...Handler) *Route {\n\tmm := strings.Split(methods, \",\")\n\tif len(mm) == 1 {\n\t\treturn rg.add(methods, path, handlers)\n\t}\n\n\tr := rg.newRoute(methods, path)\n\tfor _, method := range mm {\n\t\tr.routes = append(r.routes, rg.add(method, path, handler... | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Gets the command line interface text of the class.
@param aClass the class
@param requiredType the class type
@return the command line interface text of the class | [
"public static String classToCLIString(Class<?> aClass, Class<?> requiredType) {\n String className = aClass.getName();\n String packageName = requiredType.getPackage().getName();\n if (className.startsWith(packageName)) {\n // cut off package name\n className = className.... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
NOTE: uncertain future | [
"long[] toLongArray() {\n\t\t// create array through an aligned copy\n\t\tBitVector copy = alignedCopy();\n\t\tlong[] longs = copy.bits;\n\t\tint length = longs.length;\n\t\tif (length == 0) return longs;\n\t\t// reverse the array\n\t\tfor (int i = 0, mid = length >> 1, j = length - 1; i < mid; i++, j--) {\n\t\t\tl... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Updates a job trigger.
See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
@param \Google\Cloud\Dlp\V2\UpdateJobTriggerRequest $argument input argument
@param array $metadata metadata
@param array $options call options | [
"public function UpdateJobTrigger(\\Google\\Cloud\\Dlp\\V2\\UpdateJobTriggerRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.privacy.dlp.v2.DlpService/UpdateJobTrigger',\n $argument,\n ['\\Google\\Cloud\\Dlp\\V2\\JobTrigger', 'decode'],\n ... | [
"public function GetDeidentifyTemplate(\\Google\\Cloud\\Dlp\\V2\\GetDeidentifyTemplateRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.privacy.dlp.v2.DlpService/GetDeidentifyTemplate',\n $argument,\n ['\\Google\\Cloud\\Dlp\\V2\\DeidentifyTemplat... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Metadata management:"
} |
Go through a Contribution and validate each table | [
"def validate_contribution(the_con):\n \n passing = True\n for dtype in list(the_con.tables.keys()):\n print(\"validating {}\".format(dtype))\n fail = validate_table(the_con, dtype)\n if fail:\n passing = False\n print('--')"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// CloseStream closes the associated stream | [
"func (c *Call) CloseStream() error {\n\tif !c.Stream {\n\t\treturn errors.New(\"rpc: cannot close non-stream request\")\n\t}\n\t<-c.sent\n\tc.client.sending.Lock()\n\tdefer c.client.sending.Unlock()\n\n\tc.client.mutex.Lock()\n\tif c.client.shutdown {\n\t\tc.client.mutex.Unlock()\n\t\treturn ErrShutdown\n\t}\n\tc.... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get the list of movies on an accounts watchlist.
@param sessionId sessionId
@param accountId accountId
@param page page
@param sortBy sortBy
@param language language
@return The watchlist of the user
@throws MovieDbException exception | [
"public ResultList<TVBasic> getWatchListTV(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException {\n return tmdbAccount.getWatchListTV(sessionId, accountId, page, sortBy, language);\n }"
] | [
"@Operation(name=\"$find-matches\", idempotent=true)\n public Parameters findMatchesAdvanced(\n @OperationParam(name=\"dateRange\") DateRangeParam theDate,\n @OperationParam(name=\"name\") List<StringParam> theName,\n @OperationParam(name=\"code\") TokenAndListParam theEnd) {\n \n Paramet... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Retrieves divident history | [
"def get_dividendhistory(self, symbol, startDate, endDate, items=None):\n \n startDate, endDate = self.__get_time_range(startDate, endDate)\n response = self.select('yahoo.finance.dividendhistory', items).where(['symbol', '=', symbol], ['startDate', '=', startDate], ['endDate', '=', endDate])\n... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initializes a CMS context for the authentication data contained in a call context.<p>
@param context the call context
@return the initialized CMS context | [
"protected CmsObject getCmsObject(CmsCmisCallContext context) {\r\n\r\n try {\r\n if (context.getUsername() == null) {\r\n // user name can be null\r\n CmsObject cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());\r\n cms.getRequestCo... | [
"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:"
} |
Convert an enumeration to a Set.
@param self an enumeration
@return a Set
@since 1.8.0 | [
"public static <T> Set<T> toSet(Enumeration<T> self) {\n Set<T> answer = new HashSet<T>();\n while (self.hasMoreElements()) {\n answer.add(self.nextElement());\n }\n return answer;\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
(For testing) Insert images to the ViSearch App with custom parameters.
@param imageList the list of Images to insert.
@param customParams custom parameters
@return an insert transaction | [
"@Override\n public InsertTrans insert(List<Image> imageList, Map<String, String> customParams) {\n return dataOperations.insert(imageList, customParams);\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
helper function to bump a statistic | [
"def _increment(self, what, host):\n ''' '''\n\n self.processed[host] = 1\n prev = (getattr(self, what)).get(host, 0)\n getattr(self, what)[host] = prev+1"
] | [
"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 Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Fetch the next row of a query result set, returning a single sequence, or ``None`` when
no more data is available. | [
"def fetchone(self):\n \n if self._state == self._STATE_NONE:\n raise Exception(\"No query yet\")\n if not self._data:\n return None\n else:\n self._rownumber += 1\n return self._data.pop(0)"
] | [
"public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ... | codesearchnet | {
"query": "Represent the description about Data retrieval:",
"pos": "Represent the code about Data retrieval:",
"neg": "Represent the code about Software Development:"
} |
// GetConnection returns single connection | [
"func (s *Server) GetConnection(connID string) Connection {\n\tconn, ok := s.getConnection(connID)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn conn\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets the Certificate RabbitMQ API client.
Returns:
CertificateRabbitMQ: | [
"def certificate_rabbitmq(self):\n \n if not self.__certificate_rabbitmq:\n self.__certificate_rabbitmq = CertificateRabbitMQ(self.__connection)\n return self.__certificate_rabbitmq"
] | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the data associated to the given object.
If the given object is not in the storage, or has no associated data, NULL is returned.
@param object $object The object.
@return mixed The stored data. | [
"public function get($object)\n {\n $hash = spl_object_hash($object);\n\n if (isset($this->data[$hash])) {\n return $this->data[$hash];\n }\n\n return null;\n }"
] | [
"function Entry (content, name, parent) {\n if (!(this instanceof Entry)) return new Entry(content, name, parent);\n\n this._parent = parent; // parent can be a Document or ArrayField\n this._schema = parent._schema; // the root Document\n this._name = name; // the field name supplied by the user\n this._hidde... | codesearchnet | {
"query": "Represent the Github comment about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
Short description of method validate
@access public
@author Bertrand Chevrier, <bertrand.chevrier@tudor.lu>
@param string schema
@return boolean | [
"public function validate($schema = '')\n {\n //You know sometimes you think you have enough time, but it is not always true ...\n //(timeout in hudson with the generis-hard test suite)\n helpers_TimeOutHelper::setTimeOutLimit(helpers_TimeOutHelper::MEDIUM);\n \n $content = $th... | [
"final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
// Unmarshal accepts a byte slice as input and writes the
// data to the value pointed to by v. | [
"func Unmarshal(bs []byte, v interface{}) error {\n\troot, err := parse(bs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn DecodeObject(v, root)\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about File management:"
} |
// LBInterfaceInit initialises the load balancing interface for a Seesaw Node. | [
"func (ncc *SeesawNCC) LBInterfaceInit(iface *ncctypes.LBInterface, out *int) error {\n\tnetIface, err := iface.Interface()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to get network interface: %v\", err)\n\t}\n\tnodeIface, err := net.InterfaceByName(iface.NodeInterface)\n\tif err != nil {\n\t\treturn fmt.Er... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Добавить Миграцию в базу
@param Migration $migration | [
"public function insert(Migration $migration)\n {\n $sql = sprintf(\"INSERT INTO {$this->tableName} (name, data) VALUES ('%s', '%s')\",\n $this->adapter->escape($migration->getName()),\n $this->adapter->escape($migration->getSql())\n );\n $this->getAdapter()->execute($s... | [
"final protected function v($name = null) {return dfak($this, function() {\n\t\t$result = dfa($this->_data, 'value', []);\n\t\t/**\n\t\t * 2016-06-29\n\t\t * Что интересно, при смене области действия настроек с глобальной на другую (сайт или магазин)\n\t\t * поле «value» может почему-то содержать не массив,\n\t\t *... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Parse parses the given string into the correct sentence type. | [
"func Parse(raw string) (Sentence, error) {\n\ts, err := parseSentence(raw)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif strings.HasPrefix(s.Raw, SentenceStart) {\n\t\tswitch s.Type {\n\t\tcase TypeRMC:\n\t\t\treturn newRMC(s)\n\t\tcase TypeGGA:\n\t\t\treturn newGGA(s)\n\t\tcase TypeGSA:\n\t\t\treturn newGSA(... | [
"@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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Retrieve a collection of File objects representing the files stored inside a bucket.
@param array $options
@throws \Exception
@throws GuzzleException
@return array | [
"public function listFiles(array $options)\n {\n // if FileName is set, we only attempt to retrieve information about that single file.\n $fileName = !empty($options['FileName']) ? $options['FileName'] : null;\n\n $nextFileName = null;\n $maxFileCount = 1000;\n\n $prefix = isse... | [
"public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n... | codesearchnet | {
"query": "Represent the description about AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code about PHP:"
} |
Configures the #CDATA of an element.
@param Project $project the project this element belongs to
@param object the element to configure
@param string $text the element's #CDATA | [
"public static function addText($project, $target, $text = null)\n {\n if ($text === null || strlen(trim($text)) === 0) {\n return;\n }\n $ih = IntrospectionHelper::getHelper(get_class($target));\n $text = $project->replaceProperties($text);\n $ih->addText($project, ... | [
"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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
read_full reads exactly `size` bytes from reader. returns
`size` bytes.
:param data: Input stream to read from.
:param size: Number of bytes to read from `data`.
:return: Returns :bytes:`part_data` | [
"def read_full(data, size):\n \n default_read_size = 32768 # 32KiB per read operation.\n chunk = io.BytesIO()\n chunk_size = 0\n\n while chunk_size < size:\n read_size = default_read_size\n if (size - chunk_size) < default_read_size:\n read_size = size - chunk_size\n c... | [
"async def send(self, request):\n \n body = bytes(request)\n msg_id = self._state._get_new_msg_id()\n await self._connection.send(\n struct.pack('<qqi', 0, msg_id, len(body)) + body\n )\n\n body = await self._connection.recv()\n if len(body) < 8:\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
Make sure a clause is valid and does not contain SQL injection attempts.
@param string $clause The string clause to validate.
@return bool True if the clause is valid. | [
"public static function isValidClause($clause) {\n $output = rtrim($clause, ' ;');\n $output = preg_replace(\"/\\\\\\\\'.*?\\\\\\\\'/\", '{mask}', $output);\n $output = preg_replace('/\\\\\".*?\\\\\"/', '{mask}', $output);\n $output = preg_replace(\"/'.*?'/\", '{mask}', $output);\n ... | [
"public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Returns the float value for the specified name. If the name does not
exist or the value for the name can not be interpreted as a float, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue | [
"public float getFloat(String name, float defaultValue) {\n try {\n String value = getString(name, null);\n if (!StringUtils.isNullOrEmpty(value)) {\n return Float.parseFloat(value.trim());\n }\n } catch (NumberFormatException e) {\n log.warn(... | [
"def _infer_embedded_object(value):\n \n\n if value is None:\n # The default behavior is to assume that a value of None is not\n # an embedded object. If the user wants that, they must specify\n # the embedded_object parameter.\n return False\n\n if isinstance(value, list):\n ... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the panel group starting element.
@return ContentModel|null | [
"protected function getPanelGroup(): ?ContentModel\n {\n $group = ContentModel::findOneBy(\n [\n 'tl_content.ptable=?',\n 'tl_content.pid=?',\n '(tl_content.type = ? OR tl_content.type = ?)',\n 'tl_content.sorting < ?',\n ],... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Run a command [cmd, arg1, arg2, ...].
Returns the output (stdout + stderr).
Raises CommandFailed in cases of error. | [
"def run(command, encoding=None, decode=True, cwd=None):\n \n if not encoding:\n encoding = locale.getpreferredencoding()\n try:\n with open(os.devnull, 'rb') as devnull:\n pipe = subprocess.Popen(command, stdin=devnull,\n stdout=subprocess.PIPE,\... | [
"def exit_cleanly(error_number=0):\n \n default = \"An Unknown error has occurred!\"\n descriptions = \\\n {22: 'An improper input error has occurred. Please see above stmt(s)',\n 29: 'An operation failed. Please see above stmt(s)',\n 5: 'An IO Error has occurred. Pelase see above... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Handles received version data.
:param data: Version string to parse
:type data: string | [
"def _handle_version(self, data):\n \n\n _, version_string = data.split(':')\n version_parts = version_string.split(',')\n\n self.serial_number = version_parts[0]\n self.version_number = version_parts[1]\n self.version_flags = version_parts[2]"
] | [
"def start_index(self, value):\n \"\"\"\"\"\"\n # TODO: Validate contents? (May want to set before adding the data.)\n if not isinstance(value, dict):\n raise TypeError('start_index attribute must be a dict.')\n self._start_index = value"
] | codesearchnet | {
"query": "Represent the Github instruction about Transaction Management:",
"pos": "Represent the Github code about Transaction Management:",
"neg": "Represent the Github code:"
} |
/*
Render pagination buttons
@param $items
@param int $page
@param int $perPage
@param $path
@param array $componentOptions | [
"public function pagination($items, $page = 1, $perPage = 25, $path = '', array $componentOptions = [])\n {\n $items = $items instanceof Collection ? $items : Collection::make($items);\n\n $paginator = (new LengthAwarePaginator($items, $items->count(), (int) $perPage, (int) $page))\n ->w... | [
"protected function update_init_params(array &$params, context $context,\n array $options = null) {\n\n $rowsnumber = $this->count_button_rows($params);\n if ($rowsnumber > 1) {\n $this->add_button_before($params, 1, 'pdw_toggle', '');\n $params['pdw_toggle_on'] = 1;\n... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Returns the canonical instance of the {@link WorkQueue} to be used in
running concurrent tasks, ensuring the <i>at least</i> the specified
number of threads are available. | [
"public static WorkQueue getWorkQueue(int numThreads) {\n if (singleton == null) {\n synchronized (WorkQueue.class) {\n if (singleton == null)\n singleton = new WorkQueue(numThreads); \n }\n }\n\n while (singleton.availableThreads() < numT... | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
find a ModuleItem | [
"public static ModuleItem findModuleItem(String[] path) {\n if (disabled)\n return null;\n if (path == null || path[0].equals(APPSERVER_MODULE)) {\n return moduleRoot;\n }\n return moduleRoot.find(path, 0);\n }"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initialize library, must be called once before other functions are
called. | [
"def begin(self):\n \n\n resp = ws.ws2811_init(self._leds)\n if resp != 0:\n str_resp = ws.ws2811_get_return_t_str(resp)\n raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, str_resp))"
] | [
"protected WsMessageRouterImpl getMessageRouter() {\n if (msgRouter == null) {\n // First activation.\n msgRouter = MessageRouterSingleton.singleton;\n\n // Pass the MessageRouter to the TrService via the TrConfigurator.\n TrConfigurator.setMessageRouter(msgRouter)... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the info for a Template | [
"def get_template_info(self, obj):\n \n client = self.get_client()\n client_uid = api.get_uid(client) if client else \"\"\n\n profile = obj.getAnalysisProfile()\n profile_uid = api.get_uid(profile) if profile else \"\"\n profile_title = profile.Title() if profile else \"\"\... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Retrieve the given property, if it does indeed exist | [
"public function getProperty(PHPStanClassReflection $reflection, string $property) : PHPStanPropertyReflection\n\t{\n\t\t$native = $reflection->getNativeReflection();\n\t\t\n\t\tif($native->hasMethod(\"getter_\".$property))\n\t\t\treturn $this->getUnderscoreGetter($reflection, $property);\n\t\t\n\t\treturn null;\n\... | [
"function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Convert a generator into a function that prints all yielded elements
>>> @print_yielded
... def x():
... yield 3; yield None
>>> x()
3
None | [
"def print_yielded(func):\n\t\n\tprint_all = functools.partial(map, print)\n\tprint_results = compose(more_itertools.recipes.consume, print_all, func)\n\treturn functools.wraps(func)(print_results)"
] | [
"def loop(self, value):\n\t\t\n\t\tif not type(value) == bool:\n\t\t\traise TypeError(\"can only be True or False\")\n\t\tself._loop = value"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set yaxis limits
Parameters
----------
low : number
high : number
index : int, optional
Returns
-------
Chart | [
"def ylim(self, low, high):\n \n self.chart['yAxis'][0]['min'] = low\n self.chart['yAxis'][0]['max'] = high\n return self"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetOutputs sets the Outputs field's value. | [
"func (s *AutomationExecution) SetOutputs(v map[string][]*string) *AutomationExecution {\n\ts.Outputs = v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Remove read file descriptor from the event loop. | [
"def remove_reader(self, fd):\n \" \"\n fd = fd_to_int(fd)\n\n if fd in self._read_fds:\n del self._read_fds[fd]\n\n self.selector.unregister(fd)"
] | [
"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:"
} |
Lazy-load the primary keys. | [
"def pks(self):\n \"\"\"\"\"\"\n if self._primary_keys is None:\n self._primary_keys = list(\n self.queryset.values_list('pk', flat=True))\n return self._primary_keys"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Implements a deep neural network for classification.
params is a list of (weights, bias) tuples.
inputs is an (N x D) matrix.
returns normalized class log-probabilities. | [
"def neural_net_predict(params, inputs):\n \"\"\"\"\"\"\n for W, b in params:\n outputs = np.dot(inputs, W) + b\n inputs = np.tanh(outputs)\n return outputs - logsumexp(outputs, axis=1, keepdims=True)"
] | [
"def _default_hparams():\n \"\"\"\"\"\"\n return hparam.HParams(\n # Use this parameter to get comparable perplexity numbers with different\n # tokenizations. This value should be set to the ratio of the number of\n # tokens in the test set according to the tokenization used to the number\n #... | codesearchnet | {
"query": "Represent the Github text about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
// GetKey returns key in section by given name. | [
"func (s *Section) GetKey(name string) (*Key, error) {\n\tif s.f.BlockMode {\n\t\ts.f.lock.RLock()\n\t}\n\tif s.f.options.Insensitive {\n\t\tname = strings.ToLower(name)\n\t}\n\tkey := s.keys[name]\n\tif s.f.BlockMode {\n\t\ts.f.lock.RUnlock()\n\t}\n\n\tif key == nil {\n\t\t// Check if it is a child-section.\n\t\ts... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
X.509 certificate signing helper function.
@param object $key
@param \phpseclib\File\X509 $subject
@param string $signatureAlgorithm
@access public
@return mixed | [
"function _sign($key, $signatureAlgorithm)\n {\n if ($key instanceof RSA) {\n switch ($signatureAlgorithm) {\n case 'md2WithRSAEncryption':\n case 'md5WithRSAEncryption':\n case 'sha1WithRSAEncryption':\n case 'sha224WithRSAEncryption'... | [
"public static function fromEncryptedKeyElement(DOMElement $element)\n {\n $objenc = new XMLSecEnc();\n $objenc->setNode($element);\n if (!$objKey = $objenc->locateKey()) {\n throw new Exception(\"Unable to locate algorithm for this Encrypted Key\");\n }\n $objKey->i... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.