query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Инициализация маршрутов
@version 29.12.2018
@author Дмитрий Щербаков <atomcms@ya.ru> | [
"protected function initRoutes()\n {\n $fileLocator = new FileLocator([__DIR__, SettingsPath::FULL_ROOT]);\n $loader = new YamlFileLoader($fileLocator);\n $routes = $loader->load('coreroutes.yaml');\n\n $headers = [\n 'X-SESSION-ID',\n 'X-UTC-OFFSET',\n ... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// EdgeNeighbors returns the four cells that are adjacent across the cell's four edges.
// Edges 0, 1, 2, 3 are in the down, right, up, left directions in the face space.
// All neighbors are guaranteed to be distinct. | [
"func (ci CellID) EdgeNeighbors() [4]CellID {\n\tlevel := ci.Level()\n\tsize := sizeIJ(level)\n\tf, i, j, _ := ci.faceIJOrientation()\n\treturn [4]CellID{\n\t\tcellIDFromFaceIJWrap(f, i, j-size).Parent(level),\n\t\tcellIDFromFaceIJWrap(f, i+size, j).Parent(level),\n\t\tcellIDFromFaceIJWrap(f, i, j+size).Parent(leve... | [
"@Override\n public int parity() {\n\n // create three vectors, v->u, v->w and u->x\n double[] vu = toVector(v, u);\n double[] vw = toVector(v, w);\n double[] ux = toVector(u, x);\n\n // normal vector (to compare against), the normal vector (n) looks like:\n // x n w... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
----------------------------------------------- | [
"private Hashtable<String,Object> setupBasicProperties(Hashtable<String,Object> env, String providerUrl)\r\n\t\t\tthrows NamingException\r\n\t{\r\n\t\t// set the tracing level\r\n\t\tif (tracing)\r\n\t\t\tenv.put(\"com.sun.jndi.ldap.trace.ber\", System.err);\r\n\r\n\t\t// always use ldap v3\r\n\t\tenv.put(\"java.na... | [
"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 about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
Prepare all parameters for request
@param bidderRequest {object}
@returns {object} | [
"function getMediaType(bidderRequest) {\n const videoMediaType = utils.deepAccess(bidderRequest, 'mediaTypes.video');\n const context = utils.deepAccess(bidderRequest, 'mediaTypes.video.context');\n\n return !videoMediaType ? DISPLAY : context === OUTSTREAM ? OUTSTREAM : VIDEO;\n}"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
/*!
\static
Creats a regexp string out of the wildcard \a $wilcard and returns it. | [
"static function wildcardToRegexp( $wildcard, $separatorCharacter = false )\n {\n if ( !$separatorCharacter )\n $separatorCharacter = '#';\n $wildcardArray = preg_split( \"#[*]#\", $wildcard, -1, PREG_SPLIT_DELIM_CAPTURE );\n $wildcardList = array();\n $i = 0;\n fore... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
resizeSection
@param string destination
@param int width
@param int height
@param int cropX [cropX=0]
@param int cropY [cropY=0]
@param mixed ratio [ratio=null]
@return boolean | [
"public function resizeSection($destination, $width, $height, $cropX=0, $cropY=0)\n {\n $size = array('width' => $width, 'height' => $height);\n\n return $this->doResize($destination, $size, $cropX, $cropY, true);\n }"
] | [
"def text(self, x, y, text, attr=None):\r\n '''\r\n self.pos(x, y)\r\n self.write_color(text, attr)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about writing:"
} |
Destroy the current object
@return boolean destroyed or not | [
"public function destroy()\n {\n if (!self::$_loaded) {\n self::_loadColumns();\n }\n\n $calling = get_called_class();\n\n if (!self::_checkCallback($calling, \"before_destroy\", $this)) {\n return false;\n }\n\n $table_name = $calling::getTableName... | [
"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 instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Set _SESSION Info | [
"private function setSession()\n {\n if (isset($_SESSION)) {\n foreach ($_SESSION as $k => $v) {\n $this->log->debug(\"[ SESSION Params ]\" . $k . \": \" . $v, []);\n $this->session->$k = $this->setSecurityLevel($v);\n $this->parameters[\"session\"][... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get a cell choice by text.
@param string $text
@return Cell|null | [
"public function getChoice($text)\n {\n $found = null;\n $text = trim($text);\n $iText = strtoupper(TextNormalizer::stripDiacritics($text));\n foreach ($this->choices as $choice) {\n /** @var CellChoice $choice */\n $tmpText = trim($choice->getText());\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Result of matching activator.
@param MessageReceived $message
@return bool | [
"public function matches(MessageReceived $message): bool\n {\n if ($this->type === null) {\n return $message->getAttachment() !== null;\n }\n\n return hash_equals($message->getAttachment()->getType(), $this->type);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code:"
} |
// findExistingClientCA returns *either* the existing client CA file name as a string,
// *or* data in a []byte for a given host, and true if it exists in the given config | [
"func findExistingClientCA(host string, kubeconfig clientcmdapi.Config) (string, []byte, bool) {\n\tfor _, cluster := range kubeconfig.Clusters {\n\t\tif cluster.Server == host {\n\t\t\tif len(cluster.CertificateAuthority) > 0 {\n\t\t\t\treturn cluster.CertificateAuthority, nil, true\n\t\t\t}\n\t\t\tif len(cluster.... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Format a boolean value for display
@param string $field Name of field.
@param mixed $value Value of field.
@param array $options Options array
@return string | [
"public function formatBoolean($field, $value, $options)\n {\n return (bool)$value ?\n $this->Html->label(__d('crud', 'Yes'), ['type' => empty($options['inverted']) ? 'success' : 'danger']) :\n $this->Html->label(__d('crud', 'No'), ['type' => empty($options['inverted']) ? 'danger' : ... | [
"public function getStoreValue($data = null)\n {\n\n // If Overrite Value\n if (isset($this->value) && $this->overwriteValue) {\n return $this->value;\n }\n\n // If user have user input value\n if ($data != null && isset($data[$this->getName()])) {\n\n // ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Makes an element required
@param string $name Name of the element to filter
@param boolean|string|array $options Boolean indicates required or not.
String indicates required with custom message.
Array indicates required and has options
@return boolean | [
"public function required($options) {\n if ((is_array($options) || (!is_array($options) && $options))) {\n if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) ||\n (!is_array($this->elementData) &... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Check token.
@param $token
@return bool | [
"protected function checkToken($token)\n {\n try {\n $response = $this->http->get($this->checkTokenURL(), [\n 'headers' => [\n 'X-Requested-With' => 'XMLHttpRequest',\n 'Authorization' => 'Bearer ' . $token\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Allocates and initializes an encoder state. | [
"def create(fs, channels, application):\n \"\"\"\"\"\"\n\n result_code = ctypes.c_int()\n\n result = _create(fs, channels, application, ctypes.byref(result_code))\n if result_code.value is not constants.OK:\n raise OpusError(result_code.value)\n\n return result"
] | [
"@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 Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Return the pattern defined by the key string specific to the platform.
:param platform:
:param key:
:param compiled:
:return: Pattern string or RE object. | [
"def pattern(self, platform, key, compiled=True):\n \n patterns = self._platform_patterns(platform, compiled=compiled)\n pattern = patterns.get(key, self._platform_patterns(compiled=compiled).get(key, None))\n\n if pattern is None:\n raise KeyError(\"Patterns database corrupte... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Generate the card body, checks to see if any section have been defined first, if not, check
for a complete body
@return string | [
"private function cardBody() : string\n {\n if (count($this->body_sections) === 0) {\n if ($this->body !== null) {\n $body = $this->body;\n } else {\n $body = '<p>No card body content defined, no calls to setBody() or setBodyContent().</p>';\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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Prepare the installation for an extension specified by a directory
@param OutputInterface $output An OutputInterface instance
@param string $source The extension source
@return string The location of the prepared extension | [
"private function handleDirectory(OutputInterface $output, $source)\n\t{\n\t\t$tmpDir = $this->joomla->getCfg('tmp_path');\n\t\t$tmpPath = $tmpDir . '/' . uniqid('install_');\n\t\t$this->writeln($output, \"Copying $source\", OutputInterface::VERBOSITY_VERBOSE);\n\n\t\tmkdir($tmpPath);\n\t\tcopy($source, $tmpPath);... | [
"@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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"@Override\n public Page<DataSession> previousPage(final Page<DataSession> page, \n final TwilioRestClient client) {\n Request request = new Request(\n HttpMethod.GET,\n page.getPreviousPageUrl(\n Domains.WIRELESS.toString(),\n ... | [
"@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Twilio:",
"pos": "Represent the Github code about Twilio:",
"neg": "Represent the Github code:"
} |
Get user countries
@return array | [
"public function getRelatedCountries()\n {\n $conn = $this->app->getApplicationBox()->get_connection();\n\n $sql = 'SELECT DISTINCT Users.country ' . $this->generate_sql_constraints() . ' ORDER BY Users.country';\n\n $stmt = $conn->prepare($sql);\n $stmt->execute($this->sql_params);\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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Look for routes to register in application properties
@throws \Exception | [
"public function boot()\n {\n if ($this->app->getProps() === null) {\n return;\n }\n\n $routes = [];\n $pathPrefix = $this->app->getProp($this->routesPathPrefixPropName, '');\n $propRoutes = $this->app->getProp($this->routesPropName, []);\n\n if (!is_array($pr... | [
"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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Return a dictionary of information regarding the server and workers.
It invokes the :meth:`extra_server_info` for adding custom
information. | [
"async def rpc_server_info(self, request):\n '''\n '''\n info = await send('arbiter', 'info')\n info = self.extra_server_info(request, info)\n try:\n info = await info\n except TypeError:\n pass\n return info"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the post about AWS Route 53:",
"pos": "Represent the code about AWS Route 53:",
"neg": "Represent the code about Software development:"
} |
获得具体组件类
@param string $component 组件名称
@param bool $forInstance 是否返回实例
@return object|string 返回类名或实例 | [
"protected static function get(string $component, bool $forInstance = false)\n {\n //读取具体组件\n $component = strtoupper($component);\n if (array_key_exists($component, self::$lists)) {\n $Class = self::$lists[$component][0];\n if ($forInstance) {\n if (!is_... | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// CheckLoginDuration checks if role set can login up to given duration and
// returns a combined list of allowed logins. | [
"func (set RoleSet) CheckLoginDuration(ttl time.Duration) ([]string, error) {\n\tlogins := make(map[string]bool)\n\tvar matchedTTL bool\n\tfor _, role := range set {\n\t\tmaxSessionTTL := role.GetOptions().MaxSessionTTL.Value()\n\t\tif ttl <= maxSessionTTL && maxSessionTTL != 0 {\n\t\t\tmatchedTTL = true\n\n\t\t\tf... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Sets the connect timeout in the specified time unit.
@param connectTimeout the connectWait to set
@param unit the time unit to set | [
"public void setConnectTimeout(long connectTimeout, TimeUnit unit) {\n this.connectTimeout = Duration.ofMillis(unit.toMillis(connectTimeout));\n }"
] | [
"function Policy(overrides) {\n if (!(this instanceof Policy))\n return new Policy(overrides);\n\n u.defaults(this, overrides, {\n /**\n * support subjects in link names with the following characteristics:\n * receiver: \"amq.topic/news\", means a filter on the ReceiverLink will be made\n * ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
<p>Return an <code>Iterator</code> over the set of currently registered
behavior ids for this <code>Application</code>.</p> | [
"public Iterator<String> getBehaviorIds() {\n\n if (defaultApplication != null) {\n return defaultApplication.getBehaviorIds();\n }\n return Collections.EMPTY_LIST.iterator();\n \n }"
] | [
"private void register(final AbstractPlugin plugin, final Map<String, HashSet<AbstractPlugin>> holder) {\n final String rendererId = plugin.getRendererId();\n\n /*\n * the rendererId support multiple,using ';' to split.\n * and using Map to match the plugin is not flexible, a regular e... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns output from a command.
@param string $command A git command.
@param string|array $args An array or string of arguments.
@return mixed The response if any from the git command.
@throws CommandFailureException If the command failed. | [
"protected function command($command, $args)\n {\n $command = trim(sprintf('git %s %s', $command, Stringify::arguments($args)));\n list($output, $return) = $this->execute($command);\n if ($return != self::SUCCESS) {\n throw new CommandFailureException($output);\n }\n\n ... | [
"protected function showHelp($msg = '', $code = 0)\n {\n $usage = Cli::color('USAGE:', 'brown');\n $commands = Cli::color('COMMANDS:', 'brown');\n $sOptions = Cli::color('SPECIAL OPTIONS:', 'brown');\n $pOptions = Cli::color('PUBLIC OPTIONS:', 'brown');\n $version = Cli::color(... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about PHP programming:"
} |
// Close - closes underneath connections to NATS server. | [
"func (target *NATSTarget) Close() (err error) {\n\tif target.stanConn != nil {\n\t\terr = target.stanConn.Close()\n\t}\n\n\tif target.natsConn != nil {\n\t\ttarget.natsConn.Close()\n\t}\n\n\treturn err\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 description about Computer Networking:",
"pos": "Represent the code about Computer Networking:",
"neg": "Represent the code about programming:"
} |
Clone EditorStack from other instance | [
"def clone_from(self, other):\r\n \"\"\"\"\"\"\r\n for other_finfo in other.data:\r\n self.clone_editor_from(other_finfo, set_current=True)\r\n self.set_stack_index(other.get_stack_index())"
] | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Writes out the current state of the ChangeList to the given file.
@param persistFile file to write state to
@return the version ID of the ChangedList which was persisted | [
"public long persist(File persistFile) {\n try {\n FileOutputStream fileStream = new FileOutputStream(persistFile);\n ObjectOutputStream oStream = new ObjectOutputStream((fileStream));\n\n long persistVersion;\n Map<String, ChangedFile> fileListCopy;\n s... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// NewClient returns a connected Client for the given options, or an error if
// the client could not be created. | [
"func NewClient(options ClientOptions) (*Client, error) {\n\tvar err error\n\tif options.KerberosClient != nil && options.KerberosClient.Credentials == nil {\n\t\treturn nil, errors.New(\"kerberos enabled, but kerberos client is missing credentials\")\n\t}\n\n\tif options.KerberosClient != nil && options.KerberosSe... | [
"func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
calculates the subword of `original` that `pos` is in | [
"def relevant_part(self, original, pos):\n \n start = original.rfind(self._separator, 0, pos)\n if start == -1:\n start = 0\n else:\n start = start + len(self._separator)\n end = original.find(self._separator, pos - 1)\n if end == -1:\n end ... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github text about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
// SetCreateIfMissingColumnFamilies specifies whether the column families
// should be created if they are missing. | [
"func (opts *Options) SetCreateIfMissingColumnFamilies(value bool) {\n\tC.rocksdb_options_set_create_missing_column_families(opts.c, boolToChar(value))\n}"
] | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Returns a list of {@code requires} directives in {@code directives}.
@return a list of {@code requires} directives in {@code directives}
@param directives the directives to filter
@since 9
@spec JPMS | [
"public static List<RequiresDirective>\n requiresIn(Iterable<? extends Directive> directives) {\n return listFilter(directives, DirectiveKind.REQUIRES, RequiresDirective.class);\n }"
] | [
"public void visitEnd() {\n String classname = workbench.getType().getClassName();\n\n component.addAttribute(new Attribute(\"classname\", classname));\n\n // Generates the provides attribute.\n component.addElement(ElementHelper.getProvidesElement(specifications));\n\n if (workbe... | codesearchnet | {
"query": "Represent the description about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
// init initializes LRU guts. | [
"func (l *blocksLRU) init(capacity int) {\n\tl.capacity = capacity\n\tl.blocks = make(map[int64]*list.Element, capacity)\n\tl.ll.Init()\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Given a converter, set up the direct_output routes for conversions,
which is used for transcoding between similar datatypes. | [
"def _setup_direct_converter(self, converter):\n '''\n \n '''\n inputs = (\n converter.direct_inputs\n if hasattr(converter, 'direct_inputs')\n else converter.inputs\n )\n for in_ in inputs:\n for out in converter.direct_outputs:\... | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
10% speedup to move MoveNext to child class | [
"function MoveNext()\n\t{\n\t\tif (!$this->EOF) {\n\t\t\t$this->_currentRow++;\n\t\t\tif ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {\n\t\t\t\t$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);\n\n\t\t\t\tif (is_array($this->fields)) {\n\t\t\t\t\tif ($this->... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Swap swaps the items at the passed indices. It is part of the
// sort.Interface implementation. | [
"func (s bulkFetchDataSorter) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// this function reads nonceSize random data | [
"func generateSalt() ([keySize]byte, error) {\n\tvar data32 [keySize]byte\n\tdata := make([]byte, keySize)\n\t_, err := rand.Read(data)\n\tif err != nil {\n\t\treturn data32, err\n\t}\n\ttotal := copy(data32[:], data)\n\tif total != keySize {\n\t\treturn data32, SaltGenerationError\n\t}\n\treturn data32, nil\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:"
} |
Delete Saved Aggregation By Slug | [
"def delete_saved_aggregation_by_slug(request, slug):\n \"\"\"\"\"\"\n ss = get_object_or_404(Aggregation, slug=slug)\n ss.delete()\n messages.success(request, _(\"Saved aggregation deleted.\"))\n return HttpResponseRedirect(\n reverse(\n 'djmongo_browse_saved_aggregations_w_params'... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Cancel all pending results. | [
"def cancelAllPendingResults( self ):\n \"\"\"\"\"\"\n\n # grab all the pending job ids\n jobs = self.pendingResults()\n \n if len(jobs) > 0:\n # abort in the cluster\n self._abortJobs(jobs)\n \n # cancel in the notebook ... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see io.jsondb.JsonDBOperations#findAllAndModify(java.lang.String, io.jsondb.query.Update, java.lang.String) | [
"@SuppressWarnings(\"unchecked\")\n @Override\n public <T> List<T> findAllAndModify(String jxQuery, Update update, String collectionName) {\n CollectionMetaData cmd = cmdMap.get(collectionName);\n Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);\n if((null == cmd) ||... | [
"public AggregationResult aggregate(String fields) throws DDFException {\n return this.getAggregationHandler().aggregate(AggregateField.fromSqlFieldSpecs(fields));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Iterate over all ConfigProperty attributes, yielding (attr_name, config_property) | [
"def _iter_config_props(cls):\n \n props = inspect.getmembers(cls, lambda a: isinstance(a, ConfigProperty))\n for attr_name, config_prop in props:\n yield attr_name, config_prop"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Creates a new context with empty values. | [
"func NewContext() context {\n\tvar ctx context\n\tctx.values = make(map[string]map[string]string)\n\n\treturn ctx\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 comment about Go programming language:",
"pos": "Represent the Github code about Go programming language:",
"neg": "Represent the Github code:"
} |
Have any fields Changed?
@param bNonKeyOnly If we are talking about non current key fields only.
@return true if any fields have changed. | [
"public boolean isModified(boolean bNonKeyOnly)\n {\n int fieldCount = this.getFieldCount(); // BaseField Count\n for (int fieldSeq = DBConstants.MAIN_FIELD; fieldSeq < fieldCount+DBConstants.MAIN_FIELD; fieldSeq++)\n {\n BaseField field = this.getField(fieldSeq);\n if... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Gets the name of the variable whose numerical index is
{@code index}. Returns {@code null} if no such variable
exists.
@return | [
"public final String getVariableNameFromIndex(int num) {\n int index = getVariableIndex(num);\n if (index >= 0) {\n return names[index];\n } else {\n return null;\n }\n }"
] | [
"@Private Object word(String name) {\n Object p = words.apply(name);\n Checks.checkArgument(p != null, \"token %s unavailable\", name);\n return p;\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// GetTenantIDs provides a mock function with given fields: ctx | [
"func (_m *Facade) GetTenantIDs(ctx datastore.Context) ([]string, error) {\n\tret := _m.Called(ctx)\n\n\tvar r0 []string\n\tif rf, ok := ret.Get(0).(func(datastore.Context) []string); ok {\n\t\tr0 = rf(ctx)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).([]string)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif... | [
"@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:"
} |
de-mix a mixed servo output | [
"def mix1(servo1, servo2, mixtype=1, gain=0.5):\n ''''''\n (v1,v2) = mixer(servo1, servo2, mixtype=mixtype, gain=gain)\n return v1"
] | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return any unknown args. | [
"def _chk_docunknown(args, exp):\n \"\"\"\"\"\"\n unknown = []\n for arg in args:\n if arg[:2] == '--':\n val = arg[2:]\n if val not in exp:\n unknown.append(arg)\n elif arg[:1] == '-':\n val = arg[1:]\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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Close closes the Writer's db connection and stops the periodic ticker. A writer
// object can be re-opened after closing. | [
"func (w *Writer) Close() {\n\tif !w.enabled {\n\t\treturn\n\t}\n\tw.mu.Lock()\n\tdefer w.mu.Unlock()\n\tif !w.isOpen {\n\t\treturn\n\t}\n\tw.ticks.Stop()\n\tw.pool.Close()\n\tlog.Info(\"Stopped heartbeat writes.\")\n\tw.isOpen = false\n}"
] | [
"def _shutdown_broker(self):\n \n if self.broker:\n self.broker.shutdown()\n self.broker.join()\n self.broker = None\n self.router = None\n\n # #420: Ansible executes \"meta\" actions in the top-level process,\n # meaning \"reset_connec... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
@param string $base_dir
@param bool $is_diff
@return void | [
"public function check($base_dir, $is_diff = false)\n {\n $start_checks = (int)microtime(true);\n\n if (!$base_dir) {\n throw new \\InvalidArgumentException('Cannot work with empty base_dir');\n }\n\n $diff_files = null;\n $deleted_files = null;\n\n $this->ful... | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// MustTrytesToBytes is only defined for hashes (81 Trytes). It returns 48 bytes. | [
"func MustTrytesToBytes(trytes Trytes) []byte {\n\tbytes, err := TrytesToBytes(trytes)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn bytes\n}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Test if this XElement has the given name and namespace.
@param name the name to test against
@param namespace the namespace to test against
@return true if the names and namespaces equal | [
"public boolean hasName(String name, String namespace) {\n return hasName(name) && Objects.equals(this.namespace, namespace);\n }"
] | [
"private Object extendArray(Object array, int currentSize, int requiredSize) {\n if (requiredSize < currentSize) {\n return array;\n } else {\n Object newArray = null;\n int newSize = currentSize * 2;\n\n if (newSize <= requiredSize) {\n newSi... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// WriteBits writes nb bits of v to the underlying writer. | [
"func (pw *Writer) WriteBits(v, nb uint) {\n\tif _, err := pw.PushBits(); err != nil {\n\t\terrors.Panic(err)\n\t}\n\tpw.bufBits |= uint64(v) << pw.numBits\n\tpw.numBits += nb\n}"
] | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the Github description about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
Get the string corresponding to the incrementation of each steps
@return string | [
"public function getStepIncrement()\n {\n switch ($this->step) {\n case self::$YEARLY:\n return '+1 year';\n break;\n case self::$MONTHLY:\n return '+1 month';\n break;\n case self::$DAILY:\n return... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetBackupSizeBytes sets the BackupSizeBytes field's value. | [
"func (s *BackupDetails) SetBackupSizeBytes(v int64) *BackupDetails {\n\ts.BackupSizeBytes = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// ListFirewallRules returns all the firewall rules. | [
"func (c *Client) ListFirewallRules() ([]params.FirewallRule, error) {\n\tvar results params.ListFirewallRulesResults\n\tif err := c.facade.FacadeCall(\"ListFirewallRules\", nil, &results); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\treturn results.Rules, nil\n}"
] | [
"func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// IsValid performs basic validation on the content of an organizations fields | [
"func (org *Organization) IsValid() bool {\n\tregex, _ := regexp.Compile(`^[a-z\\d\\-_\\s]{3,150}$`)\n\treturn validator.Validate(org) == nil && regex.MatchString(org.Globalid)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Alias for .tail(). | [
"def last(self, n=10, by=None, **kwargs):\n \n return self.tail(n=n, by=by, **kwargs)"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetServiceNamespace sets the ServiceNamespace field's value. | [
"func (s *RegisterScalableTargetInput) SetServiceNamespace(v string) *RegisterScalableTargetInput {\n\ts.ServiceNamespace = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Revert any changed config.
@AfterScenario | [
"public function cleanConfig()\n {\n // Revert config that was changed.\n foreach ($this->config as $name => $key_value) {\n foreach ($key_value as $key => $value) {\n $this->getDriver()->configSet($name, $key, $value);\n }\n }\n $this->config = ar... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Returns true if *Socket is in []Polled | [
"func socketInPolled(s *zmq.Socket, p []zmq.Polled) bool {\n\tfor _, pp := range p {\n\t\tif pp.Socket == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github summarization about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code:"
} |
// Compare compares BinaryLiteral to another one | [
"func (b BinaryLiteral) Compare(b2 BinaryLiteral) int {\n\tbufB := trimLeadingZeroBytes(b)\n\tbufB2 := trimLeadingZeroBytes(b2)\n\tif len(bufB) > len(bufB2) {\n\t\treturn 1\n\t}\n\tif len(bufB) < len(bufB2) {\n\t\treturn -1\n\t}\n\treturn bytes.Compare(bufB, bufB2)\n}"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
IPersonAttributeDao beans defined by implementors will be added to this list when the
ApplicationContext comes up. | [
"@Bean(name = \"innerMergedPersonAttributeDaoList\")\n public List<IPersonAttributeDao> getInnerMergedPersonAttributeDaoList() {\n final List<IPersonAttributeDao> rslt = new ArrayList<>();\n rslt.add(getImpersonationStatusPersonAttributeDao());\n rslt.add(getUPortalAccountUserSource());\n ... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Watch pulls stuff from etcd, converts, and pushes out the outgoing channel. Meant to be
// called as a goroutine. | [
"func (w *userProjectWatcher) Watch() {\n\tdefer close(w.outgoing)\n\tdefer func() {\n\t\t// when the watch ends, always remove the watcher from the cache to avoid leaking.\n\t\tw.authCache.RemoveWatcher(w)\n\t}()\n\tdefer utilruntime.HandleCrash()\n\n\t// start by emitting all the `initialProjects`\n\tfor i := ran... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Get the path of the first image linked to this model
or the path to the default image.
@return string path | [
"protected function getImageUrlOrDefault()\n {\n $file = '';\n\n if (is_object($this->entity->image)) {\n $file = $this->entity->image->path;\n }\n\n if (!Storage::exists($file)) {\n $file = $this->imgNotFound();\n }\n\n return Storage::url($file);\... | [
"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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Run the migrations.
@return void | [
"public function up()\n {\n Schema::create('FILE_File', function (Blueprint $table) {\n $table->increments('id');\n $table->string('name' , 100);\n $table->char('type' , 1);\n $table->string('system_type', 100)->nullable();\n $table->string('system_ro... | [
"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 comment about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about programming:"
} |
// reservationCoordinator is the primary goroutine tasked with progressing the
// funding workflow between the wallet, and any outside peers or local callers.
//
// NOTE: This MUST be run as a goroutine. | [
"func (f *fundingManager) reservationCoordinator() {\n\tdefer f.wg.Done()\n\n\tzombieSweepTicker := time.NewTicker(f.cfg.ZombieSweeperInterval)\n\tdefer zombieSweepTicker.Stop()\n\n\tfor {\n\t\tselect {\n\n\t\tcase msg := <-f.fundingMsgs:\n\t\t\tswitch fmsg := msg.(type) {\n\t\t\tcase *fundingOpenMsg:\n\t\t\t\tf.ha... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
we use the post insert hook to set the customer number. | [
"protected function PostInsertHook()\n {\n parent::PostInsertHook();\n\n // we need to add an customer number to the order... since generation of this number may differ\n // from shop to shop, we have added the method to fetch a new customer number to the shop class\n if (empty($this-... | [
"@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:"
} |
Generate the data and figs files for the report
:return: | [
"def create_data_figs(self):\n \n\n logger.info(\"Generating the report data and figs from %s to %s\",\n self.start, self.end)\n\n for section in self.sections():\n logger.info(\"Generating %s\", section)\n self.sections()[section]()\n\n logger.in... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
pointermove function | [
"function (event) {\n this.hover = this.getBounds().containsPoint(event.gameX, event.gameY);\n\n if (this.selected) {\n // follow the pointer\n this.pos.set(event.gameX, event.gameY, this.pos.z);\n this.pos.sub(this.grabOffset);\n this.updateChildBounds();\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:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Unpack received Data Packets.
@param string $data Input Data
@param bool $isUncrypted force no encrypt on message
@return ArrayObject | [
"public function unPack($data, $isUncrypted = false)\n {\n //====================================================================//\n // Debug Log\n Splash::log()->deb('MsgWsunPack');\n\n //====================================================================//\n // Decrypt resp... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
// NewMixedcaseAddress constructor (mainly for testing) | [
"func NewMixedcaseAddress(addr Address) MixedcaseAddress {\n\treturn MixedcaseAddress{addr: addr, original: addr.Hex()}\n}"
] | [
"public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, String[] columnNames, byte[] columnTypes, String[][] domains, String[][] naStrings) {\n throw new UnsupportedOperationException(\"Not implemented. This method is kept only for backwards compatibility... | codesearchnet | {
"query": "Represent the description about consul address:",
"pos": "Represent the code about consul address:",
"neg": "Represent the code about programming:"
} |
// New returns a new driver manager | [
"func New(c *Config) *manager {\n\tctx, cancel := context.WithCancel(context.Background())\n\treturn &manager{\n\t\tlogger: c.Logger.Named(\"driver_mgr\"),\n\t\tstate: c.State,\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tloader: c.Loader,\n\t\tplugin... | [
"@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 Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
// SetApplicationName sets the ApplicationName field's value. | [
"func (s *CreateApplicationVersionInput) SetApplicationName(v string) *CreateApplicationVersionInput {\n\ts.ApplicationName = &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:"
} |
@param string $type
@param string $name
@throws TokenException
@return array | [
"public function getServiceCatalog($type, $name = null)\n {\n if (!array_key_exists($type, $this->catalogs) || empty($this->catalogs[$type])) {\n throw new TokenException(sprintf('There is no catalog for \"%s\"', $type));\n }\n\n $catalogs = $this->catalogs[$type];\n\n if (... | [
"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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
@param string $url
@param array $params
@param array $headers
@throws ApiException
@return mixed | [
"public function get($url, array $params = [], array $headers = [])\n {\n $url = $this->formatUrl($url, $url !== 'current/Me', $url == $this->nextUrl);\n\n try {\n $request = $this->createRequest('GET', $url, null, $params, $headers);\n $response = $this->client()->send($reque... | [
"public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================... | codesearchnet | {
"query": "Represent the sentence about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Software development:"
} |
helper function to schedule retry future. no in iOS code. | [
"private void scheduleRetryFuture() {\n Log.v(Log.TAG_SYNC, \"%s: Failed to xfer; will retry in %d sec\", this, RETRY_DELAY_SECONDS);\n synchronized (executor) {\n if (!executor.isShutdown()) {\n this.retryFuture = executor.schedule(new Runnable() {\n publi... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *GetShardIteratorInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetShardIteratorInput\"}\n\tif s.ShardId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ShardId\"))\n\t}\n\tif s.ShardId != nil && len(*s.ShardId) < 1 {\n\t\tinvalidParams.Add(request.NewErrPar... | [
"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:"
} |
Synchronize methods in the given class.
Only synchronize the methods whose names are
given, or all methods if names=None. | [
"def synchronize(klass, names=None):\n \"\"\"\"\"\"\n\n # basestring does not exist on Python 3\n try:\n basestring\n except NameError:\n basestring = (str, bytes)\n\n if isinstance(names, basestring):\n names = names.split()\n for (name, val) in list(klass.__dict__.items()):\... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Deletes an entity by it's id but tunnels DELETE through POST
<p>Example url: /api/v1/person/99?_method=DELETE | [
"@PostMapping(value = \"/{entityTypeId}/{id}\", params = \"_method=DELETE\")\n @ResponseStatus(NO_CONTENT)\n public void deletePost(\n @PathVariable(\"entityTypeId\") String entityTypeId, @PathVariable(\"id\") String untypedId) {\n delete(entityTypeId, untypedId);\n }"
] | [
"def fetch_all_records(self):\n \n \"\"\"\n api = self.doapi_manager\n return map(self._record, api.paginate(self.record_url, 'domain_records'))"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about AWS Route 53:"
} |
Write file at the specified path with content.
If file exists, it will be overwritten. | [
"def write_file(file_path, content):\n \n handler = open(file_path, 'w+')\n handler.write(content)\n handler.close()"
] | [
"def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ... | codesearchnet | {
"query": "Represent the text about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code about programming:"
} |
Build the RelationMap objects for this table relationships | [
"public function buildRelations()\n {\n $this->addRelation('Skill', '\\\\gossi\\\\trixionary\\\\model\\\\Skill', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':skill_id',\n 1 => ':id',\n ),\n), 'CASCADE', null, null, false);\n $this->addRelation('StructureNodeParentRelatedBySt... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// GET /v1/agent/connect/proxy/:proxy_service_id
//
// Returns the local proxy config for the identified proxy. Requires token=
// param with the correct local ProxyToken (not ACL token). | [
"func (s *HTTPServer) AgentConnectProxyConfig(resp http.ResponseWriter, req *http.Request) (interface{}, error) {\n\t// Get the proxy ID. Note that this is the ID of a proxy's service instance.\n\tid := strings.TrimPrefix(req.URL.Path, \"/v1/agent/connect/proxy/\")\n\n\t// Maybe block\n\tvar queryOpts structs.Query... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Get list of cvs delimiters
@return array suitable for selection box | [
"public static function get_delimiter_list() {\n global $CFG;\n $delimiters = array('comma'=>',', 'semicolon'=>';', 'colon'=>':', 'tab'=>'\\\\t');\n if (isset($CFG->CSV_DELIMITER) and strlen($CFG->CSV_DELIMITER) === 1 and !in_array($CFG->CSV_DELIMITER, $delimiters)) {\n $delimiters['... | [
"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 Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
TODO: Don't delete terms until after processing posts. This will allow us to use keywords without defining all of them upfront. | [
"function deleteTerms( termMap, existingTerms, callback ) {\n\t\t\tif ( this.verbose ) {\n\t\t\t\tthis.log( \"Deleting old terms...\" );\n\t\t\t}\n\n\t\t\tasync.map( Object.keys( existingTerms ), function( taxonomy, callback ) {\n\t\t\t\tvar terms = existingTerms[ taxonomy ];\n\t\t\t\tthis.forEach( Object.keys( ter... | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Ensure a unique name, rename if needed.<br>
确保名称不重复,如果有必要就改名。
<p>
This method is multi-threads safe.
<p>
这个方法是多线程安全的。
@param name The original name<br>原名称
@return Same as the original name if or renamed<br>与原名称相同,或被自动改名 | [
"public String deduplicate(String name){\r\n\t\tlong id = nextId(name);\r\n\t\tif (id == 0){\t// the first one\r\n\t\t\treturn name;\r\n\t\t}else{\r\n\t\t\treturn String.format(renamePattern, name, id);\r\n\t\t}\r\n\t}"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about text processing:"
} |
Returns errors of the model state.
@param string $key If the key is specified, only errors for the specified key will be returned.
@return array | [
"public function getErrors($key = null) {\n if (isset($key)) {\n return !empty($this->errors[$key]) ? $this->errors[$key] : array();\n }\n else {\n return $this->errors;\n }\n }"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
singledispatch decorate of both functools.singledispatch and func | [
"def singledispatch(*, nargs=None, nouts=None, ndefs=None):\n \n\n def wrapper(f):\n return wraps(f)(SingleDispatchFunction(f, nargs=nargs, nouts=nouts, ndefs=ndefs))\n\n return wrapper"
] | [
"def _iter_refs(obj, named):\n '''\n '''\n r = _getreferents(obj) # special case\n return _refs(r, named, itor=_nameof(obj) or 'iteref')"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
The workhorse for resolving dependencies
@class Kernel | [
"function Kernel(){\n this.registrations = new Registrations()\n this.decorators = new Decorators()\n this.resolvers = {}\n this.activators = {}\n this._inflight = new Inflight(this.decorators)\n registerSystemServices.call(this)\n}"
] | [
"@Override\n public void performFileBasedAction(Collection<File> files) {\n Tr.audit(tc, \"LTPA_KEYS_TO_LOAD\", keyImportFile);\n submitTaskToCreateLTPAKeys();\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software Development:"
} |
Perform basic configuration of Ceph. | [
"def configure(service, key, auth, use_syslog):\n \"\"\"\"\"\"\n add_key(service, key)\n create_key_file(service, key)\n hosts = get_ceph_nodes()\n with open('/etc/ceph/ceph.conf', 'w') as ceph_conf:\n ceph_conf.write(CEPH_CONF.format(auth=auth,\n keyrin... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Crop a new Alternative if required
@param FormInterface $form | [
"protected function cropAlternative(FormInterface $form)\n {\n $needFlush = false;\n foreach ($this->thumbnailConfig as $format => $parameters) {\n $x = $form->get('coordinates')->get($format)->get('x')->getData();\n $y = $form->get('coordinates')->get($format)->get('y')->getD... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetCreatedDate sets the CreatedDate field's value. | [
"func (s *GetLayerVersionByArnOutput) SetCreatedDate(v string) *GetLayerVersionByArnOutput {\n\ts.CreatedDate = &v\n\treturn s\n}"
] | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Starts a development server for the zengine application | [
"def run(self):\n \n print(\"Development server started on http://%s:%s. \\n\\nPress Ctrl+C to stop\\n\" % (\n self.manager.args.addr,\n self.manager.args.port)\n )\n if self.manager.args.server_type == 'falcon':\n self.run_with_falcon()\n el... | [
"@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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Sets a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@param mixed $value field value
@return void | [
"public function setByPosition($pos, $value)\n {\n switch ($pos) {\n case 0:\n $this->setId($value);\n break;\n case 1:\n $this->setUsername($value);\n break;\n case 2:\n $this->setPassword($value);... | [
"@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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Default sections to used when --configure-sections is not set.
@return [Array] Section objects. | [
"def default_sections\n [\n Section.new(name: \"summary\", prefix: @options[:summary_prefix], labels: @options[:summary_labels], options: @options, body_only: true),\n Section.new(name: \"breaking\", prefix: @options[:breaking_prefix], labels: @options[:breaking_labels], options: @options),\n ... | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
This class provides helpers to load JavaScript resources and JSON data.
@class Loader | [
"function Loader () {\n var FINAL_STATES = {'loaded': true, 'complete': true, 4: true}\n var head = document.getElementsByTagName('head')[0]\n var pending = {}\n var counter = 0\n return {\n /**\n * @private\n * @callback dataCallback\n * @memberof Loader.prototype\n * @param {object|string}... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// List users that can access an app. | [
"func List(c *client.Client, appID string) ([]string, error) {\n\tbody, err := c.BasicRequest(\"GET\", fmt.Sprintf(\"/v1/apps/%s/perms/\", appID), nil)\n\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\n\tvar users api.PermsAppResponse\n\tif err = json.Unmarshal([]byte(body), &users); err != nil {\n\t\treturn... | [
"@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 description about App development:",
"pos": "Represent the code about App development:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(CreateClassifierRequest createClassifierRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (createClassifierRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marsh... | [
"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:"
} |
Verifies that installed minimum git version is met.
@param string $minimum_version
The minimum git version that is required.
@return bool
TRUE if minimum version is satisfied. | [
"public function isGitMinimumVersionSatisfied($minimum_version) {\n exec(\"git --version | cut -d' ' -f3\", $output, $exit_code);\n if (version_compare($output[0], $minimum_version, '>=')) {\n return TRUE;\n }\n return FALSE;\n }"
] | [
"def collect_manifest_dependencies(manifest_data, lockfile_data):\n \"\"\"\"\"\"\n output = {}\n\n for dependencyName, dependencyConstraint in manifest_data.items():\n output[dependencyName] = {\n # identifies where this dependency is installed from\n 'source': 'example-package... | codesearchnet | {
"query": "Represent the summarization about Logistics:",
"pos": "Represent the code about Logistics:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.