query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Evaluate internal polynomial. | [
"def _poly_eval(self, u, ids, der=0):\n \"\"\"\"\"\"\n if der == 0:\n return self._poly_eval_0(u, ids)\n elif der == 1:\n return self._poly_eval_1(u, ids)\n elif der == 2:\n return self._poly_eval_2(u, ids)\n elif der == 3:\n return self... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Confidence Intervals using the t-distribution | [
"def tdist_ci(x, df, stderr, level):\n \n q = (1 + level)/2\n delta = stats.t.ppf(q, df) * stderr\n return x - delta, x + delta"
] | [
"private static double scoreToPvalue(double score, int n) {\n double variance=2.0*(2.0*n+5.0)/(9.0*n*(n-1.0));\n\n double Z=score/Math.sqrt(variance); //follows approximately Normal with 0 mean and variance as calculated above\n\n return ContinuousDistributions.gaussCdf(Z);\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Signal Processing:"
} |
// Stats retrieves the current connection and message statistics for a Consumer | [
"func (r *Consumer) Stats() *ConsumerStats {\n\treturn &ConsumerStats{\n\t\tMessagesReceived: atomic.LoadUint64(&r.messagesReceived),\n\t\tMessagesFinished: atomic.LoadUint64(&r.messagesFinished),\n\t\tMessagesRequeued: atomic.LoadUint64(&r.messagesRequeued),\n\t\tConnections: len(r.conns()),\n\t}\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about computer science:",
"pos": "Represent the Github code about computer science:",
"neg": "Represent the Github code:"
} |
Prints out the internal state of the policy. | [
"private void printLirs() {\n System.out.println(\"** LIRS stack TOP **\");\n for (Node n = headS.nextS; n != headS; n = n.nextS) {\n checkState(n.isInS);\n if (n.status == Status.HIR_NON_RESIDENT) {\n System.out.println(\"<NR> \" + n.key);\n } else if (n.status == Status.HIR_RESIDENT) {... | [
"@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:"
} |
Update RefererACL rules of specified domain acceleration.
@param request The request containing all of the options related to the update request.
@return Result of the setDomainRefererACL operation returned by the service. | [
"public SetDomainRefererACLResponse setDomainRefererACL(SetDomainRefererACLRequest request) {\n checkNotNull(request, \"The parameter request should NOT be null.\");\n InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), \"config\");\n intern... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Replace all lines matching `old_line` with `new_line`.
If ``once`` is set to True, remove only the first instance.
Returns:
int: the number of updates performed | [
"def update_line(self, section, old_line, new_line, once=False):\n \n try:\n s = self._get_section(section, create=False)\n except KeyError:\n return 0\n return s.update(old_line, new_line, once=once)"
] | [
"def get_quoted_strings(quoted_string):\n '''\n \n '''\n try:\n # This regex grabs all quoted data from string.\n # Note that this gets everything in between the first and last double quote.\n # This is intentional, as printed (and quoted) strings from a target file may contain\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Uploads an audio item for temporary storage on the WeChat servers.
@param Audio $audio
@return Uploaded\Audio | [
"public function storeTemporaryAudio (Audio $audio)\n {\n $json = $this->storeGenericMedia(MediaType::AUDIO, false, $audio);\n\n return (new Uploaded\\Audio($json->media_id))\n ->withExpiresDate($this->createExpiryDate($json->created_at));\n }"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IMachinesetAllowTracingToAccessVM(request *IMachinesetAllowTracingToAccessVM) (*IMachinesetAllowTracingToAccessVMResponse, error) {\n\tresponse := new(IMachinesetAllowTracingToAccessVMResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, e... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Parses <Children>
@param node: Node containing the <Children> element
@type node: xml.etree.Element | [
"def parse_children(self, node):\n \n\n if 'name' in node.lattrib:\n name = node.lattrib['name']\n else:\n self.raise_error('<Children> must specify a name.')\n\n if 'type' in node.lattrib:\n type_ = node.lattrib['type']\n else:\n self.r... | [
"def _MakeGroupFromRootSection(root_section, undefined_str):\n \n group = {}\n for statement in root_section.Statements():\n if isinstance(statement, six.string_types):\n continue\n func, args = statement\n # here the function acts as ID for the block type\n if func i... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
return the schema instance if this is reference to another table | [
"def schema(self):\n \"\"\"\"\"\"\n if not hasattr(self, \"_schema\"):\n ret = None\n o = self._type\n if isinstance(o, type):\n ret = getattr(o, \"schema\", None)\n\n elif isinstance(o, Schema):\n ret = o\n\n else:\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Calculate the horizontal move motion direction.
@param delta moved delta.
@param threshold threshold to detect the motion.
@return the motion direction for the horizontal axis. | [
"public static MotionDirection getHorizontalMotionDirection(float delta, float threshold) {\n if (threshold < 0) {\n throw new IllegalArgumentException(\"threshold should be positive or zero.\");\n }\n return delta < -threshold ? MotionDirection.LEFT : delta > threshold ? MotionDirec... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// FilteredBy filters by the given predicate. Empty APIResourceLists are dropped. | [
"func FilteredBy(pred ResourcePredicate, rls []*metav1.APIResourceList) []*metav1.APIResourceList {\n\tresult := []*metav1.APIResourceList{}\n\tfor _, rl := range rls {\n\t\tfiltered := *rl\n\t\tfiltered.APIResources = nil\n\t\tfor i := range rl.APIResources {\n\t\t\tif pred.Match(rl.GroupVersion, &rl.APIResources[... | [
"@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 text about org.archive.wayback.resourceindex:",
"pos": "Represent the code about org.archive.wayback.resourceindex:",
"neg": "Represent the code:"
} |
// ConnectBlock is invoked by the index manager when a new block has been
// connected to the main chain. This indexer adds a mapping for each address
// the transactions in the block involve.
//
// This is part of the Indexer interface. | [
"func (idx *AddrIndex) ConnectBlock(dbTx database.Tx, block *btcutil.Block,\n\tstxos []blockchain.SpentTxOut) error {\n\n\t// The offset and length of the transactions within the serialized\n\t// block.\n\ttxLocs, err := block.TxLoc()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get the internal block ID associa... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Marshall the given parameter object. | [
"public void marshall(DeleteActivityRequest deleteActivityRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteActivityRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(de... | [
"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:"
} |
Auto Generated Code | [
"def port_profile_global_port_profile_name(self, **kwargs):\n \n config = ET.Element(\"config\")\n port_profile_global = ET.SubElement(config, \"port-profile-global\", xmlns=\"urn:brocade.com:mgmt:brocade-port-profile\")\n port_profile = ET.SubElement(port_profile_global, \"port-profile\... | [
"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 summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about File management:"
} |
// 3rd party tools, such as istio auto-inject, may add sidecar containers to
// the build pod. We are interested in logs from the build container only | [
"func selectBuilderContainer(containers []corev1.Container) string {\n\tfor _, c := range containers {\n\t\tfor _, bcName := range buildstrategy.BuildContainerNames {\n\t\t\tif c.Name == bcName {\n\t\t\t\treturn bcName\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Public: Actually performs the request against the URL.
Returns response body if the request was successful.
Otherwise raises a HttpCheck::ConnectionFailed error. | [
"def perform_request\n Timeout.timeout(request_timeout) do\n options = { read_timeout: request_timeout }\n\n if basic_auth_options.any?\n options[:http_basic_authentication] = basic_auth_options\n end\n\n url.read(options)\n end\n rescue => e\n raise Connection... | [
"async def get_object_proxy_location(self, client, pid):\n \n try:\n return (await client.describe(pid)).get(\"DataONE-Proxy\")\n except d1_common.types.exceptions.DataONEException:\n # Workaround for older GMNs that return 500 instead of 404 for describe()\n pa... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Computer Science:"
} |
// Convert_kops_KubeProxyConfig_To_v1alpha2_KubeProxyConfig is an autogenerated conversion function. | [
"func Convert_kops_KubeProxyConfig_To_v1alpha2_KubeProxyConfig(in *kops.KubeProxyConfig, out *KubeProxyConfig, s conversion.Scope) error {\n\treturn autoConvert_kops_KubeProxyConfig_To_v1alpha2_KubeProxyConfig(in, out, s)\n}"
] | [
"func init() {\n\t// Milo is only responsible for validating the config matching the instance's\n\t// appID in a project config.\n\tvalidation.Rules.Add(\"regex:projects/.*\", \"${appid}.cfg\", validateProjectCfg)\n\tvalidation.Rules.Add(\"services/${appid}\", globalConfigFilename, validateServiceCfg)\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// ResignOwner lets the owner start a new election. | [
"func (m *ownerManager) ResignOwner(ctx context.Context) error {\n\telec := (*concurrency.Election)(atomic.LoadPointer(&m.elec))\n\tif elec == nil {\n\t\treturn errors.Errorf(\"This node is not a ddl owner, can't be resigned.\")\n\t}\n\n\tchildCtx, cancel := context.WithTimeout(ctx, keyOpDefaultTimeout)\n\terr := e... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Handles the 'a' command.
:args: Arguments supplied to the 'a' command. | [
"def add(self, **args):\n \n kwargs = self.getKwargs(args)\n if kwargs:\n self.model.add(**kwargs)"
] | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Declares an association between this object and a ChildStructureNode object.
@param ChildStructureNode $v
@return $this|\gossi\trixionary\model\FunctionPhase The current object (for fluent API support)
@throws PropelException | [
"public function setStructureNode(ChildStructureNode $v = null)\n {\n if ($v === null) {\n $this->setId(NULL);\n } else {\n $this->setId($v->getId());\n }\n\n $this->aStructureNode = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n ... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Stop shuts down the port server | [
"func (h *PublicPortHandler) Stop() {\n\tselect {\n\tcase <-h.cancel:\n\tdefault:\n\t\tclose(h.cancel)\n\t}\n\th.wg.Wait()\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence about Container management:",
"pos": "Represent the Github code about Container management:",
"neg": "Represent the Github code about programming:"
} |
// Collect satisfies the Collector interface. | [
"func (p *ProcMetrics) Collect() {\n\tif m, err := CollectProcInfo(p.pid); err == nil {\n\t\tnow := time.Now()\n\n\t\tif !p.lastTime.IsZero() {\n\t\t\tratio := 1.0\n\t\t\tswitch {\n\t\t\tcase m.CPU.Period > 0 && m.CPU.Quota > 0:\n\t\t\t\tratio = float64(m.CPU.Quota) / float64(m.CPU.Period)\n\t\t\tcase m.CPU.Shares ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Helper function to dump out debug info. | [
"def _log_request(request):\n \"\"\"\"\"\"\n logger.debug(\"Inbound email received\")\n\n for k, v in list(request.POST.items()):\n logger.debug(\"- POST['%s']='%s'\" % (k, v))\n\n for n, f in list(request.FILES.items()):\n logger.debug(\"- FILES['%s']: '%s', %sB\", n, f.content_type, f.si... | [
"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:"
} |
@param string $className
@return SidebarViewLink | [
"public function setClassName(string $className): SidebarViewLink\n {\n $this->className = $className;\n $this->setHighlightClass($this->className);\n //如果存在日志\n $this->setHighlightClass($this->className . 'log');\n //如果存在添加\n $this->setHighlightClass($this->className . ... | [
"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 text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Change current window to another opened window. | [
"@When(\"^I change active window$\")\n public void seleniumChangeWindow() {\n String originalWindowHandle = commonspec.getDriver().getWindowHandle();\n Set<String> windowHandles = commonspec.getDriver().getWindowHandles();\n\n for (String window : windowHandles) {\n if (!window.eq... | [
"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:"
} |
Actions for an inactive user.
@return bool|void | [
"protected function checkInactive()\n {\n if ($this->user->status_id !== Status::INACTIVE) {\n return true;\n }\n\n return $this->addAction('Activate', 'check-square-o', $this->makeRoute('activate', 0));\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code:"
} |
Look for Python sources available for the current configuration. | [
"def find_sources(self):\n \n app_configs = apps.get_app_configs()\n for app_config in app_configs:\n ignore_dirs = []\n for root, dirs, files in os.walk(app_config.path):\n if [True for idir in ignore_dirs if root.startswith(idir)]:\n con... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
获取到当前登录用户凭证,如果不存在,返回一个匿名凭证
@param securityContext
当前安全上下文
@return 当前登录用户凭证,如果不存在,返回一个匿名凭证 | [
"private Authentication getAuthentication(SecurityContext securityContext) {\r\n\t\t// 用户未登录\r\n\t\tAuthentication authentication = securityContext.getAuthentication();\r\n\t\tif (authentication == null) {\r\n\t\t\tauthentication = new AnonymousAuthenticationToken(UUID.randomUUID().toString(), \"anonymous\",\r\n\t\... | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
------------------------------------------< navigation service >--- | [
"@Override\n public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,\n Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,\n Boolean includePathSegment, BigInteger maxItems, BigInteger skipCou... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Close underlying connector.
Release all acquired resources. | [
"async def close(self) -> None:\n \n if not self.closed:\n if self._connector is not None and self._connector_owner:\n await self._connector.close()\n self._connector = None"
] | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github description about Computer Networking:",
"pos": "Represent the Github code about Computer Networking:",
"neg": "Represent the Github code:"
} |
Loads an application descriptor.
@param f a file
@return an application descriptor (not null)
@throws IOException if the file could not be read | [
"public static ApplicationDescriptor load( File f ) throws IOException {\n\n\t\tProperties properties = Utils.readPropertiesFile( f );\n\t\treturn load( properties );\n\t}"
] | [
"def __resolveport(self, definitions):\n \n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % (self.type,))\n # Later on we will require access to t... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Get the text corresponding to this page | [
"def _get_text(self):\n \n boxes = self.boxes\n txt = []\n for line in boxes:\n txt_line = u\"\"\n for box in line.word_boxes:\n txt_line += u\" \" + box.content\n txt.append(txt_line)\n return txt"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
/*
(non-Javadoc)
@see org.restcomm.protocols.ss7.tcap.asn.Encodable#decode(org.mobicents.protocols .asn.AsnInputStream) | [
"public void decode(AsnInputStream ais) throws ParseException {\n\n try {\n\n BitSetStrictLength readV = ais.readBitString();\n if (readV.getStrictLength() >= 1 && readV.get(0)) {\n // ok\n } else {\n this.supportedVersion = false;\n }... | [
"@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ... | codesearchnet | {
"query": "Represent the Github instruction about Java programming:",
"pos": "Represent the Github code about Java programming:",
"neg": "Represent the Github code:"
} |
Blockmix; Used by SMix. | [
"def blockmix_salsa8(BY, Yi, r):\n ''''''\n\n start = (2 * r - 1) * 16\n X = BY[start:start + 16] # BlockMix - 1\n\n for i in xrange(0, 2 * r): # BlockMix - 2\n\n for xi in xrange(0, 16): # Bl... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetS3KeyPrefix sets the S3KeyPrefix field's value. | [
"func (s *DeliveryChannel) SetS3KeyPrefix(v string) *DeliveryChannel {\n\ts.S3KeyPrefix = &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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
packItem implementation for QTI
@inheritdoc
@see {@link ItemPacker}
@throws InvalidArgumentException
@throws common_Exception | [
"public function packItem(core_kernel_classes_Resource $item, $lang, Directory $directory)\n {\n //use the QtiParser to transform the QTI XML into an assoc array representation\n $content = $this->getXmlByItem($item, $lang);\n //load content\n $qtiParser = new QtiParser($content);\n ... | [
"public void buildSignature(XMLNode node, Content constructorDocTree) {\n constructorDocTree.addContent(\n writer.getSignature(\n (ConstructorDoc) constructors.get(currentConstructorIndex)));\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// createSystemError creates the specified error with the correct number of
// stack frames skipped. This is only to be called by the other functions for
// formatting the error. | [
"func createSystemError(err error, cause string) Error {\n\tgerr := &genericError{\n\t\tTimestamp: time.Now(),\n\t\tErr: err,\n\t\tECode: SystemError,\n\t\tCause: cause,\n\t\tStack: stacktrace.Capture(2),\n\t}\n\tif err != nil {\n\t\tgerr.Message = err.Error()\n\t}\n\treturn gerr\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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
attrib
: '[' S* [ namespace_selector ]? IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S*
[ IDENT | STRING ] S* ]? ']'
; | [
"def _parseSelectorAttribute(self, src, selector):\n \n ctxsrc = src\n if not src.startswith('['):\n raise self.ParseError('Selector Attribute opening \\'[\\' not found', src, ctxsrc)\n src = src[1:].lstrip()\n\n nsPrefix, src = self._getMatchResult(self.re_namespace_se... | [
"def get_hgvs_language() -> ParserElement:\n \"\"\"\"\"\"\n hgvs = (variant_characters | quote)(IDENTIFIER)\n language = variant_tags + nest(hgvs)\n return language"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Filter registered events and yield all of their callbacks. | [
"def filter_callbacks(cls, client, event_data):\n \"\"\"\"\"\"\n\n for event in cls.filter_events(client, event_data):\n for cb in event.callbacks:\n yield cb"
] | [
"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 about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Prepare response of get_listing; namely
- defining setting elements,
- filling in the parent path of the currently-viewed directory.
@param string $path Relative path
@return array ret array for use as get_listing's $ret | [
"private function get_listing_prepare_response($path) {\n $ret = [\n // Fetch the list dynamically. An AJAX request is sent to the server as soon as the user opens a folder.\n 'dynload' => true,\n 'nosearch' => true, // Disable search.\n 'nologin' => false, // Prov... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic boolean eIsSet(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.BPS__PSEG_NAME:\n\t\t\t\treturn PSEG_NAME_EDEFAULT == null ? psegName != null : !PSEG_NAME_EDEFAULT.equals(psegName);\n\t\t\tcase AfplibPackage.BPS__TRIPLETS:\n\t\t\t\treturn triplets != null && !triplets.isEmpt... | [
"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 description about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Register the default senders.
@return void | [
"public function registerSenders()\n {\n app('notifynder')->extend('sendSingle', function (array $notifications) {\n return new SingleSender($notifications);\n });\n\n app('notifynder')->extend('sendMultiple', function (array $notifications) {\n return new MultipleSende... | [
"@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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Returns the package items with the given description
Currently this is returning the low-level hash representation directly from the Network API | [
"def items_with_description(expected_description)\n filter = ObjectFilter.new { |filter| filter.accept(\"items.description\").when_it is(expected_description) }\n items_data = self.service.object_filter(filter).getItems()\n\n items_data.collect do |item_data|\n first_price = item_data['prices'... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
token inside an eval expression | [
"protected Token nextEval() throws ScanException {\n\t\tchar c1 = input.charAt(position);\n\t\tchar c2 = position < input.length()-1 ? input.charAt(position+1) : (char)0;\n\n\t\tswitch (c1) {\n\t\t\tcase '*': return fixed(Symbol.MUL);\n\t\t\tcase '/': return fixed(Symbol.DIV);\n\t\t\tcase '%': return fixed(Symbol.M... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Converts an element value to its "dynamic proxy return form".
Returns an exception proxy on some errors, but may return null if
a useful exception cannot or should not be generated at this point. | [
"private Object generateValue(MethodSymbol meth, Attribute attr) {\n ValueVisitor vv = new ValueVisitor(meth);\n return vv.getValue(attr);\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Remove a key for an entry in a hashmap (for instance the email field for a user) | [
"func (h *HashMap) DelKey(owner, key string) error {\n\t// Remove a key from the hashmap\n\t_, err := h.host.db.Exec(\"DELETE FROM \"+h.table+\" WHERE \"+ownerCol+\" = ? AND \"+keyCol+\" = ?\", owner, key)\n\treturn err\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
{@inheritDoc}
Resolve given {@link Viewable viewable} using {@link MediaType media type}, {@code resolving class} and
{@link TemplateProcessor template processor}. | [
"public ResolvedViewable resolveViewable(final Viewable viewable, final MediaType mediaType,\n final Class<?> resourceClass, final TemplateProcessor templateProcessor) {\n if (viewable.isTemplateNameAbsolute()) {\n return resolveAbsoluteViewable(viewable,... | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// This is O(N), but we expect haystack to be small;
// so small that we expect a linear search to be faster | [
"func containsNumber(haystack []int, needle int) bool {\n\tfor _, v := range haystack {\n\t\tif v == needle {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}"
] | [
"func NewOnDemandStorer(s storage.Storer) (*OnDemandStorer, error) {\n\t// Track a small number of recent in-memory objects, to improve\n\t// performance without impacting memory too much.\n\t//\n\t// LRU is very helpful here because of the way delta compression\n\t// works. It first sorts the objects by type and d... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Count the number of objects in a collection with the given values.
@param string $collection
@param string $column
@param array $values
@param array $extra
@return int | [
"public function getMultiCount($collection, $column, array $values, array $extra = array())\n\t{\n\t\t$queryParts = ['SELECT COUNT(*) FROM', $collection, 'WHERE', \"$column IN (?)\"];\n\n\t\tforeach ($extra as $key => $extraValue) {\n\t\t\t$queryParts[] = \"AND $key = ?\";\n\t\t}\n\n\t\t$query = $this->createQueryF... | [
"public function int($data, $default = 0, $options = [])\n {\n\n //check custom filters and flags in options array;\n list($filter, $flags, $parameters) = $this->readFiltersAndFlags(\n $options,\n static::FILTER_INTERGER\n );\n //push custom filters and flags fro... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Does x = x + stepSize * line
@param step step size. | [
"@Override\n public void step(INDArray parameters, INDArray searchDirection, double step) {\n Nd4j.getBlasWrapper().level1().axpy(searchDirection.length(), step, searchDirection, parameters);\n }"
] | [
"def getPostStates(self):\n '''\n \n '''\n self.aNrmNow = self.mNrmNow - self.cNrmNow\n self.aLvlNow = self.aNrmNow*self.pLvlNow # Useful in some cases to precalculate asset level\n return None"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Main thread: - Send messages to workers, and optionally receive an async response as a promise - Receive messages from workers, and optionally send an async response back as a promise | [
"function setupMainThread () {\n\n // Send a message to a worker, and optionally get an async response\n // Arguments:\n // - worker: one or more web worker instances to send the message to (single value or array)\n // - method: the method with this name, specified with dot-notation, will be invoked... | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
get request full url, include params
@param request current request
@return request full url, include params | [
"public static String getFullRequestUrl(HttpServletRequest request) {\n StringBuilder buff = new StringBuilder(\n request.getRequestURL().toString());\n String queryString = request.getQueryString();\n if (queryString != null) {\n buff.append(\"?\").append(queryString)... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// loadVolumeData loads volume info from specified json file/location | [
"func loadVolumeData(dir string, fileName string) (map[string]string, error) {\n\t// remove /mount at the end\n\tdataFileName := filepath.Join(dir, fileName)\n\tklog.V(4).Info(log(\"loading volume data file [%s]\", dataFileName))\n\n\tfile, err := os.Open(dataFileName)\n\tif err != nil {\n\t\tklog.Error(log(\"faile... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github post about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
Register aliases.
@return void | [
"protected function registerAliases() : void\n {\n $aliases = [\n 'bitcoind' => 'Denpa\\Bitcoin\\ClientFactory',\n 'bitcoind.client' => 'Denpa\\Bitcoin\\LaravelClient',\n ];\n\n foreach ($aliases as $key => $aliases) {\n foreach ((array) $aliases as ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about Data management:",
"pos": "Represent the Github code about Data management:",
"neg": "Represent the Github code:"
} |
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMaxVcpus | [
"func (d *Domain) GetMaxVcpus() (uint, error) {\n\tvar err C.virError\n\tret := C.virDomainGetMaxVcpusWrapper(d.ptr, &err)\n\tif ret == -1 {\n\t\treturn 0, makeError(&err)\n\t}\n\n\treturn uint(ret), nil\n}"
] | [
"func (g *Generator) SetVMHypervisorParameters(parameters []string) {\n\tg.initConfigVMHypervisor()\n\tg.Config.VM.Hypervisor.Parameters = parameters\n}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Eliminates one bond of this atom from the molecule
@param atom The atom one bond is eliminated of
@param molecule The molecule that contains the atom | [
"private void breakBond(IAtom atom, IAtomContainer molecule) {\n Iterator<IBond> bonds = molecule.bonds().iterator();\n while (bonds.hasNext()) {\n IBond bond = (IBond) bonds.next();\n if (bond.contains(atom)) {\n molecule.removeElectronContainer(bond);\n ... | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets the asset id for the object instance
@return int
@since 2.0.0 | [
"public function getId()\n\t{\n\t\t// Check for current asset id and compute other vars\n\t\t$current = $this->model->get('asset_id', null);\n\t\t$parentId = $this->getAssetParentId();\n\t\t$name = $this->getAssetName();\n\t\t$title = $this->getAssetTitle();\n\t\t$title = $title ?: $name;\n\n\t\t// Get m... | [
"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 Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Determine the current usage for each limit of this service,
and update corresponding Limit via
:py:meth:`~.AwsLimit._add_current_usage`. | [
"def find_usage(self):\n \n ignore_statuses = [\n 'DELETE_COMPLETE'\n ]\n logger.debug(\"Checking usage for service %s\", self.service_name)\n self.connect()\n for lim in self.limits.values():\n lim._reset_usage()\n count = 0\n paginator ... | [
"def SaveResourceUsage(self, client_id, status):\n \"\"\"\"\"\"\n # Per client stats.\n self.hunt_obj.ProcessClientResourcesStats(client_id, status)\n # Overall hunt resource usage.\n self.UpdateProtoResources(status)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
scores when the number of alleles is different than 2 and when the genotypes are unphased. | [
"@Override\n public double similarity(VariantCall call1, VariantCall call2) {\n int minNumberOfGenotypes = Math.min(call1.getGenotypeCount(), call2.getGenotypeCount());\n int numberOfSharedAlleles = 0;\n for (int i = 0; i < minNumberOfGenotypes; ++i) {\n if (call1.getGenotype(i) == call2.getGenotype(... | [
"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:"
} |
Gets the date fields string from a given fields array.
@param string $stub
@param array $fields
@return string | [
"protected function getDateFields($stub, array $fields)\n {\n $dates = [];\n $indentCount = $this->getIndent($stub, $this->getTemplateVariable('dates'));\n $indent = $this->Indent($indentCount - $this->backspaceCount);\n foreach ($fields as $field) {\n if ($field->isDate) {... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Builds a prediction of the expected value of y for a given x, based on a linear regression model.
@return \stdClass
@throws \InvalidArgumentException | [
"public function build() {\n // Check the number of observations in a given dataset\n if ($this->count < 3) {\n throw new \\InvalidArgumentException('The dataset should contain a minimum of 3 observations.');\n }\n \n $b = $this->round_($this->bSlope());\n $a = $... | [
"def fit(self, data):\n \n jmodel = callMLlibFunc(\"fitPCA\", self.k, data)\n return PCAModel(jmodel)"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetMovSettings sets the MovSettings field's value. | [
"func (s *ContainerSettings) SetMovSettings(v *MovSettings) *ContainerSettings {\n\ts.MovSettings = v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// ApplyStreamInbound applies the given StreamInbound middleware to
// the given StreamHandler. | [
"func ApplyStreamInbound(h transport.StreamHandler, i StreamInbound) transport.StreamHandler {\n\tif i == nil {\n\t\treturn h\n\t}\n\treturn streamHandlerWithMiddleware{h: h, i: i}\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 about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Add fields to the edit view.
@param $modelData
@return $this | [
"private function addFields($modelData)\n {\n $fields = '';\n $firstIteration = true;\n\n foreach ($modelData->fields as $field)\n {\n if ($firstIteration)\n {\n $fields .= self::getInputFor($field) . PHP_EOL;\n $firstIteration = fal... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Custom equality operator that smooths out differences between different Soy runtimes.
<p>This approximates Javascript's behavior, but is much easier to understand. | [
"public static boolean equal(SoyValue operand0, SoyValue operand1) {\n // Treat the case where either is a string specially.\n // TODO(gboyer): This should probably handle SanitizedContent == SanitizedContent, even though\n // Javascript doesn't handle that case properly. http://b/21461181\n if (operand... | [
"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:"
} |
@param string $type
@return mixed | [
"private function executeStatement($type = 'execute')\n {\n $options = [\n 'consistency' => \\Cassandra::CONSISTENCY_LOCAL_QUORUM,\n ];\n\n if ($this->getConsistency()) {\n $options['consistency'] = $this->getConsistency();\n }\n\n if ($this->getRetryPolic... | [
"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 sentence about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
Takes a list of lines to be committed to a user's incrontab and writes it | [
"def _write_incron_lines(user, lines):\n '''\n \n '''\n if user == 'system':\n ret = {}\n ret['retcode'] = _write_file(_INCRON_SYSTEM_TAB, 'salt', ''.join(lines))\n return ret\n else:\n path = salt.utils.files.mkstemp()\n with salt.utils.files.fopen(path, 'wb') as f... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
onMigrationAfter.
@param MigrationEvent $event | [
"public function onMigrationAfter(MigrationEvent $event)\n {\n if ($this->progress) {\n $runProgress = $event->getProgress();\n $this->progress->setProgress($runProgress->getCurrent());\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// SetType sets the Type field's value. | [
"func (s *FailureDetails) SetType(v string) *FailureDetails {\n\ts.Type = &v\n\treturn s\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
{@code placeId} is a unique identifier for a place.
@return the placeId | [
"@Transient\n public String getPlaceId() {\n final Feature location = getLocation();\n if (location == null) {\n return null;\n }\n return location.getProperty(\"placeId\");\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 Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Simple output mode | [
"def outputSimple(self):\n \n\n out = []\n errors = []\n\n successfulResponses = \\\n len([True for rsp in self.results if rsp['success']])\n\n out.append(\"INFO QUERIED {0}\".format(\n len(self.serverList)))\n out.append(\"INFO SUCCESS {0}\".format(\n... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetLocalConsolePassword sets the LocalConsolePassword field's value. | [
"func (s *SetLocalConsolePasswordInput) SetLocalConsolePassword(v string) *SetLocalConsolePasswordInput {\n\ts.LocalConsolePassword = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param string $src
@return array | [
"private function prepareHeaderData(string $src): array\n {\n $header_sep_position = strpos($src, \"\\r\\n\");\n\n $tmp = explode('/', $this->parsed_url['path'] ?? '');\n $path_lst_fragment = end($tmp);\n\n $res = [\n 'status_raw' => substr($src, 0, $header_sep_position),... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Builds the return code.
@param methodBuilder
the method builder
@param updateMode
the update mode
@param method
the method
@param returnType
the return type | [
"public void buildReturnCode(MethodSpec.Builder methodBuilder, boolean updateMode, SQLiteModelMethod method, TypeName returnType) {\n\t\tif (returnType == TypeName.VOID) {\n\n\t\t} else if (isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {\n\t\t\tmethodBuilder.addJavadoc(\"\\n\");\n\t\t\tif (updateMode)\... | [
"@Override\n public void visitEnum(String targetMethodName,\n String enumerationTypeDescription,\n String enumerationLiteral) {\n\n if (tc.isDebugEnabled()) {\n Tr.debug(tc, MessageFormat.format(\"visitEnum [ {0} ] Name [ {1} ] Description [ {2}... | codesearchnet | {
"query": "Represent the post about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
Returns true or false if the given version would be satisfied by
the version constraint.
@param [Semverse::Version, #to_s] target
@return [Boolean] | [
"def satisfies?(target)\n target = Semverse::Version.coerce(target)\n\n return false if !(version == 0) && greedy_match?(target)\n\n compare(target)\n end"
] | [
"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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sets the media url of the service item.
@param string $value Location of the media/picture | [
"public function setMediaUrl( $value )\n\t{\n\t\tif ( $value == $this->getMediaUrl() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->_values['mediaurl'] = (string) $value;\n\t\t$this->setModified();\n\t}"
] | [
"def set_note_attribute(data):\n \n na = False\n if data.get('link'):\n na = Types.NoteAttributes()\n # add the url\n na.sourceURL = data.get('link')\n # add the object to the note\n return na"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// SetMaxResults sets the MaxResults field's value. | [
"func (s *ListDevicesInput) SetMaxResults(v int64) *ListDevicesInput {\n\ts.MaxResults = &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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
bind to a map
If a map with given name already exists it will return exactly this map
to add more key-value pairs to it.
@param string $name
@return \stubbles\ioc\binding\MapBinding
@since 2.0.0 | [
"public function bindMap(string $name): MapBinding\n {\n if (!isset($this->mapBindings[$name])) {\n $this->mapBindings[$name] = $this->addBinding(new MapBinding($name));\n }\n\n return $this->mapBindings[$name];\n }"
] | [
"protected function setInstance(string $name, $object):bool\n {\n if (!isset(self::$instances[$name])) {\n self::$instances[$name] = $object;\n return (true);\n }\n throw new Server500(new \\ArrayObject(array(\"explain\" => \"Cannot redeclare instance name $name as new ... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Calculate the node priority from its job count, stick to the current node
As the priority is based on the number of jobs, higher is better.
@param Node $node
@param string $currentNodeId
@return float Node priority | [
"private function calculateNodePriority(Node $node, $currentNodeId)\n {\n $priority = $node->getJobCount();\n\n if ($node->getId() === $currentNodeId) {\n $margin = 1 + $this->marginToSwitch;\n $priority = $priority * $margin;\n }\n\n // Apply a weight determined... | [
"private void makeJobRunning(JobInProgress job, JobSchedulingInfo oldInfo, \n QueueInfo qi) {\n // Removing of the job from job list is responsibility of the\n //initialization poller.\n // Add the job to the running queue\n qi.addRunningJob(job);\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Fetch and read an intersphinx inventory file at a specified uri,
which can either be a url (e.g. http://...) or a local file system
filename. | [
"def fetch_intersphinx_inventory(uri):\n \n\n # See https://stackoverflow.com/a/30981554\n class MockConfig(object):\n intersphinx_timeout = None\n tls_verify = False\n\n class MockApp(object):\n srcdir = ''\n config = MockConfig()\n\n def warn(self, msg):\n ... | [
"def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. o... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the TvInputProvider that was defined by the project's manifest | [
"public static TvInputProvider getTvInputProvider(Context mContext, final TvInputProviderCallback callback) {\n ApplicationInfo app = null;\n try {\n Log.d(TAG, mContext.getPackageName()+\" >\");\n app = mContext.getPackageManager().getApplicationInfo(mContext.getPackageName(), P... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Logistic returns a random number of logistic distribution | [
"func (lrng LogisticGenerator) Logistic(mu, s float64) float64 {\n\tif !(s > 0.0) {\n\t\tpanic(fmt.Sprintf(\"Invalid parameter s: %.2f\", s))\n\t}\n\treturn lrng.logistic(mu, s)\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Returns the iterator to be used as the inner iterator
@return \Iterator | [
"public function getIterator()\n {\n if (is_null($this->iterator)) {\n $finder = $this->finderFactory->createFinder();\n $finder->files()->in($this->path);\n\n if (false === empty($this->extensions)) {\n $finder->name($this->getExtensionsRegex());\n ... | [
"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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Creates a Key for a type and an ID value
@param type the Class of the entity
@param id the ID value
@param <T> the type of the entity
@return the Key | [
"public <T> Key<T> manualRefToKey(final Class<T> type, final Object id) {\n return id == null ? null : new Key<T>(type, getCollectionName(type), id);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
export will export an image, sudo must be used.
Parameters
==========
image_path: full path to image
tmptar: if defined, use custom temporary path for tar export | [
"def export(self, image_path, tmptar=None):\n '''\n\n '''\n from spython.utils import check_install\n check_install()\n\n if tmptar is None:\n tmptar = \"/%s/tmptar.tar\" %(tempfile.mkdtemp())\n cmd = ['singularity', 'image.export', '-f', tmptar, image_path]\n\n output = self.run_command... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// NewFacade provides the signature required for facade registration. | [
"func NewFacade(ctx facade.Context) (*API, error) {\n\tbackend, err := NewStateBackend(ctx.State())\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"getting state\")\n\t}\n\tblockChecker := common.NewBlockChecker(ctx.State())\n\treturn NewAPI(\n\t\tbackend,\n\t\tctx.Auth(),\n\t\tblockChecker,\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Returns the selected items (WMenUItems/WSubMenus, depending on the menu type) in the given context.
@return the selected items, or an empty list if nothing is selected.
@deprecated Use {@link #getSelectedMenuItems()} instead. | [
"@Deprecated\n\tpublic List<WComponent> getSelectedItems() {\n\t\tList<WComponent> items = new ArrayList(getSelectedMenuItems());\n\t\treturn Collections.unmodifiableList(items);\n\t}"
] | [
"def getItem(self, index, altItem=None):\n \n if index.isValid():\n item = index.internalPointer()\n if item:\n return item\n\n #return altItem if altItem is not None else self.invisibleRootItem # TODO: remove\n return altItem"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Query the storage account key. This is used when the customer doesn't offer account key but name. | [
"def _query_account_key(cli_ctx, account_name):\n \"\"\"\"\"\"\n rg, scf = _query_account_rg(cli_ctx, account_name)\n t_storage_account_keys = get_sdk(\n cli_ctx, CUSTOM_MGMT_STORAGE, 'models.storage_account_keys#StorageAccountKeys')\n\n if t_storage_account_keys:\n return scf.storage_acco... | [
"func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Looks at the definition of {@link Item} and list up the related github repositories,
then puts them into the collection.
@param item the item.
@param result the collection to add repository names to
@since 1.25.0 | [
"@SuppressWarnings(\"deprecation\")\n public /*abstract*/ void parseAssociatedNames(Item item, Collection<GitHubRepositoryName> result) {\n if (Util.isOverridden(\n GitHubRepositoryNameContributor.class,\n getClass(),\n \"parseAssociatedNames\",\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 Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Executes the compilation.
@throws JasperException If an error occurs | [
"@Override\n public void execute() {\n if(log.isDebugEnabled()) {\n log.debug(\"execute() starting for \" + pages.size() + \" pages.\");\n }\n\n try {\n if (uriRoot == null) {\n if( pages.size() == 0 ) {\n throw new JasperException(\n ... | [
"public ValidationResult validateConfiguration(@Nonnull AnalysisContext analysisContext) {\n ValidationResult validation = ValidationResult.success();\n\n // even though we're not using the extensions much during validation and we actually don't run any analysis\n // at all, let's just use the ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Module returns ModuleLoader for a given ID. | [
"func Module(id string) ModuleLoader {\n\tglobalMu.RLock()\n\tdefer globalMu.RUnlock()\n\n\treturn globalModules[id]\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 text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Check the connection parameters according to verify
type of used OS
@return void | [
"protected function _determineI5()\n {\n // first us the compiled flag.\n $this->_isI5 = (php_uname('s') == 'OS400') ? true : false;\n\n // if this is set, then us it\n if (isset($this->_config['os'])){\n if (strtolower($this->_config['os']) === 'i5') {\n $th... | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
// SetDesiredStatus sets the DesiredStatus field's value. | [
"func (s *ListTasksInput) SetDesiredStatus(v string) *ListTasksInput {\n\ts.DesiredStatus = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Browse for a particle image and set the value into both the emitter and text field
on successful completion | [
"private void browseForImage() {\r\n\t\tif (emitter != null) {\r\n\t\t\tint resp = chooser.showOpenDialog(this);\r\n\t\t\tif (resp == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\tString path = file.getParentFile().getAbsolutePath();\r\n\t\t\t\tString name = file.getNam... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// InternalValidate should be called to validate the structure
// of the provider.
//
// This should be called in a unit test for any provider to verify
// before release that a provider is properly configured for use with
// this library. | [
"func (p *Provider) InternalValidate() error {\n\tif p == nil {\n\t\treturn errors.New(\"provider is nil\")\n\t}\n\n\tvar validationErrors error\n\tsm := schemaMap(p.Schema)\n\tif err := sm.InternalValidate(sm); err != nil {\n\t\tvalidationErrors = multierror.Append(validationErrors, err)\n\t}\n\n\t// Provider-spec... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
@param string $id
@param mixed $value
@param bool $multi
@return $this
@throws FrozenException
@throws MixedMultiException | [
"public function setValue(string $id, $value, bool $multi = false): self\n {\n return $this->set($id, new Definition\\Value($value), $multi);\n }"
] | [
"public function setAttr(\\n2n\\persistence\\orm\\property\\EntityProperty $entityProperty, $name, $value) {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
A subset of postInvoke specifically for the lifecycle interceptors of a
Singleton Session bean. This method must be paired with
preInvokeForLifecycleInterceptors. | [
"public void postInvokeForLifecycleInterceptors(LifecycleInterceptorWrapper wrapper,\n int methodId,\n EJSDeployedSupport s) throws RemoteException {\n // NOTE: The implementation of this method is structured ... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
returns currently selected :class:`~alot.db.Thread` | [
"def get_selected_thread(self):\n \"\"\"\"\"\"\n threadlinewidget = self.get_selected_threadline()\n thread = None\n if threadlinewidget:\n thread = threadlinewidget.get_thread()\n return thread"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates a String by repeating the source string.
@param source the source String
@param times times the source String will be repeated
@return the resulting string | [
"public static String repeat(String source, int times) {\n dbc.precondition(source != null, \"cannot repeat a null source\");\n dbc.precondition(times > -1, \"times must be non negative\");\n final int srcLen = source.length();\n final long longLen = times * (long) srcLen;\n final... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.