query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Use this API to fetch dnssuffix resources of given names . | [
"public static dnssuffix[] get(nitro_service service, String Dnssuffix[]) throws Exception{\n\t\tif (Dnssuffix !=null && Dnssuffix.length>0) {\n\t\t\tdnssuffix response[] = new dnssuffix[Dnssuffix.length];\n\t\t\tdnssuffix obj[] = new dnssuffix[Dnssuffix.length];\n\t\t\tfor (int i=0;i<Dnssuffix.length;i++) {\n\t\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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Returns true if the qualified permission exists.
@param permissionName the permission name
@param orgQualifier the org qualifier
@return true if has qualified permission | [
"public boolean hasQualifiedPermission(PermissionType permissionName, String orgQualifier) {\n String key = createQualifiedPermissionKey(permissionName, orgQualifier);\n return qualifiedPermissions.contains(key);\n }"
] | [
"@Override\n public IPersonAttributes findPerson(final IPerson searcher, final String username) {\n\n // get the IAuthorizationPrincipal for the searching user\n final IAuthorizationPrincipal principal = getPrincipalForUser(searcher);\n\n // build a set of all possible user attributes the cu... | 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:"
} |
// SetTaskDefinition sets the TaskDefinition field's value. | [
"func (s *TaskSet) SetTaskDefinition(v string) *TaskSet {\n\ts.TaskDefinition = &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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
:class:`~zhmcclient.VirtualSwitchManager`: Access to the
:term:`Virtual Switches <Virtual Switch>` in this CPC. | [
"def virtual_switches(self):\n \n # We do here some lazy loading.\n if not self._virtual_switches:\n self._virtual_switches = VirtualSwitchManager(self)\n return self._virtual_switches"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
commands getter and setter.
@param array
@return mixed | [
"public function commands(array $value = null)\n {\n if (null === $value) {\n return $this->commands;\n }\n $this->commands = [];\n foreach ($value as $name => $command) {\n $this->command($name, $command);\n }\n return $this;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
get the tag object from a tag name
@param string $tagName tag name to load
@return TagInterface|null | [
"protected function getTagObject($tagName)\n {\n if (!$this->extensionsLoaded) {\n $this->loadExtensions();\n }\n\n if (!array_key_exists($tagName, $this->tagObjects)) {\n return null;\n }\n\n $tagObject = $this->tagObjects[$tagName];\n $tagObject->... | [
"def app_to_object(self):\n \"\"\"\"\"\"\n if self.tagClass != Tag.applicationTagClass:\n raise ValueError(\"application tag required\")\n\n # get the class to build\n klass = self._app_tag_class[self.tagNumber]\n if not klass:\n return None\n\n # buil... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
cURL request
@param array $options
@return bool | [
"private function request($options = [])\n {\n $curl = curl_init();\n $caPathOrFile = CaBundle::getSystemCaRootBundlePath();\n // Set default cURL options\n curl_setopt_array($curl, [\n CURLOPT_AUTOREFERER => true,\n CURLOPT_CONNECTTIMEOUT => 30,\n CUR... | [
"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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Run an SQL statement and get the number of rows affected.
@param string $query
@param array $bindings
@return int | [
"public function affectingStatement($query, $bindings = [])\n {\n return $this->run($query, $bindings, function ($query, $bindings) {\n if ($this->pretending()) {\n return 0;\n }\n\n // For update or delete statements, we want to get the number of rows affec... | [
"public function remove($entity)\n {\n if ($entity->isValid() && is_numeric($entity['id']->value)) {\n $query = 'DELETE FROM `' . $this->tableName . '` WHERE `id`=:id';\n $statement = $this->database->prepare($query);\n $statement->bindParam(':id', $entity['id']->value);\n... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Work management:"
} |
Retrieve the default number of minutes per month.
@return minutes per month | [
"public Number getMinutesPerMonth()\n {\n return Integer.valueOf(NumberHelper.getInt(getMinutesPerDay()) * NumberHelper.getInt(getDaysPerMonth()));\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns the step value for this ruler. If the cached value is None,
then a default value will be specified based on the ruler type.
:return <variant> | [
"def step( self ):\n \n if ( self._step is not None ):\n return self._step\n \r\n elif ( self.rulerType() == XChartRuler.Type.Number ):\r\n self._step = int((self.maximum() - self.minimum()) / 10.0)\r\n \r\n elif ( self.rulerType() == XChartRuler.Type.... | [
"def _find_associated_colorbar(obj):\n \n for child in obj.get_children():\n try:\n cbar = child.colorbar\n except AttributeError:\n continue\n if cbar is not None: # really necessary?\n # if fetch was successful, cbar contains\n # (reference t... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// TODO ... set up based on the tiller existing in the cluster, if no ops given | [
"func tillerHost(kubeClient *kubernetes.Clientset, opts TillerOptions) (string, error) {\n\tif opts.Host == \"\" || opts.Port == \"\" {\n\t\tts, err := kubeClient.CoreV1().Services(opts.Namespace).Get(\"tiller-deploy\", metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn fmt.Sprintf... | [
"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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Set PNG compressen algorithm to use when saving image
@param int $compress as the algorithm to use.
@return $this | [
"public function setPngCompression($compress = null)\n {\n if ($compress) {\n $this->useCompress = true;\n }\n\n $this->compress = isset($compress)\n ? $compress\n : self::PNG_COMPRESSION_DEFAULT;\n\n (is_numeric($this->compress) and $this->compress >=... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about Image compression:",
"pos": "Represent the Github code about Image compression:",
"neg": "Represent the Github code:"
} |
Open a file.
:arg file: file-like or path-like object.
:arg str mode: ``mode`` argument for :func:`open`. | [
"def open_file(file, mode):\n\t\n\tif hasattr(file, \"read\"):\n\t\treturn file\n\tif hasattr(file, \"open\"):\n\t\treturn file.open(mode)\n\treturn open(file, mode)"
] | [
"def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get a string representation of the AFE list, for debugging
@return string | [
"public function dump() {\n\t\t$prev = null;\n\t\t$s = '';\n\t\tfor ( $node = $this->head; $node; $prev = $node, $node = $node->nextAFE ) {\n\t\t\tif ( $node instanceof Marker ) {\n\t\t\t\t$s .= \"MARKER\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$s .= $node->getDebugTag();\n\t\t\tif ( $node->nextNoah ) {\n\t\t\t\t$s... | [
"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 post about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about programming:"
} |
// UpdateWeights takes an output size * 1 output vector and a size * 1
// back-propagated error vector, as well as a learnRate and updates
// the internal weights matrix. | [
"func (n *Network) UpdateWeights(out, err *mat.Dense, learnRate float64) {\n\n\tif n.origWeights == nil {\n\t\tn.origWeights = mat.DenseCopyOf(n.weights)\n\t}\n\n\t// Multiply that by the learning rate\n\tmulFunc := func(target, source int, v float64) float64 {\n\t\tif target == source {\n\t\t\treturn v\n\t\t}\n\t\... | [
"def _default_hparams():\n \"\"\"\"\"\"\n return hparam.HParams(\n # Use this parameter to get comparable perplexity numbers with different\n # tokenizations. This value should be set to the ratio of the number of\n # tokens in the test set according to the tokenization used to the number\n #... | codesearchnet | {
"query": "Represent the description about Deep Learning:",
"pos": "Represent the code about Deep Learning:",
"neg": "Represent the code:"
} |
Track the matched route.
@param \Illuminate\Routing\Route $route
@param \Illuminate\Http\Request $request | [
"public function trackMatchedRoute(Route $route, Request $request)\n {\n if ( ! $this->isEnabled()) return;\n\n $tracker = $this->getRouteTracker();\n\n if ($tracker->isTrackable($route)) {\n $this->mergeVisitorActivityData([\n 'route_path_id' => $tracker->track($ro... | [
"public function register()\n {\n $this->mergeConfigFrom(__DIR__ . '/../config/translator.php', 'translator');\n\n parent::register();\n $this->registerCacheRepository();\n $this->registerFileLoader();\n $this->registerCacheFlusher();\n $this->app->singleton('translation... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Extract all useful infos from the given table
Args:
engine: SQLAlchemy connection engine
table: table name
Returns:
Dictionary of infos | [
"def get_table_metadata(engine, table):\n \n metadata = MetaData()\n metadata.reflect(bind=engine, only=[table])\n table_metadata = Table(table, metadata, autoload=True)\n return table_metadata"
] | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create a new query builder for the pivot table.
:rtype: eloquent.orm.Builder | [
"def _new_pivot_query(self):\n \n query = super(MorphToMany, self)._new_pivot_query()\n\n return query.where(self._morph_type, self._morph_class)"
] | [
"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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
table exists
@param string $table can be table|prefix_table|dbname.table
@return boolean | [
"public function tableExists($table)\n {\n $database = null;\n if (($pos = strpos($table, '.')) !== false) {\n $database = substr($table, 0, $pos);\n $table = substr($table, $pos + 1);\n } else {\n $table = $this->buildRealTableName($table, false);\n }... | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// NewPermission returns a permission with provided arguments. | [
"func NewPermission(a Action, r Resource) (*Permission, error) {\n\tp := &Permission{\n\t\tAction: a,\n\t\tResource: r,\n\t}\n\n\treturn p, p.Valid()\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Performs a get_slice for column_parent and predicate for the given keys in parallel.
Parameters:
- keys
- column_parent
- predicate
- consistency_level | [
"def multiget_slice(self, keys, column_parent, predicate, consistency_level):\n \n self._seqid += 1\n d = self._reqs[self._seqid] = defer.Deferred()\n self.send_multiget_slice(keys, column_parent, predicate, consistency_level)\n return d"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Reads an unstructured mesh with added data.
:param filenames: The files to read from.
:type filenames: str
:returns mesh{2,3}d: The mesh data. | [
"def read(filename, file_format=None):\n \n # https://stackoverflow.com/q/4843173/353337\n assert isinstance(filename, str)\n\n if not file_format:\n # deduce file format from extension\n file_format = _filetype_from_filename(filename)\n\n format_to_reader = {\n \"ansys\": ansys_... | [
"def _unpack_list(example):\n \n try:\n x = example[0]\n y = example[1]\n meta = None\n return x, y, meta\n except IndexError:\n raise IndicoError(\n \"Invalid input data. Please ensure input data is \"\n \"formatted as a list of `[data, target]` pa... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Take and element, look at it's contents, if it's above a certain threshold, shrink with "more..." button, otherwise leave alone. | [
"function _shrink_wrap(elt_id){\n\n // Now take what we have, and wrap around some expansion code if\n // it looks like it is too long.\n var _trim_hash = {};\n var _trimit = 100;\n // Only want to compile once.\n var ea_regexp = new RegExp(\"\\<\\/a\\>\", \"i\"); // detect an <a>\n var br_rege... | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Removes a Value or Pair Map from Dictionary by its Key.
@access public
@param string $key Key in Dictionary
@return void | [
"public function remove( $key )\n\t{\n\t\tif( empty( $key ) )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// no Key given\n\t\t\tthrow new InvalidArgumentException( 'Key must not be empty.' );\t\t\t\t\t\t// throw Exception\n\t\tif( isset( $this->pairs[$key] ) )\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Key is set on its own\n\t\t\tu... | [
"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 sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Returns a docco section for the given enum.
:Parameters:
enum
Parsed IDL enum dict. Keys: 'comment', 'name', 'values' | [
"def parse_enum(enum):\n \n docs = enum['comment']\n code = '<span class=\"k\">enum</span> <span class=\"gs\">%s</span> {\\n' % enum['name']\n for v in enum[\"values\"]:\n if v['comment']:\n for line in v['comment'].split(\"\\n\"):\n code += ' <span class=\"c1\">// %s... | [
"def _MakeGroupFromRootSection(root_section, undefined_str):\n \n group = {}\n for statement in root_section.Statements():\n if isinstance(statement, six.string_types):\n continue\n func, args = statement\n # here the function acts as ID for the block type\n if func i... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Returns the array type for the given primitive type name.
@param primitiveType The primitive type name
@return The array type | [
"public static @Nonnull Optional<Class> arrayTypeForPrimitive(String primitiveType) {\n if (primitiveType != null) {\n return Optional.ofNullable(PRIMITIVE_ARRAY_MAP.get(primitiveType));\n }\n return Optional.empty();\n }"
] | [
"@Override\n protected PyExpr visitPrimitiveNode(PrimitiveNode node) {\n // Note: ExprNode.toSourceString() technically returns a Soy expression. In the case of\n // primitives, the result is usually also the correct Python expression.\n return new PyExpr(node.toSourceString(), Integer.MAX_VALUE);\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get or create the given user | [
"def get_or_create_user(self, username, password):\n '''\n \n '''\n\n # Get the groups for this user\n info = self.get_ad_info(username, password)\n self.debug(\"INFO found: {}\".format(info))\n\n # Find the user\n try:\n user = User.objects.get(use... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Send a premium SMS
@param $shortcode
@param $keyword
@param $tariff
@param $mid
@param $member | [
"public function setPremiumSms($shortcode, $keyword, $tariff, $mid = null, $member = null)\n {\n $this->typeDetails['shortcode'] = $shortcode;\n $this->typeDetails['keyword'] = $keyword;\n $this->typeDetails['tariff'] = $tariff;\n if ($mid != null) {\n $this->typeDetai... | [
"public function Send()\n\t{\n\t\t$tscall = array(\"TriggeredSendDefinition\" => $this->props , \"Subscribers\" => $this->subscribers);\n\t\t$response = new ET_Post($this->authStub, \"TriggeredSend\", $tscall);\n\t\treturn $response;\n\t}"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
@param NotifiableInterface $notifiable
@param string $order
@param null|int $limit
@param null|int $offset
@return array | [
"public function getUnseenNotifications(NotifiableInterface $notifiable, $order = 'DESC', $limit = null,\n $offset = null)\n {\n return $this->notifiableNotificationRepository->findAllByNotifiable(\n $this->generateIdentifier($notifiable),\n ... | [
"public static function getTreeByQuery(EloquentBuilder $query, array $columns = ['*'])\n {\n /**\n * @var Entity $instance\n */\n $instance = new static;\n $columns = $instance->prepareTreeQueryColumns($columns);\n return $query->get($columns)->toTree();\n }"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// Gauge sends one or more gauge statistics to Statsd.
//
// Application code should call it for every potential invocation of a
// statistic; it uses the sampleRate to determine whether or not to send or
// squelch the data, on an aggregate basis. | [
"func (s *Statsd) Gauge(sampleRate float32, bucket string, v ...string) {\n\tsamp, ok := maybeSample(sampleRate)\n\tif !ok {\n\t\treturn\n\t}\n\n\tmsgs := make([]sendable, len(v))\n\tfor i, vi := range v {\n\t\tmsgs[i] = &gaugeUpdate{\n\t\t\tprefix: s.prefix,\n\t\t\tbucket: bucket,\n\t\t\tval: vi,\n\t\t\ts... | [
"func NewOnDemandStorer(s storage.Storer) (*OnDemandStorer, error) {\n\t// Track a small number of recent in-memory objects, to improve\n\t// performance without impacting memory too much.\n\t//\n\t// LRU is very helpful here because of the way delta compression\n\t// works. It first sorts the objects by type and d... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Technology:"
} |
// New creates a new server instance. | [
"func New(lsnCfg engine.Listener, router http.Handler, stapler stapler.Stapler,\n\tconnTck conntracker.ConnectionTracker, autoCertCache autocert.Cache, wg *sync.WaitGroup,\n) (*T, error) {\n\tscopedRouter, err := newScopeRouter(lsnCfg.Scope, router)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &T{\n\t\tls... | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Selects records by multiple ids.
@param string|array $ids
@param array $options
@param array $criteria
@return mixed
@throws BatchException | [
"public static function selectByIds($ids, array $options = [], array $criteria = [])\n {\n $criteria = static::cleanCriteria($criteria);\n if (empty($criteria)) {\n $criteria['select'] = ['*'];\n }\n\n if (is_array($ids)) {\n $ids = implode(',', $ids);\n }... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
This is a special method - If the db doesn't allow multiple keys indexes,
see if this field is a first field on an index (non-primary).
@return true if true. | [
"public boolean checkIndexField(BaseField field)\n {\n for (int iKeySeq = 0; iKeySeq < this.getRecord().getKeyAreaCount(); iKeySeq++)\n {\n KeyArea keyArea = this.getRecord().getKeyArea(iKeySeq);\n if (keyArea.getField(0) == field)\n if (field != this.getRecord(... | [
"def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// AddCommands adds all the commands from cli/command to the root command | [
"func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {\n\tcmd.AddCommand(\n\t\t// checkpoint\n\t\tcheckpoint.NewCheckpointCommand(dockerCli),\n\n\t\t// config\n\t\tconfig.NewConfigCommand(dockerCli),\n\n\t\t// container\n\t\tcontainer.NewContainerCommand(dockerCli),\n\t\tcontainer.NewRunCommand(dockerCli),\... | [
"@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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
use will duplicate a new Model class and bind ec
ec is Engine name or Sesstion object | [
"def use(cls, ec):\n \n \n if isinstance(ec, (str, unicode)):\n m = get_model(cls._alias, ec, signal=False)\n else:\n m = cls._use(ec)\n return m"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets the receiver theshold to the given level.
@param level The threshold level events must equal or be greater
than before further processing can be done. | [
"public void setThreshold(final Level level) {\n Level oldValue = this.thresholdLevel;\n thresholdLevel = level;\n firePropertyChange(\"threshold\", oldValue, this.thresholdLevel);\n }"
] | [
"public void validateRange(final LmlParser parser) {\n if (min >= max || stepSize > max - min || value < min || value > max || stepSize <= 0f) {\n parser.throwError(\n \"Range widget not properly constructed. Min value has to be lower than max and step size cannot be higher than... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
CMS Fields
@return FieldList | [
"public function getCMSFields()\n {\n $fields = parent::getCMSFields();\n if (!$this->isAllowedChildren()) {\n return $fields;\n }\n $fields->addFieldsToTab(\n 'Root.' . _t(__CLASS__ . '.CHILDREN', 'Children'),\n [\n GridField::create(\n... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Property names for Facebook - Override to customize
@param props
@return | [
"protected SocialProfile parseProfile(Map<String, Object> props) {\n if (!props.containsKey(\"id\")) {\n throw new IllegalArgumentException(\"No id in profile\");\n }\n SocialProfile profile = SocialProfile.with(props)\n .displayName(\"name\")\n .first(\"first_name\")\n .last(\"la... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
execute
@see Command | [
"protected function execute(InputInterface $input, OutputInterface $output)\n {\n parent::execute($input, $output);\n\n $session = $this->mustBeModelManagerSession($this->getSession());\n\n $this->updateOutput(\n $output,\n (new StructureGenerator(\n $ses... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Import data from an epw file.
Hourly data will be saved in self.data and the various header data
will be saved in the properties above. | [
"def _import_data(self, import_header_only=False):\n \n # perform checks on the file before opening it.\n assert os.path.isfile(self._file_path), 'Cannot find an epw file at {}'.format(\n self._file_path)\n assert self._file_path.lower().endswith('epw'), '{} is not an .epw fil... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the longest possible first part and the last part of the
hyphenated word. The first part has the hyphen already attached.
Returns None, if there is no hyphenation point before width, or
if the word could not be hyphenated. | [
"def wrap(self, word, width, hyphen='-'):\n \n width -= len(hyphen)\n for w1, w2 in self.iterate(word):\n if len(w1) <= width:\n return w1 + hyphen, w2"
] | [
"def _split_token_to_subtokens(token, subtoken_dict, max_subtoken_length):\n \"\"\"\"\"\"\n ret = []\n start = 0\n token_len = len(token)\n while start < token_len:\n # Find the longest subtoken, so iterate backwards.\n for end in xrange(min(token_len, start + max_subtoken_length), start, -1):\n sub... | codesearchnet | {
"query": "Represent the Github summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code:"
} |
Create or retrieve a muxed connection
Arguments:
address -- a peer endpoint in IPv4/v6 address format; None refers
to the connection for unknown peers
Return:
a bound, connected datagram socket instance | [
"def get_connection(self, address):\n \n\n if self.connections.has_key(address):\n return self.connections[address]\n \n # We need a new datagram socket on a dynamically assigned ephemeral port\n conn = socket.socket(self._forwarding_socket.family,\n ... | [
"function listen(self, address, port, addressType, backlog, exclusive) {\n /* TODO Index servers by a self-assigned identifier and the process\n * identifier so messages intended for previous instances do not pass\n * through. */\n servers[port] = self; // Index servers by port.\n self._port = port... | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *DnsRecord) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DnsRecord\"}\n\tif s.TTL == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TTL\"))\n\t}\n\tif s.Type == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Type\"))\n\t}\n\n\tif invalidParams.Len() > 0... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// CheckRegister is used to register a new check with
// the local agent | [
"func (a *Agent) CheckRegister(check *AgentCheckRegistration) error {\n\tr := a.c.newRequest(\"PUT\", \"/v1/agent/check/register\")\n\tr.obj = check\n\t_, resp, err := requireOK(a.c.doRequest(r))\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp.Body.Close()\n\treturn nil\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Encode the CertificateVersion period in DER form to the stream.
@param out the OutputStream to marshal the contents to.
@exception IOException on errors. | [
"public void encode(OutputStream out) throws IOException {\n // Nothing for default\n if (version == V1) {\n return;\n }\n DerOutputStream tmp = new DerOutputStream();\n tmp.putInteger(version);\n\n DerOutputStream seq = new DerOutputStream();\n seq.write(... | [
"private byte[] toByteArray(Object val) {\n if (val == null)\n return null;\n if (val instanceof byte[])\n return (byte[]) val;\n if (val instanceof ByteBuffer) {\n // Defensive code but execution should never get here. The internal\n // representatio... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Check if we have same number of equivalent sites on both surfaces.
This is an alternative to checking Laue symmetry (is_symmetric())
if we want to ensure both surfaces in the slab are the same | [
"def have_equivalent_surfaces(self):\n \n\n # tag the sites as either surface sites or not\n surf_sites_dict = self.get_surface_sites(tag=True)\n\n a = SpacegroupAnalyzer(self)\n symm_structure = a.get_symmetrized_structure()\n\n # ensure each site on one surface has a\n ... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
id is 'A' - 'F' for the various keys used by ssh | [
"def _compute_key(self, id, nbytes):\n \"\"\"\"\"\"\n m = Message()\n m.add_mpint(self.K)\n m.add_bytes(self.H)\n m.add_byte(b(id))\n m.add_bytes(self.session_id)\n # Fallback to SHA1 for kex engines that fail to specify a hex\n # algorithm, or for e.g. transp... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html>`_
:arg index: The name of the index to remove policy on | [
"def remove_policy(self, index=None, params=None):\n \n return self.transport.perform_request(\n \"POST\", _make_path(index, \"_ilm\", \"remove\"), params=params\n )"
] | [
"def _search(self, query, fields=None, limit=50000, sampling=None):\n \n body = {\n \"query\": {\n \"bool\": {\n \"must\": [\n query\n ]\n }\n }\n }\n\n # @see https://www.ela... | codesearchnet | {
"query": "Represent the description about Elasticsearch:",
"pos": "Represent the code about Elasticsearch:",
"neg": "Represent the code about programming:"
} |
// NewGenerator builds a Generator. | [
"func NewGenerator(iface *Interface, pkg string, inPackage bool) *Generator {\n\n\tvar roots []string\n\n\tfor _, root := range filepath.SplitList(build.Default.GOPATH) {\n\t\troots = append(roots, filepath.Join(root, \"src\"))\n\t}\n\n\tg := &Generator{\n\t\tiface: iface,\n\t\tpkg: pkg,\n... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Permute functions
// Xor the state's top bits with the bottom and randomly rotate them
// based on the highest 6 bits. | [
"func XslRr(state Uint128) uint64 {\n h, l := state.H, state.L\n shift := l ^ h;\n rot := h >> 58;\n return (shift >> rot) | (shift << (64 - rot));\n}"
] | [
"public void fastClear(int index) {\n assert index >= 0 && index < numBits;\n int wordNum = index >> 6;\n int bit = index & 0x03f;\n long bitmask = 1L << bit;\n bits[wordNum] &= ~bitmask;\n // hmmm, it takes one more instruction to clear than it does to set... any\n ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*!
Get limitation array
\return access limitation array | [
"function limitArray()\n {\n $limitValues = $this->attribute( 'values' );\n\n $valueArray = array();\n\n foreach ( array_keys( $limitValues ) as $valueKey )\n {\n $valueArray[] = $limitValues[$valueKey]->attribute( 'value' );\n }\n\n return array( $this->attri... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Empty our virtualenv so that new (or older) dependencies may be
installed | [
"def clean_virtualenv(self):\n \n self.user_run_script(\n script=scripts.get_script_path('clean_virtualenv.sh'),\n args=[],\n rw_venv=True,\n )"
] | [
"def update_command(yes, development, development_version):\n \n # enforce that pip MUST be installed\n # Why not just include it in the setup.py requirements? Mostly weak\n # reasons, but it shouldn't matter much.\n # - if someone has installed the CLI without pip, then they haven't\n # followe... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
given is at the begining, of is at the end | [
"public float conditionalLogProb(int[] given, int of) {\r\n if (given.length != windowSize - 1) {\r\n System.err.println(\"error computing conditional log prob\");\r\n System.exit(0);\r\n }\r\n int[] label = indicesFront(given);\r\n float[] masses = new float[label.length];\r\n for (int i =... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Read - Lists ---- | [
"public static function generateNameValueList( $config = [] ) {\n\n\t\t$modelClass\t= static::$modelClass;\n\t\t$modelTable = $modelClass::tableName();\n\n\t\t$site\t= Yii::$app->core->site;\n\t\t$theme\t= $site->theme;\n\n\t\t$config[ 'ignoreSite' ] = true;\n\n\t\t$config[ 'conditions' ][] = isset( $theme ) ? \"$m... | [
"public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Set a setting by name
@param string $name
@param string|\StructureAbstract $value
@return \Core\Model\Settings\Structure | [
"public function setSetting( $name, $value )\n {\n $old = isset( $this->settings[$name] )\n ? $this->settings[$name]\n : null;\n\n if ( $old instanceof self || $value instanceof self )\n {\n if ( $old instanceof self && $value instanceof self )\n {... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Adds new properties to the parent (KickAssets) file JSON
@return array | [
"protected function buildJSON()\n {\n $json = $this->parent->createFileJson($this->file);\n $json['created'] = $this->file->obj('Created')->FormatFromSettings();\n $json['lastEdited'] = $this->file->obj('LastEdited')->FormatFromSettings();\n $json['url'] = $this->file->getAbsoluteURL(... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Describe all columns in a single table
@param string $table
@return array | [
"public function describe($table)\n {\n $schema = $this->db->connection()\n ->getDoctrineConnection()\n ->getSchemaManager();\n\n return $this->parseSchema(\n $schema->listTableColumns($table)\n );\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
does a given node already have a rootid
@param {DOM Node} node
@param {String} id
@param {String} propertyName
@return {Boolean} | [
"function(node, id, propertyName) {\n\t\t\tvar rootids = [];\n\t\t\tif(!modules.domUtils.hasAttribute(node,'rootids')){\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\trootids = modules.domUtils.getAttributeList(node, 'rootids');\n\t\t\t\treturn (rootids.indexOf('id' + id + '-' + propertyName) > -1);\n\t\t\t}\n\t\t... | [
"function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns an edge by its path.
@param (string|string[])[] a path
@return Edge
@throws InvalidArgumentException path not found | [
"public function getEdge(array $edge)\n {\n foreach ($this->instructions as $instruction) {\n if (!$instruction instanceof Edge) {\n continue;\n }\n\n if ($instruction->getList() == $edge) {\n return $instruction;\n }\n }\n\n... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Check if two models have the same values in all properties.
@param ModelInterface $firstModel The first model to compare.
@param ModelInterface $secondModel The second model to compare.
@return boolean True - If both models are same, false if not. | [
"public function sameModels($firstModel, $secondModel)\n {\n foreach ($firstModel as $key => $value) {\n if ($key === $this->idProperty) {\n continue;\n }\n\n if (\\is_array($value)) {\n if (!\\is_array($secondModel->getProperty($key))) {\n ... | [
"function DataModelMigration() {\n /**\n * Gets an array that contains the definition of fields that are going to be added\n * @type {Array}\n */\n this.add = [];\n /**\n * Gets an array that contains a collection of constraints which are going to be added\n * @type {Array}\n */\n ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
验证请求URL是否正确的方法
@param request 请求
@return 结果 | [
"protected String legalStr(HttpServletRequest request){\n String echoStr = \"\";\n if(StrUtil.isBlank(getToken()) || StrUtil.isBlank(getAESKey()) || StrUtil.isBlank(getCropId())){\n return echoStr;\n }\n try {\n WXBizMsgCrypt pc = new WXBizMsgCrypt(getToken(), getAE... | [
"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 about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Create a url instance given an array of url properties and values
@param array $arr
@return \sndsgd\Url | [
"public static function createFromArray(array $arr)\n {\n $ret = new Url;\n $keys = ['scheme','user','pass','host','port','path','query','fragment'];\n foreach ($keys as $key) {\n if (array_key_exists($key, $arr)) {\n $fn = 'set'.ucfirst($key);\n call... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// DecodeToResource decode meta values to resource result | [
"func DecodeToResource(res Resourcer, result interface{}, metaValues *MetaValues, context *qor.Context) *processor {\n\treturn &processor{Resource: res, Result: result, Context: context, MetaValues: metaValues}\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:"
} |
decide if the status is retweetable | [
"def retweet?(status)\n filters = load_filters\n retweet = true\n if !filters.nil?\n filters.each_pair do |path, value|\n array = []\n array << value\n array.flatten.each do |filter_value|\n path_value = StreamBot::ArrayPath.get_path(status, path)\n ... | [
"def can_pull(self, initial, scheduled):\n \n if not initial and self.config.is_valid_schedule():\n # if the config has a valid schedule, return True if this is a scheduled run\n return scheduled\n return True"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
Retrieves field information about the given table
@param string $table The name of the database table.
@param boolean $typeOnly True to only return field types.
@return array An array of fields for the database table.
@since 2.2.15 | [
"public function getTableColumns($table, $typeOnly = true)\n\t{\n\t\t$columns = array();\n\n\t\t$fieldCasing = $this->connection->getAttribute(\\PDO::ATTR_CASE);\n\n\t\t$this->connection->setAttribute(\\PDO::ATTR_CASE, \\PDO::CASE_UPPER);\n\n\t\t$table = strtoupper($table);\n\n\t\t$this->setQuery('pragma table_info... | [
"public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even... | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
---------------------------------------------------------------------- | [
"public function toByte()\r\n {\r\n\r\n $size = $this->size();\r\n\r\n if($size == 0) {\r\n return array();\r\n }\r\n\r\n $data = array_fill(0, (int)(($size + 7) / 8), 0);\r\n $bytes = (int)($size / 8);\r\n\r\n $p = 0;\r\n\r\n for($i=0; $i<$bytes; $i++)... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github instruction about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
Construct the payload from the options | [
"private function getPayload()\n {\n $payloads = [\n 'json' => Utils::findKey($this->options, 'json', false),\n 'query' => Utils::findKey($this->options, 'query', false),\n 'similar' => [\n 'query' => [\n 'more_like_this' => [\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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param string $region
@param mixed $credential
@return CodeDeployClient|null | [
"public function getCD($region, $credential)\n {\n if (!$config = $this->getConfigWithCredentials($region, $credential)) {\n return null;\n }\n\n return $this->aws->createCodeDeploy($config);\n }"
] | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// SaveAccount "persists" the account. | [
"func (db *DB) SaveAccount(model AccountModel) {\n\tdb.Lock()\n\tdefer db.Unlock()\n\tdb.accounts[model.ID] = &model\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
/* (non-Javadoc)
@see org.joml.Matrix4dc#reflect(double, double, double, double, org.joml.Matrix4d) | [
"public Matrix4d reflect(double a, double b, double c, double d, Matrix4d dest) {\n if ((properties & PROPERTY_IDENTITY) != 0)\n return dest.reflection(a, b, c, d);\n if ((properties & PROPERTY_IDENTITY) != 0)\n return dest.reflection(a, b, c, d);\n else if ((properties & ... | [
"public Vector3f transformPosition(Vector3fc v, Vector3f dest) {\n return transformPosition(v.x(), v.y(), v.z(), dest);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
执行调用存储过程<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return ResultSet
@throws SQLException SQL执行异常
@since 4.1.4 | [
"public static ResultSet callQuery(Connection conn, String sql, Object... params) throws SQLException {\n\t\tCallableStatement proc = null;\n\t\ttry {\n\t\t\tproc = StatementUtil.prepareCall(conn, sql, params);\n\t\t\treturn proc.executeQuery();\n\t\t} finally {\n\t\t\tDbUtil.close(proc);\n\t\t}\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 sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Structs are always stored inline, so need to be created right
where they are used. You'll get this error if you created it
elsewhere. | [
"def assertStructIsInline(self, obj):\n \n\n N.enforce_number(obj, N.UOffsetTFlags)\n if obj != self.Offset():\n msg = (\"flatbuffers: Tried to write a Struct at an Offset that \"\n \"is different from the current Offset of the Builder.\")\n raise StructI... | [
"public static CodedInputStream newInstance(final byte[] buf, final int off,\n final int len) {\n CodedInputStream result = new CodedInputStream(buf, off, len);\n try {\n // Some uses of CodedInputStream can be more efficient if they know\n // exactly how ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(GetClientCertificatesRequest getClientCertificatesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (getClientCertificatesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolM... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates the update event with the provided form data
@param array $formData
@return BrandUpdateEvent | [
"protected function getUpdateEvent($formData)\n {\n $brandUpdateEvent = new BrandUpdateEvent($formData['id']);\n\n $brandUpdateEvent\n ->setLogoImageId($formData['logo_image_id'])\n ->setVisible($formData['visible'])\n ->setLocale($formData['locale'])\n -... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the overall Unsplash stats for the past 30 days.
:return [Stat]: The Unsplash Stat. | [
"def month(self):\n \n url = \"/stats/month\"\n result = self._get(url)\n return StatModel.parse(result)"
] | [
"def SaveResourceUsage(self, client_id, status):\n \"\"\"\"\"\"\n # Per client stats.\n self.hunt_obj.ProcessClientResourcesStats(client_id, status)\n # Overall hunt resource usage.\n self.UpdateProtoResources(status)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Remove a key/account from an account's permission | [
"def disallow(ctx, foreign_account, permission, threshold, account):\n \n print_tx(\n ctx.bitshares.disallow(\n foreign_account, account=account, permission=permission, threshold=threshold\n )\n )"
] | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Get all the workflow action instances for an item
@return DataList|null | [
"public function getWorkflowHistoryFor($item, $limit = null)\n {\n if ($active = $this->getWorkflowFor($item, true)) {\n $limit = $limit ? \"0,$limit\" : '';\n return $active->Actions('', 'ID DESC ', null, $limit);\n }\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Nastavi viditelnost
@param int $id
@secured
@throws AbortException | [
"public function handleVisibility(int $id)\n\t{\n\t\tif ($this->isAjax()) {\n\t\t\t$page = $this->orm->pages->getById($id);\n\t\t\t$page->visible = !$page->visible;\n\t\t\t$this->orm->persistAndFlush($page);\n\n\t\t\t$this['list']->setDataSource($this->orm->pages->findById($id));\n\t\t\t$this['list']->redrawItem($i... | [
"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 PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
Initializes this class.<p> | [
"public static void initClass() {\n\n // registers a factory for creating new instances of this widget\n CmsWidgetFactoryRegistry.instance().registerFactory(WIDGET_TYPE, new I_CmsFormWidgetFactory() {\n\n /**\n * @see org.opencms.gwt.client.ui.input.form.I_CmsFormWidgetFactory#c... | [
"public static SwapFile createTempFile(String prefix, String suffix, File directory) throws IOException\n {\n throw new IOException(\"Not applicable. Call get(File, String) method instead\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
Map of program name to meta of included programs
@return Optional of the <code>includes</code> field value. | [
"@javax.annotation.Nonnull\n public java.util.Optional<java.util.Map<String,net.morimekta.providence.model.ProgramMeta>> optionalIncludes() {\n return java.util.Optional.ofNullable(mIncludes);\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(BatchDetectSyntaxItemResult batchDetectSyntaxItemResult, ProtocolMarshaller protocolMarshaller) {\n\n if (batchDetectSyntaxItemResult == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMars... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Adds a message to the session
@param $type The type could be info, warning, success or error
@param $content The message
@return void | [
"public function addMessage($type, $content)\n\t{\n\t\tif($this->session->has('Cfmessage')) {\n\t\t\t$messages = $this->session->get('Cfmessage', []);\n\t\t}\n\t\t\n\t\t$messages[] = [\n\t\t\t'content' => $content,\n\t\t\t'type' => $type,\n\t\t];\n\t\t\n\t\t$this->session->set('Cfmessage', $messages);\n\t}"
] | [
"public function init()\n\t{\n\t\t$this->help_str = 'Send a mail using the instance mail configuration. '.PHP_EOL;\n\n\t\t$this->setNewParam( 'S', 'subject', 'Mail subject.', true, true );\n\t\t$this->setNewParam( 'F', 'filecontent', 'Mail body. Don\\'t define this params to send the stdin', true, true );\n\t\t$th... | codesearchnet | {
"query": "Represent the Github sentence about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Get a list of collaborators that are allowed access to an app.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@return list of collaborators | [
"public List<Collaborator> listCollaborators(String appName) {\n return connection.execute(new CollabList(appName), apiKey);\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
@param string $xsollaErrorCode
@param string $message
@param int $httpStatus
@return WebhookResponse | [
"public static function fromErrorCode($xsollaErrorCode, $message = '', $httpStatus = 500)\n {\n $body = [\n 'error' => [\n 'code' => $xsollaErrorCode,\n 'message' => $message,\n ],\n ];\n $encodedBody = XsollaClient::jsonEncode($body);\n\n ... | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about Software development:"
} |
Given a list of capability URI's returns <hello> message XML string | [
"def build(capabilities, device_handler):\n \"\"\n if device_handler:\n # This is used as kwargs dictionary for lxml's Element() function.\n # Therefore the arg-name (\"nsmap\") is used as key here.\n xml_namespace_kwargs = { \"nsmap\" : device_handler.get_xml_base_nam... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Create and return toolbar with *title* and *object_name* | [
"def create_toolbar(self, title, object_name, iconsize=24):\r\n \"\"\"\"\"\"\r\n toolbar = self.addToolBar(title)\r\n toolbar.setObjectName(object_name)\r\n toolbar.setIconSize(QSize(iconsize, iconsize))\r\n self.toolbarslist.append(toolbar)\r\n return toolbar"
] | [
"def insert_text(self, text):\n \"\"\"\"\"\"\n # Eventually this maybe should wrap to insert_text_to if\n # backspace-handling is required\n self.textCursor().insertText(text, self.default_style.format)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetFlags adds command specific flags and then returns the flagset. | [
"func (c *removeCommand) SetFlags(f *gnuflag.FlagSet) {\n\tc.ControllerCommandBase.SetFlags(f)\n\tf.BoolVar(&c.ConfirmDelete, \"y\", false, \"Confirm deletion of the user\")\n\tf.BoolVar(&c.ConfirmDelete, \"yes\", false, \"\")\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Custom function to insert an entryComponent into NgModule. It also imports it. | [
"function addEntryComponentToModule(source, modulePath, classifiedName, importPath) {\n return addSymbolToNgModuleMetadata(source, modulePath, 'entryComponents', classifiedName, importPath);\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
kafka download and install
:return: | [
"def kafka_install(self):\n \n with cd('/tmp'):\n if not exists('kafka.tgz'):\n sudo('wget {0} -O kafka.tgz'.format(\n bigdata_conf.kafka_download_url\n ))\n\n sudo('tar -zxf kafka.tgz')\n\n sudo('rm -rf {0}'.format(bigd... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
create base64-encoded image src target data to be used for html images
@param Graph $graph graph to display
@return string
@uses GraphViz::createImageData() | [
"public function createImageSrc(Graph $graph)\n {\n $format = $this->format;\n if ($this->format === 'svg' || $this->format === 'svgz') {\n $format = 'svg+xml;charset=' . $graph->getAttribute('graphviz.graph.charset', 'UTF-8');\n }\n\n return 'data:image/' . $format . ';bas... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns the size of the limited subset of data, or null if the wrapped
stream returns null for getSize.
@return int|null | [
"public function getSize()\n {\n $size = $this->stream->getSize();\n if ($size === null) {\n // this shouldn't happen on a seekable stream I don't think...\n $pos = $this->stream->tell();\n $this->stream->seek(0, SEEK_END);\n $size = $this->stream->tell()... | [
"long storeSpaceForAdd() {\n return ConcurrentSubList.maximumSerializedSize() // List header\n + 3 * ConcurrentSubList.Link.maximumSerializedSize() // Current,Previous,Next links \n + 4 * owningToken.objectStore.getAddSpaceOverhead() // Store overhead for all of the above.\n ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetCreatedDate sets the CreatedDate field's value. | [
"func (s *ProjectDetails) SetCreatedDate(v time.Time) *ProjectDetails {\n\ts.CreatedDate = &v\n\treturn s\n}"
] | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(GetGroupRequest getGroupRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (getGroupRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(getGroupRequest.getG... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set the read-only state of the widget. This should probably change the widget's appearance and
prevent it from being used.
@param bool $state Make input read-only
@return $this | [
"public function setReadOnly( $state ) {\n\t\t$this->readOnly = (bool)$state;\n\t\tif ( $this->readOnly ) {\n\t\t\t$this->input->setAttributes( [ 'readonly' => 'readonly' ] );\n\t\t} else {\n\t\t\t$this->input->removeAttributes( [ 'readonly' ] );\n\t\t}\n\t\treturn $this;\n\t}"
] | [
"public void discardHeaderClick(ClickEvent event) {\n if (event == null) return;\n\n // Example: we use radioset on collapsible header, so stopPropagation() is needed\n // to suppress collapsible open/close behavior.\n // But preventDefault() is not needed, otherwise radios won't switch.... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks whether this media specification matches to at least one of the given media queries.
@param queries The list of media queries to be matched.
@return {@code true} when at least one query matches, {@code false} when no query matches. | [
"public boolean matchesOneOf(List<MediaQuery> queries)\n {\n for (MediaQuery q : queries)\n {\n if (matches(q))\n return true;\n }\n return false;\n }"
] | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Configures the IOL bridge in uBridge. | [
"def _networking(self):\n \n\n bridge_name = \"IOL-BRIDGE-{}\".format(self.application_id + 512)\n try:\n # delete any previous bridge if it exists\n yield from self._ubridge_send(\"iol_bridge delete {name}\".format(name=bridge_name))\n except UbridgeError:\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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Convenience dispatcher to the error_exit() method.
Will raise "warning" error, i.e. script processing continues. | [
"def warn( callingClass, astr_key, **kwargs ):\n '''\n \n '''\n kwargs['exitToOS'] = False\n report( callingClass, astr_key, **kwargs )"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetApplicationSettings sets the ApplicationSettings field's value. | [
"func (s *Stack) SetApplicationSettings(v *ApplicationSettingsResponse) *Stack {\n\ts.ApplicationSettings = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Write writes bytes to the gzip.Writer. It will also set the Content-Type
// header using the net/http library content type detection if the Content-Type
// header was not set yet. | [
"func (grw gzipResponseWriter) Write(b []byte) (int, error) {\n\tif len(grw.Header().Get(headerContentType)) == 0 {\n\t\tgrw.Header().Set(headerContentType, http.DetectContentType(b))\n\t}\n\n\t// Delete the content length after we know we have been written to.\n\tgrw.Header().Del(headerContentLength)\n\treturn grw... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// DecimalToIPv4 converts a decimal to the dotted quad IP address format. | [
"func DecimalToIPv4(addr uint32) net.IP {\n\tbytes := make([]byte, 4)\n\tbinary.BigEndian.PutUint32(bytes, addr)\n\treturn net.IP(bytes)\n}"
] | [
"def create_response_pdu(self, data):\n \n log.debug('Create single bit response pdu {0}.'.format(data))\n bytes_ = [data[i:i + 8] for i in range(0, len(data), 8)]\n\n # Reduce each all bits per byte to a number. Byte\n # [0, 0, 0, 0, 0, 1, 1, 1] is intepreted as binary en is deci... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"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.