query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Adds another string to the buffer.
@param string $string_to_add | [
"function addString($string_to_add){\n\t\tsettype($string_to_add,\"string\");\n\t\tif(strlen($string_to_add)>0){\n\t\t\t$this->_Buffer[] = new StringBufferItem($string_to_add);\n\t\t}\n\t}"
] | [
"def forward_char(self, e): # (C-f)\r\n \"\"\"\r\n self.l_buffer.forward_char(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Register the service provider.
@return void | [
"public function register() {\n $configPath = __DIR__ . '/../config/backup-manager.php';\n $this->mergeConfigFrom($configPath, 'backup-manager');\n $this->registerFilesystemProvider();\n $this->registerDatabaseProvider();\n $this->registerCompressorProvider();\n $this->regi... | [
"@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 Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
URL to parent brand stats.
@since 160625 Brand URLs.
@param string $uri URI to append.
@return string Output URL. | [
"public function toBrandParentStats(string $uri = ''): string\n {\n return $this->App->Parent ? $this->App->Parent->Utils->§BrandUrl->toBrandStats($uri) : $this->toBrandStats($uri);\n }"
] | [
"@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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
/* (non-Javadoc)
@see org.jboss.as.controller.AttributeValueCorrector#correct(org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode) | [
"@Override\n public ModelNode correct(ModelNode newValue, ModelNode currentValue) {\n if(newValue.getType() == ModelType.UNDEFINED) {\n return newValue;\n }\n if(newValue.getType() != ModelType.OBJECT || currentValue.getType() != ModelType.OBJECT) {\n return newValue;\n... | [
"public void setTransactionRegistry(org.jboss.tm.usertx.UserTransactionRegistry v)\n {\n ((org.jboss.tm.usertx.UserTransactionProvider)utp).setTransactionRegistry(v);\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Write one node and all possible edges. | [
"def log_url (self, url_data):\n \"\"\"\"\"\"\n node = self.get_node(url_data)\n if node:\n self.xml_starttag(u'node', attrs={u\"name\": u\"%d\" % node[\"id\"]})\n self.xml_tag(u\"label\", node[\"label\"])\n if self.has_part(\"realurl\"):\n self.x... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Transforms the values in a collection by running each value through the iterator
@param array $array array of values
@param \Closure $closure closure to map the values
@return array | [
"public static function mapValues(array $array, Closure $closure = null): array\n {\n if (is_null($closure)) {\n $closure = '__::identity';\n }\n $resultArray = [];\n foreach ($array as $key => $value) {\n $resultArray[$key] = call_user_func_array($closure, [$val... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
缺省目录
如果 setFile 没有指定,会去 setDir 目录看有没有特定文件,有则加载
@param string $sPath
@static
@access public
@return void | [
"public static function setDir($sPath) {\n\t\tif (static::$_sDir) {\n\t\t\tthrow new TangoException('dir define duplicate');\n\t\t}\n\t\t$sPath = rtrim(trim($sPath), '/');\n\t\tif (!is_dir($sPath)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tstatic::$_sDir = $sPath . '/';\n\t\treturn TRUE;\n\t}"
] | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Tables implements Session. | [
"func (m SessionMock) Tables(keyspace string) ([]string, error) {\n\tvar r = m.Called(keyspace)\n\n\treturn r.Get(0).([]string), r.Error(1)\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetSubstitutions sets the Substitutions field's value. | [
"func (s *SMSMessage) SetSubstitutions(v map[string][]*string) *SMSMessage {\n\ts.Substitutions = 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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
The variety of ways to set a color
@param ColorInterface | string | integer | int[] $color - Many options for initializing a color object - SEE CONSTRUCTOR | [
"public function setColor($color) {\n\n // if null is passed in, then just leave everything null\n if (!is_null($color)) {\n\n // if it an instance of another color\n if ($color instanceof ColorInterface) {\n\n // save the name\n $this->name = $color... | [
"public function initializeArguments()\n {\n $this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);\n $this->registerArgument('mode', 'string', 'The case to apply, must be one of this\\' CASE_* constants. Defaults to upperca... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Add one or multiple validation rules to one or multiple fields
@param string|array $fieldnames
@return sFire\Validator\Validator | [
"public function field($fieldnames) {\r\n\r\n\t\t$fieldnames = func_get_args();\r\n\r\n\t\tforeach($fieldnames as $fieldname) {\r\n\r\n\t\t\tif(false === is_string($fieldname)) {\r\n\t\t\t\treturn trigger_error(sprintf('All fieldnames used in \"%s\"() must be of the type string, \"%s\" given', __METHOD__, gettype($... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
.. versionadded:: 2019.2.0
Returns the glusterfs volume's max op-version value
Requires Glusterfs version > 3.9
CLI Example:
.. code-block:: bash
salt '*' glusterfs.get_max_op_version | [
"def get_max_op_version():\n '''\n \n '''\n if _get_version() < (3, 10,):\n return False, 'Glusterfs version must be 3.10+. Your version is {0}.'.format(str('.'.join(str(i) for i in _get_version())))\n\n cmd = 'volume get all cluster.max-op-version'\n root = _gluster_xml(cmd)\n\n if not... | [
"def openstack_undercloud_install(self):\n \n instack_undercloud_ver, _ = self.run('repoquery --whatprovides /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.pp')\n if instack_undercloud_ver.rstrip('\\n') == 'instack-undercloud-0:2.2.0-1.el7ost.noarch':\n LOG.war... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Strip inline directive prefix
@param string $rule
@return string | [
"protected function stripInlineDirective($rule)\n {\n $directive = $this->isInlineDirective($rule);\n if ($directive !== false) {\n $rule = trim(str_ireplace($directive . ':', '', $rule));\n }\n return $rule;\n }"
] | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetFacetNames sets the FacetNames field's value. | [
"func (s *ListTypedLinkFacetNamesOutput) SetFacetNames(v []*string) *ListTypedLinkFacetNamesOutput {\n\ts.FacetNames = 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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
This Method tries to find the first module that implements the method
named +methodname+ in the array of +ancestors+. If this fails nil is
returned. | [
"def find_method_module(methodname, ancestors)\n methodname = methodname.to_s\n ancestors.each do |a|\n begin\n a.instance_method(methodname)\n return a\n rescue NameError\n end\n end\n nil\n end"
] | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetVaultName sets the VaultName field's value. | [
"func (s *RemoveTagsFromVaultInput) SetVaultName(v string) *RemoveTagsFromVaultInput {\n\ts.VaultName = &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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *ServiceStatus) DeepCopyInto(out *ServiceStatus) {\n\t*out = *in\n\tin.LoadBalancer.DeepCopyInto(&out.LoadBalancer)\n\treturn\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Determines whether an item is present in the cache.
@param string $key The cache item key.
@throws \Psr\SimpleCache\InvalidArgumentException
@return bool | [
"public function has($key)\n {\n /* If $key is not valid string throws InvalidArgumentException */\n if (!$this->isString($key)) {\n throw new InvalidArgumentException('Cache key must be not empty string');\n }\n\n return $this->getCollection()->has($key);\n }"
] | [
"final public function getArray()\n {\n $res = $this->getArrayInternal();\n if (!$this->isArray($res) && !$this->isArrayObject($res)) {\n $errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';\n $errorMessage .= ' Make sure you have provided a v... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software Development:"
} |
Save the image data to a file or file-like object | [
"def save(self, outfile):\n \"\"\"\"\"\"\n if isinstance(outfile, compat.string_type):\n outfile = open(outfile, 'wb')\n assert hasattr(outfile, 'write') and callable(outfile.write), \\\n \"Expect a file or file-like object with a .write() method\"\n outfile.write(s... | [
"def handle_request_files_upload(request):\n \n # FILES is a dictionary in Django but Ajax Upload gives the uploaded file\n # an ID based on a random number, so it cannot be guessed here in the code.\n # Rather than editing Ajax Upload to pass the ID in the querystring,\n # note that each upload is a... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Register an oauth scope. If the scope already exists, returns an error.
@param req http request
@return String message that will be returned in the response | [
"public String registerScope(FullHttpRequest req) throws OAuthException {\n String contentType = (req.headers() != null) ? req.headers().get(HttpHeaderNames.CONTENT_TYPE) : null;\n // check Content-Type\n if (contentType != null && contentType.contains(ResponseBuilder.APPLICATION_JSON)) {\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
get header value with title with default value
try to get key from header and consider case sensitive
e.g. header['x-log-abc'] or header['X-Log-Abc']
:param header:
:param key:
:param default:
:return: | [
"def h_v_td(header, key, default):\r\n \r\n if key not in header:\r\n key = key.title()\r\n\r\n return header.get(key, default)"
] | [
"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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Callback performed when the transport is closed. | [
"def closed(self, reason):\n \"\"\"\"\"\"\n self.client.remove_connection(self)\n self.protocol.connection_lost(reason)\n if not isinstance(reason, ConnectionClosed):\n logger.warn(\"connection closed, reason {}\".format(reason))\n else:\n logger.info(\"conne... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GET Oper REST call | [
"func httpInspectServiceLB(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {\n\tvar obj ServiceLBInspect\n\tlog.Debugf(\"Received httpInspectServiceLB: %+v\", vars)\n\n\tkey := vars[\"key\"]\n\n\tcollections.serviceLBMutex.Lock()\n\tdefer collections.serviceLBMutex.Unlock()\n\to... | [
"@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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EList<Parameter> getRole() {\n\t\tif (role == null) {\n\t\t\trole = new EObjectContainmentEList<Parameter>(Parameter.class, this, BpsimPackage.RESOURCE_PARAMETERS__ROLE);\n\t\t}\n\t\treturn role;\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the summarization about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
// getAccessControl gets the corresponding accessControlV1 for p. It walks
// along the children field recursively. If a specifically defined one exists,
// it's returned. Otherwise the parent's (parentAC) is returned. | [
"func (c *aclCheckerV1) getAccessControl(\n\tparentAC *accessControlV1, p string) (ac *accessControlV1) {\n\teffectiveAC := c.ac\n\tif c.ac == nil {\n\t\t// If c.ac == nil, it means user didn't specify an ACL for the\n\t\t// path that c represents. So just inherit from the parent.\n\t\teffectiveAC = parentAC\n\t}\n... | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
@param $key
@param null $errorMessage
@param null $scalarType
@return IConfig
@throws InvalidConfigValueException
@throws MissingConfigException | [
"public function ensure($key, $errorMessage = null, $scalarType = null) {\n if ( ! $this->has($key)) {\n if ($errorMessage === null) {\n $errorMessage = sprintf('Missing config at key \"%s\".', $key);\n } else {\n $errorMessage = s('%s: %s', $key, $errorMes... | [
"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 instruction about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
Get the number of names, optionally counting the expired ones
Return {'error': ...} on failure | [
"def get_num_names(include_expired=False, proxy=None, hostport=None):\n \n assert proxy or hostport, 'Need proxy or hostport'\n if proxy is None:\n proxy = connect_hostport(hostport)\n\n schema = {\n 'type': 'object',\n 'properties': {\n 'count': {\n 'type'... | [
"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:"
} |
General sort filter - sorts by either attribute or key. | [
"def sort_by(items, attr):\n \n def key_func(item):\n try:\n return getattr(item, attr)\n except AttributeError:\n try:\n return item[attr]\n except TypeError:\n getattr(item, attr) # Reraise AttributeError\n return sorted(items,... | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Orders by the specified property name (defaults to ascending)
@param propertyName The property name to order by
@return A Order instance | [
"public org.grails.datastore.mapping.query.api.Criteria order(String propertyName) {\n if (criteria == null) {\n throwRuntimeException(new IllegalArgumentException(\"Call to [order] with propertyName [\" +\n propertyName + \"]not allowed here.\"));\n }\n propertyNa... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
/*
(non-Javadoc)
@see edu.jhu.hlt.acute.archivers.Archiver#addEntry(edu.jhu.hlt.acute.archivers.Archivable) | [
"@Override\n public void addEntry(Archivable arch) throws IOException {\n final String fn = arch.getFileName();\n TarArchiveEntry entry = new TarArchiveEntry(fn);\n byte[] cbytes = arch.getBytes();\n entry.setSize(cbytes.length);\n this.tos.putArchiveEntry(entry);\n try (ByteArrayInputStream bis ... | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the Github post about org.archive.wayback.resourceindex:",
"pos": "Represent the Github code about org.archive.wayback.resourceindex:",
"neg": "Represent the Github code:"
} |
enqueue css asset to be loaded
@param [string] $css [css file to be loaded relative to base_asset_dir]
@param [array] $options [location=internal|external, position=first|last|after:file|before:file] | [
"protected function loadCss($css, $options=array())\n {\n $location = (isset($options['location'])) ? $options['location']:'internal';\n\n //after:file, before:file, first, last\n $position = (isset($options['position'])) ? $options['position']:'last';\n\n if(!in_array($css,$this->dat... | [
"def ng_bindings(binding, opt = {})\n opt[:root_selector] ||= ng_root_selector\n ng.get_nodes_2 :findBindingsIds, [binding, opt[:exact] == true], opt\n end"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Get loaded shipping method given its id.
@param CartInterface $cart Cart
@param string $shippingMethodId Shipping method id
@return ShippingMethod|null Required shipping method | [
"public function getOneById(CartInterface $cart, $shippingMethodId)\n {\n $shippingMethods = $this->get($cart);\n\n return array_reduce(\n $shippingMethods,\n function (\n $foundShippingMethod,\n ShippingMethod $shippingMethod\n ) use (... | [
"public function execute(Observer $observer) {\n\n // Get the order\n $order = $observer->getEvent()->getOrder();\n\n // Get the payment method\n $paymentMethod = $order->getPayment()->getMethod();\n\n // Test the current method used\n if ($paymentMethod == ConfigProvider::... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns a list of resource according to the conditions
@return string HTML output | [
"public function search()\n\t{\n\t\t$view = $this->getView();\n\t\t$context = $this->getContext();\n\n\t\ttry\n\t\t{\n\t\t\t$total = 0;\n\t\t\t$params = $this->storeSearchParams( $view->param(), 'locale/currency' );\n\t\t\t$manager = \\Aimeos\\MShop::create( $context, 'locale/currency' );\n\n\t\t\t$search = $manage... | [
"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 Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Converts a Native File Object to Upload File object | [
"protected UploadFile convertUploadFile(File file) {\n Date lastModifiedDate = new Date();\n // Avoid parsing error on last modified date\n if (file.lastModifiedDate != null && !file.lastModifiedDate.isEmpty()) {\n lastModifiedDate = new Date(file.lastModifiedDate);\n }\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Apply updates a view with the view updates properties. | [
"func (u ViewUpdate) Apply(v *View) error {\n\tif err := u.Valid(); err != nil {\n\t\treturn err\n\t}\n\n\tif u.Name != nil {\n\t\tv.Name = *u.Name\n\t}\n\n\tif u.Properties != nil {\n\t\tv.Properties = u.Properties\n\t}\n\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Find the deepest stack frame that is not part of SCons.
Input is a "pre-processed" stack trace in the form
returned by traceback.extract_tb() or traceback.extract_stack() | [
"def find_deepest_user_frame(tb):\n \n\n tb.reverse()\n\n # find the deepest traceback frame that is not part\n # of SCons:\n for frame in tb:\n filename = frame[0]\n if filename.find(os.sep+'SCons'+os.sep) == -1:\n return frame\n return tb[0]"
] | [
"def getFilenameSet(self):\n \n result = set(self._mergeFileTiming())\n # Ignore profiling code. __file__ does not always provide consistent\n # results with f_code.co_filename (ex: easy_install with zipped egg),\n # so inspect current frame instead.\n # Get current file fr... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Connect to the server | [
"def connect\n site = @proxy || @dest\n begin\n retry_number = 0\n timeout(@connect_timeout) do\n @socket = create_socket(site)\n begin\n @src.host = @socket.addr[3]\n @src.port = @socket.addr[1]\n rescue SocketError\n # to avoid IPSocket#addr problem ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Calls the iPOPO unbind method | [
"def __unbind_call(self, still_valid):\n \n with self._lock:\n if self.__timer is not None:\n # Timeout expired, we're not valid anymore\n self.__timer = None\n self.__still_valid = still_valid\n self._ipopo_instance.unbind(\n ... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} | [
"@XmlElementDecl(namespace = \"http://docs.oasis-open.org/ns/cmis/messaging/200908/\", name = \"filter\", scope = GetCheckedOutDocs.class)\r\n\tpublic JAXBElement<String> createGetCheckedOutDocsFilter(String value) {\r\n\t\treturn new JAXBElement<String>(_GetPropertiesFilter_QNAME,\r\n\t\t\t\tString.class, GetCheck... | [
"@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\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:"
} |
Validate JSON by parsing string data. Returns the json dict. | [
"def validate_json(data: str):\n \n result = None\n try:\n result = json.loads(data)\n except ValueError as error:\n log(ERROR, \"invalid json: %s\", error)\n\n return result"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// GET /server_appliances | [
"func (api *API) ListServerAppliances(args ...interface{}) ([]ServerAppliance, error) {\n\turl, err := processQueryParams(createUrl(api, serverAppliancePathSegment), args...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres := []ServerAppliance{}\n\terr = api.Client.Get(url, &res, http.StatusOK)\n\tif err != nil... | [
"def list(self, subid, params=None):\n ''' \n '''\n params = update_params(params, {'SUBID': subid})\n return self.request('/v1/server/list_ipv4', params, 'GET')"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
/* Helper library to interpret commands as they flow in
Please invoke with a valid Webhook configuration | [
"function CommandInterpreter(config) {\n this.token = config.token;\n if (!this.token) {\n debug(\"token required, skipping interpreter initialization...\");\n return;\n }\n \n // A bot should ignore its own messages by default\n // Only case when this would be set to true is for a d... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get the command string that can be used to create this screen.
@return The screen command (defaults to ?applet=&screen=xxx.xxx.xxxx). | [
"public String getScreenCommand()\n {\n String strCommand = super.getScreenCommand();\n FieldList record = this.getFieldList();\n if (record != null)\n if ((record.getEditMode() == Constants.EDIT_IN_PROGRESS)\n || (record.getEditMode() == Constants.EDIT_CURRENT))\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Before every action of this controller.
We sets appropriate breadcrumbs based on current action being requested.
@param \Cake\Event\Event $event The event that was triggered
@return void | [
"public function beforeRender(Event $event)\n {\n $this->_beforeRender($event);\n $this->loadModel('Content.ContentTypes');\n $this->Breadcrumb->push('/admin/content/types');\n $contentType = $this->ContentTypes\n ->find()\n ->where(['slug' => $this->request->que... | [
"public function setup()\n {\n if (!$this->_checkRequestType('jsonapi')) {\n return;\n }\n\n $appClass = Configure::read('App.namespace') . '\\Application';\n\n // If `App\\Application` class exists it means Cake 3.3's PSR7 middleware\n // implementation is used and ... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// Merge with storage and maybe notify the gui of staleness | [
"func (s *HybridConversationSource) mergeMaybeNotify(ctx context.Context,\n\tconvID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) error {\n\n\tmergeRes, err := s.storage.Merge(ctx, convID, uid, msgs)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.notifyExpunge(ctx, uid, convID, mergeRes)\n\ts.no... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Sets current page and calculates offset
@param integer $value The number of the current page.
@return Pagination A self instance for method chain calls | [
"public function setCurrent($value)\n {\n if (!StaticValidator::isValid('number', $value)) {\n return $this;\n }\n\n $this->_current = StaticFilter::filter('number',$value);\n $this->_offset = $this->_rowsPerPage * ($this->_current - 1);\n return $this;\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 Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get list of all update sequences.
@return \Generator|SequenceInterface[]
@throws ConfigException | [
"public function updateSequence(): \\Generator\n {\n $sequence = $this->config['update'] ?? $this->config['updateSequence'] ?? [];\n foreach ($sequence as $item) {\n yield $this->parseSequence($item);\n }\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Create an L{SSHFactory} which allows access to Mantissa accounts. | [
"def getFactory(self):\n \n privateKey = Key.fromString(data=self.hostKey)\n public = privateKey.public()\n factory = SSHFactory()\n factory.publicKeys = {'ssh-rsa': public}\n factory.privateKeys = {'ssh-rsa': privateKey}\n factory.portal = Portal(\n IReal... | [
"@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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Check whether a job is running for too long or not.
@return true if the is running for too long, else false.
Returned value is made available for testing purposes. | [
"boolean detectLongRunningJob(long currentTime, Job job) {\n\t\tif(job.status() == JobStatus.RUNNING && !longRunningJobs.containsKey(job)) {\n\t\t\tint jobExecutionsCount = job.executionsCount();\n\t\t\tLong jobStartedtimeInMillis = job.lastExecutionStartedTimeInMillis();\n\t\t\tThread threadRunningJob = job.thread... | [
"public List<Rule> findRulesToExecute() {\n\n\t\tthis.logger.fine( \"Looking for rules to execute after an event was recorded for application \" + this.app );\n\t\tList<Rule> result = new ArrayList<> ();\n\t\tlong now = System.nanoTime();\n\n\t\t/*\n\t\t * For all the rules, find if there are events that should tri... | codesearchnet | {
"query": "Represent the description about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about programming:"
} |
Gets the width of a range of characters.
@param startIdx the first index to calculate
@param lastIdx the last inclusive index to calculate
@return the sum of all widths | [
"public float getWidth(int startIdx, int lastIdx) {\n char c = 0;\n PdfChunk ck = null;\n float width = 0;\n for (; startIdx <= lastIdx; ++startIdx) {\n boolean surrogate = Utilities.isSurrogatePair(text, startIdx);\n if (surrogate) {\n width += detai... | [
"public static int byteCount(Slice slice, int offset, int length, int codePointCount)\n {\n requireNonNull(slice, \"slice is null\");\n if (length < 0) {\n throw new IllegalArgumentException(\"length must be greater than or equal to zero\");\n }\n if (offset < 0 || offset +... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Remove the Remind command with the uid from the file | [
"def remove(self, uid, filename=None):\n \"\"\"\"\"\"\n if not filename:\n filename = self._filename\n elif filename not in self._reminders:\n return\n\n uid = uid.split('@')[0]\n\n with self._lock:\n rem = open(filename).readlines()\n f... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Inflate the layout associated to this renderer | [
"@Override protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {\n return layoutInflater.inflate(R.layout.episode_row, viewGroup, false);\n }"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Invite generates a token which can be used to add another SSH node
// to a cluster | [
"func (c *NodeCommand) Invite(client auth.ClientI) error {\n\t// parse --roles flag\n\troles, err := teleport.ParseRoles(c.roles)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\ttoken, err := client.GenerateToken(auth.GenerateTokenRequest{Roles: roles, TTL: c.ttl, Token: c.token})\n\tif err != nil {\n\t\tret... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the instruction about API documentation:",
"pos": "Represent the code about API documentation:",
"neg": "Represent the code:"
} |
Deletes a user with the given id.
@return \Closure | [
"public function delete()\n {\n $delete = function($id) {\n $user = $this->userRepository->findUserById($id);\n if (!$user) {\n throw new EntityNotFoundException($this->userRepository->getClassName(), $id);\n }\n\n $this->em->remove($user);\n ... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Locks document by storing the lock mode on the mapped lock field. | [
"public function lock(object $document, int $lockMode) : void\n {\n $id = $this->uow->getDocumentIdentifier($document);\n $criteria = ['_id' => $this->class->getDatabaseIdentifierValue($id)];\n $lockMapping = $this->class->fieldMappings[$this->class->lockField];\n assert($... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// UnmarshalJSON unmarshals json into a VariableArguments struct, using the `Type`
// field to assign the approriate struct to the `Values` field | [
"func (a *VariableArguments) UnmarshalJSON(data []byte) error {\n\ttype Alias VariableArguments\n\taux := struct{ *Alias }{Alias: (*Alias)(a)}\n\n\terr := json.Unmarshal(data, &aux)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Decode the polymorphic VariableArguments.Values field into the approriate struct\n\tsw... | [
"func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Build a new remote session and initialize it.
NOTE: This is convenience method to create a task below the current APPLICATION (not below this task)
@param properties to create the new remote task
@return The remote Task. | [
"public RemoteTask createRemoteTask(Map<String, Object> properties) throws RemoteException\n { // Note: This new task's parent is MY application!\n BaseTransport transport = this.createProxyTransport(CREATE_REMOTE_TASK); // Don't use my method yet, since I don't have the returned ID\n transport.a... | [
"@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 text about file transfer:",
"pos": "Represent the code about file transfer:",
"neg": "Represent the code about programming:"
} |
Return useful information from a SmartOS compute node | [
"def _smartos_computenode_data():\n '''\n \n '''\n # Provides:\n # vms_total\n # vms_running\n # vms_stopped\n # vms_type\n # sdc_version\n # vm_capable\n # vm_hw_virt\n\n grains = {}\n\n # collect vm data\n vms = {}\n for vm in __salt__['cmd.run']('vmadm l... | [
"@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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
===== BUILD LOCATION ============================================================================================= | [
"def derived_data_location\n derived_data_style = value_for_setting('IDEWorkspaceUserSettings_DerivedDataLocationStyle')\n custom_derived_data_location = value_for_setting('IDEWorkspaceUserSettings_DerivedDataCustomLocation')\n \n if derived_data_style == 2 # 2 is the code for 'Workspace-relativ... | [
"protected function ping(InputInterface $input, OutputInterface $output)\n {\n $input;\n //====================================================================//\n // Perform Ping Test\n $result = Splash::Selftest();\n //=========================================================... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
standard-css-notate CamelCased string.
@param {String} string
@returns {String} | [
"function(string) {\n\t\t\treturn string.replace(/[A-Z]/g, function(all, letter) {\n\t\t\t\treturn \"-\" + string.charAt(letter).toLowerCase();\n\t\t\t});\n\t\t}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github instruction about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
设置全局配置:是否通过debug日志显示SQL
@param isShowSql 是否显示SQL
@param isFormatSql 是否格式化显示的SQL
@param isShowParams 是否打印参数
@param level SQL打印到的日志等级
@since 4.1.7 | [
"public static void setShowSqlGlobal(boolean isShowSql, boolean isFormatSql, boolean isShowParams, Level level) {\r\n\t\tSqlLog.INSTASNCE.init(isShowSql, isFormatSql, isShowParams, level);\r\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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
//生成 ORDER BY 子句 | [
"func (a *DataTable) GenOrderBy(args ...func(string, string) string) string {\n\treturn a.orders.Sql(args...)\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Convert a string representation of a HostHostBusAdapter into an
object reference. | [
"def _get_hba_type(hba_type):\n '''\n \n '''\n if hba_type == \"parallel\":\n return vim.host.ParallelScsiHba\n elif hba_type == \"block\":\n return vim.host.BlockHba\n elif hba_type == \"iscsi\":\n return vim.host.InternetScsiHba\n elif hba_type == \"fibre\":\n retu... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Processes the client-side payload, and transforms the client-side
callback function signal to an actual callback function | [
"function getPayload(req, res, next) {\n req.hasCallback = false;\n req.payload = req.body.payload || [];\n\n // Determines if the request is asynchronous or not\n req.payload.forEach(function(arg, i) {\n if (arg === '__clientCallback__') {\n req.hasCallback = true;\n req.clientCallbackIndex = i;\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GetURL returns the URL field if it's non-nil, zero value otherwise. | [
"func (d *DiscussionComment) GetURL() string {\n\tif d == nil || d.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.URL\n}"
] | [
"def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the icons presenter instance.
@return IconSetInterface | [
"public function getPresenter(): ?IconSetInterface\n {\n static $presenter;\n\n if ($presenter instanceof IconSetInterface) {\n return $presenter;\n }\n\n return $presenter = $this->hasPresenter() ? app($this->icons_presenter_class) : null;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Clean removes HTML elements around the main content and prepares the document for parsing | [
"func (c *Cleaner) Clean(docToClean *goquery.Document) *goquery.Document {\n\tif c.config.debug {\n\t\tlog.Println(\"Starting cleaning phase with Cleaner\")\n\t}\n\tdocToClean = c.cleanBr(docToClean)\n\tdocToClean = c.cleanArticleTags(docToClean)\n\tdocToClean = c.cleanEMTags(docToClean)\n\tdocToClean = c.dropCaps(... | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github instruction about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code about Language and programming:"
} |
Returns true if the region is explicitly configured in the partition
or if the region matches the {@link #regionRegex} of the partition. | [
"public boolean hasRegion(String region) {\n return regions.containsKey(region) || matchesRegionRegex(region) || hasServiceEndpoint\n (region);\n }"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Fetch the token data from the store.
:param opts: Salt master config options
:param tok: Token value to get
:returns: Token data if successful. Empty dict if failed. | [
"def get_token(opts, tok):\n '''\n \n '''\n redis_client = _redis_client(opts)\n if not redis_client:\n return {}\n serial = salt.payload.Serial(opts)\n try:\n tdata = serial.loads(redis_client.get(tok))\n return tdata\n except Exception as err:\n log.warning(\n ... | [
"def get(self, key, namespace=None):\n \"\"\"\"\"\"\n full_key = generate_uppercase_key(key, namespace)\n full_key = full_key.lower()\n\n logger.debug('Searching %s for %s', self, full_key)\n\n # Build a map of lowercase -> actual key\n obj_keys = {\n item.lower(... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Run the test with this method.
The data is input for the {@link Record}.
@param input input {@link Record}
@param output result of {@link Record} {@link List} | [
"public void run(Record input, List<Record> output) {\n driver.withInput(input.getKey(), input.getValue());\n\n if (output != null) {\n for (Record r : output) {\n driver.withOutput(r.getKey(), r.getValue());\n }\n }\n\n driver.runTest();\n }"
] | [
"@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift... | codesearchnet | {
"query": "Represent the text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
/*
enums
ZERO
ONE
SRC_COLOR
ONE_MINUS_SRC_COLOR
SRC_ALPHA
ONE_MINUS_SRC_ALPHA
DST_ALPHA
ONE_MINUS_DST_ALPHA
DST_COLOR
ONE_MINUS_DST_COLOR
SRC_ALPHA_SATURATE | [
"function( srcRgb, dstRgb, srcAlpha, dstAlpha ){\n this._dat[ 0|BLEND_FUNC_C_SRC ] = srcRgb;\n this._dat[ 0|BLEND_FUNC_C_DST ] = dstRgb;\n this._dat[ 0|BLEND_FUNC_A_SRC ] = srcAlpha;\n this._dat[ 0|BLEND_FUNC_A_DST ] = dstAlpha;\n this._set |= BLEND_FUNC_SET | BLEND_FUNC_A_SET;\n return this;\n }... | [
"public static int blendFunctionToGL(\n final JCGLBlendFunction function)\n {\n switch (function) {\n case BLEND_CONSTANT_ALPHA:\n return GL2ES2.GL_CONSTANT_ALPHA;\n case BLEND_CONSTANT_COLOR:\n return GL2ES2.GL_CONSTANT_COLOR;\n case BLEND_DESTINATION_ALPHA:\n return GL.G... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Save properties to a file.
@param file
Destination file - Cannot be <code>null</code> and parent directory must exist.
@param props
Properties to save - Cannot be <code>null</code>.
@param comment
Comment for the file. | [
"public static void saveProperties(final File file, final Properties props, final String comment) {\n checkNotNull(\"file\", file);\n checkNotNull(\"props\", props);\n\n if (!file.getParentFile().exists()) {\n throw new IllegalArgumentException(\"The parent directory '\" + file.getPa... | [
"public void setValue(Object value) {\n\n if(LOGGER.isInfoEnabled() && !(value instanceof java.io.Serializable))\n LOGGER.info(\"Warning: setting a filter value tiat is not serializable. The Filter object is serializable and should contain only serializable state\");\n\n _value = value;\n ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Wraps a coroutine function with pre-defined arguments (including keyword
arguments). It is an asynchronous version of :func:`functools.partial`. | [
"def apartial(coro, *args, **kwargs):\n '''\n \n '''\n\n @functools.wraps(coro)\n async def wrapped(*cargs, **ckwargs):\n return await coro(*args, *cargs, **kwargs, **ckwargs)\n\n return wrapped"
] | [
"def _get_target(self):\n \n if None in [self._func, self._func_kwargs, self._func_kwargs, self._every_kwargs]:\n raise ValueError('You must call the .every() and .run() methods on every tab.')\n return self._loop"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Create or replace a document with the given ID
@param array $document Document to create. Must include `_id` and `_type`
@param array $options Optional request options
@return array Returns the created document | [
"public function createOrReplace($document, $options = null)\n {\n $this->assertProperties($document, ['_id', '_type'], 'createOrReplace');\n return $this->createDocument($document, 'createOrReplace', $options);\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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Look for the given file in the directory containing the current
file, and then in each of the directories specified in the
RDOC_INCLUDE path | [
"def find_include_file(name)\n to_search = [ File.dirname(@input_file_name) ].concat @include_path\n to_search.each do |dir|\n full_name = File.join(dir, name)\n stat = File.stat(full_name) rescue next\n return full_name if stat.readable?\n end\n nil\n end"
] | [
"def is_secretly_root(lib):\n \n from distutils import ccompiler\n libdir = os.path.dirname(lib)\n cc = ccompiler.new_compiler()\n for rootlib in (\"Core\",\"MathCore\"):\n if not cc.find_library_file([libdir], rootlib):\n return False\n else:\n try:\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the template path for given code.
@param string|null $code
@return string | [
"protected function getTemplatePath($code)\n {\n $code = $code ?: $this->getDefaultTemplateCode();\n $template = $this->get($code);\n\n return $template ? $template->getPath() : $this->defaultTemplatePath;\n }"
] | [
"def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sent out any buffered messages if necessary. | [
"protected static function process_buffer() {\n // Reset the buffers first in case we get exception from processor.\n $messages = self::$buffer;\n self::$buffer = array();\n $convmessages = self::$convmessagebuffer;\n self::$convmessagebuffer = array();\n\n foreach ($messag... | [
"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:"
} |
Implements java.util.ResourceBundle.handleGetObject; inherits javadoc specification. | [
"public final Object handleGetObject(String key) {\n // lazily load the lookup hashtable.\n if (lookup == null) {\n loadLookup();\n }\n if (key == null) {\n throw new NullPointerException();\n }\n return lookup.get(key); // this class ignores locales\n... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Return an array of all value. | [
"def valarray(shape, value=np.NaN, typecode=None):\n \"\"\"\"\"\"\n if typecode is None:\n typecode = bool\n out = np.ones(shape, dtype=typecode) * value\n\n if not isinstance(out, np.ndarray):\n out = np.asarray(out)\n return out"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
list(context, verbose)
List all tags.
>>> dcictl tag-list
:param boolean verbose: Display verbose output | [
"def list(context, verbose):\n \n result = tag.list(context)\n utils.format_output(result, context.format, verbose=verbose)"
] | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param string $name
@param array $constraints
@return ValidationPropertyMappingBuilderInterface | [
"public static function create(string $name, array $constraints): ValidationPropertyMappingBuilderInterface\n {\n $self = new self();\n $self->name = $name;\n\n $self->constraints = [];\n foreach ($constraints as $constraint) {\n $self->addConstraint($constraint);\n ... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// You should always use this function to get a new UpdateVMAffinityGroupParams instance,
// as then you are sure you have configured all required params | [
"func (s *AffinityGroupService) NewUpdateVMAffinityGroupParams(id string) *UpdateVMAffinityGroupParams {\n\tp := &UpdateVMAffinityGroupParams{}\n\tp.p = make(map[string]interface{})\n\tp.p[\"id\"] = id\n\treturn p\n}"
] | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Get all the branch aliases.
@param ApiPackage\Version $version
@return null|array | [
"private function getBranchAliases(ApiPackage\\Version $version)\n {\n $extra = $version->getExtra();\n if (null !== $extra\n && isset($extra[\"branch-alias\"])\n && is_array($extra[\"branch-alias\"])\n ) {\n return $extra[\"branch-alias\"];\n }\n\n ... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Subscribes to a topic.
@param consumer
@param topic
@since 1.3.2 | [
"private void _checkAndSubscribe(KafkaConsumer<?, ?> consumer, String topic) {\n synchronized (consumer) {\n Set<String> subscription = consumer.subscription();\n if (subscription == null || !subscription.contains(topic)) {\n consumer.subscribe(Arrays.asList(topic));\n ... | [
"public function setNotificationType($s) {\n if (is_string($s)){\n $this->options['Subscription.NotificationType'] = $s;\n $this->options['NotificationType'] = $s;\n } else {\n return false;\n }\n /*\n * List of valid Notification Types:\n ... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Unsets properties of a user. The list must not be empty.
@param uid ID of the user
@param properties a list of all the properties to unset
@param eventTime timestamp of the event
@return ID of this event | [
"public String unsetUser(String uid, List<String> properties, DateTime eventTime)\n throws ExecutionException, InterruptedException, IOException {\n return createEvent(unsetUserAsFuture(uid, properties, eventTime));\n }"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Open an IPython console for the given client or the current one. | [
"def open_console(self, client=None):\r\n \"\"\"\"\"\"\r\n if not client:\r\n client = self.get_current_client()\r\n if self.ipyconsole is not None:\r\n kernel_id = client.get_kernel_id()\r\n if not kernel_id:\r\n QMessageBox.critical(\r\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
附近 查看地点列表
@since 2.8.18
@param access_token access_token
@param page 起始页id(从1开始计数)
@param page_rows 每页展示个数(最多1000个)
@return result | [
"public static GetnearbypoilistResult getnearbypoilist(String access_token, int page, int page_rows){\r\n\t\tHttpUriRequest httpUriRequest = RequestBuilder.get()\r\n\t\t\t\t.setHeader(jsonHeader)\r\n\t\t\t\t.setUri(BASE_URI + \"/wxa/getnearbypoilist\")\r\n\t\t\t\t.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(ac... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
/*
CircuitsExtractor | [
"@Override\r\n public Map<Circuit, Collection<TileRef>> getCircuits(Collection<Media> levels,\r\n Media sheetsConfig,\r\n Media groupsConfig)\r\n {\r\n final Collection<MapTile> mapsSet = new... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Render an ImageButton
@param ImageButton $button
@return string | [
"public function imageButton(ImageButton $button)\n {\n $tag = new Tag('input');\n $tag->setAttribute('type', 'image');\n $tag->setAttribute('src', $button->getSrc());\n $tag->setAttribute('alt', $button->getAlt());\n\n return $this->parseTag($tag, $button);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Add some kerning data
@param first The first character
@param second The second character
@param offset The kerning offset to apply | [
"public void addKerning(int first, int second, int offset) {\r\n kerning.add(new KerningData(first, second, offset));\r\n }"
] | [
"def augment_cells_no_span(self, rows, source):\n \n # TODO: Hardwired str transform.\n # 4-tuple: morerows, morecols, offset, cellblock\n # - morerows: The number of additional rows this cells spans\n # - morecols: The number of additional columns this cell spans\n # - off... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns a list of all the entities.
@param array $options
@param integer $hydrationMode
@return array | [
"public function getEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)\n {\n $options = EntityRepositoryOptionsResolver::createAndResolve($options);\n return $this->getQueryBuilder($options['filters'], $options['sorting'])\n ->getQuery()\n ->execute(... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
/* produce a table from raw macro content (lines of tab (or 4 spaces) delimitted cells) | [
"function(args, content, options){\n\t\t\tvar lines = utils.parseLinesCells(content, false);\n\t\t\tvar output = \"<table>\\n\";\n\t\t\tif(args && args[0])\t// args[0] === table caption\n\t\t\t\toutput += \"<caption>\"+args[0]+\"</caption>\\n\";\n\t\t\tlines.forEach(function(cells){\n\t\t\t\tif(!cells.length)\n\t\t... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Validate that the given direction is one of the allowed constants.
If ``allow_bi`` is ``True`` then ``Direction.BIDIRECTIONAL`` is
acceptable. | [
"def direction(direction, allow_bi=False):\n \n valid = [Direction.CAUSE, Direction.EFFECT]\n if allow_bi:\n valid.append(Direction.BIDIRECTIONAL)\n\n if direction not in valid:\n raise ValueError('`direction` must be one of {}'.format(valid))\n\n return True"
] | [
"def statement_ref_mode(self, value):\n \"\"\"\"\"\"\n valid_values = ['STRICT_KEEP', 'STRICT_KEEP_APPEND', 'STRICT_OVERWRITE', 'KEEP_GOOD', 'CUSTOM']\n if value not in valid_values:\n raise ValueError('Not an allowed reference mode, allowed values {}'.format(' '.join(valid_values)))... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Construct the validation rules with values given in the config.
@return \GraphQL\Validator\Rules\ValidationRule[] | [
"protected function getValidationRules(): array\n {\n return [\n QueryComplexity::class => new QueryComplexity(config('lighthouse.security.max_query_complexity', 0)),\n QueryDepth::class => new QueryDepth(config('lighthouse.security.max_query_depth', 0)),\n DisableIntrospe... | [
"protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {\n return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Return a dictionary describing character ``char``. | [
"def character_copy(self, char):\n \"\"\"\"\"\"\n ret = self.character_stat_copy(char)\n chara = self._real.character[char]\n nv = self.character_nodes_stat_copy(char)\n if nv:\n ret['node_val'] = nv\n ev = self.character_portals_stat_copy(char)\n if ev:\n... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// MonthNarrow returns the locales narrow month given the 'month' provided | [
"func (ml *ml_IN) MonthNarrow(month time.Month) string {\n\treturn ml.monthsNarrow[month]\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Create a venue from a description.
@param Description $description The venue description.
@return Venue | [
"public function create(Description $description)\n {\n return new Venue(\n new Identifier($description->getMandatoryProperty('id')),\n $description->getMandatoryProperty('name'),\n $this->getCategories($description),\n $this->getTipGroups($description),\n ... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IMachineStateChangedEventgetState(request *IMachineStateChangedEventgetState) (*IMachineStateChangedEventgetStateResponse, error) {\n\tresponse := new(IMachineStateChangedEventgetStateResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, e... | [
"@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 Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Some docstrings. | [
"def signal(e):\n \n callback = find_handler(e)\n if callback is None:\n if _activate_debugger:\n print 'Handler for error {0} not found'.format(type(e))\n traceback.print_stack()\n set_trace()\n raise e\n else:\n return callback(e)"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// handleFrame handles a single frame received from the channel. This is a
// convenience funciton to dedupe code for the multiple deadline cases. | [
"func (c *conn) handleFrame(message *messageEvent, ok bool) (*messageEvent, error) {\n\tif !ok { // The channel has been closed\n\t\treturn nil, io.EOF\n\t} else if message == nil {\n\t\t// See onClose for the explanation about sending a nil item.\n\t\tclose(c.ch)\n\t\treturn nil, io.EOF\n\t}\n\n\treturn message, n... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.