query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Returns an estimate of the number of path+queries that this visit state should keep in memory. @return an estimate of the number of path+queries that this visit state should keep in memory.
[ "public int pathQueryLimit() {\n\t\t/* We first compute the ratio beween the delay for scheme+authorities and the IP delay.\n\t\t * It is usually greater than one and it expresses the number of scheme+authorities\n\t\t * that can \"fit\" the IP delay. */\n\t\tfinal double delayRatio = Math.max(1 , (frontier.rc.sche...
[ "function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// UniqueCoords creates a new coordinate array (with the same layout as the inputs) that // contains each unique coordinate in the coordData. The ordering of the coords are the // same as the input.
[ "func UniqueCoords(layout geom.Layout, compare Compare, coordData []float64) []float64 {\n\tset := NewTreeSet(layout, compare)\n\tstride := layout.Stride()\n\tuniqueCoords := make([]float64, 0, len(coordData))\n\tnumCoordsAdded := 0\n\tfor i := 0; i < len(coordData); i += stride {\n\t\tcoord := coordData[i : i+stri...
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Group the resulted collection to multiple chunk :@param size: 0 :@type size: integer :@return Chunked List
[ "def chunk(self, size=0):\n \n\n if size == 0:\n raise ValueError('Invalid chunk size')\n\n self.__prepare()\n _new_content = []\n\n while(len(self._json_data) > 0):\n _new_content.append(self._json_data[0:size])\n self._json_data = self._json_data...
[ "def QA_fetch_index_list_adv(collections=DATABASE.index_list):\n '''\n \n '''\n index_list_items = QA_fetch_index_list(collections)\n if len(index_list_items) == 0:\n print(\"QA Error QA_fetch_index_list_adv call item for item in collections.find() return 0 item, maybe the DATABASE.index_list ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
A group allows a command to have subcommands attached. This is the most common way to implement nesting in Click. :param name: the name of the group (optional) :param commands: a dictionary of commands.
[ "def group(self, *args, **kwargs):\n \n return super().group(\n *args, cls=kwargs.pop('cls', AppGroup) or AppGroup, **kwargs)" ]
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns request handler @return \Zend\Http\Client
[ "public function getRequestHandler()\r\n {\r\n if (!isset($this->requestHandler)) {\r\n $requestHandler = new \\Zend\\Http\\Client();\r\n $requestHandler->setOptions(array(\r\n 'timeout'=> 60\r\n ));\r\n $this->setRequestHandler($requestHandler);\...
[ "public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Traverse trie node. @param str the str @return the trie node
[ "public TrieNode traverse(String str) {\n if (str.isEmpty()) {\n return this;\n }\n return getChild(str.charAt(0)).map(n -> n.traverse(str.substring(1))).orElse(this);\n }" ]
[ "def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()" ]
codesearchnet
{ "query": "Represent the Github instruction about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about programming:" }
Creates a Product API interface @param string $url Url to analyze @return Product
[ "public function createProductAPI($url)\r\n {\r\n $api = new Product($url);\r\n if (!$this->getHttpClient()) {\r\n $this->setHttpClient();\r\n }\r\n if (!$this->getEntityFactory()) {\r\n $this->setEntityFactory();\r\n }\r\n return $api->registerDiff...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Get the cache control directives @link https://tools.ietf.org/html/rfc7234#page-21 @return array
[ "protected function _getCacheControl()\n {\n $cache = array();\n $response = $this->getResponse();\n\n if($response->getUser()->isAuthentic()) {\n $cache = array('private');\n } else {\n $cache = array('public');\n }\n\n if(0 == $cache['max-age'] = ...
[ "final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}" ]
codesearchnet
{ "query": "Represent the Github text about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
Create dumpfile from postgres database, and return filename.
[ "def dump_database(self):\n \n db_file = self.create_file_name(self.databases['source']['name'])\n self.print_message(\"Dumping postgres database '%s' to file '%s'\"\n % (self.databases['source']['name'], db_file))\n self.export_pgpassword('source')\n arg...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github comment about Database Management:", "pos": "Represent the Github code about Database Management:", "neg": "Represent the Github code about Technology:" }
Removed the lines with the wrongly sorted tags. @return array The first tag token of this doc block.
[ "private function removeOldTagLines(): array\n {\n $tags = $this->getTagTokens();\n $firstTag = array_shift($tags);\n\n (new LineHelper($this->file))\n ->removeLines(\n $firstTag['line'],\n $this->tokens[$this->token['comment_closer']]['line']\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Return the absolute path of the whl in a setup.py install directory.
[ "def _get_whl_from_dir(cls, install_dir):\n \"\"\"\"\"\"\n dist_dir = cls._get_dist_dir(install_dir)\n dists = glob.glob(os.path.join(dist_dir, '*.whl'))\n if len(dists) == 0:\n raise cls.BuildLocalPythonDistributionsError(\n 'No distributions were produced by python_create_distribution task...
[ "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:" }
Validates the product equation. * Validates the feature order * Validates the product spec (mandatory functional features) :param poi: optional product of interest
[ "def validate_product_equation(poi=None):\n \n from . import utils\n from . import validators\n\n container_dir, product_name = tasks.get_poi_tuple(poi=poi)\n feature_list = utils.get_features_from_equation(container_dir, product_name)\n ordering_constraints = utils.get_feature_order_constraints(c...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns cache if exists, otherwise the translation cache file is created, filled with content and returned @param sFire\System\File $cache @param sFire\System\File $file
[ "private static function cache(File $cache, File $file) {\r\n\r\n\t\tif(false === isset(static :: $translations[$cache -> entity() -> getName()])) {\r\n\r\n\t\t\t$parse = true;\r\n\r\n\t\t\tif(true === $cache -> exists()) {\r\n\t\t\t\t\r\n\t\t\t\tif($cache -> entity() -> getModificationTime() >= $file -> entity() -...
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Errorf logs a message with severity ERROR.
[ "func Errorf(ctx context.Context, format string, v ...interface{}) {\n\tinstance.Errorf(ctx, format, v...)\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
Initialize password recovery form @access public @author Aleh Hutnikau <hutnikau@1pt.com>
[ "public function initForm()\n {\n $this->form = tao_helpers_form_FormFactory::getForm('passwordRecoveryForm');\n\n $connectElt = tao_helpers_form_FormFactory::getElement('recovery', 'Submit');\n $connectElt->setValue(__('Email'));\n $connectElt->setAttribute('class', 'btn-success smal...
[ "def helpAbout(self):\n \n\n # Text to be displayed\n about_text = translate('pyBarPlugin',\n \"\"\"<qt>\n <p>Data plotting plug-in for pyBAR.\n </qt>\"\"\",\n 'About')\n\n descr = dict(module_name='pyBarPl...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
builds an order-by clause
[ "def clause(grouped_columns_calculations = nil)\n return nil if sorts_by_method? || default_sorting?\n\n # unless the sorting is by method, create the sql string\n order = []\n each do |sort_column, sort_direction|\n next if constraint_columns.include? sort_column.name\n sql = grou...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parse a single field from {@code tokenizer} and merge it into {@code builder}.
[ "private static void mergeField(final Tokenizer tokenizer,\n final ExtensionRegistry extensionRegistry,\n final Message.Builder builder)\n throws ParseException {\n FieldDescriptor field;\n final Descriptor type = ...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Same as `ol.events.condition.platformModifierKeyOnly`. @param {JQueryEventObject} event Event. @return {boolean} True if only the platform modifier key is pressed. @private
[ "function isPlatformModifierKeyOnly(event) {\n return !event.altKey &&\n (olHas.MAC ? event.metaKey : event.ctrlKey) &&\n !event.shiftKey;\n}" ]
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the refund. @param CardPayments\Refund $refund @return CardPayments\Refund[] @throws PaysafeException
[ "public function getRefund(CardPayments\\Refund $refund)\n {\n $refund->setRequiredFields(array('id'));\n $refund->checkRequiredFields();\n\n $request = new Request(array(\n 'method' => Request::GET,\n 'uri' => $this->prepareURI(\"/refunds/\" . $refund->id)\n )...
[ "final public function transaction(?string $version = null): Contracts\\Bill\\Transaction\n {\n return $this->uses('Bill.Transaction', $version);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Transaction Management:" }
// GetGroupResult implements AggregationFunction interface.
[ "func (cf *concatFunction) GetGroupResult(groupKey []byte) (d types.Datum) {\n\tctx := cf.getContext(groupKey)\n\tif ctx.Buffer != nil {\n\t\td.SetString(ctx.Buffer.String())\n\t} else {\n\t\td.SetNull()\n\t}\n\treturn d\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 Github comment about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code about programming:" }
Create a new Number path @param <A> @param property property name @param type property type @return property path
[ "@SuppressWarnings(\"unchecked\")\n protected <A extends Number & Comparable<?>> NumberPath<A> createNumber(String property, Class<? super A> type) {\n return add(new NumberPath<A>((Class) type, forProperty(property)));\n }" ]
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Documentation:" }
Consumes the next character in the request, checking that it matches the expected one. This method should be used when the
[ "protected void consumeChar(ImapRequestLineReader request, char expected)\n throws ProtocolException {\n char consumed = request.consume();\n if (consumed != expected) {\n throw new ProtocolException(\"Expected:'\" + expected + \"' found:'\" + consumed + '\\'');\n }\n }...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
@since 0.0.1 @author Igor Ivanovic @method RouteRule#match @description Match named
[ "function RouteRule_match(rgx, str) {\n var group, matched, data = [];\n if (Type.isString(rgx)) {\n rgx = this.toRegex(rgx);\n }\n if (Type.isObject(rgx) && Type.isRegExp(rgx.regex)) {\n if (rgx.group && rgx.group.length) {\n group = rgx.group;\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 post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// NewDriver returns a new driver implementation for this version of Parallels // Desktop, or an error if the driver couldn't be initialized.
[ "func NewDriver() (Driver, error) {\n\tvar drivers map[string]Driver\n\tvar prlctlPath string\n\tvar prlsrvctlPath string\n\tvar supportedVersions []string\n\tDHCPLeaseFile := \"/Library/Preferences/Parallels/parallels_dhcp_leases\"\n\n\tif runtime.GOOS != \"darwin\" {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"Parallel...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// ClosePortOnSubnet closes the given port and protocol for the unit on the given // subnet, which can be empty. When non-empty, subnetID must refer to an // existing, alive subnet, otherwise an error is returned.
[ "func (u *Unit) ClosePortOnSubnet(subnetID, protocol string, number int) error {\n\treturn u.ClosePortsOnSubnet(subnetID, protocol, number, number)\n}" ]
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Post-daemonize initialization
[ "protected function initializeDaemon() {\n declare (ticks = 100);\n\n // Install signal handlers\n pcntl_signal(SIGHUP, [$this, 'handleSignal']);\n pcntl_signal(SIGINT, [$this, 'handleSignal']);\n pcntl_signal(SIGTERM, [$this, 'handleSignal']);\n pcntl_signal(SIGCHLD, [$thi...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic Object eGet(int featureID, boolean resolve, boolean coreType) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.PGP1__XOSET:\n\t\t\t\treturn getXOset();\n\t\t\tcase AfplibPackage.PGP1__YOSET:\n\t\t\t\treturn getYOset();\n\t\t}\n\t\treturn super.eGet(featureID, resolve, coreType);\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 Github sentence about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Saves data using util_io, but smartly constructs a filename
[ "def save_cache(dpath, fname, cfgstr, data, ext='.cPkl', verbose=None):\n \n fpath = _args2_fpath(dpath, fname, cfgstr, ext)\n util_io.save_data(fpath, data, verbose=verbose)\n return fpath" ]
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SetNextToken sets the NextToken field's value.
[ "func (s *ListInstancesOutput) SetNextToken(v string) *ListInstancesOutput {\n\ts.NextToken = &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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// CheckLocalServerAddr - checks if serverAddr is valid and local host.
[ "func CheckLocalServerAddr(serverAddr string) error {\n\thost, port, err := net.SplitHostPort(serverAddr)\n\tif err != nil {\n\t\treturn uiErrInvalidAddressFlag(err)\n\t}\n\n\t// Strip off IPv6 zone information.\n\tif i := strings.Index(host, \"%\"); i > -1 {\n\t\thost = host[:i]\n\t}\n\n\t// Check whether port is ...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
/* Create the Prometheus metric name by sanitizing some characters
[ "private static String getPrometheusMetricName(String name) {\n\n String out = name.replaceAll(\"(?<!^|:)(\\\\p{Upper})(?=\\\\p{Lower})\", \"_$1\");\n out = out.replaceAll(\"(?<=\\\\p{Lower})(\\\\p{Upper})\", \"_$1\").toLowerCase();\n out = out.replaceAll(\"[-_.\\\\s]+\", \"_\");\n out =...
[ "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 software development:", "pos": "Represent the code about software development:", "neg": "Represent the code about programming:" }
// Add adds the values of all measurements in other to s.
[ "func (s MeasurementStats) Add(other MeasurementStats) {\n\tfor name, v := range other {\n\t\ts[name] += v\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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Runs the machine's +before+ callbacks for this transition. Only callbacks that are configured to match the event, from state, and to state will be invoked. Once the callbacks are run, they cannot be run again until this transition is reset.
[ "def before(complete = true, index = 0, &block)\n unless @before_run\n while callback = machine.callbacks[:before][index]\n index += 1\n \n if callback.type == :around\n # Around callback: need to handle recursively. Execution only gets\n #...
[ "function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
The file condition to wait for during execution. @deprecated in favor of {@link #file()}
[ "@Deprecated\n public WaitFileConditionBuilder file(String filePath) {\n FileCondition condition = new FileCondition();\n condition.setFilePath(filePath);\n container.setCondition(condition);\n this.buildAndRun();\n return new WaitFileConditionBuilder(condition, this);\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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
use setField to set values in target according to source source and target must have same structure
[ "function(source, target) {\n var linkedTarget = $(target);\n clearLinkedData(target);\n $.each(source, function(key, sourceValue) {\n if (isInternal(key)) {\n return;\n }\n var targetValue = null;\n if ($.isPlainObject(sourceValue)) {\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// FindUserBySlackID converts a slack.User into a bot.User struct
[ "func FindUserBySlackID(userID string) *bot.User {\n\tslackUser, err := api.GetUserInfo(userID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error retrieving slack user: %s\\n\", err)\n\t\treturn &bot.User{\n\t\t\tID: userID,\n\t\t\tIsBot: false}\n\t}\n\treturn &bot.User{\n\t\tID: userID,\n\t\tNick: slackUser....
[ "@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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Returns the list of available properties and their corresponding URLs.
[ "private void taskProperties(RESTRequest request, RESTResponse response) {\n String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID);\n\n String taskPropertiesText = getMultipleRoutingHelper().getTaskProperties(taskID);\n OutputHelper.writeTextOutput(response, taskPrope...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get a view to render the given number. @param {zebkit.ui.RulerPan} t a target ruler panel. @param {Number} v a number to be rendered @return {zebkit.draw.View} a view to render the number @method getView
[ "function getView(t, v) {\n if (v !== null && v !== undefined && this.numPrecision !== -1 && zebkit.isNumber(v)) {\n v = v.toFixed(this.numPrecision);\n }\n return this.$super(t, v);\n }" ]
[ "function getPositionByKey(\n opts: Options,\n // The current value\n containerNode: Node,\n // Key of the node in desired position\n key: string\n): TablePosition {\n return TablePosition.create(opts, containerNode, key);\n}" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Checks if a pre-trained token embedding file name is valid. Parameters ---------- pretrained_file_name : str The pre-trained token embedding file.
[ "def _check_pretrained_file_names(cls, pretrained_file_name):\n \n\n embedding_name = cls.__name__.lower()\n if pretrained_file_name not in cls.pretrained_file_name_sha1:\n raise KeyError('Cannot find pretrained file %s for token embedding %s. Valid '\n 'pre...
[ "def parse_arguments(argv):\n \n parser = argparse.ArgumentParser(\n formatter_class=argparse.RawDescriptionHelpFormatter,\n description=textwrap.dedent(\"\"\"\\\n Runs analysis on structured data and produces auxiliary files for\n training. The output files can also be used by the Tra...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Stream not found status notification @param item Playlist item
[ "private void sendStreamNotFoundStatus(IPlayItem item) {\n Status notFound = new Status(StatusCodes.NS_PLAY_STREAMNOTFOUND);\n notFound.setClientid(streamId);\n notFound.setLevel(Status.ERROR);\n notFound.setDetails(item.getName());\n\n doPushMessage(notFound);\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Called by the invocation director when it discovers that the client object has changed.
[ "protected void clientObjectDidChange (ClientObject clobj)\n {\n _clobj = clobj;\n _cloid = _clobj.getOid();\n\n // report to our observers\n notifyObservers(new ObserverOps.Session(this) {\n @Override protected void notify (SessionObserver obs) {\n obs.clien...
[ "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:" }
Returns the {@link BitemporalCondition} represented by this builder. @return a new bitemporal condition
[ "@Override\n public BitemporalCondition build() {\n return new BitemporalCondition(boost, field, vtFrom, vtTo, ttFrom, ttTo);\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Resolve leading and trailing spaces, which may involve prepopulating other positions
[ "function() {\n if (!this.prepopulatedChar) {\n this.prepopulateChar();\n }\n if (this.checkForTrailingSpace) {\n var trailingSpace = this.session.getNodeWrapper(this.node.childNodes[this.offset - 1]).getTrailingSpace();\n log.debug(\"res...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Initialize the "fileWatcher" domain. The fileWatcher domain handles watching and un-watching directories.
[ "function init(domainManager) {\n if (!domainManager.hasDomain(\"fileWatcher\")) {\n domainManager.registerDomain(\"fileWatcher\", {major: 0, minor: 1});\n }\n\n domainManager.registerCommand(\n \"fileWatcher\",\n \"watchPath\",\n watcherManager.watchPath,\n false,\n ...
[ "function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
////////////////// CLASSES //////////////////
[ "function Animation(modelGeometry) {\n var geometry = new BAS.ModelBufferGeometry(modelGeometry);\n\n var i, j;\n\n var aOffsetAmplitude = geometry.createAttribute('aOffsetAmplitude', 2);\n var positionBuffer = geometry.getAttribute('position').array;\n var x, y, distance;\n\n for (i = 0; i < aOffsetAmplitude...
[ "public static function ws()\n {\n if (!isset(self::core()->soap)) {\n //====================================================================//\n // WEBSERVICE INITIALISATION\n //====================================================================//\n // Initial...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Rewind the file handle to the start
[ "public function rewind()\n {\n rewind($this->file_handle);\n $this->line_number = 0;\n $this->current_line = null;\n $this->header = null;\n }" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
Associate all tracks in any state to the latest observations. If a dormant track is associated it will be reactivated. If a reactivated track is associated it's state will be updated. PureKLT tracks are left unmodified.
[ "public void associateAllToDetected() {\n\t\t// initialize data structures\n\t\tList<CombinedTrack<TD>> all = new ArrayList<>();\n\t\tall.addAll(tracksReactivated);\n\t\tall.addAll(tracksDormant);\n\t\tall.addAll(tracksPureKlt);\n\n\t\tint numTainted = tracksReactivated.size() + tracksDormant.size();\n\n\t\ttracksR...
[ "def _get_best_merge(routing_table, aliases):\n \n # Create an empty merge to start with\n best_merge = _Merge(routing_table)\n best_goodness = 0\n\n # Look through every merge, discarding those that are no better than the\n # best we currently know about.\n for merge in _get_all_merges(routing...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Make a REST PUT method call with parameters @param array|string $params @return string @throws \ByJG\Util\CurlException
[ "public function put($params = null)\n {\n $handle = $this->preparePut($params);\n return $this->curlGetResponse($handle);\n }" ]
[ "public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())...
codesearchnet
{ "query": "Represent the Github instruction about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Programming:" }
Methods called by states
[ "function ContentDialog_setState(NewState, arg0) {\n if (!this._disposed) {\n this._state && this._state.exit();\n this._state = new NewState();\n this._state.dialog = this;\n this._state.enter(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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Check if the file corresponding to model JSON/YAML or HDF5 files actually exists and throw an explicit exception. @param fileName File name to check for existence @throws FileNotFoundException File not found
[ "private void checkForExistence(String fileName) throws IOException {\n File file = new File(fileName);\n if (!file.exists()) {\n throw new FileNotFoundException(\"File with name \" + fileName + \" does not exist.\");\n }\n if (!file.isFile()) {\n throw new IOExcept...
[ "def _is_path(instance, attribute, s, exists=True):\n \"\"\n if not s:\n # allow False as a default\n return\n if exists:\n if os.path.exists(s):\n return\n else:\n raise OSError(\"path does not exist\")\n else:\n # how do we tell if it's a path i...
codesearchnet
{ "query": "Represent the Github comment about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about programming:" }
// SetContentType sets the ContentType field's value.
[ "func (s *Model) SetContentType(v string) *Model {\n\ts.ContentType = &v\n\treturn s\n}" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// computeAccuracy is a helper method for Prune()
[ "func computeAccuracy(predictions base.FixedDataGrid, from base.FixedDataGrid) float64 {\n\tcf, _ := evaluation.GetConfusionMatrix(from, predictions)\n\treturn evaluation.GetAccuracy(cf)\n}" ]
[ "function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns the values of this enum as an array, suitable for insertion into a {@link DropdownField} @param boolean @return array
[ "public function enumValues($hasEmpty = false)\n {\n return ($hasEmpty)\n ? array_merge(array('' => ''), ArrayLib::valuekey($this->getEnum()))\n : ArrayLib::valuekey($this->getEnum());\n }" ]
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Documentation:" }
Internal function. The node whatToShow and the filter are combined into one result.
[ "private short acceptNode(Node node) {\n\t\t/***\n\t\t * 7.1.2.4. Filters and whatToShow flags\n\t\t * \n\t\t * Iterator and TreeWalker apply whatToShow flags before applying\n\t\t * Filters. If a node is rejected by the active whatToShow flags, a\n\t\t * Filter will not be called to evaluate that node. When a node...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
SPARQL query / wrapper for rdflib sparql query method
[ "def query(self, stringa):\n \n qres = self.rdflib_graph.query(stringa)\n return list(qres)" ]
[ "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 post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
The response cache header settings for the given contentType. @param contentType the content type in the format 'type.[cache | nocache]', e.g. 'page.nocache'. @return the parameter value if set, or null if not set.
[ "public static String getResponseCacheHeaderSettings(final String contentType) {\n\t\tString parameter = MessageFormat.format(RESPONSE_CACHE_HEADER_SETTINGS, contentType);\n\t\treturn get().getString(parameter);\n\t}" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Use this API to fetch a tunnelglobal_binding resource .
[ "public static tunnelglobal_binding get(nitro_service service) throws Exception{\n\t\ttunnelglobal_binding obj = new tunnelglobal_binding();\n\t\ttunnelglobal_binding response = (tunnelglobal_binding) obj.get_resource(service);\n\t\treturn response;\n\t}" ]
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the summarization about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code about Natural Language Processing:" }
Unwatches all previously specified keys
[ "async def _unwatch(self, conn):\n \"\"\n await conn.send_command('UNWATCH')\n res = await conn.read_response()\n return self.watching and res or True" ]
[ "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:" }
Accepts the invite. @return \React\Promise\Promise
[ "public function accept()\n {\n $deferred = new Deferred();\n\n if ($this->revoked) {\n $deferred->reject(new \\Exception('This invite has been revoked.'));\n\n return $deferred->promise();\n }\n\n if ($this->uses >= $this->max_uses) {\n $deferred->rej...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Plot groups of GOs which have been placed in sections.
[ "def plot_sections(self, fout_dir=\".\", **kws_usr):\n \"\"\"\"\"\"\n kws_plt, _ = self._get_kws_plt(None, **kws_usr)\n PltGroupedGos(self).plot_sections(fout_dir, **kws_plt)" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Return an iterable to replay the journal by going through all records locations starting from the given one. @param start @return @throws IOException @throws CompactedDataFileException @throws ClosedJournalException
[ "public Iterable<Location> redo(Location start) throws ClosedJournalException, CompactedDataFileException, IOException {\n return new Redo(start);\n }" ]
[ "public static JMProgressiveManager<Path, Boolean>\n deleteAllAsync(List<Path> pathList) {\n debug(log, \"deleteAllAsync\", pathList);\n return new JMProgressiveManager<>(pathList,\n targetPath -> Optional.of(deleteAll(targetPath)));\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
getCertificateFile @param string $contents
[ "protected function getCertificateFile($contents)\n {\n $filename = storage_dir() . '/' . md5($contents) . '.pem';\n\n if (!file_exists($filename)) {\n file_put_contents($filename, $contents);\n }\n\n return realpath($filename);\n }" ]
[ "def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Return the default locale. @return string
[ "public function getLocale() {\n\t\tif($this->locale === null)\n\t\t\t$this->locale = $this->getDefinition()->getEntityManager()->getDefaultLocale();\n\t\treturn $this->locale;\n\t}" ]
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Marshall the given parameter object.
[ "public void marshall(CreateDeploymentRequest createDeploymentRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (createDeploymentRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marsh...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
校验option restore @param string $restore @throws OssException
[ "private function precheckStorage($storage)\n {\n if (is_string($storage)) {\n switch ($storage) {\n case self::OSS_STORAGE_ARCHIVE:\n return;\n case self::OSS_STORAGE_IA:\n return;\n case self::OSS_STORAGE_STAND...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Compute allowed distance for clustering based on end confidence intervals.
[ "def _calculate_cluster_distance(end_iter):\n \n out = []\n sizes = []\n for x in end_iter:\n out.append(x)\n sizes.append(x.end1 - x.start1)\n sizes.append(x.end2 - x.start2)\n distance = sum(sizes) // len(sizes)\n return distance, out" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetMetricFilters sets the MetricFilters field's value.
[ "func (s *DescribeMetricFiltersOutput) SetMetricFilters(v []*MetricFilter) *DescribeMetricFiltersOutput {\n\ts.MetricFilters = v\n\treturn s\n}" ]
[ "func parseService(svc *structs.ServiceQuery) error {\n\t// Service is required.\n\tif svc.Service == \"\" {\n\t\treturn fmt.Errorf(\"Must provide a Service name to query\")\n\t}\n\n\t// NearestN can be 0 which means \"don't fail over by RTT\".\n\tif svc.Failover.NearestN < 0 {\n\t\treturn fmt.Errorf(\"Bad NearestN...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Find the k nearest neighbors of x in the observed input data @see Databag.nn() for argument description @return distance and indexes of found nearest neighbors.
[ "def nn_x(self, x, k=1, radius=np.inf, eps=0.0, p=2):\n \n assert len(x) == self.dim_x\n k_x = min(k, self.size)\n # Because linear models requires x vector to be extended to [1.0]+x\n # to accomodate a constant, we store them that way.\n return self._nn(DATA_X, x, k=k_x, r...
[ "def add (data, label)\n raise \"No meaningful label associated with data\" unless ([:positive, :negative].include? label)\n \n #Create a data point in the vector space from the datum given\n data_point = Eluka::DataPoint.new(data, @analyzer)\n \n #Add the data point to the feature spa...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
a method to retrieve route information for file on telegram api :param file_id: string with id of file in a message send to bot :return: dictionary of response details with route details in [json][result]
[ "def get_route(self, file_id):\r\n\r\n ''' \r\n '''\r\n\r\n title = '%s.get_route' % self.__class__.__name__\r\n\r\n # validate inputs\r\n input_fields = {\r\n 'file_id': file_id,\r\n }\r\n for key, value in input_fields.items():\r\n if value:\r\n ...
[ "def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// Sub lock is held on entry
[ "func (s *StanServer) clearSentAndAck(sub *subState) {\n\tsr := s.ssarepl\n\tsr.waiting.Delete(sub)\n\tsr.ready.Delete(sub)\n\tsub.replicate = nil\n}" ]
[ "boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns a builder for the URL that would be retrieved by following {@code link} from this URL, or null if the resulting URL is not well-formed.
[ "public Builder newBuilder(String link) {\n Builder builder = new Builder();\n Builder.ParseResult result = builder.parse(this, link);\n return result == Builder.ParseResult.SUCCESS ? builder : null;\n }" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Rename a file. @param int $fileid The file ID. @param string $newname The new file name. @return object Box.net file object.
[ "public function rename_file($fileid, $newname) {\n // This requires a PUT request with data within it. We cannot use\n // the standard PUT request 'CURLOPT_PUT' because it expects a file.\n $data = array('name' => $newname);\n $options = array(\n 'CURLOPT_CUSTOMREQUEST' => 'P...
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
@param CompilerPayload $payload @return CompilerPayload
[ "public function compileGroupBy(CompilerPayload $payload)\n {\n $builder = $payload->getBuilder();\n\n if ($builder instanceof Clause\\GroupByInterface && $builder->getGroupByClauses()) {\n $newSQL = 'GROUP BY ' . implode(', ', $builder->getGroupByClauses());\n $payload = $pay...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Sum the scrollTop between two elements.
[ "function getScrollParent(parent, child) {\n let element = child;\n let scrollTop = 0;\n\n while (element && element !== parent) {\n element = element.parentNode;\n scrollTop += element.scrollTop;\n }\n return scrollTop;\n}" ]
[ "def rowsInserted(self, parent, start, end):\n \n\n super(LogView, self).rowsInserted(parent, start, end)\n\n # IMPORTANT: This must be done *after* the superclass to get\n # an accurate value of the delegate's height.\n self.scrollToBottom()" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Remove expired entries. @param expireHandler implementation that will be called for each expired entry.
[ "int removeExpired(TimeoutHandler expireHandler)\n {\n // ensure the clock never goes backwards\n long t = ticker.currentTimeMillis();\n\n int expired = 0;\n for (int i = 0; i < slotCount; i++)\n {\n expired += slots[i].removeExpired(t, expireHandler);\n }\n ...
[ "@Override\n public void unIndex(Class entityClazz, Object entity, EntityMetadata metadata, MetamodelImpl metamodel)\n {\n // we need not implement this method for Redis because\n // redis automatically removes indexes while performing delete\n logger.warn(\"Removing index is implicitly m...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Called by parse, loops through all the rules to find out if nested or not. @param array $rules @param Builder $querybuilder @param string $queryCondition @throws QBParseException @return Builder
[ "protected function loopThroughRules(array $rules, Builder $querybuilder, $queryCondition = 'AND')\n {\n foreach ($rules as $rule) {\n /*\n * If makeQuery does not see the correct fields, it will return the QueryBuilder without modifications\n */\n $querybuild...
[ "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 Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Perform a recursive action @param string $method @param array $data @param array $rules @param array $messages @return bool
[ "private function recurse($method, array $data = [], array $rules = [], array $messages = [])\n {\n // Make sure method is valid\n if ( ! in_array($method, ['save', 'validate'])) return false;\n\n // Disable validation\n $validateBeforeSave = $this->validateBeforeSave;\n $this-...
[ "public function setModel($model)\n {\n /** @type Model $model */\n $model = parent::setModel($model);\n\n foreach ($model as $rule) {\n $this->addRule($rule['rule'], $rule['target'], explode(',', $rule['params']));\n }\n\n // @todo Consider to return $model instead ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
This function reduces the dimensions of an array until it is no longer of length 1.
[ "def red_dim(self, array):\n \n while isinstance(array, list) == True or \\\n isinstance(array, np.ndarray) == True:\n try:\n if len(array) == 1:\n array = array[0]\n else:\n break\n except:\n ...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns TRUE if a file or directory is empty and FALSE if not. @param string $path Path to directory @return bool
[ "public function isEmpty(string $path): bool\n\t{\n\t\tif(is_dir($path))\n\t\t{\n\t\t\treturn (new FilesystemIterator($path))->valid() === false;\n\t\t}\n\n\t\treturn filesize($path) === 0;\n\t}" ]
[ "public function deleteFiles()\n {\n if ($this->isAbsolute()) {\n if ($this->isDir()) {\n // delete files in the current directory\n return $this->deleteFilesAction($this->getPathname(), false);\n } else {\n throw new FileException('Given ...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// This is a courtesy helper function, which in some cases may not work as expected!
[ "func (s *VPCService) GetVPCOfferingByName(name string, opts ...OptionFunc) (*VPCOffering, int, error) {\n\tid, count, err := s.GetVPCOfferingID(name, opts...)\n\tif err != nil {\n\t\treturn nil, count, err\n\t}\n\n\tr, count, err := s.GetVPCOfferingByID(id, opts...)\n\tif err != nil {\n\t\treturn nil, count, err\n...
[ "function isSafeProperty (object, prop) {\n if (!object || typeof object !== 'object') {\n return false\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Obje...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
recursive function to get all ancestor nodes of given element
[ "function getAllAncestors(el) {\n var ancestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var nextAncestor = el.parentNode;\n\n if (!nextAncestor) {\n return ancestors;\n }\n\n ancestors.push(nextAncestor);\n return getAllAncestors(nextAncestor, ancestors);\n}" ]
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
zoom out full data range
[ "def unzoom_all(self, event=None):\n \n if len(self.conf.zoom_lims) > 0:\n self.conf.zoom_lims = [self.conf.zoom_lims[0]]\n self.unzoom(event)" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Advance the model by one time step.
[ "def update(self, τ: float = 1.0, update_indicators=True, dampen=False):\n \n\n for n in self.nodes(data=True):\n n[1][\"next_state\"] = n[1][\"update_function\"](n)\n\n for n in self.nodes(data=True):\n n[1][\"rv\"].dataset = n[1][\"next_state\"]\n\n for n in self....
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Load config file and set values to defaults where no present. :return: The configuration ``WilyConfig`` :rtype: :class:`wily.config.WilyConfig`
[ "def load(config_path=DEFAULT_CONFIG_PATH):\n \n if not pathlib.Path(config_path).exists():\n logger.debug(f\"Could not locate {config_path}, using default config.\")\n return DEFAULT_CONFIG\n\n config = configparser.ConfigParser(default_section=DEFAULT_CONFIG_SECTION)\n config.read(config...
[ "def set_config(self, config):\n \n self._config = config\n self._config.dump_to_sdb(\"botoConfigs\", self.id)" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Clones the class info, but changes access, setting deprecated flag. @param classInfo the original class info @return the cloned and deprecated info.
[ "private static ClassInfo cloneDeprecated(ClassInfo classInfo) {\n\treturn new ClassInfo(classInfo.getVersion(), classInfo.getAccess()\n\t\t| Opcodes.ACC_DEPRECATED, classInfo.getName(),\n\t\tclassInfo.getSignature(), classInfo.getSupername(),\n\t\tclassInfo.getInterfaces(), classInfo.getMethodMap(),\n\t\tclassInfo...
[ "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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// IsLocked returns whether or not the address managed is locked. When it is // unlocked, the decryption key needed to decrypt private keys used for signing // is in memory.
[ "func (m *Manager) IsLocked() bool {\n\tm.mtx.RLock()\n\tdefer m.mtx.RUnlock()\n\n\treturn m.isLocked()\n}" ]
[ "public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
reads through the definitions and generates an python class for each definition
[ "def make(self):\n \n log.setLevel(self.log_level)\n created = []\n self.set_class_dict()\n start = datetime.datetime.now()\n log.info(\" # of classes to create: %s\" % len(self.class_dict))\n log.debug(\" creating classes that are not subclassed\")\n\n for na...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Check that the current contents of the rdata's fields are valid. If you change an rdata by assigning to its fields, it is a good idea to call validate() when you are done making changes.
[ "def validate(self):\n \n dns.rdata.from_text(self.rdclass, self.rdtype, self.to_text())" ]
[ "def uid(self):\n \n # Since this does not change over time (?) check whether we already\n # know the answer. If so, there is no need to go further\n if self._uid is not None:\n return self._uid\n # if not, we have to get it from the zone topology, which\n # is p...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetPortfolioId sets the PortfolioId field's value.
[ "func (s *AssociatePrincipalWithPortfolioInput) SetPortfolioId(v string) *AssociatePrincipalWithPortfolioInput {\n\ts.PortfolioId = &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 comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Add a EXISTS clause with a sub-query inside of parenthesis. <p> <b>NOTE:</b> The sub-query will be prepared at the same time that the outside query is. </p>
[ "public Where<T, ID> exists(QueryBuilder<?, ?> subQueryBuilder) {\n\t\t// we do this to turn off the automatic addition of the ID column in the select column list\n\t\tsubQueryBuilder.enableInnerQuery();\n\t\taddClause(new Exists(new InternalQueryBuilderWrapper(subQueryBuilder)));\n\t\treturn this;\n\t}" ]
[ "public function compileUpdateLabels(Builder $query, $labels, $operation = 'add' )\n {\n if(trim(strtolower($operation)) == 'add')\n {\n $updateType = 'SET';\n } else\n {\n $updateType = 'REMOVE';\n }\n // Each one of the columns in the update state...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// BeeFuncMap returns a FuncMap of functions used in different templates.
[ "func BeeFuncMap() template.FuncMap {\n\treturn template.FuncMap{\n\t\t\"trim\": strings.TrimSpace,\n\t\t\"bold\": colors.Bold,\n\t\t\"headline\": colors.MagentaBold,\n\t\t\"foldername\": colors.RedBold,\n\t\t\"endline\": EndLine,\n\t\t\"tmpltostr\": TmplToString,\n\t}\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Post-processing activities When the order returns from the processor, if PDT was successful, this stores the results in order-status-history and logs data for subsequent reference @return boolean
[ "function after_process() {\n global $insert_id, $db, $order;\n if ($_SESSION['paypal_transaction_PDT_passed'] != true) {\n $_SESSION['order_created'] = '';\n unset($_SESSION['paypal_transaction_PDT_passed']);\n return false;\n } else {\n // PDT found order to be approved, so add a new OS...
[ "def ObjectInitializedEventHandler(analysis, event):\n \n\n # Initialize the analysis if it was e.g. added by Manage Analysis\n wf.doActionFor(analysis, \"initialize\")\n\n # Try to transition the analysis_request to \"sample_received\". There are\n # some cases that can end up with an inconsistent s...
codesearchnet
{ "query": "Represent the summarization about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
Get all the repository tags. @param {Object} [execaOpts] Options to pass to `execa`. @return {Array<String>} List of git tags. @throws {Error} If the `git` command fails.
[ "async function getTags(execaOpts) {\n return (await execa.stdout('git', ['tag'], execaOpts))\n .split('\\n')\n .map(tag => tag.trim())\n .filter(Boolean);\n}" ]
[ "function define(File, utils) {\n return class JSONFile extends File {\n /**\n * Constructor\n * @param {String} id\n * @param {String} filepath\n * @param {Object} options\n * - {Function} buildFactory\n * - {Object} fileCache\n * - {Object} fileExtensions\n * - {Function} f...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
override for covariant return type
[ "@Override\n public ChronoLocalDateTime<D> with(TemporalAdjuster adjuster) {\n return toLocalDate().getChronology().ensureChronoLocalDateTime(super.with(adjuster));\n }" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Since this class implements {@link DTDInfo}, method can just return <code>this</code>.
[ "@Override\n public DTDInfo getDTDInfo() throws XMLStreamException\n {\n /* Let's not allow it to be accessed during other events -- that\n * way callers won't count on it being available afterwards.\n */\n if (mCurrToken != DTD) {\n return null;\n }\n if...
[ "public void visitEnd() {\n String classname = workbench.getType().getClassName();\n\n component.addAttribute(new Attribute(\"classname\", classname));\n\n // Generates the provides attribute.\n component.addElement(ElementHelper.getProvidesElement(specifications));\n\n if (workbe...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get an item from an object using "dot" notation. @param object $object @param string $key @param mixed $default @return mixed
[ "public static function object_get($object, $key, $default = null)\n {\n if (\\is_null($key) || trim($key) === '') {\n return $object;\n }\n\n foreach (explode('.', $key) as $segment) {\n if (! \\is_object($object) || ! isset($object->{$segment})) {\n ret...
[ "protected function get($key, $value = false)\n {\n if (is_null($key)) {\n throw new \\InvalidArgumentException('Null argument passed to '.__METHOD__);\n }\n\n $config = [];\n $config = static::$config;\n\n if (empty($config)) {\n throw new \\Exception('Co...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
// ListDir lists the contents of a GitHub repo
[ "func (s *Service) ListDir(ctx context.Context, q *ListDirRequest) (*FileList, error) {\n\tgitClient, commitSHA, err := s.newClientResolveRevision(q.Repo, q.Revision)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif files, err := s.cache.GetGitListDir(commitSHA, q.Path); err == nil {\n\t\tlog.Infof(\"listdir cach...
[ "static function removeExpiryCacheFromDisk( $expiryCachePath )\n {\n $fileHandler = eZClusterFileHandler::instance();\n if ( $fileHandler instanceof eZFSFileHandler )\n {\n // We will only delete files if the FS file handler is used,\n // if the DB file handler is in us...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Get top keywords categories
[ "def get_cats(self):\n ''''''\n start_url = 'http://top.taobao.com/index.php?from=tbsy'\n rs = self.fetch(start_url)\n if not rs: return None\n soup = BeautifulSoup(rs.content, convertEntities=BeautifulSoup.HTML_ENTITIES, markupMassage=hexentityMassage)\n cats = [{'id':'TR_...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
static method also used by ConfigDelayedMergeObject
[ "static AbstractConfigValue resolveSubstitutions(ReplaceableMergeStack replaceable,\n List<AbstractConfigValue> stack, ResolveContext context) throws NotPossibleToResolve {\n // to resolve substitutions, we need to recursively resolve\n // the stack of stuff to merge, and merge the stack so...
[ "def create(self):\n \n self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),\n maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the count of the returned entries from the specified search results. @param $searchResults @return int
[ "public function countEntries($searchResults)\n {\n if ($this->suppressErrors) {\n return @ldap_count_entries($this->getConnection(), $searchResults);\n }\n\n return ldap_count_entries($this->getConnection(), $searchResults);\n }" ]
[ "def get_pointer_mapping(self):\n \"\"\"\"\"\"\n r = request.GetPointerMapping(display = self.display)\n return r.map" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }