query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Get the value of the given constant. @param string $name The name of the constant. @return mixed The value of the given constant. @throws InvalidArgumentException If no such constant exists.
[ "private static function constant(string $name)\n {\n $constant = static::class . '::' . $name;\n\n if (!defined($constant)) {\n $message = sprintf('Enum %s does not contain value named %s.', static::class, $name);\n throw new InvalidArgumentException($message);\n }\n\n...
[ "public function set($key, $value)\n {\n if (!is_null($key)\n && is_scalar($key)\n ) {\n return $this->_items[$key] = $value;\n } else {\n // given index name is not valid\n throw new EnumeratorException('Element could not be added to list. Index i...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Initializes the options for the object Called from {@link __construct()} as a first step of object instantiation. @param ObjectConfig $config An optional ObjectConfig object with configuration options. @return void
[ "protected function _initialize(ObjectConfig $config)\n {\n $config->append(array(\n 'controller' => $this->getIdentifier()->package,\n 'controller_action' => 'render',\n 'authenticators' => array(),\n 'forwarded'\t => false,\n ))->append...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software Development:" }
Get current line height
[ "function lineHeight( $options = array() )\n {\n if ( is_array( $options ) && isset( $options['size'] ) )\n {\n $size = $options['size'];\n }\n else\n {\n $size = $this->ez['fontSize'];\n }\n\n if ( is_array( $options ) && isset( $options['le...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetDNSVersion is a handy function that returns the DNS version by DNS type
[ "func GetDNSVersion(dnsType kubeadmapi.DNSAddOnType) string {\n\tswitch dnsType {\n\tcase kubeadmapi.KubeDNS:\n\t\treturn KubeDNSVersion\n\tdefault:\n\t\treturn CoreDNSVersion\n\t}\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
setMinGap(string, double) -> None Sets the offset (gap to front vehicle if halting) of vehicles of this type.
[ "def setMinGap(self, typeID, minGap):\n \n self._connection._sendDoubleCmd(\n tc.CMD_SET_VEHICLETYPE_VARIABLE, tc.VAR_MINGAP, typeID, minGap)" ]
[ "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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Write replaces the data associated with the file named by path.
[ "func (c *Context) Write(path string, data []byte) error {\n\tif ae != nil {\n\t\treturn ae.Write(c.ae, path, data)\n\t}\n\treturn c.write(path, data)\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Error sends a error level log message to the handler. Arguments are handled in the manner of fmt.Printf.
[ "func (l *logger) Error(format string, args ...interface{}) {\n\tif l.Level >= ERROR {\n\t\tl.log(ERROR, format, args...)\n\t}\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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
Grab the user from the mapper @param string $value @return mixed
[ "protected function query($value)\n {\n $filters[$this->getKey()] = $value;\n $result = false;\n// if(!$this->getMapper()->enableFilters($filters))\n// throw new \\Exception('Invalid filters used in record validator');\n \n $result = $this->getMapper()->findByFilte...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// PrimaryField return scope's main primary field, if defined more that one primary fields, will return the one having column name `id` or the first one
[ "func (scope *Scope) PrimaryField() *Field {\n\tif primaryFields := scope.GetModelStruct().PrimaryFields; len(primaryFields) > 0 {\n\t\tif len(primaryFields) > 1 {\n\t\t\tif field, ok := scope.FieldByName(\"id\"); ok {\n\t\t\t\treturn field\n\t\t\t}\n\t\t}\n\t\treturn scope.PrimaryFields()[0]\n\t}\n\treturn nil\n}"...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Add entries to the gallery node Should happen when all the doctrees have been read and the gallery entries have been collected. i.e at doctree-resolved time.
[ "def add_entries_to_gallery(app, doctree, docname):\n \n if docname != 'gallery':\n return\n\n if not has_gallery(app.builder.name):\n return\n\n # Find gallery node\n try:\n node = doctree.traverse(gallery)[0]\n except TypeError:\n return\n\n content = []\n for e...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns an input stream from a {@code File} object. @param file a {@code File} object representing the input file; the file must be existing and readable. @return a {@code FileInputStream} object. @throws FileNotFoundException
[ "public static InputStream fromFile(File file) throws FileNotFoundException {\n\t\tif(file != null && file.isFile() && file.canRead()) {\n\t\t\treturn new FileInputStream(file);\n\t\t}\n\t\treturn null;\n\t}" ]
[ "@Override\n public List<Writable> next() {\n List<String> next = dataIter.next();\n invokeListeners(next);\n List<Writable> ret = new ArrayList<>();\n for (String s : next)\n ret.add(new Text(s));\n return ret;\n }\n\n /**\n * Check whether there are anymo...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Parse a use declaration list. @return UseDeclarationStatementNode
[ "private function _use() {\n $node = new UseDeclarationStatementNode();\n $this->mustMatch(T_USE, $node);\n $this->tryMatch(T_FUNCTION, $node, 'useFunction') || $this->tryMatch(T_CONST, $node, 'useConst');\n $declarations = new CommaListNode();\n do {\n $declarations->addChild($this->useDeclarat...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Sets the passed message as multipart/mixed. If the message has content, a new part is created and added as a child of the message. The message's content and content headers are moved to the new part. @param Message $message
[ "public function setMessageAsMixed(Message $message)\n {\n if ($message->hasContent()) {\n $part = $this->genericHelper->createNewContentPartFrom($message);\n $message->addChild($part, 0);\n }\n $this->setMimeHeaderBoundaryOnPart($message, 'multipart/mixed');\n $...
[ "def decrypt payload, armor=false # a RubyMail::Message object\n return unknown_status(@not_working_reason) unless @not_working_reason.nil?\n\n gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP}\n gpg_opts = HookManager.run(\"gpg-options\",\n {:operation => \"decrypt\", :option...
codesearchnet
{ "query": "Represent the sentence about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about PHP programming:" }
Get all closed indices.
[ "def get_closed_indices(self):\n \n state = self.conn.cluster.state()\n status = self.status()\n\n indices_metadata = set(state['metadata']['indices'].keys())\n indices_status = set(status['indices'].keys())\n\n return indices_metadata.difference(indices_status)" ]
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Periodically checks for scheduled jobs.
[ "def scheduler(rq, ctx, verbose, burst, queue, interval, pid):\n \"\"\n scheduler = rq.get_scheduler(interval=interval, queue=queue)\n if pid:\n with open(os.path.expanduser(pid), 'w') as fp:\n fp.write(str(os.getpid()))\n if verbose:\n level = 'DEBUG'\n else:\n level ...
[ "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:" }
Renders the resulting XML @ignore
[ "public function renderXML(&$req)\n {\n $res = '<cps:xpath_match>';\n $res .= htmlspecialchars($this->_xpath, ENT_NOQUOTES);\n $res .= '</cps:xpath_match>';\n $res .= '<cps:' . htmlspecialchars($this->_operation) . '>';\n if (is_string($this->_document)) {\n $res .= ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Convert a list of bytes to a list of strings. Each string is of length mmtf.CHAIN_LEN :param in_bytes: the input bytes :return the decoded list of strings
[ "def decode_chain_list(in_bytes):\n \"\"\"\"\"\"\n bstrings = numpy.frombuffer(in_bytes, numpy.dtype('S' + str(mmtf.utils.constants.CHAIN_LEN)))\n return [s.decode(\"ascii\").strip(mmtf.utils.constants.NULL_BYTE) for s in bstrings]" ]
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Return the names of groups in the file Note that there is not necessarily a TDMS object associated with each group name. :rtype: List of strings.
[ "def groups(self):\n \n\n # Split paths into components and take the first (group) component.\n object_paths = (\n path_components(path)\n for path in self.objects)\n group_names = (path[0] for path in object_paths if len(path) > 0)\n\n # Use an ordered dict ...
[ "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 summarization about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code:" }
Add the alignment and model_state data table.. :param data: Alignment and model_state table to be written.
[ "def add_2d_call_alignment(self, data):\n \n path = 'Analyses/{}'.format(self.group_name)\n if 'BaseCalled_2D' not in self.handle.handle[path]:\n self.handle.add_analysis_subgroup(self.group_name, 'BaseCalled_2D')\n\n path = '{}/BaseCalled_2D'.format(self.group_name)\n ...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return the rack for which an endpoint resides in @param endpoint the endpoint to process @return string of rack
[ "public String getRack(InetAddress endpoint)\n {\n String[] info = getEndpointInfo(endpoint);\n assert info != null : \"No location defined for endpoint \" + endpoint;\n return info[1];\n }" ]
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about AWS Auto Scaling:" }
Return an instance of the language class that fname is suited for. Searches through the module langs for the class that matches up with fname. If is_ext is True then fname will be taken to be the extension for a language.
[ "def language(fname, is_ext=False):\n \n\n global _langmapping\n\n # Normalize the fname so that it looks like an extension.\n if is_ext:\n fname = '.' + fname\n _, ext = os.path.splitext(fname)\n\n return _langmapping[ext]()" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewInterview creates a new interview with sane defaults
[ "func NewInterview() *Interview {\n\treturn &Interview{\n\t\tPromptTerminator: \": \",\n\t\tRequiredMessage: \"You must provide an answer to this question.\",\n\t\tInvalidMessage: \"Your answer is not valid.\",\n\t\tShowOutput: showOutput,\n\t\tShowError: showError,\n\t\tReadAnswer: readAnswer...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
a = bytearray a_offset = int b = bytearray
[ "def _adjust(a, a_offset, b):\n \n x = (b[-1] & 0xFF) + (a[a_offset + len(b) - 1] & 0xFF) + 1\n a[a_offset + len(b) - 1] = ctypes.c_ubyte(x).value\n x >>= 8\n\n for i in range(len(b)-2, -1, -1):\n x += (b[i] & 0xFF) + (a[a_offset + i] & 0xFF)\n a[a_offset + i] = ctypes.c_ubyte(x).value\...
[ "def buffer(self, byte_offset=0):\n \"\"\"\"\"\"\n contents = self.ptr.contents\n ptr = addressof(contents.buffer.contents) + byte_offset\n length = contents.length * 4 - byte_offset\n return buffer((c_char * length).from_address(ptr).raw) \\\n if length else None" ]
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Applies the case-insensitive strategy (orthography) to the given <code>name</code>, if {@link #isCaseSensitiveTableNames()} is <code>false</code>. @param name The identifier name @return The adjusted identifier name @see Orthography
[ "String applyCaseInsensitivity(String name) {\n return (name != null)\n ? isCaseSensitiveTableNames() ? name : isCaseInsensitiveStrategyLowerCase()\n ? name.toLowerCase(Locale.ENGLISH)\n : name.toUpperCase(Locale.ENGLISH)\n : null;\n...
[ "public Element tagName(String tagName) {\n Validate.notEmpty(tagName, \"Tag name must not be empty.\");\n tag = Tag.valueOf(tagName, NodeUtils.parser(this).settings()); // maintains the case option of the original parse\n return this;\n }" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Make sure we have laid out the pane with the current layout.
[ "private void ensureCurrentLayout() {\n if (!tabPane.isValid()) {\n tabPane.validate();\n }\n\n /*\n * If tabPane doesn't have a peer yet, the validate() call will silently\n * fail. We handle that by forcing a layout if tabPane is still invalid.\n * See bug 4...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* reIndex For an array of assoc rays, return a new array of assoc rays using a certain field for keys
[ "public static function reIndex() {\n $fields = func_get_args();\n $array = array_shift($fields);\n $array = (array) $array;\n \n $R = array();\n foreach ($array as $obj) {\n $target =& $R;\n \n foreach ($fields as $field) {\n if (! array_key_exists($field, $obj)) die(\"reInd...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
TypeMismatchException中获取到参数错误类型 @param e
[ "private ModelAndView getParamErrors(TypeMismatchException e) {\n\n Throwable t = e.getCause();\n\n if (t instanceof ConversionFailedException) {\n\n ConversionFailedException x = (ConversionFailedException) t;\n TypeDescriptor type = x.getTargetType();\n Annotation[] ...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Deploy to pypi as specified version.
[ "def deploy(version):\n \n NAME = \"pathquery\"\n git = Command(\"git\").in_dir(DIR.project)\n version_file = DIR.project.joinpath(\"VERSION\")\n old_version = version_file.bytes().decode('utf8')\n if version_file.bytes().decode(\"utf8\") != version:\n DIR.project.joinpath(\"VERSION\").writ...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
A way of getting the weight of an edge with or without weight as a parameter returns a the value of the weight parameter converted to returnType if it is given or 1 (also converted) if not
[ "def getWeight(grph, nd1, nd2, weightString = \"weight\", returnType = int):\n \n if not weightString:\n return returnType(1)\n else:\n return returnType(grph.edges[nd1, nd2][weightString])" ]
[ "def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// EncodeRLP implements rlp.Encoder.
[ "func (v IP) EncodeRLP(w io.Writer) error {\n\tif ip4 := net.IP(v).To4(); ip4 != nil {\n\t\treturn rlp.Encode(w, ip4)\n\t}\n\treturn rlp.Encode(w, net.IP(v))\n}" ]
[ "func NewProtoWrapperWithSerializer(db keyval.CoreBrokerWatcher, serializer keyval.Serializer) *ProtoWrapper {\n\t// OBSOLETE, use NewProtoWrapper\n\treturn NewProtoWrapper(db, serializer)\n}" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
(non-PHPdoc) @see Symfony\Component\Form.AbstractType::buildView()
[ "public function buildView(FormView $view, FormInterface $form, array $options)\n {\n $view->vars['configs'] = $options['configs']; \n \n // Adds a custom block prefix\n array_splice(\n $view->vars['block_prefixes'],\n array_search($this->getName(), $view->vars['...
[ "protected function addFieldNamePrefixToViewHelperVariableContainer()\n {\n $fieldNamePrefix = $this->getFieldNamePrefix();\n $this->viewHelperVariableContainer->add(\\Neos\\FluidAdaptor\\ViewHelpers\\FormViewHelper::class, 'fieldNamePrefix', $fieldNamePrefix);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code about Software development:" }
Look in doctrees for toctree and replace with custom render
[ "def render_toctrees(kb_app: kb, sphinx_app: Sphinx, doctree: doctree,\n fromdocname: str):\n \n\n # Only do any of this if toctree support is turned on in KaybeeSettings.\n # By default, this is off.\n settings: KaybeeSettings = sphinx_app.config.kaybee_settings\n if not settings....
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Method to initialize the Volume Service from the config data Args: version (string): Version of Boss API to use. Returns: None Raises: (KeyError): if given invalid version.
[ "def _init_volume_service(self, version):\n \n volume_cfg = self._load_config_section(CONFIG_VOLUME_SECTION)\n self._token_volume = volume_cfg[CONFIG_TOKEN]\n proto = volume_cfg[CONFIG_PROTOCOL]\n host = volume_cfg[CONFIG_HOST]\n\n self._volume = VolumeService(host, version...
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// SetSupportedAddonList sets the SupportedAddonList field's value.
[ "func (s *PlatformSummary) SetSupportedAddonList(v []*string) *PlatformSummary {\n\ts.SupportedAddonList = 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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Add {lang} param to all Frontend routes, if the site is multilanguage Backend routes are excluded @return $this
[ "public function addLanguagePrefix()\n {\n $projectConfig = Config::get('project');\n if($projectConfig['multilanguage']) {\n foreach (Route::getRoutes() as $route) {\n foreach($route->methods() as $method){\n\n // Only proceed routes that have translat...
[ "private function generateFrontEndRoutes()\n {\n $this->comment(\"Front End Routes...\");\n if (!$this->checkWilling('frontend')) {\n return $this->line(\"\\tskip\");\n }\n\n $moduleName = $this->starter->getModuleName();\n // 1. To generate the module route file if ...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Updates the execution state for all vertices included in this pipeline. @param executionState the execution state to set for all vertices included in this pipeline
[ "public void updateExecutionState(final ExecutionState executionState) {\n\n\t\tfinal Iterator<ExecutionVertex> it = this.vertices.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tfinal ExecutionVertex vertex = it.next();\n\t\t\tvertex.updateExecutionState(executionState);\n\t\t}\n\n\t}" ]
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Gets n solutions for an address.
[ "def _eval(self, memory, addr, n, **kwargs):\n \n return memory.state.solver.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)" ]
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get's all values in the specific section. @param string $section @param null $default @return mixed
[ "public function getAllBySection($section, $default = null)\n {\n $items = $this->getSettingsConfig();\n\n if (isset($items[$section])) {\n $this->setting = ArrayHelper::getColumn($items[$section], 'value');\n } else {\n $this->setting = $default;\n }\n\n ...
[ "public static function getPageAuthority($url = false)\n {\n $data = static::getCols('34359738368', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['upa'];\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns value from model for given element. @param \Illuminate\Database\Eloquent\Model $model @param NamedFormElement $el @return mixed|null
[ "protected function getElementValue(Model $model, NamedFormElement $el)\n {\n $attribute = $el->getModelAttributeKey();\n if (strpos($attribute, '->') === false) {\n return $model->getAttribute($attribute);\n }\n\n // Parse json attributes\n $casts = collect($model->...
[ "public function getAll() : array\n {\n $fieldOptions = call_user_func($this->fieldOptionsLoader);\n TypeMismatchException::verifyAllInstanceOf(__METHOD__, '<return>', $fieldOptions, IFieldOption::class);\n return $fieldOptions;\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Set terminal title.
[ "def set_title(self, title):\n \n if self.term not in ('linux', 'eterm-color'): # Not supported by the Linux console.\n self.write_raw('\\x1b]2;%s\\x07' % title.replace('\\x1b', '').replace('\\x07', ''))" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.COMMENT__COMMENT:\n\t\t\t\tsetComment(COMMENT_EDEFAULT);\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\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 sentence about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Compute all descendants of the given node in the given tree model @param treeModel The tree model @param node The node @param result The descendants
[ "private static void getAllDescendants(\r\n TreeModel treeModel, Object node, List<Object> result)\r\n {\r\n if (node == null)\r\n {\r\n return;\r\n }\r\n result.add(node);\r\n List<Object> children = getChildren(treeModel, node);\r\n for (Object child ...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
执行生成in范围查询SQL片段的方法. @param prefix 前缀 @param field 数据库字段 @param values 数组的值 @param match 是否匹配 @param positive true则表示是in,否则是not in @return ZealotKhala实例的当前实例
[ "private ZealotKhala doIn(String prefix, String field, Object[] values, boolean match, boolean positive) {\n return this.doInByType(prefix, field, values, match, ZealotConst.OBJTYPE_ARRAY, positive);\n }" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
collect metadata into this object :param data: dict :param args: build from args instead of data
[ "def build_result_metadata(self, data=None, args=None):\n \n data = data if data else self._build_result_metainfo(args)\n if data.get(\"build_branch\"):\n self.build_branch = data.get(\"build_branch\")\n if data.get(\"buildcommit\"):\n self.buildcommit = data.get(\"...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param string $message @param mixed $data @return self
[ "public function trace($message, $data)\n {\n // TODO: Implement trace() method.\n $this->logMessages->enqueue([\n 'date' => date('Y-m-d H:i:s'),\n 'message' => $message,\n 'data' => $data\n ]);\n\n return $this;\n }" ]
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the Github comment about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
Exports a model to a JSON file.
[ "static void exportModel() throws Exception {\n HttpClient client = new HttpClient();\n GetMethod get = new GetMethod(URL + \"/2/ExportModel.json?model=MyInitialNeuralNet\");\n int status = client.executeMethod(get);\n if( status != 200 )\n throw new Exception(get.getStatusText());\n JsonObject ...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Checks whether the class has a mapped embedded document for the specified field and if yes, checks whether it is a collection-valued association (to-many).
[ "public function isCollectionValuedEmbed(string $fieldName) : bool\n {\n return isset($this->fieldMappings[$fieldName]['association']) &&\n $this->fieldMappings[$fieldName]['association'] === self::EMBED_MANY;\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 sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
setStatusCode Set, and send, the HTTP status code.
[ "public function setStatusCode($code = null)\n {\n if (!empty($code)) {\n $this->_statusCode = $code;\n http_response_code($this->_statusCode); // this sends the http status code\n }\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Initialize payload @param string $text @return Payload
[ "private function initPayload($text)\n {\n $payload = new Payload();\n $payload->setOptions($this->getOptions());\n $payload->setQueryText($text);\n return $payload->createPayload();\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 description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Returns a view of the marketplace landing page @param webRequest @param portletRequest @param model @param initialFilter - optional request paramter. Use to init filter on initial view @return a string representing the initial view.
[ "@RenderMapping\n public String initializeView(\n WebRequest webRequest,\n PortletRequest portletRequest,\n Model model,\n @RequestParam(required = false) String initialFilter) {\n this.setUpInitialView(webRequest, portletRequest, model, initialFilter);\n ...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// GetXtructs returns the value of Xtructs if it is set or its // zero value if it is unset.
[ "func (v *Insanity) GetXtructs() (o []*Xtruct) {\n\tif v != nil && v.Xtructs != nil {\n\t\treturn v.Xtructs\n\t}\n\n\treturn\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Process a server request and return a response.
[ "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n $server = $request->getServerParams();\n $startTime = $server['REQUEST_TIME_FLOAT'] ?? microtime(true);\n $response = $handler->handle($request);\n\n return $response->...
[ "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 Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Initializes the instance and register them in the Engine.
[ "protected function init()\n {\n $this->prepareHTTPManagers();\n $this->prepareHTTPRendersManager();\n $this->prepareMediotecasManager();\n\n $this->nb_engine->registerApplication($this);\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Get all of the exact attribute values for a given wildcard attribute. @param array $masterData @param array $data @param string $attribute @return array
[ "protected static function extractValuesForWildcards($masterData, $data, $attribute)\n {\n $keys = [];\n\n $pattern = str_replace('\\*', '[^\\.]+', preg_quote($attribute));\n\n foreach ($data as $key => $value) {\n if ((bool) preg_match('/^'.$pattern.'/', $key, $matches)) {\n ...
[ "protected function process()\n {\n\n // query whether or not, we've found a new path => means we've found a new category\n if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {\n return;\n }\n\n // process the parent instance\n parent::process();...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
make new RegExp object to match file names that fit the pattern <name>[.env].ext @param {String} name base name of the file @return {RegExp} RegExp generated from base name and extensions
[ "function makeFilenameRegex(name) {\n if (!_.isString(name)) {\n throw new TypeError('name parameter must be of type \"String\"');\n }\n\n const regexString = `^${name}(?:[.](.+))?.(${fileExtensions.join('|')})$`;\n return new RegExp(regexString);\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
/* change canceled state
[ "public function SetStatusCanceled($bIsCanceled = true)\n {\n if ($this->fieldCanceled != $bIsCanceled) {\n $sDate = '';\n if ($bIsCanceled) {\n $sDate = date('Y-m-d H:i:s');\n }\n $aData = $this->sqlData;\n $aData['canceled_date'] = $s...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Retrieve data from an sqlite3 db (returns all rows, be careful!) CLI Example: .. code-block:: bash salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;'
[ "def fetch(db=None, sql=None):\n '''\n \n '''\n cur = _connect(db)\n\n if not cur:\n return False\n\n cur.execute(sql)\n rows = cur.fetchall()\n return rows" ]
[ "def view_running_services(self, package: str='') -> str:\n ''''''\n output, _ = self._execute(\n '-s', self.device_sn, 'shell', 'dumpsys', 'activity', 'services', package)\n return output" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get an element weight by attribute. Uses regular expressions to tell if this element looks good or bad. @param \DOMElement $element @param string $attribute @return int
[ "protected function weightAttribute(\\DOMElement $element, $attribute)\n {\n if (!$element->hasAttribute($attribute)) {\n return 0;\n }\n $weight = 0;\n\n // $attributeValue = trim($element->getAttribute('class').\" \".$element->getAttribute('id'));\n $attributeValue...
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Returns a PDO query resource ready for execution for an SQL union @param array $arrParam SQL Parameter Array @param array $arrParam SQL Parameter Array ... etc @return \PDOStatement
[ "public function genUnionQuery ()\n\t{\n\n\t\t$sql\t= $this->genUnionSQL (func_get_args (), 'UNION ALL');\n\n\t\t// Prepare database query\n\n\t\t$query\t= $this->prepare ($sql);\n\t\t\n\t\t// Bind values\n\t\t\n\t\t$this->genUnionBindValues ($query, func_get_args ());\n\n\t\t// Return query\n\n\t\treturn $query;\...
[ "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 post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Documentation:" }
Gets the default environment name. @throws \RuntimeException @return string
[ "public function getDefaultEnvironment()\n {\n // if the user has configured a default database then use it,\n // providing it actually exists!\n if (isset($this->values['environments']['default_database'])) {\n if ($this->getEnvironment($this->values['environments']['default_data...
[ "@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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// PrimaryFields return scope's primary fields
[ "func (scope *Scope) PrimaryFields() (fields []*Field) {\n\tfor _, field := range scope.Fields() {\n\t\tif field.IsPrimaryKey {\n\t\t\tfields = append(fields, field)\n\t\t}\n\t}\n\treturn fields\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(AccountSettings accountSettings, ProtocolMarshaller protocolMarshaller) {\n\n if (accountSettings == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(accountSettings.getD...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Find common surnames. @param int $threshold @param int $number_of_surnames @param string $sorting @return string
[ "public function commonSurnamesTotals(\n int $threshold = 1,\n int $number_of_surnames = 10,\n string $sorting = 'rcount'\n ): string {\n return $this->commonSurnamesQuery('nolist', true, $threshold, $number_of_surnames, $sorting);\n }" ]
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Listens for any kind of cursor activity on CodeMirror. - For tracking cursor activity in insert mode. - Should only be active in insert mode.
[ "function onCursorActivity() {\n var macroModeState = vimGlobalState.macroModeState;\n var lastChange = macroModeState.lastInsertModeChanges;\n if (lastChange.expectCursorActivityForChange) {\n lastChange.expectCursorActivityForChange = false;\n } else {\n // Cursor moved outside t...
[ "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 Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetKeyAlgorithm sets the KeyAlgorithm field's value.
[ "func (s *LoadBalancerTlsCertificate) SetKeyAlgorithm(v string) *LoadBalancerTlsCertificate {\n\ts.KeyAlgorithm = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Retrieves one or more bugs by id @return [Array<Bug>] a list of bugs
[ "def get_bugs(*ids)\n params = {}\n params[:ids] = normalize_ids ids\n\n bugs = []\n ret = @client.call('Bug.get', params)\n handle_faults(ret)\n ret['bugs'].each do |bug_data|\n bugs << Bug.new(self, bug_data)\n end\n bugs\n end" ]
[ "def note(id, type, options = {})\n # Welguisz: No idea why this is here, but keeping it here because it follows other blocks\n _notes\n # Create a new note and place it in the notes 2-D Hash\n @_notes[id][type] = Note.new(id, type, options)\n end" ]
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
:db.model.job record holds event log, that can be accessed by MX this method adds a record and removes oldest one if necessary
[ "def add_log_entry(self, entry):\n \n event_log = self.job_record.event_log\n if len(event_log) > job.MAX_NUMBER_OF_EVENTS:\n del event_log[-1]\n event_log.insert(0, entry)" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Set the original source. @param mixed $original @param null|string $adapter @throws \InvalidArgumentException On error @return Uploader A new cloned copy with the source and adapter configured
[ "public function with($original, $adapter = null)\n {\n $new = clone $this;\n $new->original = $original;\n $new->adapter = $adapter;\n\n if ($new->adapter === null) {\n foreach ($new->adapters as $each) {\n if ($each::check($original)) {\n ...
[ "private function _init()\n {\n // TODO: check if self::$instance is required here or if we can only set\n // decorated object\n\n // initialize and store the instance of template engine for further access\n self::$instance = Doozr_Loader_Serviceloader::load($this->library, $this->res...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Serves the Swagger description of the REST API. As host, fills in the host where the controller lives. As options for the entity names, contains only those entity names that the user can actually see.
[ "@GetMapping(value = \"/swagger.yml\", produces = \"text/yaml\")\n public String swagger(Model model, HttpServletResponse response) {\n response.setContentType(\"text/yaml\");\n response.setCharacterEncoding(\"UTF-8\");\n final UriComponents uriComponents =\n ServletUriComponentsBuilder.fromCurrent...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Access the fields @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList
[ "protected function getFields() {\n if (!$this->_fields) {\n $this->_fields = new FieldList(\n $this->version,\n $this->solution['assistantSid'],\n $this->solution['sid']\n );\n }\n\n return $this->_fields;\n }" ]
[ "public function choices(): HasMany\n {\n return $this->hasMany(\\Iocaste\\Microservice\\Foundation\\Data\\Models\\Parameter\\Choice::class);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Twilio:", "pos": "Represent the Github code about Twilio:", "neg": "Represent the Github code about programming:" }
Supports primitive types: boolean, char, byte, short, int, long, float, double. And array type with format {@code java.lang.String[]} @param clsName @return @throws IllegalArgumentException if class not found.
[ "@SuppressWarnings(\"unchecked\")\r\n static <T> Class<T> forClass(final String clsName, final boolean cacheResult) throws IllegalArgumentException {\r\n Class<?> cls = clsNamePool.get(clsName);\r\n\r\n if (cls == null) {\r\n cls = BUILT_IN_TYPE.get(clsName);\r\n\r\n if (cls =...
[ "@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 sentence about Java programming:", "pos": "Represent the Github code about Java programming:", "neg": "Represent the Github code about Software development:" }
// newIndexInfo returns IndexInfo configuration from indexName
[ "func newIndexInfo(config *serviceConfig, indexName string) (*registrytypes.IndexInfo, error) {\n\tvar err error\n\tindexName, err = ValidateIndexName(indexName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Return any configured index info, first.\n\tif index, ok := config.IndexConfigs[indexName]; ok {\n\t\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// in a transaction, truncate, create or update, and then copy from the s3 data file or manifest // yell loudly if there is anything different in the target table compared to config (different distkey, etc)
[ "func runCopy(\n\tdb *redshift.Redshift, inputConf s3filepath.S3File, inputTable redshift.Table, targetTable *redshift.Table,\n\ttruncate, gzip bool, delimiter, timeGranularity, targetTimeZone, streamStart, streamEnd string,\n) error {\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TRUNCAT...
[ "def set_identifiers(self, data):\n \n for id_info in self._details.identifiers:\n var_name = id_info['var_name']\n self._data[var_name] = data.get(var_name)\n\n # FIXME: This needs to likely kick off invalidating/rebuilding\n # relations.\n # F...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
The data under /apidocs json or Swagger UI
[ "def get(self):\n \n base_endpoint = self.config.get('endpoint', 'flasgger')\n specs = [\n {\n \"url\": url_for(\".\".join((base_endpoint, spec['endpoint']))),\n \"title\": spec.get('title', 'API Spec 1'),\n \"version\": spec.get(\"version...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Converts a {@link SafeScript} into a Soy {@link SanitizedContent} of kind JS.
[ "public static SanitizedContent fromSafeScript(SafeScript script) {\n return SanitizedContent.create(script.getSafeScriptString(), ContentKind.JS);\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
get only common range @param string $name @param mixed $default @return mixed
[ "static public function getCommon($name = null, $default=null)\n {\n $value = self::get($name, self::$range);\n return $value === null ? $default : $value;\n }" ]
[ "final static function f($m, array $stages = []) {return dfcf(function(M $m, array $stages) {\n\t\t/** @var string $c */$c = df_con_hier($m, __CLASS__); return new $c($m, $stages ?: ['', '']);\n\t}, [dfpm($m), $stages]);}" ]
codesearchnet
{ "query": "Represent the Github comment about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
// LocalPeer returns a peer object of the current server.
[ "func (s *Server) LocalPeer() *protocol.Peer {\n\treturn &protocol.Peer{\n\t\tId: s.LocalID(),\n\t\tServing: s.Serving,\n\t\tKeyspace: s.LocalKeyspace(),\n\t}\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 about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
// UploadPendingResource sends the provided resource blob up to Juju // and makes it available.
[ "func (c Client) UploadPendingResource(applicationID string, res charmresource.Resource, filename string, reader io.ReadSeeker) (pendingID string, err error) {\n\tids, err := c.AddPendingResources(AddPendingResourcesArgs{\n\t\tApplicationID: applicationID,\n\t\tResources: []charmresource.Resource{res},\n\t})\n\...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Generates a normalized URI (URL) for the Request. @return string A normalized URI (URL) for the Request @see getQueryString()
[ "public function getUri()\n {\n if (null !== $qs = $this->getQueryString()) {\n $qs = '?' . $qs;\n }\n return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getRequest()->getPathInfo() . $qs;\n }" ]
[ "public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
include an object graph in another
[ "function(target, namespace, graph) {\n \n //if the first param is a string, \n //we are including the namespace on Sysmo\n if (typeof target == 'string') {\n graph = namespace;\n namespace = target;\n target = Sysmo;\n }\n \n //create namespace on target\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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Determines if every item in the other set is in this set.
[ "func (set StringSet) IsSubset(other StringSet) bool {\n\tfor elem := range set {\n\t\tif !other.Contains(elem) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Very simplified method to parse CLI options only works with options starting with -- Will also make nested options by using ":" so --a:b:c=yes will become {a: {b: {c: "yes"}}}
[ "def parse_generic_options(args)\n a = args.dup\n arguments = []\n options = {}\n\n until a.empty?\n arg = a.shift\n case arg\n when /\\A--.+=/\n _, option, value = arg.match(/\\A--(.+)=(.+)\\Z/).to_a\n update_options(option, value, options)\n when /...
[ "def _format_envvar(param):\n \"\"\"\"\"\"\n yield '.. envvar:: {}'.format(param.envvar)\n yield ' :noindex:'\n yield ''\n if isinstance(param, click.Argument):\n param_ref = param.human_readable_name\n else:\n # if a user has defined an opt with multiple \"aliases\", always use th...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// TaskCreateNamed is a convenience function for TaskCreate when a name // will be set on the task as well
[ "func TaskCreateNamed(t TaskType, name string) (*Task, error) {\n\ttask := TaskCreate(t)\n\tif task == nil {\n\t\treturn nil, fmt.Errorf(\"devicemapper: Can't create task of type %d\", int(t))\n\t}\n\tif err := task.setName(name); err != nil {\n\t\treturn nil, fmt.Errorf(\"devicemapper: Can't set task name %s\", na...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
将byte值转为16进制并添加到{@link StringBuilder}中 @param builder {@link StringBuilder} @param b byte @param toLowerCase 是否使用小写 @since 4.4.1
[ "public static void appendHex(StringBuilder builder, byte b, boolean toLowerCase) {\r\n\t\tfinal char[] toDigits = toLowerCase ? DIGITS_LOWER : DIGITS_UPPER;\r\n\t\t\r\n\t\tint high = (b & 0xf0) >>> 4;//高位\r\n\t\tint low = b & 0x0f;//低位\r\n\t\tbuilder.append(toDigits[high]);\r\n\t\tbuilder.append(toDigits[low]);\r\...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the instruction about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about text processing:" }
Set the box size for the molecular assembly
[ "def _set_box(self):\n \n net_volume = 0.0\n for idx, mol in enumerate(self.mols):\n length = max([np.max(mol.cart_coords[:, i])-np.min(mol.cart_coords[:, i])\n for i in range(3)]) + 2.0\n net_volume += (length**3.0) * float(self.param_list[idx]['...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
静音,客户端拒绝收到服务器端的离线推送通知 @param callback
[ "public void mute(final AVIMConversationCallback callback) {\n if (StringUtil.isEmpty(getConversationId())) {\n if (null != callback) {\n callback.internalDone(new AVException(AVException.INVALID_QUERY, \"ConversationId is empty\"));\n } else {\n LOGGER.w(\"ConversationId is empty\");\n ...
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Create a DeleteDurable request for an existing durable connection. @param subName the name of the subscription to delete. @param reqID The request ID to be used for the request. @param dme The dme to which the request should be sent
[ "protected static ControlDeleteDurable createDurableDeleteDurable(\n MessageProcessor MP,\n String subName,\n String userName,\n long reqID,\n SIBUuid8 dme) \n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"createDurableDeleteDurable\", new Object[] ...
[ "@SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n public Token<DelegationTokenIdentifier> getBoundOrNewDT(String renewer) throws IOException {\n logger.atFine().log(\"Delegation token requested\");\n if (isBoundToDT()) {\n // the FS was created on startup with a token, so return it.\n logger.at...
codesearchnet
{ "query": "Represent the description about Messaging:", "pos": "Represent the code about Messaging:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(DecreaseReplicationFactorRequest decreaseReplicationFactorRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (decreaseReplicationFactorRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Delete account. Note that this action cannot be undone.
[ "func (s *Service) AccountDeleteByUser(ctx context.Context, accountIdentity string) (*Account, error) {\n\tvar account Account\n\treturn &account, s.Delete(ctx, &account, fmt.Sprintf(\"/users/%v\", accountIdentity))\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Marinate only an instance of a view @memberOf module:marinate @param {Backbone.BaseView} viewInstance @param {...object} mixins
[ "function (viewInstance) {\n console.assert(viewInstance instanceof Backbone.BaseView, 'viewInstance must be an instance of Backbone.BaseView');\n var mixins = slice.call(arguments, 1);\n _marinate(viewInstance, mixins);\n }" ]
[ "public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns the path length plus a penalty if the starting/ending edge is unfavored.
[ "private double penalizedPathDistance(Path path,\n Set<EdgeIteratorState> penalizedVirtualEdges) {\n double totalPenalty = 0;\n\n // Unfavored edges in the middle of the path should not be penalized because we are\n // only concerned about the direction a...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
编译组件节点 @param {ANode} aNode 节点对象 @param {CompileSourceBuffer} sourceBuffer 编译源码的中间buffer @param {Component} owner 所属组件实例环境 @param {Object} extra 编译所需的一些额外信息 @param {Function} extra.ComponentClass 对应组件类
[ "function (aNode, sourceBuffer, owner, extra) {\n var dataLiteral = '{}';\n\n sourceBuffer.addRaw('var $sourceSlots = [];');\n if (aNode.children) {\n var defaultSourceSlots = [];\n var sourceSlotCodes = {};\n\n each(aNode.children, function (child) {\n ...
[ "function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Dt8ForInts returns a Dt8 value for a UTC year, month, day, hour, minute and second.
[ "func Dt14ForInts(yyyy, mm, dd, hr, mn, dy int) int64 {\n\tsDt14 := fmt.Sprintf(\"%04d%02d%02d%02d%02d%02d\", yyyy, mm, dd, hr, mn, dy)\n\tiDt14, err := strconv.ParseInt(sDt14, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(iDt14)\n}" ]
[ "def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Marshall the given parameter object.
[ "public void marshall(AutoScalingThresholds autoScalingThresholds, ProtocolMarshaller protocolMarshaller) {\n\n if (autoScalingThresholds == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(au...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getIfcProcedure() {\r\n\t\tif (ifcProcedureEClass == null) {\r\n\t\t\tifcProcedureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(384);\r\n\t\t}\r\n\t\treturn ifcProcedureEClass;\r\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:" }
Retrieve information for the specified VPC. If no VPC ID was specified then just pick the first VPC we find. Returns a dict with the VPC's zones, subnets, route tables and instances.
[ "def get_vpc_overview(con, vpc_id, region_name):\n \n logging.debug(\"Retrieving information for VPC '%s'\" % vpc_id)\n d = {}\n d['zones'] = con.get_all_zones()\n\n # Find the specified VPC, or just use the first one\n all_vpcs = con.get_all_vpcs()\n if not all_vpcs:\n raise VpcRoute...
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the summarization about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about AWS S3:" }
Convert an HTML string to plain-text. @param string $html The HTML string to convert. @return string The resulting plain-text string.
[ "protected function stripHtml($html)\n {\n $str = html_entity_decode($html);\n\n // Strip HTML (Replace br with newline, remove \"invisible\" tags and strip other tags)\n $str = preg_replace('#<br[^>]*?>#siu', \"\\n\", $str);\n $str = preg_replace(\n [\n '#<a...
[ "function formatMailBody(obj, order) {\n var result = \"\";\n if (!order) {\n order = Object.keys(obj);\n }\n \n // loop over all keys in the ordered form data\n for (var idx in order) {\n var key = order[idx];\n result += \"<h4 style='text-transform: capitalize; margin-bottom: 0'>\" + key + \"</h4><...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// NewDeviceLinkFailDetails returns a new DeviceLinkFailDetails instance
[ "func NewDeviceLinkFailDetails(DeviceType *DeviceType) *DeviceLinkFailDetails {\n\ts := new(DeviceLinkFailDetails)\n\ts.DeviceType = DeviceType\n\treturn s\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// UpdateAlphaHealthCheck applies the given alpha HealthCheck as an update.
[ "func (g *Cloud) UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error {\n\tctx, cancel := cloud.ContextWithCallTimeout()\n\tdefer cancel()\n\n\tmc := newHealthcheckMetricContextWithVersion(\"update\", computeAlphaVersion)\n\treturn mc.Observe(g.c.AlphaHealthChecks().Update(ctx, meta.GlobalKey(hc.Name), hc))\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Status ログなどのステータス情報 取得
[ "func (api *VPCRouterAPI) Status(id int64) (*sacloud.VPCRouterStatus, error) {\n\tvar (\n\t\tmethod = \"GET\"\n\t\turi = fmt.Sprintf(\"%s/%d/status\", api.getResourceURL(), id)\n\t\tres = &vpcRouterStatusResponse{}\n\t)\n\terr := api.baseAPI.request(method, uri, nil, res)\n\tif err != nil {\n\t\treturn nil, e...
[ "function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }