query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Returns a Logger with the specified name. @param fqcn The fully qualified class name of the class that this method is a member of. @param name The logger name. @return The Logger.
[ "protected static Logger getLogger(final String fqcn, final String name) {\n return factory.getContext(fqcn, null, null, false).getLogger(name);\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Create a relative repository path for the given artifact coordinates. @param separator the separator character to use (typically {@code '/'} or {@link File#separatorChar}) @return the path string
[ "public String relativeArtifactPath(char separator) {\n String artifactId1 = getArtifactId();\n String version1 = getVersion();\n StringBuilder builder = new StringBuilder(getGroupId().replace('.', separator));\n builder.append(separator).append(artifactId1).append(separator);\n S...
[ "public static String pathEncode(String path, Charset charset) {\n return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);\n\n /*\n * path encoding is not equivalent to query encoding, there are few differences, namely dealing\n * with spaces, !, ', (, ), and ~ characters. we will need to man...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Displays a single Assignment model. @param int $id @return mixed
[ "public function actionView(int $id)\n {\n $model = $this->findModel($id);\n\n return $this->render('view', [\n 'model' => $model,\n 'usernameField' => $this->usernameField,\n ]);\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Processes this time zone entry widget If any validation type errors occur, an error message is attached to this entry widget.
[ "public function process()\n {\n parent::process();\n\n $areas_flydown = $this->getCompositeWidget('areas_flydown');\n $regions_flydown = $this->getCompositeWidget('regions_flydown');\n\n if ($areas_flydown->value === 'UTC') {\n $this->value = 'UTC';\n } elseif (\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// BroadcastPacket sends a packet to all online players.
[ "func (l Players) BroadcastPacket(pkt packet.Packet) {\n\tl.RLock()\n\tfor _, p := range l.list {\n\t\tif p.Ready {\n\t\t\tpkt.WriteTo(p.Conn)\n\t\t}\n\t}\n\tl.RUnlock()\n}" ]
[ "function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a producer that writes String keys and values @param overrideConfig Producer config to override @return KafkaProducer
[ "public KafkaProducer<String, String> createStringProducer(Properties overrideConfig) {\n return createProducer(new StringSerializer(), new StringSerializer(), overrideConfig);\n }" ]
[ "public void submitContextString(final String evaluatorConfigurationString,\n final String contextConfigurationString) {\n if (evaluatorConfigurationString.isEmpty()) {\n throw new RuntimeException(\"empty evaluatorConfigurationString provided.\");\n }\n if (contextCon...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
将用户信息 array 转换成 Base User @param array $user @return \asbamboo\security\user\BaseUser
[ "private function convertUser(array $user) : UserInterface\n {\n $baseUser = new BaseUser();\n $baseUser->setLoginName($user['login_name']);\n $baseUser->setLoginPassword($user['login_password']);\n $baseUser->setRoles($user['roles']);\n return $baseUser;\n }" ]
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// NewSQL creates a new database checker that can be used for ".AddCheck(s)".
[ "func NewSQL(cfg *SQLConfig) (*SQL, error) {\n\tif err := validateSQLConfig(cfg); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &SQL{\n\t\tConfig: cfg,\n\t}, nil\n}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* Batch Upload ------------ Author: Alex Boyce (curiosity26@gmail.com)
[ "function () {\n if (arguments.length === 0) {\n return;\n }\n\n var ret = Object.create({});\n\n for (var i = 0; i < arguments.length; i++) {\n for (var n in arguments[i]) {\n ret[n] = arguments[i][n];\n }\n }\n\n return ret;\n}" ]
[ "def helpAbout(self):\n \n\n # Text to be displayed\n about_text = translate('pyBarPlugin',\n \"\"\"<qt>\n <p>Data plotting plug-in for pyBAR.\n </qt>\"\"\",\n 'About')\n\n descr = dict(module_name='pyBarPl...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get all customer contacts not imported for a website. @param int $websiteId @param int $pageSize @return $this
[ "public function getContactsToImportForWebsite($websiteId, $pageSize = 100)\n {\n $collection = $this->addFieldToFilter('website_id', $websiteId)\n ->addFieldToFilter('email_imported', ['null' => true])\n ->addFieldToFilter('customer_id', ['neq' => '0']);\n\n $collection->getS...
[ "protected function setGeneratorCategorymembers()\n {\n $this->logger->debug('Base:setGeneratorCategorymembers');\n $this->setParam('generator', 'categorymembers');\n $this->setParam('gcmprop', 'ids|title|type|timestamp');\n $this->setParam('gcmlimit', $this->getLimit());\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Format field as real number with 2 digit precision. @param string $field
[ "public function format_float($field)\n {\n $precision = 2;\n $m = (float) $this->current_row[$field];\n $this->current_row[$field] =\n is_null($this->current_row[$field])\n ? '-'\n : number_format($m, $precision);\n $this->setTDParam($field, '...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// // Utility //
[ "func comment(comment string) string {\n\tcommentLines := make([]string, 0, 5)\n\tfor _, line := range strings.Split(comment, \"\\n\") {\n\t\ttrimLine := strings.TrimLeft(line, \" \\t\\n\")\n\t\tif trimLine != \"\" {\n\t\t\tcommentLines = append(commentLines, trimLine)\n\t\t}\n\t}\n\treturn strings.Join(commentLine...
[ "@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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// AddStructType adds a new structure type to debug_info. Call TagClose to // finish adding fields. // Will write a DW_TAG_struct_type, followed by a DW_AT_byte_size.
[ "func (b *Builder) AddStructType(typename string, byteSz uint16) dwarf.Offset {\n\tr := b.TagOpen(dwarf.TagStructType, typename)\n\tb.Attr(dwarf.AttrByteSize, byteSz)\n\treturn r\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
We want to raise the exception only at ready time
[ "private static InputStream getInputStreamFromFilename(String filename) {\n try {\n return new FileInputStream(filename);\n } catch (FileNotFoundException e) {\n log.debug(\"Error initializing RdfStreamReader, file '{}' not found\", filename);\n // do not handle except...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Supprime une valeur du cache @param String $key Clé à supprimer
[ "public function deleteFromCache($key)\r\n {\r\n $file = $this->cachePath . $this->getEncodedKey($key);\r\n if (file_exists($file)) {\r\n unlink($file);\r\n }\r\n }" ]
[ "void writeToFile() throws IOException {\r\n\t\t// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès\r\n\t\tfinal Counter counter = this.clone();\r\n\t\t// on n'écrit pas rootCurrentContextsByThreadId en fichier\r\n\t\t// puisque ces données ne seront plus vraies dans...
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
This must boot the system If an error occurred, a message is written "as is" on screen and the run stops here. @return void @see \WebDocBook\Kernel::boot()
[ "protected function boot()\n {\n try {\n Kernel::boot();\n// Kernel::debug();\n\n // the actual manifest\n if (true===file_exists(Kernel::getPath('app_manifest_filepath'))) {\n $manifest_data = FilesystemHelper::parseJson(Kernel::getPath('app_mani...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github text about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about programming:" }
// Respond replies to the request with the given response.
[ "func (r *CreateRequest) Respond(resp *CreateResponse) {\n\tout := &createOut{\n\t\toutHeader: outHeader{Unique: uint64(r.ID)},\n\n\t\tNodeid: uint64(resp.Node),\n\t\tGeneration: resp.Generation,\n\t\tEntryValid: uint64(resp.EntryValid / time.Second),\n\t\tEntryValidNsec: uint32(resp.EntryValid % ti...
[ "@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:" }
// CombineErrors returns an error which combined all stored errors. Return nil // if not erros stored.
[ "func (d *Drain) CombineErrors() error {\n\tif d == nil || len(d.errors) == 0 {\n\t\treturn nil\n\t}\n\treturn drainError(d.errors)\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:" }
Put the given line into the callback machinery, and set the result on a None line.
[ "def _feed_line(self, line):\n \"\"\"\"\"\"\n if line is None:\n self.set_result(self._callback(self.__spooled_lines))\n else:\n self.__spooled_lines.append(line)" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence about Software Engineering:", "pos": "Represent the code about Software Engineering:", "neg": "Represent the code about programming:" }
%prog filter *.consensus.fasta Filter consensus sequence with min cluster size.
[ "def filter(args):\n \n from jcvi.formats.fasta import Fasta, SeqIO\n\n p = OptionParser(filter.__doc__)\n p.add_option(\"--minsize\", default=2, type=\"int\",\n help=\"Minimum cluster size\")\n p.set_outfile()\n opts, args = p.parse_args(args)\n\n if len(args) < 1:\n sys...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns an *Auth instance suitable for the requests package
[ "def get_auth_instance(credentials, auth_type):\n \n model = AUTH_TYPE_MAP[auth_type]\n if model is None:\n return None\n username = credentials.username\n if auth_type == NTLM and credentials.type == credentials.EMAIL:\n username = '\\\\' + username\n if auth_type == GSSAPI:\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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// callOnConnectHandlers runs the registered connect handlers.
[ "func (c *Client) callOnConnectHandlers() {\n\tc.m.RLock()\n\tdefer c.m.RUnlock()\n\n\tfor _, handler := range c.onConnectHandlers {\n\t\tfunc() {\n\t\t\tdefer nopRecover()\n\t\t\thandler()\n\t\t}()\n\t}\n}" ]
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
so we can avoid leakage on deleting panel For attribute error display
[ "function renderHelpText(text) {\n if (text) {\n if (!helpTextDiv) {\n helpTextDiv = document.createElement(\"div\");\n helpTextDiv.className = 'col-sm-9 col-sm-offset-3 has-error';\n formGroup.appendChild(helpTextDiv);\n }\n helpTextDiv.innerHTML = '<span style=...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewPaperDevice creates a new paper backup key device
[ "func NewPaperDevice(passphrasePrefix string) (*Device, error) {\n\tdid, err := NewDeviceID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts := DeviceStatusActive\n\tdesc := passphrasePrefix\n\n\td := &Device{\n\t\tID: did,\n\t\tType: DeviceTypePaper,\n\t\tStatus: &s,\n\t\tDescription: &desc...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
list.map( doSomething);
[ "function getImageData(array, callback)\n {\n \"use strict\"; \n array.map( doSomething); \n // this is not fully satisfying - I collect the promises and then do the writeFile via timeout\n setTimeout(function(){\n \"use strict\"; \n Q.all(promises)\n .then(function (fi...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Run @access public
[ "public function run() {\n\t\t// initializing\n\t\t$this->max_processes = Config::$max_processes;\n\n\t\t// unlocking all transactions in case the process did not stop properly\n\t\tTransaction::unlock_all();\n\n\t\t// initializing the processes array to free slots\n\t\tfor ($i = 0; $i <= $this->max_processes; $i++...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Print short description of the object.
[ "def head(self):\n \"\"\"\"\"\"\n summary = list()\n summary.append(\"%s %s\" % (self.geotype, self.name) + \"\\n\")\n summary.append(\" - Metadata:\" + \"\\n\")\n summary.append(\n \"\\n\".join(self._get_metadata_as_string().split(\"\\n\")[:5]) + \"\\n\")\n summ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns file with full backup. In case of RDBMS backup it may be a directory. @param restoreDir @return
[ "public static File getFullBackupFile(File restoreDir)\r\n {\r\n Pattern p = Pattern.compile(\".+\\\\.0\");\r\n\r\n for (File f : PrivilegedFileHelper.listFiles(restoreDir, new FileFilter()\r\n {\r\n public boolean accept(File pathname)\r\n {\r\n Pattern p = Pattern.compi...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Registers a widget area @param string $name The display name @param string $location The area location @param string $id The unique identifier
[ "public function registerWidget($name, $location, $id)\n {\n $tab = ' ';\n $indent = str_repeat($tab, 5);\n\n register_sidebar([\n 'name' => $name,\n 'id' => sprintf('%s-%s', $location, $id),\n 'class' => sprintf('%s-%s', $locat...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
The UTF-8 encoding uses sequences of 1, 2, or 3 bytes per character. With he maximal length of the fragment we want to ensure, that there are no overflow of 65536 byte sized buffer @param str String to be written in the output stream @throws IOException
[ "public void writeFragmentedUTF(String str) throws IOException {\n\t\tif (str.length() <= MAX_LENGTH) {\n\t\t\twriteLastUTFFragment(str);\n\t\t} else {\n\t\t\twriteUTFFragment(str.substring(0, MAX_LENGTH));\n\t\t\twriteFragmentedUTF(str.substring(MAX_LENGTH));\n\t\t}\n\t}" ]
[ "def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// Packages makes the client package definition.
[ "func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages {\n\tboilerplate, err := arguments.LoadGoBoilerplate()\n\tif err != nil {\n\t\tklog.Fatalf(\"Failed loading boilerplate: %v\", err)\n\t}\n\n\tcustomArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs)\n\tif !ok {\...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Logistics:", "pos": "Represent the Github code about Logistics:", "neg": "Represent the Github code:" }
// SetFieldNames sets the FieldNames field's value.
[ "func (s *BuildSuggestersOutput) SetFieldNames(v []*string) *BuildSuggestersOutput {\n\ts.FieldNames = v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Visit the given $block placeholders into hash representation.
[ "private function visitPlaceholders(Block $block, VisitorInterface $subVisitor): Generator\n {\n foreach ($block->getPlaceholders() as $placeholder) {\n yield $placeholder->getIdentifier() => $subVisitor->visit($placeholder);\n }\n }" ]
[ "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 Blockchain:", "pos": "Represent the code about Blockchain:", "neg": "Represent the code:" }
Sets the result value of the action. @param actionId the new action id @param resultValue the new result value of the action
[ "public void setResultValue(String actionId, Object resultValue) {\n if (actionId == null || !actionId.contains(ActivityContext.ID_SEPARATOR)) {\n this.actionId = actionId;\n this.resultValue = resultValue;\n } else {\n String[] ids = StringUtils.tokenize(actionId, Act...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Int returns a random, non-negative int.
[ "func (m *MT19937) Int() int {\n\tu := uint(m.Int32())\n\treturn int(u << 1 >> 1)\n}" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Natural Language Processing:" }
// SetDownloadServiceToken mocks base method
[ "func (m *MockRCHTTPClienter) SetDownloadServiceToken(arg0 string) {\n\tm.ctrl.Call(m, \"SetDownloadServiceToken\", arg0)\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Puts the content of all given node blocks into the first one, essentially merging them.
[ "function mergeBlocks(blocks) {\n let finalBlock;\n for (const block of blocks) {\n if (!finalBlock) finalBlock = block;\n else {\n block.nodes.forEach(node => finalBlock.push(node));\n }\n }\n return finalBlock;\n}" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// UpdateAuthorization is the handler for PUT /users/{username}/authorizations/{grantedTo} // Modify which information an organization is able to see.
[ "func (api UsersAPI) UpdateAuthorization(w http.ResponseWriter, r *http.Request) {\n\tusername := mux.Vars(r)[\"username\"]\n\tgrantedTo := mux.Vars(r)[\"grantedTo\"]\n\n\tauthorization := &user.Authorization{}\n\n\tif err := json.NewDecoder(r.Body).Decode(authorization); err != nil {\n\t\thttp.Error(w, http.Status...
[ "func (r *MintOAuthTokenGrantRPC) validateRequest(c context.Context, req *minter.MintOAuthTokenGrantRequest, caller identity.Identity) (*Rule, error) {\n\t// Dump the whole request and relevant auth state to the debug log.\n\tr.logRequest(c, req, caller)\n\n\t// Reject obviously bad requests.\n\tif err := r.checkRe...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Access control:" }
// Release is called when a file handle is no longer needed. This is // called asynchronously after the last handle to a file is closed.
[ "func (h *mutFileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) error {\n\th.tmp.Close()\n\tos.Remove(h.tmp.Name())\n\th.tmp = nil\n\n\treturn nil\n}" ]
[ "def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Writes the given function input definition.
[ "protected void writeFunction( FunctionInputDef function)\n {\n xmlWriter_\n .element( FUNCTION_TAG)\n .attribute( NAME_ATR, function.getName())\n .content( () ->\n {\n writeAnnotations( function);\n for( String varType : function.getVarTypes())\n {\n writ...
[ "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 comment about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code about programming:" }
getDirectives @return callable[]
[ "public function getDirectives()\n {\n return [\n 'lang' => [$this, 'translate'],\n 'translate' => [$this, 'translate'],\n 'sprintf' => [$this, 'sprintf'],\n 'plural' => [$this, 'plural'],\n 'choice' => [$this, 'plural'],\n 'messages' => [$...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Run starts the http(s) server for the cli
[ "func Run() {\n\tmux := NewServeMux(viper.GetString(\"static\"))\n\terr := ServeMux(\n\t\tmux,\n\t\tviper.GetString(\"addr\"),\n\t\tviper.GetString(\"port\"),\n\t\tviper.GetString(\"cert\"),\n\t\tviper.GetString(\"key\"),\n\t)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Set a provider. @param mixed $name The name. @param ThemeProviderInterface $provider The provider. @return ManagerInterface Returns this manager. @throws ReflectionException Throws a reflection exception if an error occurs.
[ "protected function setProvider($name, ThemeProviderInterface $provider) {\n $k = ObjectHelper::getShortName($name);\n $v = $this->getIndex()[$k];\n if (null !== $v) {\n $this->getProviders()[$v] = $provider;\n return $this;\n }\n $this->index[$k] = count($th...
[ "protected function findMetadata($class)\n {\n $metadata = null;\n\n try {\n // We could not use the hasMetadataFor() method as it is not working if the entity is not loaded. But\n // the getMetadataFor() method could throw an exception if the class is not found\n $...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
Sets messages @param $translations array<string, string> To set many messages in one time. The array is key message.
[ "public function setMessages(array $translations) {\n\t\tforeach ($translations as $key => $message) {\n\t\t\tif($message) {\n\t\t\t\t$this->msg[$key] = $message;\n\t\t\t}\n\t\t}\n\t}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// Delete removes an item by ID
[ "func (db *memDB) Delete(c *Container) error {\n\treturn db.withTxn(func(txn *memdb.Txn) error {\n\t\tview := &memdbView{txn: txn}\n\t\tnames := view.getNames(c.ID)\n\n\t\tfor _, name := range names {\n\t\t\ttxn.Delete(memdbNamesTable, nameAssociation{name: name})\n\t\t}\n\n\t\t// Ignore error - the container may 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:" }
Connection to the server
[ "def server(self):\n \n if self._server is None:\n self._server = bugzilla.Bugzilla(url=self.parent.url)\n return self._server" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Stops all the clients (agents and DM). <p> Mostly for tests. </p>
[ "void stopAll() {\n\n\t\ttry {\n\t\t\tthis.dmClient.closeConnection();\n\t\t\tstop();\n\n\t\t} catch( Throwable t ) {\n\t\t\tthis.logger.warning( \"An error occurred while closing the connection of the DM client.\" );\n\t\t\tUtils.logException( this.logger, new RuntimeException( t ));\n\t\t}\n\t}" ]
[ "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 Github sentence about command or instruction:", "pos": "Represent the Github code about command or instruction:", "neg": "Represent the Github code about Software Development:" }
Repositions the low-level layer to read from the specified index. @param reqIndex Index to position the file pointer to.
[ "protected synchronized void navigateToIndex(int reqIndex)\n\t\t\tthrows IOException {\n\t\t// determine if navigation is necessary\n\t\tif (reqIndex != index) {\n\t\t\t// ensure that the requested index is valid\n\t\t\tif (reqIndex < 0 || reqIndex >= size) {\n\t\t\t\tthrow new IndexOutOfBoundsException();\n\t\t\t}...
[ "public List<Pair<UIEvent, Table>> readEvents() throws IOException {\n //TODO eventually we'll support working out the offset for files that were not written in this session\n Preconditions.checkState(endStaticInfoOffset >= 0, \"Cannot read events - have not written end of static info marker\");\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
// Creates a disk on the specified project.
[ "func (api *ProjectsAPI) CreateDisk(projectID string, spec *DiskCreateSpec) (task *Task, err error) {\n\tbody, err := json.Marshal(spec)\n\tif err != nil {\n\t\treturn\n\t}\n\tres, err := api.client.restClient.Post(\n\t\tapi.client.Endpoint+projectUrl+projectID+\"/disks\",\n\t\t\"application/json\",\n\t\tbytes.NewR...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// WithPayload adds the payload to the patch endpoint Id invalid response
[ "func (o *PatchEndpointIDInvalid) WithPayload(payload models.Error) *PatchEndpointIDInvalid {\n\to.Payload = payload\n\treturn o\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Get R.A. corresponding to the current position (ICRS, J2000) :return: Right Ascension
[ "def get_ra(self):\n \n\n try:\n\n return self.ra.value\n\n except AttributeError:\n\n # Transform from L,B to R.A., Dec\n\n return self.sky_coord.transform_to('icrs').ra.value" ]
[ "def ecliptic_velocity(self):\n \"\"\"\"\"\"\n vector = _ECLIPJ2000.dot(self.velocity.au_per_d)\n return Velocity(vector)" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set type, text and actions on popup @param params @returns {boolean}
[ "function setParameters(params) {\n // Use default `inputValidator` for supported input types if not provided\n if (!params.inputValidator) {\n Object.keys(defaultInputValidators).forEach(function (key) {\n if (params.input === key) {\n params.inputValidator = params.expectRejections ? defaultInput...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Localization:", "pos": "Represent the Github code about Localization:", "neg": "Represent the Github code:" }
Resolves post_category arg into an array of category ids. @param string $arg Supplied argument. @return array
[ "private function get_category_ids( $arg ) {\n\n\t\t$categories = explode( ',', $arg );\n\t\t$category_ids = [];\n\t\tforeach ( $categories as $post_category ) {\n\t\t\tif ( trim( $post_category ) ) {\n\t\t\t\tif ( is_numeric( $post_category ) && (int) $post_category ) {\n\t\t\t\t\t$category_id = category_exists(...
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
Save an Entity in the cache. @param EntityDocument $entity
[ "public function save( EntityDocument $entity ) {\n\t\tif( !$this->cache->save(\n\t\t\t$this->getCacheIdFromEntityId( $entity->getId() ),\n\t\t\t$entity,\n\t\t\t$this->lifeTime\n\t\t) ) {\n\t\t\tthrow new RuntimeException( 'The cache failed to save for entity ' . $entity->getId()->getSerialization() );\n\t\t}\n\t}"...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// DeleteKeys deletes the authorised ssh keys for the specified user.
[ "func (api *KeyManagerAPI) DeleteKeys(arg params.ModifyUserSSHKeys) (params.ErrorResults, error) {\n\tif err := api.check.ChangeAllowed(); err != nil {\n\t\treturn params.ErrorResults{}, errors.Trace(err)\n\t}\n\tresult := params.ErrorResults{\n\t\tResults: make([]params.ErrorResult, len(arg.Keys)),\n\t}\n\tif len(...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Mass action: kill @return void
[ "public function killAction()\n {\n $ids = $this->getRequest()->getParam('schedule_ids');\n foreach ($ids as $id) {\n $schedule = Mage::getModel('cron/schedule'); /* @var $schedule Aoe_Scheduler_Model_Schedule */\n $schedule->load($id)->requestKill();\n }\n $mess...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about Database management:", "pos": "Represent the code about Database management:", "neg": "Represent the code:" }
Parse header record (100)
[ "def parse_100_row(row: list, file_name: str) -> HeaderRecord:\n \n return HeaderRecord(\n row[1],\n parse_datetime(row[2]),\n row[3],\n row[4],\n file_name,\n )" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetFilterBy 指定キーでのフィルター
[ "func (api *NoteAPI) SetFilterBy(key string, value interface{}) {\n\tapi.filterBy(key, value, false)\n}" ]
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S...
codesearchnet
{ "query": "Represent the comment about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code about Software development:" }
If there is a JPX box then the compatibility list must also contain 'jpx '.
[ "def _validate_jpx_compatibility(self, boxes, compatibility_list):\n \n JPX_IDS = ['asoc', 'nlst']\n jpx_cl = set(compatibility_list)\n for box in boxes:\n if box.box_id in JPX_IDS:\n if len(set(['jpx ', 'jpxb']).intersection(jpx_cl)) == 0:\n ...
[ "def end(self):\n \n\n # Note: Vend is just a macro; use 'Vfinish' instead\n # Note also the the same C function is used to end\n # the VS interface\n _checkErr('vend', _C.Vfinish(self._hdf_inst._id),\n \"cannot terminate V interface\")\n self._hdf_inst = N...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Creates a METADATA.json file from a data directory The file is written to output_path
[ "def create_metadata_file(output_path, data_dir):\n '''\n '''\n\n # Relative path to all (BASIS).metadata.json files\n meta_filelist, table_filelist, _, _ = get_all_filelist(data_dir)\n\n metadata = {}\n for meta_file_relpath in meta_filelist:\n\n # Read in the metadata for a single basis s...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Overrides update to concatenate streamed data up to defined length.
[ "def update(self, **kwargs):\n \n data = kwargs.get('data')\n if data is not None:\n if (util.pd and isinstance(data, util.pd.DataFrame) and\n list(data.columns) != list(self.data.columns) and self._index):\n data = data.reset_index()\n self.v...
[ "@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:" }
Conversão de hora para o formato que definir (Hora, Minuto, Segundo) @param time $time @param string $conversion @param boolean $debub @return double
[ "public static function convertTime($time, $conversion, $debub = false) {\n list ($hora, $minuto, $segundo) = explode(\":\", $time);\n switch (strtolower($conversion)) {\n case 'h':\n $resultH = $hora * 1;\n $resultM = $minuto / 60;\n $resultS = ...
[ "def bloquear_sat(retorno):\n \n resposta = analisar_retorno(forcar_unicode(retorno),\n funcao='BloquearSAT')\n if resposta.EEEEE not in ('16000',):\n raise ExcecaoRespostaSAT(resposta)\n return resposta" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// StartGoTrace turns on tracing, writing to the given file.
[ "func (h *HandlerT) StartGoTrace(file string) error {\n\th.mu.Lock()\n\tdefer h.mu.Unlock()\n\tif h.traceW != nil {\n\t\treturn errors.New(\"trace already in progress\")\n\t}\n\tf, err := os.Create(expandHome(file))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := trace.Start(f); err != nil {\n\t\tf.Close()\n\t...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
// Weight returns the total weight of the Sasmple.
[ "func (s Sample) Weight() float64 {\n\tif s.Weights == nil {\n\t\treturn float64(len(s.Xs))\n\t}\n\treturn vec.Sum(s.Weights)\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Registers new account. @return int
[ "public function register()\r\n {\r\n $this->setPassword($this->password);\r\n $this->generateActivationToken();\r\n $this->generateAuthKey();\r\n $this->status = self::STATUS_REGISTERED;\r\n\r\n if (!$this->save()) {\r\n return self::RESP_ERR;\r\n }\r\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
/* Sets the authentication information that should be used for the connector @param username the username @param password the password @return this
[ "public MongoDB auth(String username, String password) {\n return username(username).password(password);\n }" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Add the requested post parameters to the Request. @param request Request to add post params to
[ "private void addPostParams(final Request request) {\n if (from != null) {\n request.addPostParam(\"From\", from.toString());\n }\n\n if (to != null) {\n request.addPostParam(\"To\", to.toString());\n }\n\n if (statusCallback != null) {\n request.a...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// relationalFieldDefinition returns true and current context if it is an RelationalFieldDefinition, // nil and false otherwise.
[ "func relationalFieldDefinition(failIfNotSD bool) (*gorma.RelationalFieldDefinition, bool) {\n\ta, ok := dslengine.CurrentDefinition().(*gorma.RelationalFieldDefinition)\n\tif !ok && failIfNotSD {\n\t\tdslengine.IncompatibleDSL()\n\t}\n\treturn a, ok\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:" }
Deletes the group from the disk @param groupName @return True if successful.
[ "public boolean deleteGroup(String groupName) {\n\t\tif (groupsFile != null) {\n\t\t\tlock.writeLock().lock();\n\t\t\ttry {\n\t\t\t\treloadGroupsFromFile();\n\t\t\t\tgroups.remove(groupName);\n\t\t\t\treturn writeGroupFile();\n\t\t\t} finally {\n\t\t\t\tlock.writeLock().unlock();\n\t\t\t}\n\t\t} // end if resourceP...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about AWS Auto Scaling:" }
creates data point payloads for trending data to influxdb
[ "def send_trending_data(events):\n \n bodies = {}\n\n # sort the values\n top_hits = sorted(\n [(key, count) for key, count in events.items()],\n key=lambda x: x[1],\n reverse=True\n )[:100]\n\n # build up points to be written\n for (site, content_id), count in top_hits:\n ...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
@param RequestHandlerInterface $requestHandler @return callable
[ "private function createRequestHandler(RequestHandlerInterface $requestHandler)\n {\n return function (\\swoole_http_request $swooleRequest, \\swoole_http_response $swooleResponse) use ($requestHandler) {\n $request = $this->messageTransformer->transform($swooleRequest);\n $response ...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Return the XML with correct indentation. @param string $xml @return string @throws Exception
[ "public function format($xml)\n {\n $dom = new DOMDocument('1.0');\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($xml);\n $formatted = $dom->saveXML();\n\n if (!$formatted) {\n throw new Exception(\"An error occurred while fo...
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Load hook module and register signals. :param path: Absolute or relative path to module. :return: module
[ "def _load_hooks(path):\n \n module = imp.load_source(os.path.splitext(os.path.basename(path))[0], path)\n if not check_hook_mechanism_is_intact(module):\n # no hooks - do nothing\n log.debug('No valid hook configuration: \\'%s\\'. Not using hooks!', path)\n else:\n if check_registe...
[ "def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
does the same this as `pageviews`, except it includes content ids and then optionally filters the response by a list of content ids passed as query params - note, this load can be a little heavy and could take a minute
[ "def content_ids(params):\n \n # set up default values\n default_from, default_to, yesterday, _ = make_default_times()\n\n # get params\n try:\n series = params.get(\"site\", [DEFAULT_SERIES])[0]\n from_date = params.get(\"from\", [default_from])[0]\n to_date = params.get(\"to\",...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetCacheSecurityGroup sets the CacheSecurityGroup field's value.
[ "func (s *RevokeCacheSecurityGroupIngressOutput) SetCacheSecurityGroup(v *CacheSecurityGroup) *RevokeCacheSecurityGroupIngressOutput {\n\ts.CacheSecurityGroup = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// WaitUntilAuditReportCreated uses the ACM-PCA API operation // DescribeCertificateAuthorityAuditReport to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned.
[ "func (c *ACMPCA) WaitUntilAuditReportCreated(input *DescribeCertificateAuthorityAuditReportInput) error {\n\treturn c.WaitUntilAuditReportCreatedWithContext(aws.BackgroundContext(), input)\n}" ]
[ "public boolean isASGEnabled(InstanceInfo instanceInfo) {\n CacheKey cacheKey = new CacheKey(getAccountId(instanceInfo, accountId), instanceInfo.getASGName());\n Boolean result = asgCache.getIfPresent(cacheKey);\n if (result != null) {\n return result;\n } else {\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
You can modify the container here before it is dumped to PHP code. @param ContainerBuilder $container @api
[ "public function process(ContainerBuilder $container)\n {\n $twig = $container->getDefinition('twig');\n\n $languages = array('en', 'fr');\n if ($container->hasParameter('open_orchestra_base.administration_languages')) {\n $languages = $container->getParameter('open_orchestra_base...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Execute Ant task @throws BuildException If an error occurs
[ "@Override\n public void execute() throws BuildException {\n if (path == null)\n throw new BuildException(\"Path isn't defined\");\n\n if (descriptors == null)\n throw new BuildException(\"Descriptors isn't defined\");\n\n if (descriptors.getData() == null)\n ...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Build the realurl alias. @param $params @param $ref @return string
[ "public function main($params, $ref)\n {\n $params['pathParts'] = array_filter($params['pathParts'], function ($v, $k) {\n return !empty($v);\n }, ARRAY_FILTER_USE_BOTH);\n\n return null;\n }" ]
[ "def doc_uri(self, args, range=None):\n \"\"\"\"\"\"\n self.log.debug('doc_uri: in')\n self.send_at_position(\"DocUri\", False, \"point\")" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Add a menu item node at the correct place in the menu. @param Menu $menu @param MenuItem $node @param $startDepth @return bool|\Knp\Menu\ItemInterface
[ "public function addNodeToMenu(Menu $menu, MenuItem $node, $startDepth)\n {\n if ($node->getLvl() < $startDepth) {\n return false;\n }\n\n if ($node->getLvl() > $startDepth) {\n $menu = $this->getParentMenu($menu, $node);\n }\n\n if (is_object($menu)) {\n ...
[ "protected function Init()\n {\n $contentContainer = ContentContainer::Schema()->ByContent($this->content);\n $tree = new ContainerContentTreeProvider($contentContainer->GetContainer());\n \n $renderer = new ContentsRenderer($tree->TopMost(), $tree);\n $this->contents = $render...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Compose a resource to a stream, possibly using pretty presentation for a human reader, and maybe a different choice in the xhtml narrative (used in the spec in one place, but should not be used in production) @
[ "public void compose(OutputStream stream, Resource resource, boolean htmlPretty) throws IOException {\r\n\t\tXMLWriter writer = new XMLWriter(stream, \"UTF-8\");\r\n\t\twriter.setPretty(style == OutputStyle.PRETTY);\r\n\t\twriter.start();\r\n\t\tcompose(writer, resource, htmlPretty);\r\n\t\twriter.end();\r\n\t}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Construit une requête à partir des paramètre du serveur. @return ServerRequest
[ "public static function create()\n {\n $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n $scheme = isset($_SERVER[ 'HTTPS' ]) && ($_SERVER[ 'HTTPS' ] == 'on' || $_SERVER[ 'HTTPS' ] == 1) ||\n isset($_SERVER[ 'HTTP_X_FORWARDED_PROTO' ]) && $_SERVER[ 'HTTP...
[ "void writeToFile() throws IOException {\r\n\t\t// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès\r\n\t\tfinal Counter counter = this.clone();\r\n\t\t// on n'écrit pas rootCurrentContextsByThreadId en fichier\r\n\t\t// puisque ces données ne seront plus vraies dans...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Get info by real team using a ID @return: name,[player list]
[ "def club(self,cid):\n '''\n \n '''\n headers = {\"Content-type\": \"application/x-www-form-urlencoded\",\"Accept\": \"text/plain\",'Referer': 'http://'+self.domain+'/',\"User-Agent\": user_agent}\n req = self.session.get('http://'+self.domain+'/clubInfo.phtml?cid='+cid,headers=he...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// FindSession attempts to find a debug hooks session for the unit specified // in the context, and returns a new ServerSession structure for it.
[ "func (c *HooksContext) FindSession() (*ServerSession, error) {\n\tcmd := exec.Command(\"tmux\", \"has-session\", \"-t\", c.tmuxSessionName())\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tif len(out) != 0 {\n\t\t\treturn nil, errors.New(string(out))\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\...
[ "def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Creates color from either short hand like #ff0 or long hex values like #001122 with or without leading hash @param string $hex The alpha rgb color hex value @return ArgbColor returns an instance with the defined colors
[ "static function FromRgbHex($hex)\n {\n $cleanHex = ltrim($hex, '#');\n if (strlen($cleanHex) == 3) {\n $r = hexdec(substr($cleanHex, 0, 1) . substr($cleanHex, 0, 1));\n $g = hexdec(substr($cleanHex, 1, 1) . substr($cleanHex, 1, 1));\n $b = hexdec(substr($cleanHex, ...
[ "def to_s(opts = {})\n return smallest if options[:style] == :compressed\n return representation if representation\n\n # IE10 doesn't properly support the color name \"transparent\", so we emit\n # generated transparent colors as rgba(0, 0, 0, 0) in favor of that. See\n # #1782.\n retu...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// MasterTimeout specifies the timeout for connection to master.
[ "func (s *IndicesPutMappingService) MasterTimeout(masterTimeout string) *IndicesPutMappingService {\n\ts.masterTimeout = masterTimeout\n\treturn s\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Maximum state requirement
[ "function( max, startFunc ) {\n\t\tvar self = this;\n\n\t\tif ( max < self.state ) {\n\t\t\tself._stateError( startFunc || self.requireMaxState );\n\t\t}\n\n\t\treturn self;\n\t}" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Start a VM. .. versionadded:: 2016.3.0 name The name of the VM to start. CLI Example: .. code-block:: bash salt-cloud -a start my-vm
[ "def start(name, call=None):\n '''\n \n '''\n if call != 'action':\n raise SaltCloudSystemExit(\n 'The start action must be called with -a or --action.'\n )\n\n log.info('Starting node %s', name)\n\n return vm_action(name, kwargs={'action': 'resume'}, call=call)" ]
[ "def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
intersect transcription position with annotation files
[ "def anncluster(c, clus_obj, db, type_ann, feature_id=\"name\"):\n \"\"\"\"\"\"\n id_sa, id_ea, id_id, id_idl, id_sta = 1, 2, 3, 4, 5\n if type_ann == \"bed\":\n id_sb = 7\n id_eb = 8\n id_stb = 11\n id_tag = 9\n ida = 0\n clus_id = clus_obj.clus\n loci_id = clus_obj.lo...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Make request to Google API to get profile data for the user.
[ "def google_get_data(self, config, response):\n \"\"\"\"\"\"\n params = {\n 'access_token': response['access_token'],\n }\n payload = urlencode(params)\n url = self.google_api_url + 'userinfo?' + payload\n req = Request(url)\n json_str = urlopen(req).read(...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the text about accounts.authinfo:", "pos": "Represent the code about accounts.authinfo:", "neg": "Represent the code about programming:" }
Replace a field with a single field or array of fields @param string $name name of field to replace @param NamedBuilder|NamedBuilder[] $field single or array of fields @throws FieldNotFoundException if the field name doesn't exist @return void
[ "public function replaceField($name, $field)\n {\n $index = $this->getFieldIndex($name);\n $this->removeFieldAtIndex($index);\n $this->insertFields($field, $index);\n }" ]
[ "protected function getSingleFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())\n {\n // booleans were handled here. They are now handled as complextypes\n\n // q: do we really want this to happen by default on all scalar field values?\n //...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
used for destructuring forms, since we don't transform() them
[ "void decompileArrayLiteral(ArrayLiteral node) {\n decompiler.addToken(Token.LB);\n List<AstNode> elems = node.getElements();\n int size = elems.size();\n for (int i = 0; i < size; i++) {\n AstNode elem = elems.get(i);\n decompile(elem);\n if (i < size - ...
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Copies a {@link GlobeCoordinatesValue}. @param object object to copy @return copied object
[ "public GlobeCoordinatesValue copy(GlobeCoordinatesValue object) {\n\t\treturn dataObjectFactory.getGlobeCoordinatesValue(\n\t\t\t\tobject.getLatitude(), object.getLongitude(),\n\t\t\t\tobject.getPrecision(), object.getGlobe());\n\t}" ]
[ "@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 description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Software development:" }
----------------------------------------------------------------------
[ "public function encodeModeAn($version)\n {\n try {\n $words = (int)($this->size / 2);\n $bs = new QRbitstream();\n \n $bs->appendNum(4, 0x02);\n $bs->appendNum(QRspec::lengthIndicator(QR_MODE_AN, $version), $this->size);\n...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github summarization about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Event handler for the rating to update the label and the data @param {sap.ui.base.Event}
[ "function(oEvent) {\n\t\t\t\tvar that = this;\n\t\t\t\tvar oPressedButton = oEvent.getSource();\n\n\t\t\t\tthat._oFeedbackDialog.ratingBar.forEach(function(oRatingBarElement) {\n\t\t\t\t\tif (oPressedButton !== oRatingBarElement.button) {\n\t\t\t\t\t\toRatingBarElement.button.setPressed(false);\n\t\t\t\t\t} else {\...
[ "function (oControl) {\n\t\t\treturn oControl instanceof this._oWindow.sap.ui.core.mvc.View && oControl !== that._oView;\n\t\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the attribute have enabled value Form android styles namespace @param attrs AttributeSet @param attribute The attribute to retrieve @param defaultValue What to return if the attribute isn't found @return Resulting value
[ "public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) {\n return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue);\n }" ]
[ "@SuppressWarnings(\"unchecked\") // we know that return value type is a child of view, and V is bound to a child of view.\n public static <V extends View> V findViewById(Activity activity, int id) {\n return (V) activity.findViewById(id);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Indicates whether the provided package should be scanned (based upon the inclusion/exclusion lists).
[ "public boolean shouldScanPackage(String pkg)\n {\n // assume an empty string if it wasn't specified\n if (pkg == null)\n {\n pkg = \"\";\n }\n WindupJavaConfigurationModel configuration = getJavaConfigurationModel(getGraphContext());\n for (PackageModel pkgMo...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Render client list for the current instance @return \Symfony\Component\HttpFoundation\RedirectResponse
[ "public function clientAction()\n {\n $worker = $this->getWorker();\n // Worker can be undefined if server went away\n // For the current instance or if we have no instance selected\n if(!$worker) {\n return new RedirectResponse($this->generateUrl('ringo_php_redmon'));\n ...
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the Github text about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code:" }
Unquote and fix hostname. Returns is_idn.
[ "def url_fix_host (urlparts):\n \"\"\"\"\"\"\n if not urlparts[1]:\n urlparts[2] = urllib.unquote(urlparts[2])\n return False\n userpass, netloc = urllib.splituser(urlparts[1])\n if userpass:\n userpass = urllib.unquote(userpass)\n netloc, is_idn = idna_encode(urllib.unquote(netl...
[ "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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
See res_init() in ICU4C/source/common/uresdata.c.
[ "private void init(ByteBuffer inBytes) throws IOException {\n dataVersion = ICUBinary.readHeader(inBytes, DATA_FORMAT, IS_ACCEPTABLE);\n int majorFormatVersion = inBytes.get(16);\n bytes = ICUBinary.sliceWithOrder(inBytes);\n int dataLength = bytes.remaining();\n\n if(DEBUG) Syste...
[ "def cxx(source, libraries=[]):\n \n \"\"\"\n path = _cc_build_shared_lib(source, '.cc', libraries)\n return ctypes.cdll.LoadLibrary(path)" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }