query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Get upload file from multipart request.
[ "public List<UploadFile> getFiles(String uploadPath, Integer maxPostSize, String encoding) {\r\n\t\tif (request instanceof MultipartRequest == false)\r\n\t\t\trequest = new MultipartRequest(request, uploadPath, maxPostSize, encoding);\r\n\t\treturn ((MultipartRequest)request).getFiles();\r\n\t}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Renders a clickable map.
[ "public void doMap(StaplerRequest req, StaplerResponse rsp) throws IOException {\n if (req.checkIfModified(timestamp, rsp)) return;\n\n ChartRenderingInfo info = new ChartRenderingInfo();\n render(req,info);\n\n rsp.setContentType(\"text/plain;charset=UTF-8\");\n rsp.getWriter().p...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parse one or more objects using an objectfilter expression.
[ "def ParseObjs(self, objs, expression):\n \"\"\"\"\"\"\n filt = self._Compile(expression)\n for result in filt.Filter(objs):\n yield result" ]
[ "@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 summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Creates a Packaged program from the given command line options. @return A PackagedProgram (upon success)
[ "PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException {\n\t\tString[] programArgs = options.getProgramArgs();\n\t\tString jarFilePath = options.getJarFilePath();\n\t\tList<URL> classpaths = options.getClasspaths();\n\n\t\tif (jarFilePath == null) {\n\t\t\tthr...
[ "@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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Removes a change listener added using `on`.
[ "function off(property, callback){\n listeners[property] = listeners[property].filter(function (listener) {\n return listener !== callback;\n });\n }" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Prepares fields with incorrect property name format @param array $options @return array
[ "protected function prepareFields($options = [])\n {\n $params = $this->toArray($options);\n\n if (empty($this->mapper)) {\n return $params;\n }\n\n foreach ($this->mapper as $modelKey => $apiKey) {\n if(array_key_exists($modelKey,$params)) {\n $pa...
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Update stored activities and update caches as required.
[ "def _update_activities(self):\n \"\"\"\"\"\"\n self._activities = self._activities_request()\n _LOGGER.debug(\"Device Activities Response: %s\", self._activities)\n\n if not self._activities:\n self._activities = []\n elif not isinstance(self._activities, (list, tuple)...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
检查返回值是否符合格式要求 @param object $requireTypeObj type object @param object $returnObj return object @return array
[ "private function compareReturnJson($requireTypeObj, $returnObj)\n {\n // 检查属性是否存在并且类型一致\n if (empty($requireTypeObj)\n && gettype($requireTypeObj) != gettype($returnObj)\n ) {\n return [false, 'expect type is ' . gettype($returnObj) . ', but get ' . gettype($requireTy...
[ "public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
The full form of the kinetic energy integral >>> isclose(kinetic(1,(0,0,0),array((0,0,0),'d'),1,(0,0,0),array((0,0,0),'d')),2.953052) True
[ "def kinetic(alpha1,lmn1,A,alpha2,lmn2,B):\n \n l1,m1,n1 = lmn1\n l2,m2,n2 = lmn2\n term0 = alpha2*(2*(l2+m2+n2)+3)*\\\n overlap(alpha1,(l1,m1,n1),A,\\\n alpha2,(l2,m2,n2),B)\n term1 = -2*pow(alpha2,2)*\\\n (overlap(alpha1,(l1,m1,n1),A,\n ...
[ "def deriv(f,c,dx=0.0001):\n \n return (f(c+dx)-f(c-dx))/(2*dx)" ]
codesearchnet
{ "query": "Represent the Github post about Computer programming or scientific field:", "pos": "Represent the Github code about Computer programming or scientific field:", "neg": "Represent the Github code:" }
Parse a reference type signature. @param parser The parser @param definingClassName The class containing the type descriptor. @return The parsed type reference type signature. @throws ParseException If the type signature could not be parsed.
[ "static ReferenceTypeSignature parseReferenceTypeSignature(final Parser parser, final String definingClassName)\n throws ParseException {\n final ClassRefTypeSignature classTypeSignature = ClassRefTypeSignature.parse(parser, definingClassName);\n if (classTypeSignature != null) {\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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Create a new revision file.
[ "def revision(directory=None, message=None, autogenerate=False, sql=False,\n head='head', splice=False, branch_label=None, version_path=None,\n rev_id=None):\n \"\"\"\"\"\"\n config = current_app.extensions['migrate'].migrate.get_config(directory)\n if alembic_version >= (0, 7, 0):\...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Start listening to global focus-related events
[ "function () {\n\n\t\tif (!this._focus_acquired_listener) {\n\t\t\tthis._focus_acquired_listener = Lava.app.on('focus_acquired', this._onFocusTargetAcquired, this);\n\t\t\tthis._focus_lost_listener = Lava.app.on('focus_lost', this.clearFocusedTarget, this);\n\t\t\tthis._focus_listener = Lava.Core.addGlobalHandler('...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SaveSynonym saves the given synonyms. // // Unlike SaveObjects, this method does not batch the given synonyms i.e. all synonyms // are sent in a single call.
[ "func (i *Index) SaveSynonyms(synonyms []Synonym, opts ...interface{}) (res UpdateTaskRes, err error) {\n\tif replaceExistingSynonyms := iopt.ExtractReplaceExistingSynonyms(opts...); replaceExistingSynonyms != nil {\n\t\topts = opt.InsertExtraURLParam(opts, \"replaceExistingSynonyms\", replaceExistingSynonyms.Get()...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Create load or refresh tip dom of each stages
[ "function createTipDom(h, context, type, tip) {\n const stage = context.vuescroll.state[`${type}Stage`];\n let dom = null;\n // Return user specified animation dom\n /* istanbul ignore if */\n if ((dom = context.$slots[`${type}-${stage}`])) {\n return dom;\n }\n\n switch (stage) {\n // The dom will show ...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Creates a plus function that adds given {@code value} to it's argument. @param arg a value to be added to function's argument @return a closure object that does {@code _ + _}
[ "public static VectorFunction asPlusFunction(final double arg) {\n return new VectorFunction() {\n @Override\n public double evaluate(int i, double value) {\n return value + arg;\n }\n };\n }" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Serialize a list of objects to an OutputStream. @param map The map of objects to serialize. @param os The OutputStream to which the list should be serialized
[ "public void serialize(Map<String, T> map, OutputStream os) throws IOException {\n JsonGenerator jsonGenerator = LoganSquare.JSON_FACTORY.createGenerator(os);\n serialize(map, jsonGenerator);\n jsonGenerator.close();\n }" ]
[ "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns a list of relevant variable indices. A relevant variable is known by the solver. @param variables variables to convert and filter @return list of relevant variable indices
[ "private List<Integer> getRelevantVarIndices(final Collection<Variable> variables) {\n final List<Integer> relevantVarIndices = new ArrayList<>(variables.size());\n for (final Variable var : variables) {\n final Integer idx = this.name2idx.get(var.name());\n // Note: Unknown vari...
[ "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 post about Deep Learning:", "pos": "Represent the Github code about Deep Learning:", "neg": "Represent the Github code:" }
if we failed to find compatible parents among free units. (This may be the case if an attacker floods the network trying to shift the witness list)
[ "function pickDeepParentUnits(conn, arrWitnesses, max_wl, onDone){\n\t// fixed: an attacker could cover all free compatible units with his own incompatible ones, then those that were not on MC will be never included\n\t//var cond = bDeep ? \"is_on_main_chain=1\" : \"is_free=1\";\n\t\n\tconsole.log(\"looking for dee...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Registers a new orb object to this schema. This could be a column, index, or collector -- including a virtual object defined through the orb.virtual decorator. :param item: <variant> :return:
[ "def register(self, item):\n \n if callable(item) and hasattr(item, '__orb__'):\n item = item.__orb__\n\n key = item.name()\n model = self.__model\n\n # create class methods for indexes\n if isinstance(item, orb.Index):\n self.__indexes[key] = item\n ...
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Computes the term Grad[fi].stepX
[ "protected DoubleMatrix1D gradFiStepX(DoubleMatrix1D stepX){\r\n\t\t\r\n\t\tDoubleMatrix1D ret = F1.make(getMieq());\r\n\t\tfor(int i=0; i<getDim(); i++){\r\n\t\t\tret.setQuick( i, - stepX.getQuick(i));\r\n\t\t\tret.setQuick(getDim()+i, stepX.getQuick(i));\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}" ]
[ "def plogdet(K):\n \n \"\"\"\n egvals = eigvalsh(K)\n return npsum(log(egvals[egvals > epsilon]))" ]
codesearchnet
{ "query": "Represent the Github post about Computer programming or scientific field:", "pos": "Represent the Github code about Computer programming or scientific field:", "neg": "Represent the Github code:" }
Parse RESERVOIR Link Method
[ "def reservoirLink(lines):\n \n # Constants\n KEYWORDS = ('LINK',\n 'RESERVOIR',\n 'RES_MINWSE',\n 'RES_INITWSE',\n 'RES_MAXWSE',\n 'RES_NUMPTS',\n 'LAKE',\n 'MINWSE',\n 'INITWSE',\n ...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
blindly query the schema by name
[ "def query(self, name, node):\n \n #log.debug('searching schema for (%s)', name)\n qref = qualify(name, node, node.namespace())\n query = BlindQuery(qref)\n result = query.execute(self.schema)\n return (result, [])" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Launch the appropriate builder.
[ "def main(args):\n \"\"\"\"\"\"\n\n grr_config.CONFIG.AddContext(contexts.CLIENT_BUILD_CONTEXT)\n\n if args.subparser_name == \"generate_client_config\":\n # We don't need a full init to just build a config.\n GetClientConfig(args.client_config_output)\n return\n\n # TODO(user): Find out if adding the ...
[ "@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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Inspect mount table for device
[ "func (m *Mounter) Inspect(sourcePath string) []*PathInfo {\n\tm.Lock()\n\tdefer m.Unlock()\n\n\tv, ok := m.mounts[sourcePath]\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn v.Mountpoint\n}" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@function ImmutableCoreModelQuery instantiate a new ImmutableCoreModelQuery instance @param {object} args @param {ImmutableCoreModel} model @param {object} session @returns {ImmutableCoreModelQuery}
[ "function ImmutableCoreModelQuery (args) {\n // require model\n this.assert(defined(args.model) && args.model.ImmutableCoreModel, 'model required')\n // set model for query\n this.model = args.model\n // args and session are both optional in some cases\n this.args = _.cloneDeep( requireValidOption...
[ "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 Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// AttributeImports will construct a new ImportsSpec slice from an existing slice and add in imports specified in // struct:field:type Metadata tags.
[ "func AttributeImports(att *design.AttributeDefinition, imports []*ImportSpec, seen []*design.AttributeDefinition) []*ImportSpec {\n\n\tfor _, a := range seen {\n\t\tif att == a {\n\t\t\treturn imports\n\t\t}\n\t}\n\tseen = append(seen, att)\n\n\tif tname, ok := att.Metadata[\"struct:field:type\"]; ok {\n\t\tif len...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Get catalog item @param array $item @return \AnimeDb\Bundle\CatalogBundle\Entity\Item|null
[ "public function getCatalogItem(array $item)\n {\n $sources = [$this->browser->getHost().$item['url']];\n if (!empty($item['world_art_id'])) {\n $sources[] = str_replace('#ID#', $item['world_art_id'], self::WORLD_ART_URL);\n }\n if (!empty($item['myanimelist_id'])) {\n ...
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
If none of this tree's nodes have conditions, this tree's cache is the most basic
[ "public function updateTreeOpts($treeID = -3)\n {\n $treeRow = $GLOBALS[\"SL\"]->treeRow;\n if ($treeID <= 0) {\n $treeID = $GLOBALS[\"SL\"]->treeID;\n } else {\n $treeRow = SLTree::find($treeID);\n }\n if ($treeRow->TreeType == 'Page') {\n /* /...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
does the actual work of indent_func
[ "def _indent_decor(lbl):\n \n def closure_indent(func):\n if util_arg.TRACE:\n @ignores_exc_tb(outer_wrapper=False)\n #@wraps(func)\n def wrp_indent(*args, **kwargs):\n with util_print.Indenter(lbl):\n print(' ...trace[in]')\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Set up the Schema for the current data model, based on the provided Kind/Schema/buildSchema @param Schema|string|null $mix_schema @return Schema @throws \Exception
[ "private function determineSchema($mix_schema)\n {\n if(null === $mix_schema) {\n $mix_schema = $this->buildSchema();\n }\n if ($mix_schema instanceof Schema) {\n return $mix_schema;\n }\n if (is_string($mix_schema)) {\n return new Schema($mix_s...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get current position for scroll bar.
[ "def _get_pos(self):\n \n if self._canvas.height >= self._max_height:\n return 0\n else:\n return self._canvas.start_line / (self._max_height - self._canvas.height + 1)" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param frameNumber @param dropFrame set to true to indicate that the frame-rate excludes dropframes @param timebase @return a timecode representation of the given data, null when a timecode can not be generated (i.e. duration exceeds a day)
[ "public static final Timecode getInstance(long frameNumber, boolean dropFrame, Timebase timebase)\n\t{\n\t\treturn TimecodeBuilder.fromFrames(frameNumber, timebase, dropFrame).build();\n\t}" ]
[ "@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 Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Converts a Type Label into a type Id for this specific graph. Mapping labels to ids will differ between graphs so be sure to use the correct graph when performing the mapping. @param label The label to be converted to the id @return The matching type id
[ "public LabelId convertToId(Label label) {\n if (transactionCache.isLabelCached(label)) {\n return transactionCache.convertLabelToId(label);\n }\n return LabelId.invalid();\n }" ]
[ "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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Locate a child block by byte pattern and validate by checking the length of the string we are expecting to follow the pattern. @param bufferIndex start index @return true if a child block starts at this point
[ "private final boolean matchChildBlock(int bufferIndex)\n {\n //\n // Match the pattern we see at the start of the child block\n //\n int index = 0;\n for (byte b : CHILD_BLOCK_PATTERN)\n {\n if (b != m_buffer[bufferIndex + index])\n {\n return false;\n ...
[ "int blockForReadSpace(int readLocation) {\n\n // sets the nextReadLocation my moving it on by 1, this may cause it it wrap back to the start.\n final int nextReadLocation = (readLocation + 1 == capacity) ? 0 : readLocation + 1;\n\n // in the for loop below, we are blocked reading unit another ...
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
// ReadBuckets reads datapoints from the server, aggregated to buckets with given parameters.
[ "func (c *Client) ReadBuckets(t MetricType, o ...Modifier) ([]*Bucketpoint, error) {\n\to = prepend(o, c.URL(\"GET\", TypeEndpoint(t), StatsEndpoint()))\n\n\tr, err := c.Send(o...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer r.Body.Close()\n\n\tif r.StatusCode == http.StatusOK {\n\t\tb, err := ioutil.Re...
[ "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 text about AWS S3:", "pos": "Represent the code about AWS S3:", "neg": "Represent the code:" }
@param string $name @param QueryObjectInterface $queryObject @param DisplayCriteriaInterface $displayCriteria @return int
[ "public function count($name, QueryObjectInterface $queryObject, DisplayCriteriaInterface $displayCriteria = null)\n {\n $count = $this->doCount($queryObject, $displayCriteria);\n $this->data[$name] = $count;\n\n return $count;\n }" ]
[ "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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Appends $segment to the end of the path @param string $segment the segment to append @return self @throws InvalidArgumentException if $segment is not a string @since 0.1.0
[ "public function appendSegment($segment)\n\t{\n\t\tif (is_string($segment)) {\n\t\t\t$this->segments[] = $segment;\n\t\t} else {\n\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t__METHOD__.\"() expects parameter one, segment, to be a string\"\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}" ]
[ "private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Returns a new {@code CallOptions} with a deadline that is after the given {@code duration} from now.
[ "public CallOptions withDeadlineAfter(long duration, TimeUnit unit) {\n return withDeadline(Deadline.after(duration, unit));\n }" ]
[ "public long appendEntry(JournalEntry entry) {\n // TODO(gpang): handle bounding the queue if it becomes too large.\n\n /**\n * Protocol for appending entries\n *\n * This protocol is lock free, to reduce the overhead in critical sections. It uses\n * {@link AtomicLong} and {@link ConcurrentLi...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about text processing:" }
/* public int numFree() { return numFree; } public int numAlloc() { return free.length - numFree; }
[ "public T alloc() {\n if (numFree == 0) {\n Preconditions.checkState(numAlloc < maxSize);\n numAlloc++;\n return allocator.get();\n } else {\n T item = free[numFree - 1];\n numFree--;\n return item;\n }\n }" ]
[ "public void clear() {\n\tnew ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);\n\t//new DoubleArrayList(values).fillFromToWith(0, state.length-1, 0); // delta\n\t\n\t/*\n\tif (debug) {\n\t\tfor (int i=table.length; --i >= 0; ) {\n\t\t state[i] = FREE;\n\t\t table[i]= Integer.MAX_VALUE;\...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
QStyledItemDelegate.paint implementation
[ "def paint(self, painter, option, index):\n \n option.state &= ~QStyle.State_HasFocus # never draw focus rect\n\n options = QStyleOptionViewItem(option)\n self.initStyleOption(options,index)\n\n style = QApplication.style() if options.widget is None else options.widget.style()\n\...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return the slice after at sub in string astr
[ "def fsliceafter(astr, sub):\n \"\"\"\"\"\"\n findex = astr.find(sub)\n return astr[findex + len(sub):]" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github sentence about Text analysis:", "pos": "Represent the Github code about Text analysis:", "neg": "Represent the Github code:" }
Render an accordion item @param mixed $titleHtml @param mixed $bodyHtml @param array $options @return string
[ "public function accordionItem($titleHtml, $bodyHtml = null, $options = array()) {\n\t\t$itemBodyId = str_replace('.', '', uniqid('accordion_body_', true));\n\t\t$titleLink = $this->link($titleHtml, '#' . $itemBodyId, array(\n\t\t\t'data-toggle' => 'collapse', 'data-parent' => '#' . $options['accordionId']\n\t\t));...
[ "function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }" ]
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Push element ID to end of list @param int $iElementID @see \Lovata\Toolbox\Tests\Unit\CollectionTest::testUnshiftMethod() @link https://github.com/lovata/oc-toolbox-plugin/wiki/ElementCollection#pushielementid @return $this
[ "public function push($iElementID)\n {\n if (empty($iElementID)) {\n return $this->returnThis();\n }\n\n if ($this->isEmpty()) {\n $this->arElementIDList = [$iElementID];\n\n return $this->returnThis();\n }\n\n $this->arElementIDList[] = $iEleme...
[ "public function createUiComponent(\\n2n\\impl\\web\\ui\\view\\html\\HtmlView $view, \\rocket\\ei\\util\\Eiu $eiu) {\r\n\t\treturn $view->getHtmlBuilder()->getEsc($eiu->field()->getValue());\r\n\t}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// We don't get proper application error structs back from v6, but we // do know that anything that's not considered a fatal error can be // translated into an application error.
[ "func remoteApplicationError(err error) error {\n\treturn &fluxerr.Error{\n\t\tType: fluxerr.User,\n\t\tErr: err,\n\t\tHelp: `Error from daemon\n\nThe daemon (fluxd, running in your cluster) reported this error when\nattempting to fulfil your request:\n\n ` + err.Error() + `\n`,\n\t}\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the comment about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Decode a simple (flat) JSON string into a structure. The ciphertext, adata, salt and iv will be base64-decoded. @param {String} str The string. @return {Object} The decoded structure. @throws {sjcl.exception.invalid} if str isn't (simple) JSON.
[ "function (str) {\n str = str.replace(/\\s/g,'');\n if (!str.match(/^\\{.*\\}$/)) {\n throw new sjcl.exception.invalid(\"json decode: this isn't json!\");\n }\n var a = str.replace(/^\\{|\\}$/g, '').split(/,/), out={}, i, m;\n for (i=0; i<a.length; i++) {\n if (!(m=a[i].match(/^\\s*(?:([\"'...
[ "def Decode(self, encoded_data):\n \n try:\n # TODO: replace by libuna implementation or equivalent. The behavior of\n # base64.b64decode() does not raise TypeError for certain invalid base64\n # data e.g. b'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08' these are silently\n # ignored.\n d...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
converts from JSONObject to cell class @param jsonObject @return @throws IllegalAccessException @throws InstantiationException @throws InvocationTargetException
[ "public static Cells getCellFromJson(LinkedMapWritable jsonObject, String tableName) throws IllegalAccessException,\n InstantiationException, InvocationTargetException, NoSuchMethodException {\n\n Cells cells = tableName != null ? new Cells(tableName) : new Cells();\n\n Set<Map.Entry<Writab...
[ "public static Collection<BaseStyler> findForCssName(String cssName) throws ClassNotFoundException, IOException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {\n return findForCssName(cssName, false);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
//等同与UpdateId(db *mgo.Database, collection,id,bson.M{"$set":change})
[ "func SetId(db *mgo.Database, collection string, id interface{}, change interface{}) error {\n\treturn UpdateId(db, collection, id, bson.M{\"$set\": change})\n}" ]
[ "func (ru *RelationUnit) Joined() (bool, error) {\n\treturn ru.inScope(bson.D{{\"departing\", bson.D{{\"$ne\", true}}}})\n}" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
返回 {column} = {column} &#38; {value} 操作 @param column 字段名 @param value 字段值 @return ColumnValue
[ "public static ColumnValue and(String column, Serializable value) {\r\n return new ColumnValue(column, AND, value);\r\n }" ]
[ "static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }" ]
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
处理普通路由,获取命名空间、控制器和执行方法 @return array
[ "public static function getRoute() {\n //获取请求URL\n $requestUrlArr = self::getRouteArray();\n\n //处理请求URL\n if (count($requestUrlArr) == 1) {//dev.example.com/aaa\n $data = array(array(\n 'act' => !empty($requestUrlArr[0]) ? $requestUrlArr[0] : 'index',\n ...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Wipes clean the entire cache's keys. @author : evalor <master@evalor.cn> @return bool True on success and false on failure.
[ "public function clear()\n {\n $keys = self::$instance->keys($this->options['prefix'].'*');\n if ($keys) {\n self::$instance->del(...$keys);\n }\n\n return true;\n }" ]
[ "function Flow(waits, // @arg Integer: Number of wait for processes\n callback, // @arg Function/FunctionHash/Flow/FlowHash: callback and forks\n // callback on completion of processes.\n // callback(err:Error, args:MixArray)\n ...
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Execute the command. @return void
[ "public function fire()\n {\n\n $presenter = $this->option('presenter');\n if (is_null($presenter) && $this->confirm('Would you like to create a Presenter? [y|N]')) {\n $presenter = 'yes';\n }\n\n if ($presenter == 'yes') {\n $this->call('starter:presenter', [\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Pocet kliku po dnech @param int $groupId @param Range $interval @return Result|null @throws QueryException
[ "public function findClicksByDay(int $groupId, Range $interval): ?Result\n\t{\n\t\t$builder = $this->builder()\n\t\t\t->select('DATE([inserted]) date, COUNT([uid]) num, SUM([sumValue]) sum, AVG([averageValue]) avg')\n\t\t\t->andWhere('[groupId] = %i', $groupId)\n\t\t\t->andWhere('DATE([inserted]) BETWEEN DATE(%dt) ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Returns the result set from the provided query. Holds a pessimistic lock on all returned documents. @return The contents of the Document at this DocumentReference.
[ "@Nonnull\n public ApiFuture<QuerySnapshot> get(@Nonnull Query query) {\n Preconditions.checkState(isEmpty(), READ_BEFORE_WRITE_ERROR_MSG);\n\n return query.get(transactionId);\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Given a list of exposure numbers, find all the KBOs in that set of exposures
[ "def searchTriples(expnums,ccd):\n \"\"\"\"\"\"\n import MOPfits,os \n import MOPdbaccess\n \n if len(expnums)!=3:\n return(-1)\n\n\n ### Some program Constants\n\n proc_file = open(\"proc-these-files\",\"w\")\n proc_file.write(\"# Files to be planted and searched\\n\")\n proc_file...
[ "def _calculate_index_of_coincidence(frequency_map, length):\n \n if length <= 1:\n return 0\n # We cannot error here as length can legitimiately be 1.\n # Imagine a ciphertext of length 3 and a key of length 2.\n # Spliting this text up and calculating the index of coincidence res...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public FontFidelityStpFntEx createFontFidelityStpFntExFromString(EDataType eDataType, String initialValue) {\n\t\tFontFidelityStpFntEx result = FontFidelityStpFntEx.get(initialValue);\n\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enumerator of '\" +...
[ "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 instruction about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Execute the console command.
[ "public function handle()\n {\n $bladePath = $this->laravel['config']['view.compiled'];\n $twigPath = $this->laravel['config']['view.twig'];\n\n if (! $bladePath || ! $twigPath) {\n throw new \\RuntimeException('View cache path not found.');\n }\n\n foreach ($this->f...
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Deserializes Question areas. @param GraphicQuestion $graphicQuestion @param array $solutions
[ "private function deserializeAreas(GraphicQuestion $graphicQuestion, array $solutions)\n {\n $areaEntities = $graphicQuestion->getAreas()->toArray();\n\n foreach ($solutions as $solutionData) {\n $area = null;\n\n // Searches for an existing area entity.\n foreach (...
[ "SimpleArticle readData(int properties, String name) {\n return getPerformedAction(new GetRevision(null, name, properties)).getArticle();\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Loads the libsass library if it isn't already loaded.
[ "def _load(self):\n \"\"\"\"\"\"\n if self.clib is None:\n root_path = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__ )), '..'))\n path1 = os.path.join(root_path, 'sass.so')\n path2 = os.path.join(root_path, '..', 'sass.so')\n\n if o...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Register view composers. @return void
[ "protected function registerComposers()\n {\n View::composer(\n '*',\n \\Appstract\\Multisite\\Composers\\CurrentSiteComposer::class\n );\n\n View::composer(\n Config::get('multisite.views.overwriteable'),\n \\Appstract\\Multisite\\Composers\\Overw...
[ "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:" }
// checkAndInitDBPriv checks if DB scope privilege entry exists in mysql.DB. // If unexists, insert a new one.
[ "func checkAndInitDBPriv(ctx sessionctx.Context, dbName string, is infoschema.InfoSchema, user string, host string) error {\n\tok, err := dbUserExists(ctx, user, host, dbName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ok {\n\t\treturn nil\n\t}\n\t// Entry does not exist for user-host-db. Insert a new entry.\n\t...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about AWS Auto Scaling:" }
// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
[ "func (p *PagesBuild) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}" ]
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
获取日志对象 @param name 日志的名字 @return 日志实现
[ "public static org.slf4j.Logger getLogger(String name, String appname) {\n //从\"com/alipay/sofa/rpc/log\"中获取 rpc 的日志配置并寻找对应logger对象,log 为默认添加的后缀\n if (name == null || name.isEmpty()) {\n return null;\n }\n\n Map<String, String> properties = new HashMap<String, String>();\n ...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Internal generate log message. @param string $type @param string $message @param string $trace @param string $groupIdentifier @return boolean
[ "private static function log($type, $message, $trace, $groupIdentifier)\n {\n $hashArray = static::getHashArray($message, $groupIdentifier);\n \n $file = 'unknown';\n $line = 'unknown';\n $fn = 'unknown';\n $fnArgs = [];\n \n if (isset($trace[0])) {\n ...
[ "public function errTrace($text)\n {\n //====================================================================//\n // Build Error Trace\n $trace = (new Exception())->getTrace()[1];\n\n //====================================================================//\n // Push Error to Lo...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
To configure JMS Destinations @param jmsDestinations
[ "private void configureJMSDestinations(List<JMSDestination> jmsDestinations) {\n Map<String, ConfigItem<JMSDestination>> jmsDestinationConfigItemMap = configurator.getConfigItemMap(JNDIEnvironmentRefType.JMSConnectionFactory.getXMLElementName());\n \n for (JMSDestination jmsDestination : jmsDes...
[ "@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:" }
Perform an 'off-policy' training step of sampling the replay buffer and gradient descent
[ "def off_policy_train_batch(self, batch_info: BatchInfo):\n \n self.model.train()\n\n rollout = self.env_roller.sample(batch_info, self.model, self.settings.number_of_steps).to_device(self.device)\n\n batch_result = self.algo.optimizer_step(\n batch_info=batch_info,\n ...
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retrieve reflection for anonymous function @return void @throws ComponentException @throws ControllerException @throws \ReflectionException
[ "protected function initMeta(): void\n {\n // cache for reflection data\n $cacheKey = \"meta.{$this->module}.{$this->controller}\";\n\n if (!$meta = Cache::get($cacheKey)) {\n $meta = new Meta($this->getFile());\n $meta->process();\n\n Cache::set(\n ...
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Parses all declarations including:<br> <ul> <li> Fields <li> Methods <li> Properties <li> Inner types, recursively </ul>
[ "public void parseDeclarations( IGosuClass gsCls )\n {\n IGosuClassInternal gsClass = (IGosuClassInternal)gsCls;\n\n if( gsClass.isDeclarationsCompiled() )\n {\n if( !gsClass.isInnerDeclarationsCompiled() )\n {\n if( parseDeclarationsOfLeftOverInnerClasses( gsClass ) )\n {\n ...
[ "protected void createGenModelAnnotations()\n\t{\n\t\tString source = \"http://www.eclipse.org/emf/2002/GenModel\";\t\n\t\taddAnnotation\n\t\t (jvmIdentifiableElementEClass.getEOperations().get(0), \n\t\t source, \n\t\t new String[] \n\t\t {\n\t\t\t \"documentation\", \"<p>The identifier of a JvmIdentifiable...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Text generation:" }
Initializes the artist based on the plot method declared on the plot.
[ "def init_artists(self, ax, plot_args, plot_kwargs):\n \n plot_method = self._plot_methods.get('batched' if self.batched else 'single')\n plot_fn = getattr(ax, plot_method)\n artist = plot_fn(*plot_args, **plot_kwargs)\n return {'artist': artist[0] if isinstance(artist, list) and\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Applies velocity contrast curve constraint to each population See :func:`vespa.stars.StarPopulation.apply_vcc`; all arguments passed to that function for each population.
[ "def apply_vcc(self,vcc):\n \n if 'secondary spectrum' not in self.constraints:\n self.constraints.append('secondary spectrum')\n for pop in self.poplist:\n if not pop.is_specific:\n try:\n pop.apply_vcc(vcc)\n except:\n ...
[ "def _verify_constrained_hash(self):\n \n changed_params = dict(self.param.get_param_values(onlychanged=True))\n if self.time_dependent and ('name' not in changed_params):\n self.param.warning(\"Default object name used to set the seed: \"\n \"random val...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// generateListFilterFromLabels create a filter string based off --filter documentation at // https://cloud.google.com/sdk/gcloud/reference/compute/disks/list
[ "func generateListFilterFromLabels(labels map[string]string) string {\n\tvar filter string\n\tfor k, v := range labels {\n\t\tfilter = fmt.Sprintf(\"%s(labels.%s eq %s)\", filter, k, v)\n\t}\n\n\treturn filter\n}" ]
[ "def create_logstash(self, **kwargs):\n \n logstash = predix.admin.logstash.Logging(**kwargs)\n logstash.create()\n logstash.add_to_manifest(self)\n\n logging.info('Install Kibana-Me-Logs application by following GitHub instructions')\n logging.info('git clone https://githu...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Reads a class and returns its registration. @return May be null. @see ClassResolver#readClass(Input)
[ "public Registration readClass (Input input) {\r\n\t\tif (input == null) throw new IllegalArgumentException(\"input cannot be null.\");\r\n\t\ttry {\r\n\t\t\treturn classResolver.readClass(input);\r\n\t\t} finally {\r\n\t\t\tif (depth == 0 && autoReset) reset();\r\n\t\t}\r\n\t}" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about File management:" }
// SetProposalId sets the ProposalId field's value.
[ "func (s *Proposal) SetProposalId(v string) *Proposal {\n\ts.ProposalId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns information about the in-app product specified. (inappproducts.get) @param string $packageName @param string $sku Unique identifier for the in-app product. @param array $optParams Optional parameters. @return AndroidPublisher_InAppProduct
[ "public function get($packageName, $sku, $optParams = array())\n {\n $params = array('packageName' => $packageName, 'sku' => $sku);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"AndroidPublisher_InAppProduct\");\n }" ]
[ "protected function rules() {\n return [\n new Rule('Transaction ID', function(array $subject) {\n $response = SubjectReader::readResponse($subject);\n\n return array_key_exists('id', $response);\n }, __('Checkout.com response does not have transaction ID.'...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
/*! Returns an array of languages for which translations don't exist. \return an array of languages. Each key in this array is 'language locale'.
[ "function untranslatedLanguages()\n {\n $availableLanguages = $this->prioritizedLanguages();\n $availableLanguagesCodes = array_keys( $availableLanguages );\n\n $languages = array();\n foreach ( eZContentLanguage::prioritizedLanguages() as $language )\n {\n $language...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// The GUI needs a way to refer to repos
[ "func formatUniqueRepoID(teamID keybase1.TeamID, repoID keybase1.RepoID) string {\n\treturn string(teamID) + \"_\" + string(repoID)\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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Dump plugin stats. @param {function} writeCb Callback to write stats to. @returns {undefined}
[ "function status(writeCb) {\n Object.keys(stats).forEach((stat) => {\n writeCb(null, 'zabbix', stat, stats[stat]);\n });\n}" ]
[ "function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Removing placeholder. @param string $name name of placeholder. @throws TemplateException
[ "public function removePlaceholder($name)\n {\n if (empty($name)) {\n return;\n }\n $_name = $name;\n list($name, , $template) = $this->getParentPlaceholder($name);\n if (!isset($template)) {\n $template = $this;\n }\n\n if ($template === fal...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Request wrapper that automatically parses SDF response and supresses NotFoundError.
[ "def get_sdf(identifier, namespace='cid', domain='compound',operation=None, searchtype=None, **kwargs):\n \"\"\"\"\"\"\n try:\n return get(identifier, namespace, domain, operation, 'SDF', searchtype, **kwargs).decode()\n except NotFoundError as e:\n log.info(e)\n return None" ]
[ "@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:" }
Generates the LTPA keys and stores them into a Properties object. @param keyPasswordBytes @param realm @return @throws Exception
[ "protected final Properties generateLTPAKeys(byte[] keyPasswordBytes, final String realm) throws Exception {\n Properties expProps = null;\n\n try {\n KeyEncryptor encryptor = new KeyEncryptor(keyPasswordBytes);\n LTPAKeyPair pair = LTPADigSignature.generateLTPAKeyPair();\n ...
[ "def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)" ]
codesearchnet
{ "query": "Represent the comment about Encryption:", "pos": "Represent the code about Encryption:", "neg": "Represent the code about programming:" }
Adds a chef recipe to the cloud The hsh parameter is inserted into the override_attributes. The insertion is performed as follows. If the recipe name = "foo::bar" then effectively the call is override_attributes.merge! { :foo => { :bar => hsh } }
[ "def recipe(recipe_name, hsh={})\n _recipes << recipe_name unless _recipes.include?(recipe_name)\n\n head = {}\n tail = head\n recipe_name.split(\"::\").each do |key|\n unless key == \"default\"\n n = {}\n tail[key] = n\n tail = n\n end\n end\n ...
[ "def set_variation_lineage(kind = nil)\n @lineage = \"testlineage#{@deployment.href.split(/\\//).last}\"\n if kind\n raise \"Only support nil kind for ebs lineage\"\n else\n @deployment.set_input('EBS_LINEAGE', \"text:#{@lineage}\")\n # unset all server level inputs in the deploy...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Creates a real valued diagonal matrix of the specified type
[ "public static SimpleMatrix diag( Class type, double ...vals ) {\n SimpleMatrix M = new SimpleMatrix(vals.length,vals.length,type);\n for (int i = 0; i < vals.length; i++) {\n M.set(i,i,vals[i]);\n }\n return M;\n }" ]
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Called when the receiver should be stopped. Closes the server socket and all of the open sockets.
[ "public synchronized void shutdown() {\n // mark this as no longer running\n active = false;\n\n if (rThread != null) {\n rThread.interrupt();\n rThread = null;\n }\n doShutdown();\n }" ]
[ "@Override\n public void channelHandlerContext(ChannelHandlerContext ctx) throws Http2Exception {\n this.ctx = checkNotNull(ctx, \"ctx\");\n\n // Writing the pending bytes will not check writability change and instead a writability change notification\n // to be provided by an explicit call....
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Return interpreted / typed list of args.
[ "def cooked(self, raw_args):\n \"\"\"\"\"\"\n args = []\n for arg in raw_args:\n # TODO: use the xmlrpc-c type indicators instead / additionally\n if arg and arg[0] in \"+-\":\n try:\n arg = int(arg, 10)\n except (ValueError...
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Get setting by key @param $key @param null $default @param bool $save @return mixed
[ "public function get($key, $default = null, $save = false)\n {\n $this->load();\n\n if ($this->has($key)) {\n return Arr::get($this->settings, $key, $default);\n }\n\n if ($save) {\n $this->set($key, $default);\n }\n\n if ($this->config->has($key)) ...
[ "private function preconfigured() {return dfc($this, function() {\n\t\t$s = $this->s(); /** @var S $s */\n\t\t/** @var string $key */\n\t\t$key = 'actionFor' . (df_customer_is_new($this->o()->getCustomerId()) ? 'New' : 'Returned');\n\t\t/** @var string $result */\n\t\treturn $s->v($key, null, function() use($s) {re...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Auto Generated Code
[ "def secpolicy_sa_secpolicy_defined_policy_policies_policy(self, **kwargs):\n \n config = ET.Element(\"config\")\n secpolicy_sa = ET.SubElement(config, \"secpolicy-sa\", xmlns=\"urn:brocade.com:mgmt:brocade-fc-auth\")\n secpolicy = ET.SubElement(secpolicy_sa, \"secpolicy\")\n defi...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github text about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
ND Convolution @param input the input to op @param kernel the kerrnel to op with @param type the opType of convolution @param axes the axes to do the convolution along @return the convolution of the given input and kernel
[ "public static INDArray convn(INDArray input, INDArray kernel, Type type, int[] axes) {\n return Nd4j.getConvolution().convn(input, kernel, type, axes);\n }" ]
[ "def input_sensitivity(self, summarize=True):\n \n if not summarize:\n num_params = [0]\n parts = []\n def sum_params(x):\n if (not isinstance(x, CombinationKernel)) and isinstance(x, Kern):\n num_params[0] += 1\n pa...
codesearchnet
{ "query": "Represent the Github description about Image processing:", "pos": "Represent the Github code about Image processing:", "neg": "Represent the Github code about programming:" }
Close the open stream. Close the stream if it was opened before
[ "public synchronized final void closeStream() {\n try {\n if ((stream != null) && (streamState == StreamStates.OPEN)) {\n stream.close();\n stream = null;\n }\n streamState = StreamStates.CLOSED;\n } catch (IOException e) {\n e....
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
PHP Validation *
[ "public function validate($validator)\n {\n // First check if value is numeric\n if ($this->value && $this->isNumeric()) {\n // Convert to a number to check\n $value = $this->value + 0;\n \n if(is_int($value)) {\n return true;\n ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
Get the cache control directives @link https://tools.ietf.org/html/rfc7234#page-21 @return array
[ "protected function _getCacheControl()\n {\n $response = $this->getResponse();\n $cache = $response->getCacheControl();\n\n if($response->getUser()->isAuthentic()) {\n $cache[] = 'private';\n } else {\n $cache[] = 'public';\n }\n\n return $cache;...
[ "final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}" ]
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Programming:" }
Fetch the sequence from the trace data.
[ "private void setSeq() {\n\t\tchar tempseq[] = new char[seqLength];\n\t\tfor (int x = 0; x <= seqLength - 1; ++x) {\n\t\t\ttempseq[x] = (char) traceData[PBAS2 + x];\n\t\t}\n\t\tsequence = new String(tempseq);\n\t}" ]
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns the functional description of a gender for use in e.g. interface elements @param string $locale @return array gender => string
[ "public function getGenders($locale = null)\n {\n return array('M' => $this->_('Male', $locale), 'F' => $this->_('Female', $locale), 'U' => $this->_('Unknown', $locale));\n }" ]
[ "def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Convert ArrayObjects to arrays. Recursively convert all ArrayObjects into arrays in the full data structure. @param mixed $data @return mixed
[ "protected function convertArrayObjects($data)\n {\n if ($data instanceof Json\\ArrayObject) {\n // @todo: Check if we need to convert arrays with only one single\n // element into non-arrays /cc cba\n $data = $data->getArrayCopy();\n foreach ($data as $key => $...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Handle a generic exception and build return data. @param Exception $e @return mixed
[ "protected function handleGenericException(Exception $e)\n {\n // Get the status code and build the message.\n $statusCode = 500;\n $message = $e->getMessage();\n\n return $this->generateResponse('', null, $statusCode, Status::FAIL, $message);\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
/* DeleteNodesMacaddressDhcpWhitelist removes a whitelist of specified mac address Remove a whitelist of specified mac address */
[ "func (a *Client) DeleteNodesMacaddressDhcpWhitelist(params *DeleteNodesMacaddressDhcpWhitelistParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteNodesMacaddressDhcpWhitelistNoContent, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewDeleteNodesMacaddressDhcpWhiteli...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the CPU info gathered from sysinfo. Returns {} if sysinfo is not found.
[ "def _get_cpu_info_from_sysinfo_v2():\n\t'''\n\t\n\t'''\n\ttry:\n\t\t# Just return {} if there is no sysinfo\n\t\tif not DataSource.has_sysinfo():\n\t\t\treturn {}\n\n\t\t# If sysinfo fails return {}\n\t\treturncode, output = DataSource.sysinfo_cpu()\n\t\tif output == None or returncode != 0:\n\t\t\treturn {}\n\n\t...
[ "def _GetStat(self):\n \n stat_object = super(VShadowFileEntry, self)._GetStat()\n\n if self._vshadow_store is not None:\n # File data stat information.\n stat_object.size = self._vshadow_store.volume_size\n\n # Ownership and permissions stat information.\n\n # File entry type stat informat...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
// CallerHasRole does what it says and returns only transient errors.
[ "func (g *GrantsByRole) CallerHasRole(c context.Context, role Role) (bool, error) {\n\tswitch role {\n\tcase Owner:\n\t\treturn hasGrant(c, g.Owners, groupsAdministrators)\n\tcase Triggerer:\n\t\treturn hasGrant(c, g.Owners, g.Triggerers, groupsAdministrators)\n\tcase Reader:\n\t\treturn hasGrant(c, g.Owners, g.Rea...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Reads a 4 byte int.
[ "public int readInt () throws KryoException {\r\n\t\trequire(4);\r\n\t\tbyte[] buffer = this.buffer;\r\n\t\tint p = this.position;\r\n\t\tthis.position = p + 4;\r\n\t\treturn buffer[p] & 0xFF //\r\n\t\t\t| (buffer[p + 1] & 0xFF) << 8 //\r\n\t\t\t| (buffer[p + 2] & 0xFF) << 16 //\r\n\t\t\t| (buffer[p + 3] & 0xFF) <<...
[ "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 Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Converts an entity in N3.js representation to this library's representation
[ "function convertEntity(entity) {\n switch (entity[0]) {\n case '\"': {\n if(entity.indexOf(\"^^\") > 0) {\n var parts = entity.split(\"^^\");\n return {literal: parts[0] + \"^^<\" + parts[1] + \">\" };\n } else {\n return { literal: entit...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return dictionary of available plugins Returns ------- plugins : dictionary key is plugin name, value Plugin object
[ "def init_plugins():\n \n find_plugins()\n d = {}\n for c in Plugin.__subclasses__():\n ins = c()\n \n if ins.name() in config.get(\"plugin\", []):\n ins.activate()\n \n d[ins.name()] = ins\n \n return d" ]
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Interface constructor @constructor @param {String} name @param {Array} methods
[ "function (name, methods) {\n //this.callSuper(methods);\n this.name = name;\n this.methods = {};\n\n if (methods) {\n var n;\n //Add methods\n n = methods.length;\n while (n > 0) {\n n -= 1;\n this.methods[methods...
[ "@Override\n public AccessPlan fromView(XsStringVal schema, XsStringVal view) {\n return new AccessPlanSubImpl(this, \"op\", \"from-view\", new Object[]{ schema, view });\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }