query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
@param ResponseInterface $response @return ResponseInterface
[ "public function modify(ResponseInterface $response) : ResponseInterface\n {\n /** @var ResponseModifierInterface $modifier */\n foreach ($this->collection as $modifier) {\n $response = $modifier->modify($response);\n }\n\n return $response;\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// filterIntentions is used to filter intentions based on ACL rules. // We prune entries the user doesn't have access to, and we redact any tokens // if the user doesn't have a management token.
[ "func (f *aclFilter) filterIntentions(ixns *structs.Intentions) {\n\t// Management tokens can see everything with no filtering.\n\tif f.authorizer.ACLRead() {\n\t\treturn\n\t}\n\n\t// Otherwise, we need to see what the token has access to.\n\tret := make(structs.Intentions, 0, len(*ixns))\n\tfor _, ixn := range *ix...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Log the {@link BootstrapProfile} list. @param bsInfo
[ "void printBootstrapInfo(BootstrapInfo bsInfo) {\n if (bsInfo == null) return;\n\n Log.d(LOGTAG, \"printBootstrapInfo\");\n List<BootstrapProfile> profiles = bsInfo.getProfiles();\n if (profiles != null) {\n for (BootstrapProfile profile : profiles) {\n Log.d(LOGTAG, profile.toString());\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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
parses a constant @param string $key the constant to parse @param string $curBlock the current parser-block being processed @return string parsed constant
[ "protected function parseConstKey($key, $curBlock)\n\t{\n\t\tif ($this->securityPolicy !== null && $this->securityPolicy->getConstantHandling() === Dwoo_Security_Policy::CONST_DISALLOW) {\n\t\t\treturn 'null';\n\t\t}\n\n\t\tif ($curBlock !== 'root') {\n\t\t\t$output = '(defined(\"'.$key.'\") ? '.$key.' : null)';\n\...
[ "def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Sets the commit index. @param commitIndex The commit index. @return The Raft context.
[ "ServerContext setCommitIndex(long commitIndex) {\n Assert.argNot(commitIndex < 0, \"commit index must be positive\");\n long previousCommitIndex = this.commitIndex;\n if (commitIndex > previousCommitIndex) {\n this.commitIndex = commitIndex;\n log.commit(Math.min(commitIndex, log.lastIndex()));\...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Given two SegmentCompletionListener, return a SegmentCompletionListener that executes both in sequence, even if the first throws an exception, and if both throw exceptions, add any exceptions thrown by the second as suppressed exceptions of the first.
[ "protected static Consumer<Supplier<PrimitiveIterator.OfInt>> composeWithExceptions(Consumer<Supplier<PrimitiveIterator.OfInt>> a,\n Consumer<Supplier<PrimitiveIterator.OfInt>> b) {\n return (segments) -> {\n try {\n a.accept(segments);\n }\n catch (Throwable e1) {\n ...
[ "@Override\n public void close() throws IOException {\n if (open.compareAndSet(true, false)) {\n onClose.run();\n\n Throwable thrown = null;\n do {\n for (Closeable resource : resources) {\n try {\n resource.close();\n } catch (Throwable e) {\n if (t...
codesearchnet
{ "query": "Represent the Github text about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
// SetIsTruncated sets the IsTruncated field's value.
[ "func (s *GetAccountAuthorizationDetailsOutput) SetIsTruncated(v bool) *GetAccountAuthorizationDetailsOutput {\n\ts.IsTruncated = &v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// ValidateCertificate returns an error if the certificate is not valid for notary // Currently this is only ensuring the public key has a large enough modulus if RSA, // using a non SHA1 signature algorithm, and an optional time expiry check
[ "func ValidateCertificate(c *x509.Certificate, checkExpiry bool) error {\n\tif (c.NotBefore).After(c.NotAfter) {\n\t\treturn fmt.Errorf(\"certificate validity window is invalid\")\n\t}\n\t// Can't have SHA1 sig algorithm\n\tif c.SignatureAlgorithm == x509.SHA1WithRSA || c.SignatureAlgorithm == x509.DSAWithSHA1 || c...
[ "func valid(authorization []string) bool {\n\tif len(authorization) < 1 {\n\t\treturn false\n\t}\n\ttoken := strings.TrimPrefix(authorization[0], \"Bearer \")\n\t// Perform the token validation here. For the sake of this example, the code\n\t// here forgoes any of the usual OAuth2 token validation and instead check...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Load a config file into the current instance. @param string $path The config file to load. @param string $prefix The string to prefix all targets in $path with. @return $this
[ "public function load($path, $prefix = '')\n {\n $config = $this->readConfig($path);\n\n foreach ($config as $section => $values) {\n if (in_array($section, self::$_extensionTypes)) {\n // extension section, merge in the defaults.\n $defaults = $this->get($s...
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Marked as final to prevent override. Subclasses should implement the doPrepare() method. @param conf @param topologyContext @param collector
[ "public final void prepare(Map conf, TopologyContext topologyContext, OutputCollector collector){\n this.writeLock = new Object();\n if (this.syncPolicy == null) throw new IllegalStateException(\"SyncPolicy must be specified.\");\n if (this.rotationPolicy == null) throw new IllegalStateExceptio...
[ "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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Automatically registers any container-managed bean with the framework. @param bean Object to register. @param beanName Name of the managed bean.
[ "@Override\n public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {\n registerObject(bean);\n return bean;\n }" ]
[ "private boolean isInternalUnprotectedMethod(EJBMethodMetaData methodMetaData) {\n EJBMethodInterface interfaceType = methodMetaData.getEJBMethodInterface();\n /***\n * For TIMED_OBJECT, the code references EJB 2.1 spec section 22.2.2 and matches a\n * method signature, which is necess...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Calls clang-apply-fixes on a given directory.
[ "def apply_fixes(args, tmpdir):\n \"\"\"\"\"\"\n invocation = [args.clang_apply_replacements_binary]\n if args.format:\n invocation.append('-format')\n if args.style:\n invocation.append('-style=' + args.style)\n invocation.append(tmpdir)\n subprocess.call(invocation)" ]
[ "def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Utility function to get all available update packages. Sample return date: { 'updatename': '1.2.3-45', ... }
[ "def _get_available(recommended=False, restart=False):\n '''\n \n '''\n cmd = ['softwareupdate', '--list']\n out = salt.utils.mac_utils.execute_return_result(cmd)\n\n # rexp parses lines that look like the following:\n # * Safari6.1.2MountainLion-6.1.2\n # Safari (6.1.2), 51679K [...
[ "def help_dataframe_memory(self):\n \n help = '%sMaking a DataFrame: %s how to make a dataframe from memory_forensics sample' % (color.Yellow, color.Green)\n help += '\\n\\n%sMemory Images Example:' % (color.Green)\n help += '\\n\\t%s> load_sample /path/to/pcap/exemplar4.vmem [\\'bad\\...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Publish to the cheeseshop.
[ "def publish(ctx, test=False):\n \"\"\"\"\"\"\n clean(ctx)\n if test:\n run('python setup.py register -r test sdist bdist_wheel', echo=True)\n run('twine upload dist/* -r test', echo=True)\n else:\n run('python setup.py register sdist bdist_wheel', echo=True)\n run('twine upl...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
@param string $password @param DatabaseInterface $database @param string $userCondition @param string $shopCondition @deprecated since v6.4.0 (2019-03-15); This method will be removed completely. @return string
[ "protected function formQueryPartForSha512Password(string $password, DatabaseInterface $database, string $userCondition, string $shopCondition): string\n {\n $salt = $database->getOne(\"SELECT `oxpasssalt` FROM `oxuser` WHERE 1 AND $userCondition $shopCondition\");\n if (false !== $salt) {\n ...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// TrimSpace removes any space characters from the start and end of the given string.
[ "func TrimSpace(str cty.Value) (cty.Value, error) {\n\treturn TrimSpaceFunc.Call([]cty.Value{str})\n}" ]
[ "def _set_text(self, value):\n \n working_index = self.working_index\n working_lines = self._working_lines\n\n original_value = working_lines[working_index]\n working_lines[working_index] = value\n\n # Return True when this text has been changed.\n if len(value) != l...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
单例化 @param $size int 每页行数 @param $order string 排序依据字段 @param $dir string 排序方向 @return Page
[ "public static function instance($size = null, $order = 'id', $dir = 'desc'): Page\n {\n static $handle;\n if (!$handle) {\n $handle = new self ($size, $order, $dir);\n }\n return $handle;\n }" ]
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Creates a JOIN message. @return a protobuf message.
[ "public static Message buildJoin(Zxid lastZxid) {\n ZabMessage.Zxid zxid = toProtoZxid(lastZxid);\n ZabMessage.Join join =\n ZabMessage.Join.newBuilder().setLastZxid(zxid).build();\n return Message.newBuilder().setType(MessageType.JOIN).setJoin(join).build();\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 description about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code about programming:" }
Convert a list of javac types into an array of javadoc types.
[ "public static com.sun.javadoc.Type[] getTypes(DocEnv env, List<Type> ts) {\n return getTypes(env, ts, new com.sun.javadoc.Type[ts.length()]);\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Retrieve a user by its ID, and create a new one if requested. @return An existing or created user. May be {@code null} if a user does not exist and {@code create} is false.
[ "private static @Nullable\n User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) {\n User u = AllUsers.get(id);\n if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) {\n u = new User(id, fullName);\n AllUsers.put(id, u);\n ...
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Give the user with user_full_name the auth_role permissions on the remote project with project_name. :param args Namespace arguments parsed from the command line
[ "def run(self, args):\n \n email = args.email # email of person to give permissions, will be None if username is specified\n username = args.username # username of person to give permissions, will be None if email is specified\n auth_role = args.auth_role ...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS Auto Scaling:" }
Show the `xs` (inputs) and `ys` (targets). `max_len` is the maximum number of tokens displayed.
[ "def show_xys(self, xs, ys, max_len:int=70)->None:\n \"\"\n from IPython.display import display, HTML\n names = ['idx','text'] if self._is_lm else ['text','target']\n items = []\n for i, (x,y) in enumerate(zip(xs,ys)):\n txt_x = ' '.join(x.text.split(' ')[:max_len]) if ...
[ "def _default_hparams():\n \"\"\"\"\"\"\n return hparam.HParams(\n # Use this parameter to get comparable perplexity numbers with different\n # tokenizations. This value should be set to the ratio of the number of\n # tokens in the test set according to the tokenization used to the number\n #...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<p>Setter for hasName.</p> @param pHasName reference
[ "@Override\n public final void setHasName(final SpecificsOfItem pHasName) {\n this.hasName = pHasName;\n if (this.itsId == null) {\n this.itsId = new IdI18nSpecificsOfItem();\n }\n this.itsId.setHasName(this.hasName);\n }" ]
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about File management:" }
// randomZone picks one of the zone suffixes for region and returns it // appended to region, as a fully-qualified zone name. // If the given region is invalid, the default Zone is returned instead.
[ "func (h *DeployHandler) randomZone(region string) string {\n\th.zonesMu.RLock()\n\tdefer h.zonesMu.RUnlock()\n\tzones, ok := h.zones[region]\n\tif !ok {\n\t\treturn fallbackZone\n\t}\n\treturn region + zones[rand.Intn(len(zones))]\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 post about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about programming:" }
Returns the plugin namespace that will be prefixed to plugin parameters in URIs. By default this is <plugin_class_name> @return string
[ "protected function getPluginNamespace()\n {\n if ($this->getArgumentNamespace() !== null) {\n return $this->getArgumentNamespace();\n }\n\n if ($this->node instanceof NodeInterface) {\n $nodeArgumentNamespace = $this->node->getProperty('argumentNamespace');\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 instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
It returns a CGroup object which is pointed by the fullpath.
[ "def get_cgroup(fullpath):\n \n # Canonicalize symbolic links\n fullpath = os.path.realpath(fullpath)\n\n status = SubsystemStatus()\n name = None\n for name, path in status.paths.items():\n if path in fullpath:\n break\n else:\n raise Exception('Invalid path: ' + fullp...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Execute sql query @param string $query Sql query @return array|bool
[ "public function doQuery($query)\n {\n $this->statement = $this->db->query($query);\n if ($this->statement && $this->statement->rowCount()) {\n return $this->statement->rowCount();\n }\n return false;\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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Helper that prepares the fields of a batch creates for JSON serialization. @param Api\MtBatchSmsCreate $batch the batch to serialize @return [] associative array for JSON serialization
[ "private static function _createBatchHelper(Api\\MtBatchSmsCreate &$batch)\n {\n $fields = [\n 'from' => $batch->getSender(),\n 'to' => $batch->getRecipients()\n ];\n\n if (null != $batch->getDeliveryReport()) {\n $fields['delivery_report'] = $batch->getDeliv...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software Development:" }
Detects plugins for this command controller @param ObjectManagerInterface $objectManager @return array
[ "protected static function detectPlugins(ObjectManagerInterface $objectManager)\n {\n $pluginConfigurations = [];\n $classNames = $objectManager->get(ReflectionService::class)->getAllImplementationClassNamesForInterface(NodeCommandControllerPluginInterface::class);\n foreach ($classNames as ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Stop a node ("pulling the plug"). CLI Example: .. code-block:: bash salt-cloud -a stop mymachine
[ "def stop(name, vmid=None, call=None):\n '''\n \n '''\n if call != 'action':\n raise SaltCloudSystemExit(\n 'The stop action must be called with -a or --action.'\n )\n\n if not set_vm_status('stop', name, vmid=vmid):\n log.error('Unable to bring VM %s (%s) down..', nam...
[ "def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *AppProjectList) DeepCopyInto(out *AppProjectList) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tout.ListMeta = in.ListMeta\n\tif in.Items != nil {\n\t\tin, out := &in.Items, &out.Items\n\t\t*out = make([]AppProject, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\...
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
ListPages Lists all of a location's Favorites pages in Square Register. @param location_id The ID of the location to list Favorites pages for. @param [Hash] opts the optional parameters @return [Array<V1Page>]
[ "def list_pages(location_id, opts = {})\n data, _status_code, _headers = list_pages_with_http_info(location_id, opts)\n return data\n end" ]
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Retrieve a database object from a connection @param string $database database name @param boolean $wrap whether to wrap in a Database object @return Database|MongoDB
[ "public function database($database, $wrap = true)\n {\n $database = $this->connection->{$database};\n\n return $wrap ? new Database($database, $this) : $database;\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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Remove the specified Permission from storage. @param int $id @return JsonResponse
[ "public function destroy($id)\n {\n $permission = $this->repository->findWithoutFail($id);\n\n if (empty($permission)) {\n return $this->sendError('Permission not found');\n }\n\n $this->repository->delete($id);\n\n return $this->sendResponse($permission, 'Permission...
[ "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 description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about File management:" }
Jumbotron::createParagraph @param string|null $text @param array $attributes @return Paragraph
[ "public function createParagraph($text = null, array $attributes = [])\n {\n $paragraph = new Paragraph();\n\n if (count($attributes)) {\n foreach ($attributes as $name => $value) {\n $paragraph->attributes->addAttribute($name, $value);\n }\n }\n\n ...
[ "function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// FindBucketByName returns a bucket by name for a particular organization. // TODO: have method for finding bucket using organization name and bucket name.
[ "func (s *Service) FindBucketByName(ctx context.Context, orgID influxdb.ID, n string) (*influxdb.Bucket, error) {\n\tspan, ctx := tracing.StartSpanFromContext(ctx)\n\tdefer span.Finish()\n\n\tvar b *influxdb.Bucket\n\tvar err error\n\n\terr = s.kv.View(ctx, func(tx Tx) error {\n\t\tbkt, pe := s.findBucketByName(ctx...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github comment about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code about Software development:" }
获得主键where子句,包含where关键字。会自动处理软删除条件 @param clazz @throws NoKeyColumnAnnotationException
[ "public static String getKeysWhereSQL(Class<?> clazz) \n\t\t\tthrows NoKeyColumnAnnotationException {\n\t\tList<Field> keyFields = DOInfoReader.getKeyColumns(clazz);\n\t\tString where = joinWhere(keyFields, \"AND\");\n\t\treturn autoSetSoftDeleted(\"WHERE \" + where, clazz);\n\t}" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Called when the View was registered Can be used e.g. to connect signals. Here, the destroy signal is connected to close the application
[ "def register_view(self, view):\n \n super(StateOutcomesEditorController, self).register_view(view)\n if isinstance(view, StateOutcomesEditorView):\n self.connect_signal(view['add_button'], \"clicked\", self.oc_list_ctrl.on_add)\n self.connect_signal(view['remove_button'],...
[ "function (message) {\n if ('string' !== typeof message) {\n callFunc(WebViewBridge.onError, \"message is type '\" + typeof message + \"', and it needs to be string\");\n return;\n }\n\n //we queue the messages to make sure that native can collects all of them in one shot.\n sendQu...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetHistorySummary sets the HistorySummary field's value.
[ "func (s *AlarmHistoryItem) SetHistorySummary(v string) *AlarmHistoryItem {\n\ts.HistorySummary = &v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *TextInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"TextInput\"}\n\tif s.SourceLanguageCode == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"SourceLanguageCode\"))\n\t}\n\tif s.SourceLanguageCode != nil && len(*s.SourceLanguageCode) < 2 {\n\t\tinvalidParams.A...
[ "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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Sequentially add new live point proposals to the queue.
[ "def _fill_queue(self, loglstar):\n \"\"\"\"\"\"\n\n # Add/zip arguments to submit to the queue.\n point_queue = []\n axes_queue = []\n while self.nqueue < self.queue_size:\n if self._beyond_unit_bound(loglstar):\n # Propose points using the provided samp...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Runs an __is_array__ test on some $data. A test format can be set (read Documentation) @param mixed $data @param array $failed @return bool
[ "public function check($data = null, &$failed = array()) {\n if (is_null($data)) $data = $this->data;\n if (!isset($this->format)) $this->format = \"array\";\n\n // reset the reporting array\n $failed = array();\n\n if ($this->getNull()) {\n $valid = (is_null($data) || ...
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetData sets the Data field's value.
[ "func (s *Record) SetData(v []byte) *Record {\n\ts.Data = v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// FinishUpgradeSeries indicates an expected call of FinishUpgradeSeries
[ "func (mr *MockFacadeMockRecorder) FinishUpgradeSeries(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"FinishUpgradeSeries\", reflect.TypeOf((*MockFacade)(nil).FinishUpgradeSeries), arg0)\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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetSubmitTimeAfter sets the SubmitTimeAfter field's value.
[ "func (s *KeyPhrasesDetectionJobFilter) SetSubmitTimeAfter(v time.Time) *KeyPhrasesDetectionJobFilter {\n\ts.SubmitTimeAfter = &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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Attempts a forward lookup via the socket library and if successful will try to do a reverse lookup to verify DNS is returning both lookups.
[ "def validate(self, value):\n \n if '.' not in value:\n self.error_message = '%s is not a fully qualified domain name.' % \\\n value\n return False\n try:\n ipaddress = socket.gethostbyname(value)\n except socket.gaierror:\...
[ "static String getHostString(InetSocketAddress socketAddress) {\n InetAddress address = socketAddress.getAddress();\n if (address == null) {\n // The InetSocketAddress was specified with a string (either a numeric IP or a host name). If\n // it is a name, all IPs for that name should be tried. If it...
codesearchnet
{ "query": "Represent the post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Updating hashes in batch for better performance @param array $hashes 'id' => 'hash'
[ "public function updateMulti(array $hashes)\n {\n $startSql = \"UPDATE \" . $this->tableName;\n $this->storage->exec('BEGIN TRANSACTION');\n foreach ($hashes as $id => $hash) {\n $this->storage->exec($startSql . \" SET hash='$hash' WHERE id='$id'\");\n }\n $this->sto...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Implements the tokenization algorithm. Recieves : source [string], nextToken [token]
[ "function (source, nextToken) {\n var tm = this,\n tokenizerRe,\n lastIndex,\n matches,\n textType;\n\n // Initialize for first run\n // if no template passed assume first pass\n // and use the main template.\n if (typeof source === \"undefined\") {\n ...
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Regular expressions:" }
Get useradd form @return \Document\Form\ClassifiedImageAdd
[ "public function getClassifiedImageAddForm() \n {\n if (null === $this->classifiedImageAddForm) {\n $this->classifiedImageAddForm = $this->getServiceLocator()->get('document.form.classifiedimageadd');\n }\n return $this->classifiedImageAddForm;\n }" ]
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Joins a directory and a filename, replaces Windows forward-slash with a backslash.
[ "function (directory, filename) {\n\n return Path.join(directory, filename).replace(/^[a-z]:\\\\/i, '/').replace(/\\\\/g, '/');\n\n }" ]
[ "public static String pathEncode(String path, Charset charset) {\n return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);\n\n /*\n * path encoding is not equivalent to query encoding, there are few differences, namely dealing\n * with spaces, !, ', (, ), and ~ characters. we will need to man...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// LogReleaseMetadata logs a metadata array, uses this to // ensure consistent logging for release metadata
[ "func LogReleaseMetadata(metadatas []Metadata) {\n\tfor _, metadata := range metadatas {\n\t\tlogrus.Infof(\"Layer %s cleaned up\", metadata.ChainID)\n\t}\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Deprecated. Use Braintree::Transaction.submit_for_settlement
[ "def submit_for_settlement(amount = nil)\n warn \"[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement\"\n result = @gateway.transaction.submit_for_settlement(id, amount)\n if result.success?\n copy_instance_variables_from_object ...
[ "def encrypt_request(payment_request)\n variables = payment_request.request_variables.reverse_merge({\n 'notify_url'=> answer_paypal_url(protocol: 'https')\n })\n LolitaPaypal::Request.encrypt_for_paypal variables\n ensure\n LolitaPaypal.logger.info \"[#{payment_request.payment_id}] #{...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Set a config value, using a path. For example: $app['config']->set('general/branding/name', 'Bolt'); @param string $path @param mixed $value @return bool
[ "public function set($path, $value)\n {\n Arr::set($this->data, $path, $value);\n\n return true;\n }" ]
[ "public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about NLP:" }
// RPC is used to make a local RPC call
[ "func (s *Server) RPC(method string, args interface{}, reply interface{}) error {\n\tcodec := &codec.InmemCodec{\n\t\tMethod: method,\n\t\tArgs: args,\n\t\tReply: reply,\n\t}\n\tif err := s.rpcServer.ServeRequest(codec); err != nil {\n\t\treturn err\n\t}\n\treturn codec.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 Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Find the toeplitz matrix as a list of lists given its first line/column.
[ "def toeplitz(vect):\n \n return [[vect[abs(i-j)] for i in xrange(len(vect))]\n for j in xrange(len(vect))]" ]
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Sets the vertical alignment for the cell. It could be <CODE>Element.ALIGN_MIDDLE</CODE> for example. @param verticalAlignment The vertical alignment
[ "public void setVerticalAlignment(int verticalAlignment) {\n if (table != null)\n table.setExtendLastRow(verticalAlignment == Element.ALIGN_TOP);\n this.verticalAlignment = verticalAlignment;\n }" ]
[ "public static HorizontalPanel newRow (String styleName, Widget... contents)\n {\n return newRow(HasAlignment.ALIGN_MIDDLE, styleName, contents);\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
TODO: $attr не используется @return \SQRT\Tag\Checkbox|CheckboxListing
[ "public function render($attr = null)\n {\n if ($this->getOptions()) {\n $tag = new CheckboxListing(\n $this->getInputName(),\n $this->getOptions(),\n $this->getValue()\n );\n\n if ($this->getIgnoreOptionsKeys()) {\n $tag->setIgnoreOptionsKeys(true);\n }\n } el...
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
This method send the periodic heartbeats.
[ "private void runHeartbeatLoop() {\n\t\tfinal long interval = GlobalConfiguration.getInteger(\n\t\t\t\t\t\tConfigConstants.TASK_MANAGER_HEARTBEAT_INTERVAL_KEY,\n\t\t\t\t\t\tConfigConstants.DEFAULT_TASK_MANAGER_HEARTBEAT_INTERVAL);\n\n\t\twhile (!shutdownStarted.get()) {\n\t\t\t// send heart beat\n\t\t\ttry {\n\t\t\...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// SetStatus sets the Status field's value.
[ "func (s *PhoneNumber) SetStatus(v string) *PhoneNumber {\n\ts.Status = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get user by condition. @param array $condition @return User|array
[ "public function getBy(array $condition) : User\n {\n if (!$user = User::find()->andWhere($condition)->limit(1)->one()) {\n throw new NotFoundException($this->i18n->t('setrun/user', 'User not found'));\n }\n return $user;\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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Refresh the locks from the stored representation.
[ "protected void refreshFromSystem() {\n try {\n // Re-read and re-register all of the namespaces ...\n SessionCache systemCache = repository.createSystemSession(repository.context(), false);\n SystemContent system = new SystemContent(systemCache);\n CachedNode lock...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
深度优先遍历 Depth-First-Search
[ "function depthFirstSearch(obj, handler) {\n var childrenKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';\n var reverse = arguments[3];\n\n var rootChildren = hp.isArray(obj) ? obj : [obj];\n //\n var StopException = function StopException() {};\n var func = function func(...
[ "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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about text processing:" }
@deprecated use fetchAll($keyField, $valueField) @param null $key @param null $value @return array
[ "public function fetchColumns($key = null, $value = null)\n {\n $this->rewind();\n\n $result = array();\n\n if ($key instanceof Database\\Definition\\Column) {\n $key = $key->schemaName;\n }\n\n if ($value instanceof Database\\Definition\\Column) {\n $valu...
[ "public static function getOptionValues($filter = array())\n {\n $filter = Filter::create($filter);\n return self::getCollection('/options/values' . $filter->toQuery(), 'OptionValue');\n }" ]
codesearchnet
{ "query": "Represent the description about Redis command documentation:", "pos": "Represent the code about Redis command documentation:", "neg": "Represent the code about Programming:" }
Remove and get the last element in a list, or block until one is available. :raises TypeError: if timeout is not int :raises ValueError: if timeout is less than 0
[ "def brpoplpush(self, sourcekey, destkey, timeout=0, encoding=_NOTSET):\n \n if not isinstance(timeout, int):\n raise TypeError(\"timeout argument must be int\")\n if timeout < 0:\n raise ValueError(\"timeout must be greater equal 0\")\n return self.execute(b'BRPOPL...
[ "def _check_items(items):\n '''\n \n '''\n num_items = 0\n # Check that the list is iterable and finite\n try:\n num_items = len(items)\n except:\n raise TypeError(\"The item list ({}) is not a finite iterable (has no length)\".format(items))\n # Check that the list has items\n...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Retrieve variant calls for all samples, merging batched samples into single VCF.
[ "def _organize_variants(samples, batch_id):\n \n caller_names = [x[\"variantcaller\"] for x in samples[0][\"variants\"]]\n calls = collections.defaultdict(list)\n for data in samples:\n for vrn in data[\"variants\"]:\n calls[vrn[\"variantcaller\"]].append(vrn[\"vrn_file\"])\n data =...
[ "def runner(self):\n \n logging.info('Starting {} analysis pipeline'.format(self.analysistype))\n if not self.pipeline:\n # If the metadata has been passed from the method script, self.pipeline must still be false in order to\n # get Sippr() to function correctly, but the ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Run a value through the filters OR format attribute associated with the parameter. @param mixed $value Value to filter @return mixed Returns the filtered value @throws \RuntimeException when trying to format when no service description is available.
[ "public function filter($value)\n {\n // Formats are applied exclusively and supersed filters\n if ($this->format) {\n if (!$this->serviceDescription) {\n throw new \\RuntimeException('No service description was set so '\n . 'the value cannot be formatte...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// HackerPhrase will return a random hacker sentence
[ "func HackerPhrase() string {\n\twords := strings.Split(Generate(getRandValue([]string{\"hacker\", \"phrase\"})), \" \")\n\twords[0] = strings.Title(words[0])\n\treturn strings.Join(words, \" \")\n}" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Natural Language Processing:" }
Returns a list with all projects from history.<p> @param dbc the current database context @return list of <code>{@link CmsHistoryProject}</code> objects with all projects from history. @throws CmsException if operation was not successful
[ "public List<CmsHistoryProject> getAllHistoricalProjects(CmsDbContext dbc) throws CmsException {\n\n // user is allowed to access all existing projects for the ous he has the project_manager role\n Set<CmsOrganizationalUnit> manOus = new HashSet<CmsOrganizationalUnit>(\n getOrgUnitsForRole(...
[ "public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp...
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:" }
Create the encoded string @param Image $Object @param Data $Values @param array $Format
[ "public function drawSplitPath(Image $Object, Data $Values, array $Format = [])\n {\n $this->pChartObject = $Object;\n\n $Spacing = isset($Format[\"Spacing\"]) ? $Format[\"Spacing\"] : 20;\n $TextPadding = isset($Format[\"TextPadding\"]) ? $Format[\"TextPadding\"] : 2;\n $TextPos = is...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
The synchronized here is VERY important. If missing, the mapDatabase read gets corrupted by multiple threads reading the file at once.
[ "public synchronized Drawable renderTile(final long pMapTileIndex) {\n\n Tile tile = new Tile(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), (byte) MapTileIndex.getZoom(pMapTileIndex), 256);\n model.setFixedTileSize(256);\n\n //You could try something like this to load a cu...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Copies and extends the properties array and returns the React element @private @returns {React.Element}
[ "function() {\n\t\tvar defaultProps = {\n\t\t\tglEventHub: this._container.layoutManager.eventHub,\n\t\t\tglContainer: this._container,\n\t\t\tref: this._gotReactComponent.bind( this )\n\t\t};\n\t\tvar props = $.extend( defaultProps, this._container._config.props );\n\t\treturn React.createElement( this._reactClass...
[ "function (winjsComponent, propName, oldValue, newValue) {\n // TODO: dispose\n ReactDOM.render(React.DOM.div(null, newValue), winjsComponent.winControl.element);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Find the projects listed in the Home Documentation's index.md file Returns: set(str): projects' names, with the '/' in their beginings
[ "def get_listed_projects():\n \n index_path = Path().resolve() / \"docs\" / \"index.md\"\n with open(index_path, \"r\") as index_file:\n lines = index_file.readlines()\n\n listed_projects = set()\n project_section = False\n for _, l in enumerate(lines):\n idx = l.find(PROJECT_KEY)\n ...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Set the image type @param string $type Image type to set @return void
[ "public function setImageType($type)\n\t{\n\t\tif ($type)\n\t\t{\n\t\t\t$this->image_type = $type;\n\t\t}\n\n\t\tif ($this->image_type == IMAGETYPE_PNG && $this->resource)\n\t\t{\n\t\t\timagealphablending($this->resource, false);\n\t\t\timagesavealpha($this->resource, true);\n\t\t}\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 post about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
@param PathInterface|Value|Func|array $operand @return ListAppend
[ "public function listAppend($operand)\n {\n $operand = $this->path->getExpr()->value($operand);\n\n return new ListAppend($this, $operand);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
**************************************** 查找并解析文件 ****************************************
[ "function any(...args) {\n\n // 遍历文件\n for (let file of args) {\n try {\n return require(path.cwd(file));\n } catch (err) {\n // do nothing;\n }\n }\n}" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the sentence about N/A:", "pos": "Represent the code about N/A:", "neg": "Represent the code about programming:" }
Replace value. @param bodyObj the body obj @param replaceValue the replace value
[ "public void replaceValue(Object bodyObj, Object replaceValue) {\n Object parentObj = bodyObj;\n\n if(this.listChild) {\n ValidationData rootListParent = this.findListParent();\n if(this.deepLevel - rootListParent.deepLevel > 1 ){\n parentObj = this.parent.getValue...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountConfig.
[ "func (in *ServiceAccountConfig) DeepCopy() *ServiceAccountConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ServiceAccountConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}" ]
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// ToRawInfo returns a description of SecurityDefinitionsItem suitable for JSON or YAML export.
[ "func (m *SecurityDefinitionsItem) ToRawInfo() interface{} {\n\t// ONE OF WRAPPER\n\t// SecurityDefinitionsItem\n\t// {Name:basicAuthenticationSecurity Type:BasicAuthenticationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}\n\tv0 := m.GetBasicAuthenticationSecurity()\n\tif...
[ "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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Gets debug string. @param root the root @return the debug string
[ "public String getDebugString(TrieNode root) {\n if (this == root) return \"\";\n String parentStr = null == getParent() ? \"\" : getParent().getDebugString(root);\n return parentStr + getDebugToken();\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 sentence about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Return a SQLAlchemy query that is already namespaced by the app and namespace given to this backend during initialization. Returns: a SQLAlchemy query object
[ "def _ns_query(self, session):\n \n return session.query(ORMJob).filter(ORMJob.app == self.app,\n ORMJob.namespace == self.namespace)" ]
[ "def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):\n \n if self.delete_related:\n return super(AuditlogHistoryField, self).bulk_related_objects(objs, using)\n\n # When deleting, Collector.collect() finds related objects using this\n # method. However, because we d...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Ajoute une relation HasMany vers un autre modèle. @param Model $relatedModel @param string $foreignKey @return void
[ "public function hasMany(Model $relatedModel, $foreignKey)\n {\n if ($relatedModel->isIgnored()) {\n return;\n }\n\n $this->relations->add(\n new Relations\\HasMany($this, $relatedModel, $foreignKey)\n );\n }" ]
[ "public function enregistreSelectionTitreGroupeAdresse($params = array())\n {\n if (isset($this->variablesGet['idEvenementTitreSelection']) && $this->variablesGet['idEvenementTitreSelection']!='' && isset($this->variablesGet['archiIdEvenementGroupeAdresse']) && $this->variablesGet['archiIdEvenementGroupeA...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about N/A:" }
// UintToHex trans uint32 to robotgo.CHex
[ "func UintToHex(u uint32) CHex {\n\thex := U32ToHex(C.uint32_t(u))\n\treturn CHex(hex)\n}" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// This is the function responsible for determining the correct volume plugin to use, // asking it to make a snapshot and assigning it some name that it returns to the caller.
[ "func (vs *volumeSnapshotter) deleteSnapshot(spec *crdv1.VolumeSnapshotDataSpec) error {\n\tvolumeType := crdv1.GetSupportedVolumeFromSnapshotDataSpec(spec)\n\tif len(volumeType) == 0 {\n\t\treturn fmt.Errorf(\"unsupported volume type found in VolumeSnapshotData %#v\", spec)\n\t}\n\tplugin, ok := (*vs.volumePlugins...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about File management:" }
Returns a Cookie. @return Cookie|null returns cookie or null if cookie was not found
[ "public function get($name)\n {\n $cookies = $this->getAll();\n\n foreach ($cookies as $cookie) {\n if ($cookie->getName() == $name) {\n return $cookie;\n }\n }\n\n return null;\n }" ]
[ "public function get($key, $default = null)\n {\n $this->hydrate();\n\n // Create an Element instance using the data for the key\n if ($this->has($key)) {\n return new $this->model(array_merge($this->items[$key], ['key' => $key]));\n }\n\n // If the key doesn't exist...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
@param array $params @return CardParams
[ "public static function create(array $params)\n {\n $publicKey = $params[self::PublicKey];\n $privateKey = $params[self::PrivateKey];\n\n $cardParams = new self($publicKey, $privateKey);\n\n if (array_key_exists(self::Identity, $params)) {\n $cardParams->identity = $params[...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
/* Main method to lookup an entry
[ "public synchronized DownloadResponse getJnlpFile( JnlpResource jnlpres, DownloadRequest dreq )\n throws IOException\n {\n String path = jnlpres.getPath();\n URL resource = jnlpres.getResource();\n long lastModified = jnlpres.getLastModified();\n\n _log.addDebug( \"lastModi...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
This method will send a message to the attached client. @param sibMessage @return Returns the length of the message sent @throws MessageEncodeFailedException @throws IncorrectMessageTypeException @throws MessageCopyFailedException
[ "int sendMessage(SIBusMessage sibMessage)\n throws MessageCopyFailedException,\n IncorrectMessageTypeException,\n MessageEncodeFailedException,\n UnsupportedEncodingException\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, ...
[ "@Override\n protected void setAdditionalInfoToEventCallBackStruct(EventCallBackStruct callback_struct,\n String device_name, String attribute, String event_name, String[] filters, EventChannelStruct channel_struct) throws DevFailed {\n // Nothing\n ApiUtil.printTrace(\"---...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about N/A:" }
Handles the server-side (cleartext) upgrade from HTTP to HTTP/2. @param settings the settings for the remote endpoint.
[ "public void onHttpServerUpgrade(Http2Settings settings) throws Http2Exception {\n if (!connection().isServer()) {\n throw connectionError(PROTOCOL_ERROR, \"Server-side HTTP upgrade requested for a client\");\n }\n if (!prefaceSent()) {\n // If the preface was not sent yet...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Discover and return a list of the names of all analog output channels for the given device :param dev: the device name :type dev: str
[ "def get_ao_chans(dev):\n \n buf = create_string_buffer(256)\n buflen = c_uint32(sizeof(buf))\n DAQmxGetDevAOPhysicalChans(dev.encode(), buf, buflen)\n pybuf = buf.value\n chans = pybuf.decode(u'utf-8').split(u\",\")\n return chans" ]
[ "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 text about Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code about programming:" }
This property has no other meaning than knowing that a bean exits only by looking at the properties table. So remove the marker property from result of a fetch operation.
[ "public static void filterMarkerProperty(List<JpaProperty> properties) {\r\n ListIterator<JpaProperty> propIt = properties.listIterator();\r\n while (propIt.hasNext()) {\r\n if (BEAN_MARKER_PROPERTY_NAME.equals(propIt.next().getPropertyName())) {\r\n propIt.remove();\r\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
获得请求方法 @return string @throws \InvalidArgumentException @throws \One\Protocol\Exceptions\InvalidMethodException
[ "public function getMethod(): string\n {\n if ($this->method === null) {\n $this->method = $this->originalMethod;\n $customMethod = $this->getHeaderLine('X-Http-Method-Override');\n\n if ($customMethod) {\n $this->method = $this->filterMethod($customMethod);...
[ "public static function ReadSuidSession ($name = null) {\n\t\tif (!static::SeesionOnSu()) {\n\t\t\tthrow \\ickx\\fw2\\core\\exception\\CoreException::RaiseSystemError('suidセッションが開始されていません。');\n\t\t}\n\t\treturn Session::Read(static::_GetSeesionLayerPath($name));\n\t}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Generates random client ID :return:
[ "def gen_client_id():\n \n import random\n gen_id = 'hbmqtt/'\n\n for i in range(7, 23):\n gen_id += chr(random.randint(0, 74) + 48)\n return gen_id" ]
[ "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 post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
CHECKSTYLE:OFF:RedundantThrows
[ "public static void requireArgMax(@NotNull final String name, @NotNull final long value, final long max)\n throws ConstraintViolationException {\n // CHECKSTYLE:ON\n if (value > max) {\n throw new ConstraintViolationException(\"Max value of argument '\" + name + \"' is \" + max +...
[ "public void addToStringCondition(SourceBuilder code) {\n checkState(initialState() == Initially.OPTIONAL);\n code.add(\"%s != null\", property.getField());\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Compute the uncentered correlation of two vectors. @param x first NumberVector @param y second NumberVector @return the uncentered correlation coefficient for x and y
[ "public static double uncenteredCorrelation(NumberVector x, NumberVector y) {\n final int xdim = x.getDimensionality(), ydim = y.getDimensionality();\n if(xdim != ydim) {\n throw new IllegalArgumentException(\"Invalid arguments: number vectors differ in dimensionality.\");\n }\n double sumXX = 0., ...
[ "function sample_covariance(x, y) {\n\n // The two datasets must have the same length which must be more than 1\n if (x.length <= 1 || x.length != y.length){\n return null;\n }\n\n // determine the mean of each dataset so that we can judge each\n // value of the dataset...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates a getter that will drop the current value and retrieve the source's attribute with the context key as name.
[ "def source_getattr():\n \n\n def source_getattr(_value, context, **_params):\n value = getattr(context[\"model\"].source, context[\"key\"])\n return _attr(value)\n\n return source_getattr" ]
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parse input context string and returns context as dictionary.
[ "def get_parsed_context(context_arg):\n \"\"\"\"\"\"\n assert context_arg, (\"pipeline must be invoked with context arg set. For \"\n \"this json parser you're looking for something \"\n \"like: \"\n \"pypyr pipelinename './myjsonfile.jso...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return params prepared for url builder @param array $rewrite @return array
[ "public function getParams(array $rewrite = []): array\n {\n $params = $this->params;\n\n // change page to first for each new grid (with new filters or orders, or other stuff)\n $page = $rewrite['page'] ?? 1;\n\n if ($page > 1) {\n $params[$this->prefix . 'page'] = $page;\...
[ "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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Fügt dem Tag den Initialisierer für ein JQueryUI-Widget hinzu z. B. so: <span id="element"></span> <script type="text/javascript">$('#element').droppable({..})</script>
[ "public static function widget(Tag $tag, $name, $options = array()) {\n //$tag->addClass('\\Psc\\jquery-widget');\n \n $js = sprintf(\"%s(%s)\",\n $name, JSHelper::convertHashMap((object) $options)\n );\n \n $tag->chain(new Code($js));\n \n return $tag;\n }" ]
[ "function render(code, data) {\n var js = '```js' + code + '```'\n return `<div class=\"vomit-snippet\"><div class=\"column\">${marked(js)}</div><div class=\"column\"><script>\n(function() {${code}document.currentScript.parentElement.appendChild(component(${JSON.stringify(data.data)}))\n})()</script></div></div>`...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Verify the Baremetal nodes are available and do a stack update
[ "def _heat_deploy(self, stack, stack_name, template_path, parameters,\n environments, timeout):\n \"\"\"\"\"\"\n\n self.log.debug(\"Processing environment files\")\n env_files, env = (\n template_utils.process_multiple_environments_and_files(\n envi...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
下载文件/目录到指定的文件夹里.
[ "def on_download_to_activated(self, menu_item):\n ''''''\n tree_paths = self.iconview.get_selected_items()\n if not tree_paths:\n return\n\n dialog = Gtk.FileChooserDialog(_('Save to...'), self.app.window,\n Gtk.FileChooserAction.SELECT_FOLDER,\n ...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about text processing:" }