query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Incrementally return lists of elements in a set. Also return a cursor indicating the scan position. ``match`` allows for filtering the keys by pattern ``count`` allows for hint the minimum number of returns
[ "def sscan(self, name, cursor=0, match=None, count=None):\n \n pieces = [name, cursor]\n if match is not None:\n pieces.extend([Token.get_token('MATCH'), match])\n if count is not None:\n pieces.extend([Token.get_token('COUNT'), count])\n return self.execute_...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
We didn't just match an int but the int is what we need.
[ "def rx_int_extra(rxmatch):\n \n\n rxmatch = re.search(\"\\d+\", rxmatch.group(0))\n return int(rxmatch.group(0))" ]
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Remove a prefix string from the beginning of a string @param string $prefix @return StdString
[ "function stripPrefix($prefix)\n {\n $key = (string) $this;\n\n if (substr($key, 0, strlen($prefix)) == $prefix)\n $key = substr($key, strlen($prefix));\n\n return new self($key);\n }" ]
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Reblog a given post @param blogName the name of the blog to post to @param postId the id of the post @param reblogKey the reblog_key of the post @return The created reblog Post or null
[ "public Post postReblog(String blogName, Long postId, String reblogKey) {\n return this.postReblog(blogName, postId, reblogKey, null);\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// GetAllVersions returns all credential versions for a given credential name. The returned credentials will be encoded as a list of maps and may be of any type.
[ "func (ch *CredHub) GetAllVersions(name string) ([]credentials.Credential, error) {\n\tquery := url.Values{}\n\tquery.Set(\"name\", name)\n\n\treturn ch.makeMultiCredentialGetRequest(query)\n}" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Creates a key on the specified account. You must supply a valid key // that is unique across the Bitbucket service.
[ "func (r *RepoKeyResource) Update(owner, slug, key, label string, id int) (*Key, error) {\n\t// There is actually no API to update an existing key\n\tr.Delete(owner, slug, id)\n\treturn r.Create(owner, slug, key, label)\n}" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about AWS S3:" }
Returns service ID from the <service> element of the appengine-web.xml, or null if it is missing. Will also look at module ID.
[ "@Nullable\n public String getServiceId() throws AppEngineException {\n String serviceId = getText(getNode(document, \"appengine-web-app\", \"service\"));\n if (serviceId != null) {\n return serviceId;\n }\n return getText(getNode(document, \"appengine-web-app\", \"module\"));\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 comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Recursively unlinks a directory @param string $dir The target directory that will be removed @param bool TRUE on success or FALSE on failure
[ "public static function recursiveUnlink($dir) {\n $result = TRUE;\n\n if(is_dir($dir)) {\n foreach(scandir($dir) as $sub) {\n if(in_array($sub, ['.', '..'])) continue;\n $result &= self::recursiveUnlink(\"$dir/$sub\");\n }\n\n $result &= r...
[ "function (src, target) {\n /*\n * Copy a file from one path relative to the src, to another relative to the\n * target.\n * @param {String} from - the path to copy from, relative to the src.\n * @param {String} to - the path to copy to.\n * @return {Promise} - promise to copy\n */\n this.copy = funct...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Set the env pair @param string $key @param string $val @param bool $overload @access protected
[ "protected function setEnv(\n /*# string */ $key,\n /*# string */ $val,\n /*# bool */ $overload\n ) {\n if ($overload || false === getenv($key)) {\n // set env\n putenv(\"$key=$val\");\n\n // also populate $_ENV\n $_ENV[$key] = $val;\n ...
[ "public function handle()\n {\n $args = [\n 'name' => $this->argumentName(),\n '--type' => strtolower($this->type), // settings type\n '--plain' => $this->optionPlain(), // if plain stub\n '--force' => $this->optionForce(), // force override\n '--...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
公众号网页授权获取用户信息 @param string $scope @return array|bool
[ "public function getOpenId($scope = 'snsapi_base'){\n if(isset($_GET['code'])){\n $code = $_GET['code'];\n $url = $this->apiUrl.\"/sns/oauth2/access_token?appid=\".self::$config['appId'].\"&secret=\".self::$config['appSecret'].\"&code={$code}&grant_type=authorization_code\";\n ...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
recursive part of generate_copy_in
[ "def recursive_generate_copy_in(copy_in, current_path)\n limited_files_of(current_path) { |file| copy_in << file }\n directories_of(current_path) do |dir|\n recursive_generate_copy_in(copy_in, ::File.join(dir))\n end\n true\n end" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Make a GET request.
[ "private <T> PubsubFuture<T> get(final String operation, final String path, final ResponseReader<T> responseReader) {\n return request(operation, HttpMethod.GET, path, responseReader);\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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Boot model events
[ "protected static function boot()\n {\n parent::boot();\n\n static::addGlobalScope(new MailingScope);\n\n static::creating(function ($node)\n {\n if (empty($node->published_at))\n {\n $node->published_at = Carbon::now();\n }\n\n ...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
The end position of given tree, if it is a block with defined endpos.
[ "public static int endPos(JCTree tree) {\n if (tree.hasTag(BLOCK) && ((JCBlock) tree).endpos != Position.NOPOS)\n return ((JCBlock) tree).endpos;\n else if (tree.hasTag(SYNCHRONIZED))\n return endPos(((JCSynchronized) tree).body);\n else if (tree.hasTag(TRY)) {\n ...
[ "function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n }" ]
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Parse run files generated by Cluster Flow. Currently gets pipeline IDs and associated steps.
[ "def parse_clusterflow_runfiles(self, f):\n \n\n data = dict()\n in_comment = False\n seen_pipeline = False\n cf_file = False\n for l in f['f']:\n l = l.rstrip()\n # Check that this is from Cluster Flow\n if 'Cluster Flow' in l:\n ...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Parse two input arguments and return two lists of file names
[ "def parse_path(f1, f2):\n\n \"\"\"\"\"\"\n\n import glob\n\n # if second argument is missing or is a wild card, point it\n # to the current directory\n f2 = f2.strip()\n if f2 == '' or f2 == '*':\n f2 = './'\n\n # if the first argument is a directory, use all GEIS files\n if os.path....
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// CloudBackupDeleteAll mocks base method
[ "func (m *MockVolumeDriver) CloudBackupDeleteAll(arg0 *api.CloudBackupDeleteAllRequest) error {\n\tret := m.ctrl.Call(m, \"CloudBackupDeleteAll\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see org.apache.log4j.FileAppender#setQWForFiles(java.io.Writer)
[ "protected final void setQWForFiles(final Writer writer) {\n\t\tfinal SynchronizedCountingQuietWriter countingQuietWriter = new SynchronizedCountingQuietWriter(writer, super.getErrorHandler());\n\t\tthis.getProperties().setCountingQuietWriter(countingQuietWriter);\n\t\tsuper.qw = countingQuietWriter;\n\t}" ]
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets the presenceOfN=O attribute of the XLogPDescriptor object. @param ac Description of the Parameter @param atom Description of the Parameter @return The presenceOfNitor [boolean]
[ "private boolean getPresenceOfNitro(IAtomContainer ac, IAtom atom) {\n List neighbours = ac.getConnectedAtomsList(atom);\n List second = null;\n IBond bond = null;\n //int counter = 0;\n for (int i = 0; i < neighbours.size(); i++) {\n IAtom neighbour = (IAtom) neighbour...
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// handleTaskOnce handles single copTask, successful results are send to channel. // If error happened, returns error. If region split or meet lock, returns the remain tasks.
[ "func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask, ch chan<- *copResponse) ([]*copTask, error) {\n\tfailpoint.Inject(\"handleTaskOnceError\", func(val failpoint.Value) {\n\t\tif val.(bool) {\n\t\t\tfailpoint.Return(nil, errors.New(\"mock handleTaskOnce error\"))\n\t\t}\n\t})\n\n\tsender ...
[ "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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
register the service provider @return void
[ "public function register()\n {\n //register commands\n $this->commands([\n Commands\\HelperMakeCommand::class,\n ]);\n\n //include the active package helpers\n foreach (config('helpers.package_helpers', []) as $activeHelper) {\n\n $file = __DIR__ . '/Help...
[ "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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
// Set cookie with https.
[ "func (manager *Manager) isSecure(req *http.Request) bool {\n\tif !manager.config.Secure {\n\t\treturn false\n\t}\n\tif req.URL.Scheme != \"\" {\n\t\treturn req.URL.Scheme == \"https\"\n\t}\n\tif req.TLS == nil {\n\t\treturn false\n\t}\n\treturn true\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create vertical exit animation keyframes for the art @param array $lines @param string $line_method @return array
[ "protected function exitVerticalFrames(array $lines, $line_method)\n {\n $keyframes = [];\n $line_count = count($lines);\n\n for ($i = $line_count - 1; $i >= 0; $i--) {\n $keyframes[] = $this->$line_method($lines, $line_count, $i);\n }\n\n return $keyframes;\n }"...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Register bindings for the Handler Locator. @return void
[ "protected function registerLocator()\n {\n $this->app->singleton('tactician.locator', function($app) {\n\n $commandNamespace = $this->config('command_namespace');\n $handlerNamespace = $this->config('handler_namespace');\n $locator = $this->config('locator');\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:" }
Retrieves information on the current type of network connection that the device is using
[ "protected NetworkInfo getActiveNetworkInfo() {\n ConnectivityManager connectivityManager\n = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);\n return connectivityManager.getActiveNetworkInfo();\n }" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the html code for a specific children @param string path Path to the node. @param integer pos Element position. @return string The html code of the node.
[ "public function html($path=null, $pos=0) {\n\t\tif($path === null)\n\t\t\treturn $this->code;\n\t\treturn $this->item($path, $pos)->html();\n\t}" ]
[ "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:" }
// Decode docode with custom alphabet
[ "func Decode(input string, alphabet *Alphabet) ([]byte, error) {\n\tcapacity := utf8.RuneCountInString(input)*733/1000 + 1 // log(58) / log(256)\n\toutput := make([]byte, capacity)\n\toutputReverseEnd := capacity - 1\n\tvar carry, outputIdx, i int\n\tvar target rune\n\n\t// prefix 0\n\tzero58Byte := alphabet.encode...
[ "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:" }
Check if trigger exists. @param string $trigger_name @return bool
[ "private function triggerExists($trigger_name)\n {\n if ($triggers = $this->getConnection()->execute('SHOW TRIGGERS', $trigger_name)) {\n foreach ($triggers as $trigger) {\n if ($trigger['Trigger'] == $trigger_name) {\n return true;\n }\n ...
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Get element Id from webdriver @return int @throws WebDriver_Exception
[ "public function getElementId()\n {\n if ($this->elementId === null) {\n $param = WebDriver_Util::parseLocator($this->locator);\n $commandUri = (null === $this->parent) ? 'element' : \"element/{$this->parent->getElementId()}/element\";\n $command = $this->driver->factoryCo...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// CreateZFBAutoAssignment creates a new child ZFBAutoAssignment under the Me
[ "func (o *Me) CreateZFBAutoAssignment(child *ZFBAutoAssignment) *bambou.Error {\n\n\treturn bambou.CurrentSession().CreateChild(o, child)\n}" ]
[ "@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// node returns a node at the given path, constructing it if necessary. // // 'path' here has a form "a/b/c", relative to the absolute root ("").
[ "func (g *metadataGraph) node(path string) *metadataNode {\n\tcur := g.root\n\tif path != \"\" {\n\t\tfor _, elem := range strings.Split(path, \"/\") {\n\t\t\tcur = cur.child(elem)\n\t\t}\n\t}\n\treturn cur\n}" ]
[ "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:" }
calculate magnetic field strength from raw magnetometer
[ "def get_motor_offsets(SERVO_OUTPUT_RAW, ofs, motor_ofs):\n ''''''\n import mavutil\n self = mavutil.mavfile_global\n\n m = SERVO_OUTPUT_RAW\n motor_pwm = m.servo1_raw + m.servo2_raw + m.servo3_raw + m.servo4_raw\n motor_pwm *= 0.25\n rc3_min = self.param('RC3_MIN', 1100)\n rc3_max = self.pa...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
log the response and return the result of the configured handler method. @param Zend_Http_Response $response @param string $uri @return string response body or empty
[ "protected function _processResponse(Zend_Http_Response $response, $uri)\n {\n $this->_status = $response->getStatus();\n $config = $this->_getHandlerConfig($this->_getHandlerKey($response));\n $logMethod = isset($config['logger']) ? $config['logger'] : 'debug';\n $logData = array_mer...
[ "public function setRequestHeader($name, $value) {\n $header = array();\n $header[$name] = $value;\n //TODO: as a limitation of the driver it self, we will send permanent for the moment\n $this->browser->addHeader($header, true);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Return true if the name looks like a class name or a constant name.
[ "private static boolean isClassOrConstantName(String name) {\n return name != null && name.length() > 1 && Character.isUpperCase(name.charAt(0));\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
-------------------------- container processes (for one container)
[ "function dockerContainerProcesses(containerID, callback) {\n containerID = containerID || '';\n let result = [];\n return new Promise((resolve) => {\n process.nextTick(() => {\n if (containerID) {\n\n if (!_docker_socket) {\n _docker_socket = new DockerSocket();\n }\n\n _do...
[ "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:" }
// NewRouter initializes returns a new router instance with all the configurations and routes set
[ "func NewRouter(cfg *Config, routes []*Route) *Router {\n\thandlers := httpHandlers(routes)\n\tr := &Router{\n\t\toptHandlers: handlers[http.MethodOptions],\n\t\theadHandlers: handlers[http.MethodHead],\n\t\tgetHandlers: handlers[http.MethodGet],\n\t\tpostHandlers: handlers[http.MethodPost],\n\t\tputHandl...
[ "function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
The Callback to start editing the next/previous property/selector. @param {boolean} alreadyNew @param {boolean} valueChanged @param {!WebInspector.StylePropertiesSection} section @this {WebInspector.StylePropertyTreeElement}
[ "function moveToNextCallback(alreadyNew, valueChanged, section)\n {\n if (!moveDirection)\n return;\n\n // User just tabbed through without changes.\n if (moveTo && moveTo.parent) {\n moveTo.startEditing(!isEditingName ? moveTo.nameElement : move...
[ "function load() {\n Inspector.Page.on(\"frameNavigated.CSSAgent\", _onFrameNavigated);\n Inspector.CSS.on(\"styleSheetAdded.CSSAgent\", _styleSheetAdded);\n Inspector.CSS.on(\"styleSheetRemoved.CSSAgent\", _styleSheetRemoved);\n\n // getAllStyleSheets was deleted beginning with Chrome 3...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Call a function on this object @param method @param args @return @throws Exception
[ "public UiSelector call(String method, Object ... args) throws Exception {\n new QueryBuilder().retrieveResult(storedId).call(method, args).storeResult(storedId).execute();\n return this;\n }" ]
[ "def bind(self, fn: \"Callable[[Any], Reader]\") -> 'Reader':\n \n \"\"\"\n return Reader(lambda x: fn(self.run(x)).run(x))" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Recursively set the chmod for files to 0600 and 0700 for folders. It's ok unless we need something more specific. Args: target (str): Root file or folder
[ "def chmod(target):\n \n assert isinstance(target, str)\n assert os.path.exists(target)\n\n file_mode = stat.S_IRUSR | stat.S_IWUSR\n folder_mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR\n\n # Remove the immutable attribute recursively if there is one\n remove_immutable_attribute(target)\n\...
[ "def _unzip_file(filepath):\n \n\n temp_dir = tempfile.mkdtemp()\n\n if os.name == 'posix':\n os.chmod(temp_dir, 0o755)\n\n LOG.info(\"Decompressing %s\", filepath)\n\n unzip(filepath, temp_dir)\n\n # The directory that Python returns might have symlinks. The Docker File sharing settings wi...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns dependency information about two packages: 0: A does not depend, directly or indirectly, on B; 1: A depends indirectly on B; 2: A depends directly on B.
[ "def package_depends_on(self, name_a, name_b):\n \n assert self._context\n if self._dependency_lookup is None:\n self._dependency_graph = self._context.get_dependency_graph()\n self._dependency_lookup = accessibility(self._dependency_graph)\n\n downstream = self._de...
[ "function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
define a tumbling ingestion time window @param size window size
[ "public BaseWindowedBolt<T> ingestionTimeWindow(Time size) {\n long s = size.toMilliseconds();\n ensurePositiveTime(s);\n\n setSizeAndSlide(s, DEFAULT_SLIDE);\n this.windowAssigner = TumblingIngestionTimeWindows.of(s);\n return this;\n }" ]
[ "def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// New creates a new Clientset for the given RESTClient.
[ "func New(c rest.Interface) *Clientset {\n\tvar cs Clientset\n\tcs.nodeV1alpha1 = nodev1alpha1.New(c)\n\n\tcs.DiscoveryClient = discovery.NewDiscoveryClient(c)\n\treturn &cs\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
@param ObjectValue\DependencyConstraint $constraint @return Result\ValidationResult
[ "public function visitDependencyConstraint(ObjectValue\\DependencyConstraint $constraint)\n {\n $value = $this->currentValue();\n if (\n !$value instanceof Value\\ObjectValue ||\n !$value->has($constraint->property())\n ) {\n return $this->createResult();\n ...
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Create the Carousel. @method createCarousel @param elId {String} The id of the element to be created @protected
[ "function (elId) {\n var carousel = this,\n cssClass = carousel.CLASSES,\n el = Dom.get(elId);\n\n if (!el) {\n el = createElement(\"DIV\", {\n className : cssClass.CAROUSEL,\n id : elId\n ...
[ "function(element, options) {\n\n var $el = $(element);\n // React on every server/socket.io message.\n // If the element is defined with a data-react-on-event attribute\n // we take that as an eventType the user wants to be warned on this\n // element and we forward the event via jQuery events on $(...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Internal method to clear thumbnails @param array $filenames Filenames @return int|bool Number of thumbnails deleted otherwise `false` in case of error
[ "protected function _clear($filenames)\n {\n $count = 0;\n\n foreach ($filenames as $filename) {\n if (!(new File($this->getPath($filename)))->delete()) {\n return false;\n }\n\n $count++;\n }\n\n return $count;\n }" ]
[ "protected function updateActionInternal(ModelInterface $entity) {\n $params = new Params($this->request);\n if(is_array($params->getParams())) {\n throw new Exception('Bulk Updating is not supported: An array of objects was passed in', 400);\n }\n $this->saveEntity($params->g...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Merges the current resource with another resource instance. The merge objects must represent the same resource but can come from multiple methods. @param resource the resource object to merge
[ "public void merge(Resource resource) {\n if (resource == null) {\n return;\n }\n\n checkRel(resource);\n checkHrefs(resource);\n\n if (resource.templated()) {\n this.pathParams.putAll(resource.pathParams);\n this.queryParams.putAll(resource.queryP...
[ "def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Add a new observer for a given property @param {object} observer object with a onPropChange() method @param {string} property the property name to observe (optional)
[ "function (observer, property) {\n if (!property)\n property = ALL;\n var arr = this.props[property];\n if (!arr) {\n // property is not observed yet\n arr = [];\n this.props[property] = arr;\n }\n arr.push(observer);\n }" ]
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Sets to indicate one LZMA symbol (literal, rep, or match).
[ "void set1(int newPrice, int optCur, int back) {\n price = newPrice;\n optPrev = optCur;\n backPrev = back;\n prev1IsLiteral = false;\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 Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
:type identifiers: SimpleIdentifierCollection
[ "def notify_event(self, session_info, topic):\n \n try:\n self.event_bus.sendMessage(topic, items=session_info)\n except AttributeError:\n msg = \"Could not publish {} event\".format(topic)\n raise AttributeError(msg)" ]
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Regular expressions:" }
Obtiene una variable de la sesion. @param string $llave @param mixed $valorAlterno @return mixed
[ "public function obtener($llave, $valorAlterno = null)\n {\n $this->requerirInicio();\n\n return isset($this->datos[$llave]) ? $this->datos[$llave] : $valorAlterno;\n }" ]
[ "private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
このクラスのインスタンスを返します。 @static @param string $class_name 保持するクラス名 @return \ickx\fw2\container\DI このクラスのインスタンス
[ "protected static function _GetInstance ($class_name) {\n\t\treturn (isset(static::$_instanceList[$class_name])) ? static::$_instanceList[$class_name] : static::$_instanceList[$class_name] = new static($class_name);\n\t}" ]
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// Upsert mocks base method
[ "func (m *MockClient) Upsert(arg0 context.Context, arg1 []string, arg2 dosa.DomainObject) error {\n\tret := m.ctrl.Call(m, \"Upsert\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// readDataFromResponse read the data to result. Returns true means the resp is finished.
[ "func (r *streamResult) readDataFromResponse(ctx context.Context, resp kv.Response, result *tipb.Chunk) (bool, error) {\n\tresultSubset, err := resp.Next(ctx)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif resultSubset == nil {\n\t\treturn true, nil\n\t}\n\n\tvar stream tipb.StreamResponse\n\terr = stream.Unm...
[ "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 Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
@param null|string $dir @param null|string $copyTo @return string
[ "public function package($dir = null, $copyTo = null)\n {\n if (true === $this->getPhpunitService()->hasSupport()) {\n $this->getPhpunitService()->test($dir);\n }\n\n $box = $this->getJsonService()->parseFile('box.json');\n $file = $box['output'];\n\n $this->getFiles...
[ "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 Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Map a database name to the Cluster that holds the database. Args: dbname: A database name. Returns: A dict containing the information about the Cluster that holds the database.
[ "def _match_dbname(self, dbname):\n \n for config in self._clusters:\n if re.match(config['pattern'], dbname):\n return config\n raise Exception('No such database %s.' % dbname)" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the text about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about AWS S3:" }
Apply a drop shadow by copying elements and giving them different strokes @param {Boolean|Object} shadowOptions
[ "function (shadowOptions, group, cutOff) {\n\t\tvar shadows = [],\n\t\t\ti,\n\t\t\telement = this.element,\n\t\t\trenderer = this.renderer,\n\t\t\tshadow,\n\t\t\telemStyle = element.style,\n\t\t\tmarkup,\n\t\t\tpath = element.path,\n\t\t\tstrokeWidth,\n\t\t\tmodifiedPath,\n\t\t\tshadowWidth,\n\t\t\tshadowElementOpa...
[ "function get_margin_width() {\n //ignore image width, use same width as on predefined bullet List_Bullet_Frame_Decorator\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n //H...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Set the token from session manager.
[ "protected function setSessionToken()\n {\n $token = $this->session->get('twitter.oauth_token');\n $tokenSecret = $this->session->get('twitter.oauth_token_secret');\n\n $this->setToken($token, $tokenSecret);\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
@param array $claims @param int $ttl @return string
[ "public function encode($claims, $ttl = null)\n {\n if (!$this->_key) {\n throw new MisuseException('Jwt key is not set');\n }\n\n $key = is_string($this->_key) ? $this->_key : $this->_key[0];\n\n $claims['iat'] = time();\n $claims['exp'] = time() + ($ttl ?: $this->_...
[ "function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Convert objects into JSON structures.
[ "def serialize(obj):\n \"\"\"\"\"\"\n # Record class and module information for deserialization\n result = {'__class__': obj.__class__.__name__}\n try:\n result['__module__'] = obj.__module__\n except AttributeError:\n pass\n # Convert objects to dictionary representation based on ty...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Migrates the emailflag status values in order table to the order status table. @param array $stmts Associative array of tables names and lists of SQL statements to execute.
[ "protected function _process( array $stmts )\n\t{\n\t\t$this->_msg( 'Fixing order email status values', 0 );\n\n\t\tif( $this->_schema->tableExists( 'mshop_order_status' ) === true )\n\t\t{\n\t\t\t$this->_execute( $stmts['update'] );\n\n\t\t\t$mapping = array(\n\t\t\t\t0 => 'email-deleted',\n\t\t\t\t1 => 'email-pen...
[ "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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
The same as calling ``client.getReviews(build.setID)``. :returns: A list of :class:`brickfront.review.Review` objects. :rtype: list
[ "def getReviews(self):\n '''\n \n '''\n\n self._reviews = self._client.getReviews(self.setID)\n return self._reviews" ]
[ "def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
generates a report showing nine slices, three per axis, of an arbitrary volume of `in_files`, with the resulting segmentation overlaid
[ "def _post_run_hook(self, runtime):\n ''' '''\n self._anat_file = self.inputs.in_files[0]\n outputs = self.aggregate_outputs(runtime=runtime)\n self._mask_file = outputs.tissue_class_map\n # We are skipping the CSF class because with combination with others\n # it only sho...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewCommentNode returns a CommentNode.
[ "func NewCommentNode(data string, p Pos) *CommentNode {\n\treturn &CommentNode{NewTextNode(data, p), TrimmableNode{}}\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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Construct a new `AbstractMethodError`. @param [Object] instance Instance that invoked the abstract method. @param [Symbol | String] method_name Name of abstract method. #initialize
[ "def method_instance\n lazy_var :@method_instance do\n # Just drop a warning if we can't get the method object\n logger.catch.warn(\n \"Failed to get method\",\n instance: instance,\n method_name: method_name,\n ) do\n instance.method method_name\n end\n end\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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Append slider display related fields @param Form $form The form @param Front $subject The StoreFront tab @return FrontPlugin
[ "private function appendSliderDisplayRelatedFields($form, $subject)\n {\n $attribute = $this->getAttribute();\n $isAttributeDecimal = $attribute->getBackendType() == 'decimal' || $attribute->getFrontendClass() == 'validate-number';\n\n if ($isAttributeDecimal && ($attribute->getFron...
[ "public function Base_GetAppSettingsMenuItems_Handler($Sender) {\n $Menu = &$Sender->EventArguments['SideMenu'];\n $Menu->AddItem('Forum', T('Forum'));\n $Menu->AddLink('Forum', T('Tagging'), 'settings/tagging', 'Garden.Settings.Manage');\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Session returns a new session, never returns an error
[ "func Session(r *http.Request, name string) *sessions.Session {\n\tsession, _ := Store.Get(r, name)\n\treturn session\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Updates the content types database with the given configuration. :param config: The configuration dictionary. :param config_filename: The path of the configuration file.
[ "def add_config(self, config, config_filename):\n \n content_types = config['content-types']\n comment_groups = config['comment-groups']\n\n self._comment_groups.update(comment_groups)\n self._content_types.update(content_types)\n\n for content_type, patterns in content_typ...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Origin returns the route that originates the column.
[ "func (c *column) Origin() builder {\n\t// If it's a route, we have to resolve it.\n\tif rb, ok := c.origin.(*route); ok {\n\t\treturn rb.Resolve()\n\t}\n\treturn c.origin\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 sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Returns all trains that are due to start in the next 10 minutes @param train_type: ['mainline', 'suburban', 'dart']
[ "def get_all_current_trains(self, train_type=None, direction=None):\n \n params = None\n if train_type:\n url = self.api_base_url + 'getCurrentTrainsXML_WithTrainType'\n params = {\n 'TrainType': STATION_TYPE_TO_CODE_DICT[train_type]\n }\n ...
[ "def ImportTrips(self, trips_file):\n \"\"\n for trip_id, trip_starttime, line, strli, direction, \\\n stoptime_id, schedule_id, daytype_id, restriction_id, \\\n dest_station_id, dest_stop_id, trip_type in \\\n ReadCSV(trips_file,\n ['FRT_FID', 'FRT_START', 'LI_NR', 'STR_LI_...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
To do offset storage we let the topology drain itself out. Then we commit.
[ "public void maybeDoOffset(){\n long seen = tuplesSeen;\n if (offsetCommitInterval > 0 && seen % offsetCommitInterval == 0 && offsetStorage != null && fp.supportsOffsetManagement()){\n doOffsetInternal();\n }\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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Create an argument parser. Args: prog: The name of the program to use when outputting help text. Returns: An argparse.ArgumentParser built to specification.
[ "def MakeParser(prog):\n \n\n def AddStandardOptions(parser, *args):\n \"\"\"Add common endpoints options to a parser.\n\n Args:\n parser: The parser to add options to.\n *args: A list of option names to add. Possible names are: application,\n format, output, language, service, and discover...
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// IsPlain returns true, if the the MIME headers define a valid 'text/plain' or 'text/html' part. If // the emptyContentTypeIsPlain argument is set to true, a missing Content-Type header will result in // a positive plain part detection.
[ "func IsPlain(header mail.Header, emptyContentTypeIsPlain bool) bool {\n\tctype := header.Get(\"Content-Type\")\n\tif ctype == \"\" && emptyContentTypeIsPlain {\n\t\treturn true\n\t}\n\n\tmediatype, _, err := mime.ParseMediaType(ctype)\n\tif err != nil {\n\t\treturn false\n\t}\n\tswitch mediatype {\n\tcase \"text/p...
[ "def check_header\n # According to the official DICOM standard, a DICOM file shall contain 128 consequtive (zero) bytes,\n # followed by 4 bytes that spell the string 'DICM'. Apparently, some providers seems to skip this in their DICOM files.\n # Check that the string is long enough to contain a vali...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Tell if two strings are equal, without worry if the first string is null. @param p String reference, which may be null. @param t String reference, which may be null. @return true if strings are equal.
[ "private static final boolean subPartMatch(String p, String t)\n {\n return (p == t) || ((null != p) && (p.equals(t)));\n }" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// healthCheckNode performs a health check on the node and when active updates the status
[ "func (c *cluster) healthCheckNode(node *member) {\n\t// step: wait for the node to become active ... we are assuming a /ping is enough here\n\tticker := time.NewTicker(c.healthCheckInterval)\n\tdefer ticker.Stop()\n\tfor range ticker.C {\n\t\treq, err := c.client.buildMarathonRequest(\"GET\", node.endpoint, \"ping...
[ "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 sentence about Networking:", "pos": "Represent the code about Networking:", "neg": "Represent the code about Software development:" }
Use this API to fetch filtered set of nstrafficdomain resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "public static nstrafficdomain[] get_filtered(nitro_service service, String filter) throws Exception{\n\t\tnstrafficdomain obj = new nstrafficdomain();\n\t\toptions option = new options();\n\t\toption.set_filter(filter);\n\t\tnstrafficdomain[] response = (nstrafficdomain[]) obj.getfiltered(service, option);\n\t\tre...
[ "def get_object(self, group_id, mask=None):\n \n if mask is None:\n mask = \"mask[id, name, createDate, rule, backendRouter[id, hostname],\" \\\n \"guests[activeTransaction[id,transactionStatus[name,friendlyName]]]]\"\n return self.client.call('SoftLayer_Virtual_Pla...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetCloudMetadataWithFormat loads the entire cloud metadata encoded using the specified format. // Exported for testing.
[ "func (indexRef *IndexReference) GetCloudMetadataWithFormat(cons LookupConstraint, format string, requireSigned bool) (*CloudMetadata, error) {\n\tproductFilesPath, err := indexRef.GetProductsPath(cons)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogger.Tracef(\"finding products at path %q\", productFilesPath)\...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Add a MbPage to MocaBonita as main menu @param MbPage $mbPage @return MocaBonita current instance of MocaBonita
[ "public function addMbPage(MbPage $mbPage)\n {\n $mbPage->setSubMenu(false);\n\n $mbPage->setMainMenu(true);\n\n $this->mbPages->put($mbPage->getSlug(), $mbPage);\n\n foreach ($mbPage->getSubPages() as $subPage) {\n $this->addSubMbPage($subPage);\n $subPage->setP...
[ "public function Base_GetAppSettingsMenuItems_Handler($Sender) {\n $Menu = &$Sender->EventArguments['SideMenu'];\n $Menu->AddItem('Forum', T('Forum'));\n $Menu->AddLink('Forum', T('Tagging'), 'settings/tagging', 'Garden.Settings.Manage');\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<p>Evaluate string set properties from string with comma delimeter and removed new lines and trailing spaces.</p> @param pSource string @return LinkedHashSet<String> properties set
[ "public final LinkedHashSet<String> evalPropsStringsSet(final String pSource) {\n String sourceCorr = pSource.replace(\"\\n\", \"\");\n LinkedHashSet<String> resultSet = new LinkedHashSet<String>();\n for (String str : sourceCorr.split(\",\")) {\n resultSet.add(str.trim());\n }\n return resultSe...
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the description about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code about Software development:" }
@param string $foreign_id @param string $time @param array $new_targets @param array $added_targets @param array $removed_targets @return mixed @throws StreamFeedException
[ "public function updateActivityToTargets($foreign_id, $time, $new_targets = [], $added_targets = [], $removed_targets = [])\n {\n $data = [\n 'foreign_id' => $foreign_id,\n 'time' => $time,\n ];\n\n if ($new_targets) {\n $data['new_targets'] = $new_targ...
[ "public function update(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"patch\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
add a new recipient to be addressable by this MessageDispatcher generate a new uuid address if one is not specified
[ "def add(self, transport, address=None):\n \n\n if not address:\n address = str(uuid.uuid1())\n\n if address in self.recipients:\n self.recipients[address].add(transport)\n else:\n self.recipients[address] = RecipientManager(transport, address)\n\n ...
[ "def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// NewNumericRangeInclusiveQuery creates a new Query for ranges // of numeric values. // Either, but not both endpoints can be nil. // Control endpoint inclusion with inclusiveMin, inclusiveMax.
[ "func NewNumericRangeInclusiveQuery(min, max *float64, minInclusive, maxInclusive *bool) *NumericRangeQuery {\n\treturn &NumericRangeQuery{\n\t\tMin: min,\n\t\tMax: max,\n\t\tInclusiveMin: minInclusive,\n\t\tInclusiveMax: maxInclusive,\n\t}\n}" ]
[ "func parseService(svc *structs.ServiceQuery) error {\n\t// Service is required.\n\tif svc.Service == \"\" {\n\t\treturn fmt.Errorf(\"Must provide a Service name to query\")\n\t}\n\n\t// NearestN can be 0 which means \"don't fail over by RTT\".\n\tif svc.Failover.NearestN < 0 {\n\t\treturn fmt.Errorf(\"Bad NearestN...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
comment = ";" *(WSP / VCHAR) CRLF
[ "function comment() {\n var ret = this.seq(\n this.stringf(\";\"),\n this.manyf(this.choicef(WSP, VCHAR)),\n CRLF);\n return new ast.Comment(ret[2]);\n}" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Fetch Item with key equal to value @param $key Object Key @param $value Object Value @return mixed
[ "public function fetch($key, $value)\n\t{\n\t\tforeach ($this->_data as $data)\n\t\t{\n\t\t\tif ($data->get($key) == $value)\n\t\t\t{\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}" ]
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Issues any queuing service jobs up to the limit of the maximum allowed.
[ "def issueQueingServiceJobs(self):\n \"\"\"\"\"\"\n while len(self.serviceJobsToBeIssued) > 0 and self.serviceJobsIssued < self.config.maxServiceJobs:\n self.issueJob(self.serviceJobsToBeIssued.pop())\n self.serviceJobsIssued += 1\n while len(self.preemptableServiceJobsToB...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Creates an instance of the class being reflected using the no-argument constructor. @return A <code>Reflect</code> object to do further reflection @throws ReflectionException Something went wrong constructing the object
[ "public Reflect create() throws ReflectionException {\n try {\n return on(clazz.getConstructor(), accessAll);\n } catch (NoSuchMethodException e) {\n if (accessAll) {\n try {\n return on(clazz.getDeclaredConstructor(), accessAll);\n } catch (NoSuchMethod...
[ "public final void setTemplateMode(final String templateMode) {\n // Setter overload actually goes against the JavaBeans spec, but having this one is good for legacy\n // compatibility reasons. Besides, given the getter returns TemplateMode, intelligent frameworks like\n // Spring will recogniz...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get the header with the given name. The lookup is case insensitive. @param name The name of the header. @return The header value.
[ "public Optional<String> getHeader(String name) {\n PSequence<String> values = lowercaseHeaders.get(name.toLowerCase(Locale.ENGLISH));\n if (values == null || values.isEmpty()) {\n return Optional.empty();\n } else {\n return Optional.of(values.get(0));\n }\n }" ...
[ "function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Gets the element with the given name @param string $name @return IFormElement
[ "public function GetElement($name)\n {\n $element = $this->Elements()->GetElement($name);\n if (!$element)\n {\n throw new \\Exception(Trans('Core.Form.Error.ElementNotFound.Name_{0}', $name));\n }\n return $element;\n }" ]
[ "public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Returns an array of integers that represent the graphical pattern determined by the biomorph's genes. @return A 2-dimensional array containing the 8-element dx and dy arrays required to draw the biomorph.
[ "public int[][] getPatternPhenotype()\n {\n if (phenotype == null)\n {\n // Decode the genes as per Dawkins' rules.\n int[] dx = new int[GENE_COUNT - 1];\n dx[3] = genes[0];\n dx[4] = genes[1];\n dx[5] = genes[2];\n\n dx[1] = -dx[3];...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Register the manager registry
[ "protected function registerManagerRegistry()\n {\n $this->app->singleton(IlluminateRegistry::class, function ($app) {\n\n list($managers, $connections) = $this->setUpEntityManagers();\n\n return new IlluminateRegistry(\n head($managers),\n $connections,...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Derivative of the covariance with respect to the parameters.
[ "def _param_grad_helper(self, dL_dK, X, X2, target):\n \"\"\"\"\"\"\n if (X2 is None) or (X2 is X):\n dL_dKdiag = dL_dK.flat[::dL_dK.shape[0]+1]\n self.dKdiag_dtheta(dL_dKdiag, X, target)" ]
[ "def normalize(self, inplace=True):\n \n phi = self if inplace else self.copy()\n\n # The pdf of a Joint Gaussian distrinution is always\n # normalized. Hence, no changes.\n if not inplace:\n return phi" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Build the landmark operator Calculates spectral clusters on the kernel, and calculates transition probabilities between cluster centers by using transition probabilities between samples assigned to each cluster.
[ "def build_landmark_op(self):\n \n tasklogger.log_start(\"landmark operator\")\n is_sparse = sparse.issparse(self.kernel)\n # spectral clustering\n tasklogger.log_start(\"SVD\")\n _, _, VT = randomized_svd(self.diff_aff,\n n_components=self....
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// RecalculateExpectCount recalculates the expect row count if the origin row count is estimated by pseudo.
[ "func (h *Handle) RecalculateExpectCount(q *statistics.QueryFeedback) error {\n\tt, ok := h.StatsCache.Load().(StatsCache)[q.PhysicalID]\n\tif !ok {\n\t\treturn nil\n\t}\n\ttablePseudo := t.Pseudo || t.IsOutdated()\n\tif !tablePseudo {\n\t\treturn nil\n\t}\n\tisIndex := q.Hist.Tp.Tp == mysql.TypeBlob\n\tid := q.His...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
TEAL interface for the `acscte` function.
[ "def run(configobj=None):\n \n acscte(configobj['input'],\n exec_path=configobj['exec_path'],\n time_stamps=configobj['time_stamps'],\n verbose=configobj['verbose'],\n quiet=configobj['quiet'],\n single_core=configobj['single_core']\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Writes a barcode PNG image. opts: :subset - specify the Code128 subset to use ('A', 'B', or 'C'). remaining options passed through to PNGOutputter.
[ "def create_barcode(opts = {})\n path = barcode_path\n FileUtils.mkdir_p File.dirname(path)\n File.open(path, 'wb') do |f|\n f.write barcode(opts).to_png(self.class.options.merge(opts))\n end\n FileUtils.chmod(0666 &~ File.umask, path)\n end" ]
[ "def generated_postscript?\n return false unless ['.ps', '.eps', '.pfa'].include? extname\n\n # Type 1 and Type 42 fonts converted to PostScript are stored as hex-encoded byte streams; these\n # streams are always preceded the `eexec` operator (if Type 1), or the `/sfnts` key (if Type 42).\n ret...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Create the currency dictionary
[ "def make_ccys(db):\n '''\n \n '''\n dfr = 4\n dollar = r'\\u0024'\n peso = r'\\u20b1'\n kr = r'kr'\n insert = db.insert\n\n # G10 & SCANDI\n insert('EUR', '978', 'EU', 1,\n 'Euro', dfr, 'EU', '30/360', 'ACT/360',\n future='FE', symbol=r'\\u20ac', html='&#x20ac;')\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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set Twig cache directory. @param string $cacheDir
[ "public function setTwigCache($cacheDir)\n {\n if (!is_dir($cacheDir) && (!is_writable(dirname($cacheDir)) || false === @mkdir($cacheDir, 0755))) {\n throw new RendererException(\n sprintf('Unable to create twig cache \"%s\"', $cacheDir),\n RendererException::RENDE...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Return values that are to be shown in repr string.
[ "def _repr_values(self):\n \"\"\"\"\"\"\n def getattr_better(obj, field):\n try:\n return getattr(obj, field)\n except AttributeError as e:\n try:\n return getattr(obj, '_' + field)\n except AttributeError:\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Set some attribute configs. IDL4 version @param newConf the new configurations @param clIdent client id @throws DevFailed
[ "@Override\n public void set_attribute_config_4(final AttributeConfig_3[] newConf, final ClntIdent clIdent) throws DevFailed {\n MDC.setContextMap(contextMap);\n xlogger.entry();\n checkInitialization();\n clientIdentity.set(clIdent);\n if (!name.equalsIgnoreCase(getAdminDevice...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Includes a controller given a controller class name @param string $class controller class name @return @link http://www.php.net/manual/en/function.include.php
[ "private function includeController($class)\n {\n $local = $this->_srcPath . DIRECTORY_SEPARATOR;\n $controller = explode('_', $class);\n array_splice($controller, 2, 0 , 'controllers');\n $pathToController = implode(DIRECTORY_SEPARATOR, $controller);\n $classFile = $local . $p...
[ "final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg event_id: The ID of the event to remove from the calendar
[ "def delete_calendar_event(self, calendar_id, event_id, params=None):\n \n for param in (calendar_id, event_id):\n if param in SKIP_IN_PATH:\n raise ValueError(\"Empty value passed for a required argument.\")\n return self.transport.perform_request(\n \"DELE...
[ "function DataModelMigration() {\n /**\n * Gets an array that contains the definition of fields that are going to be added\n * @type {Array}\n */\n this.add = [];\n /**\n * Gets an array that contains a collection of constraints which are going to be added\n * @type {Array}\n */\n ...
codesearchnet
{ "query": "Represent the post about Work management:", "pos": "Represent the code about Work management:", "neg": "Represent the code:" }