query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Adds a _catch_all_ attribute to each class. Also, adds a placeholder
attribute for the construction of union members of void type. | [
"def _generate_union_class_vars(self, data_type):\n \n lineno = self.lineno\n if data_type.catch_all_field:\n self.emit(\"_catch_all = '%s'\" % data_type.catch_all_field.name)\n elif not data_type.parent_type:\n self.emit('_catch_all = None')\n\n # Generate s... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Run executes the Bee's event loop. | [
"func (mod *IrcBee) Run(eventChan chan bees.Event) {\n\tif len(mod.server) == 0 {\n\t\treturn\n\t}\n\n\t// channel signaling IRC connection status\n\tmod.connectedState = make(chan bool)\n\n\t// setup IRC client:\n\tcfg := irc.NewConfig(mod.nick, \"beehive\", \"beehive\")\n\tcfg.SSL = mod.ssl\n\tif mod.ssl {\n\t\th... | [
"@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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// isMachineTeam returns whether or not the given team represents a machine
// role (which uses the Team primitive) | [
"func isMachineTeam(team *primitive.Team) bool {\n\treturn team.TeamType == primitive.MachineTeamType || (team.TeamType == primitive.SystemTeamType && team.Name == primitive.MachineTeamName)\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
///////////////////////////////////// | [
"public void updateDocumentInfo(DocumentReference docref,\n String documentType, String ownerType, Long ownerId, Integer statusCode, String statusMessage) throws DataAccessException {\n TransactionWrapper transaction=null;\n try {\n transaction = startTransaction();\n ... | [
"func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}"
] | codesearchnet | {
"query": "Represent the text about Language and Writing:",
"pos": "Represent the code about Language and Writing:",
"neg": "Represent the code about programming:"
} |
Remove plugin
@param string $name
@return \pwf\basic\Application | [
"public function detachPlugin($name)\n {\n $this->plugins[$name]->unregister();\n unset($this->plugins[$name]);\n return $this;\n }"
] | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Get user's friends. | [
"def get_friends(self):\n \"\"\"\"\"\"\n for k, v in iter(self.user_data.language_data.items()):\n data = []\n for friend in v['points_ranking_data']:\n temp = {'username': friend['username'],\n 'id': friend['id'],\n 'p... | [
"function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Comes from https://github.com/cfergus/d3-plugins /* Cycle Related computations | [
"function markCycles() {\n for (var n = 0; n < nodes.length; n++) {\n if (!nodes[n].sourceLinks.length && !nodes[n].targetLinks.length) {\n nodes.splice(n, 1);\n n--;\n }\n }\n\n var addedLinks = [];\n links.forEach(function(link) {\n if (createsCycle(link.source, link.targe... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a map with library infos for the requested libraries
@param {Array} aLibrariesToTest list of libraries to load
@returns a map of library infos | [
"function getRequestedLibraries(aLibrariesToTest) {\n\t\tvar mLibraries = sap.ui.getCore().getLoadedLibraries(),\n\t\t\tbNewLibrary,\n\t\t\ti;\n\n\t\t// make sure the explicitly requested libraries are there\n\t\tfor (i = 0; i < aLibrariesToTest.length; i++) {\n\t\t\tif (!mLibraries[aLibrariesToTest[i]]) {\n\t\t\t\... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// checkForApex checks the special apex.dns directory for records that will be returned as A or AAAA. | [
"func checkForApex(ctx context.Context, b ServiceBackend, zone string, state request.Request, opt Options) ([]msg.Service, error) {\n\tif state.Name() != zone {\n\t\treturn b.Services(ctx, state, false, opt)\n\t}\n\n\t// If the zone name itself is queried we fake the query to search for a special entry\n\t// this i... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// PluginsEnabled returns true if one or more plugin features are enabled. | [
"func (c Config) PluginsEnabled() bool {\n\treturn c.Bundle != nil || c.DecisionLogs != nil || c.Status != nil || len(c.Plugins) > 0\n}"
] | [
"def ready(self):\n \"\"\"\"\"\"\n # Initialize the type extension composer.\n from . composer import composer\n composer.discover_extensions()\n\n is_migrating = sys.argv[1:2] == ['migrate']\n if is_migrating:\n # Do not register signals and ES indices when:\n ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Installs the NPM. The NPM is installed using {@code npm install npm@version}, without the {@code -g} option.
The installation is executed from the installation directory of node. | [
"private void install() {\n File directory = getNPMDirectory();\n if (directory.isDirectory()) {\n // Check the version\n String version = getVersionFromNPM(directory, log);\n // Are we looking for a specific version ?\n if (npmVersion != null) {\n ... | [
"function Cli(opts) {\n _.extend(this, {\n logger: require('./logger'),\n Interview: require('./interview'),\n service: Service,\n rimraf: require('rimraf'),\n yargs: require('yargs'), // overridable parsed arguments.\n takenFlags: [],\n commands: {\n 'install': \"ask user about environme... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
Parse a text decoration keyword | [
"private static TextDecoration parseTextDecoration(String val)\r\n {\r\n switch (val)\r\n {\r\n case NONE: return Style.TextDecoration.None;\r\n case \"underline\": return Style.TextDecoration.Underline;\r\n case \"overline\": return Style.TextDecoration.Overlin... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeCodeRepositoryRequest describeCodeRepositoryRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeCodeRepositoryRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protoc... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// NewOrgBackend is a datasource used by the org handler. | [
"func NewOrgBackend(b *APIBackend) *OrgBackend {\n\treturn &OrgBackend{\n\t\tLogger: b.Logger.With(zap.String(\"handler\", \"org\")),\n\n\t\tOrganizationService: b.OrganizationService,\n\t\tOrganizationOperationLogService: b.OrganizationOperationLogService,\n\t\tUserResourceMappingService: b.UserRe... | [
"@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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Defines the media type(s) that the methods can produce
@param MediaType producesDef - mediaType to be parsed | [
"function Produces(producesDef) {\n return function (target, propertyKey, descriptor) {\n descriptor.isJSON = producesDef === MediaType.JSON;\n return descriptor;\n };\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 post about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code about programming:"
} |
Adds 'on' eloquent method to a given properties.
@param string $properties
@param CrestApps\CodeGenerator\Models\ForeignConstraint $constraint
@return $this | [
"protected function addOnConstraint(&$properties, ForeignConstraint $constraint)\n {\n $properties .= $this->getPropertyBaseSpace(18, true) . sprintf(\"->on('%s')\", $constraint->on);\n\n return $this;\n }"
] | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
<div class="chart" data-percent="73">73%</div> | [
"def easy_as_pie percent, *args\n raise ArgumentError, \"Must take a percent argument\" unless percent\n pie_options = {:\"data-percent\" => percent, :class => 'chart'}\n \n options = args.extract_options!\n pie_options.merge!(options || {})\n\n label = args.first || \"#{percent}%\"\n\... | [
"public function run() {\n $configs = Json::encode($this->configs);\n\n \n $this->getView()->registerJs('\n var configChart = $.parseJSON(\\'' . $configs . '\\');\n console.log(configChart);\n $(function () {\n // Set up the chart\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Process a received 'Single Frame' frame | [
"def _recv_sf(self, data):\n \"\"\"\"\"\"\n self.rx_timer.cancel()\n if self.rx_state != ISOTP_IDLE:\n warning(\"RX state was reset because single frame was received\")\n self.rx_state = ISOTP_IDLE\n\n length = six.indexbytes(data, 0) & 0xf\n if len(data) - 1... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get unzipped data. Will recursively unpack data until it looks like it's no longer gzipped
@return string | [
"public function getUnpacked() {\n $tries = 0;\n $obj = $this->_original;\n\n while ($this->_dataLooksZipped($obj)) {\n $unpacked = gzdecode($obj);\n if (null === $unpacked || false === $unpacked) {\n // If anything went wrong with decoding, return result of... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Create a cropped image if needed
@return string | [
"public function maybeCropImage($data)\n {\n if (!$data['mod_image_crop']) {\n return $data['mod_image_image']['sizes'][$data['mod_image_size']];\n }\n\n $imageSrc = wp_get_attachment_image_src(\n $data['mod_image_image']['ID'],\n apply_filters('Modularity/im... | [
"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:"
} |
Get the status message for a specific code.
@param code
the code to look up
@return the specific message, or the code number itself if code
does not match known list. | [
"public static String getMessage(int code)\n {\n Code codeEnum = getCode(code);\n if (codeEnum != null)\n {\n return codeEnum.getMessage();\n }\n else\n {\n return Integer.toString(code);\n }\n }"
] | [
"def process_source(source)\n if source == \"00\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by the service user (client side).\")\n elsif source == \"02\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by ... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetEmailVerificationMessage sets the EmailVerificationMessage field's value. | [
"func (s *UserPoolType) SetEmailVerificationMessage(v string) *UserPoolType {\n\ts.EmailVerificationMessage = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// relations implements RelationsJoined and RelationsInScope. | [
"func (u *Unit) relations(predicate relationPredicate) ([]*Relation, error) {\n\tcandidates, err := applicationRelations(u.st, u.doc.Application)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar filtered []*Relation\n\tfor _, relation := range candidates {\n\t\trelationUnit, err := relation.Unit(u)\n\t\tif err !... | [
"protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {\n return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
IP Check for IPv4
@param string User IP
@return boolean true when own IP found in localconfig definitions
@access protected | [
"protected function checkIPv4($UserIP = false)\n\t{\n\t\t// Check if IP present\n\t\tif ($UserIP === false)\n\t\t{\n\t\t\treturn false; // No IP, no search.\n\t\t}\n\t\t// search for user bot IP-filter definitions in localconfig.php\n\t\tif (isset($GLOBALS['DLSTATS']['BOT_IPV4']))\n\t\t{\n\t\t\tforeach ($GLOBALS['D... | [
"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 text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
return date based on filename | [
"def decode_file_name(aFilename)\n prefix,date,ext = aFilename.scan(/(.*?)\\-(.*?)\\.(.*)/).flatten\n return Time.from_date_numeric(date)\n end"
] | [
"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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Find model type in morph mappings registry.
@param string $modelType
@return string
@throws \Cog\Contracts\Love\Reactable\Exceptions\ReactableInvalid | [
"private function findModelTypeInMorphMap(\n string $modelType\n ): string {\n $morphMap = Relation::morphMap();\n\n if (!isset($morphMap[$modelType])) {\n throw ReactableInvalid::classNotExists($modelType);\n }\n\n return $morphMap[$modelType];\n }"
] | [
"public function afterRegistry()\n {\n parent::afterRegistry();\n\n $this->_fieldsDefinition = $this->tracker->createTrackClass('Engine\\\\FieldsDefinition', $this->_trackId);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Imports the given article's statistics
@param int $oldId Old ID of the article
@param int $newId New ID of the article
@throws \Doctrine\DBAL\DBALException | [
"public function importArticleStatistic($oldId, $newId)\n {\n $article = $this->em->getRepository('VipaJournalBundle:Article')->find($newId);\n\n if (!$article) {\n $this->consoleOutput->writeln(\"Couldn't find #\" . $newId . \" on the new database.\");\n return;\n }\n\... | [
"public function toSql(\\Doctrine\\DBAL\\Schema\\SchemaDiff $schema) //Doctrine\\DBAL\\Schema\\SchemaDiff | \\Doctrine\\DBAL\\Schema\\Schema\n {\n return $schema->toSaveSql($this->getPlatform());\n //return $schema->toSql($this->getPlatform()); //it can return with DROP TABLE\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// MarshalTextString is the same as MarshalText, but returns the string directly. | [
"func MarshalTextString(pb Message) string {\n\tvar buf bytes.Buffer\n\tmarshalText(&buf, pb, false)\n\treturn buf.String()\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Parse implements Parser. | [
"func (ps *SourceTransformParser) Parse(req *http.Request, params imageserver.Params) error {\n\treturn parseSourceTransform(ps.Parser, req, params, ps.Transform)\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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about File management:"
} |
Change the name of the logger that log.* should call
Args:
**fields: Extra fields to be logged. Logger name will be:
".".join([<module_name>, <cls_name>] + fields_sorted_on_key) | [
"def set_logger(self, **fields):\n \n names = [self.__module__, self.__class__.__name__]\n for field, value in sorted(fields.items()):\n names.append(value)\n # names should be something like this for one field:\n # [\"malcolm.modules.scanning.controllers.runnablecont... | [
"def a(value):\n \n name = getattr(value, 'name', value)\n return some(lambda t: t == value).named(u'(a \"%s\")' % (name,))"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
/*
(non-Javadoc)
@see
edu.umd.cs.findbugs.classfile.IAnalysisEngine#analyze(edu.umd.cs.findbugs
.classfile.IAnalysisCache, java.lang.Object) | [
"@Override\n public ClassNameAndSuperclassInfo analyze(IAnalysisCache analysisCache, ClassDescriptor descriptor)\n throws CheckedAnalysisException {\n // Get InputStream reading from class data\n ClassData classData = analysisCache.getClassAnalysis(ClassData.class, descriptor);\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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
In the context of the /ad route, should the participant be shown
the thanks.html page instead of ad.html? | [
"def should_show_thanks_page_to(participant):\n \n if participant is None:\n return False\n status = participant.status\n marked_done = participant.end_time is not None\n ready_for_external_submission = (\n status in (\"overrecruited\", \"working\") and marked_done\n )\n assignmen... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
@param BunqEnumApiEnvironmentType $environmentType
@param string|null $apiKey
@return bool | [
"private static function shouldSandboxUserBeCreated(\n BunqEnumApiEnvironmentType $environmentType,\n string $apiKey = null\n ): bool {\n return $environmentType->equals(BunqEnumApiEnvironmentType::SANDBOX()) && is_null($apiKey);\n }"
] | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create a loopback interface. Uses parent constructor
:rtype: LoopbackClusterInterface | [
"def create(cls, address, ospf_area=None, **kwargs):\n \n return super(LoopbackClusterInterface, cls).create(\n address=address,\n network_value='{}/32'.format(address),\n interface_id='Loopback Interface',\n ospfv2_area_ref=ospf_area,\n **kwargs)... | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Try to convert upper unicode characters to plain ascii,
the returned string may contain unconverted unicode characters.
@param string $text input string
@param string $charset encoding of the text
@return string converted ascii string | [
"public static function specialtoascii($text, $charset='utf-8') {\n $charset = self::parse_charset($charset);\n $oldlevel = error_reporting(E_PARSE);\n $result = self::typo3()->specCharsToASCII($charset, (string)$text);\n error_reporting($oldlevel);\n return $result;\n }"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
// MonthWide returns the locales wide month given the 'month' provided | [
"func (nn *nn_NO) MonthWide(month time.Month) string {\n\treturn nn.monthsWide[month]\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Сливает корзины из сессии и из БД | [
"public function merge()\n {\n $sessionProducts = Yii::$app->session->get($this->owner->storageName, []);\n\n // Сливаем корзины из сессии и из БД в соответствии с выбранным методом\n switch($this->owner->mergeMethod) {\n // корзина в сессии и корзина в БД (если такая была) будут ... | [
"private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Perform a click on a link or a button, given by a locator.
@param string $buttonLinkLocator the button title
@see \Codeception\Module\WebDriver::click() | [
"public function clickButtonInDialog(string $buttonLinkLocator)\n {\n $I = $this->tester;\n $this->canSeeDialog();\n $I->click($buttonLinkLocator, self::$openedModalButtonContainerSelector);\n $I->waitForElementNotVisible(self::$openedModalSelector);\n }"
] | [
"@Then(\"^this text exists '(.+?)'$\")\n public void assertSeleniumTextInSource(String text) {\n assertThat(this.commonspec, commonspec.getDriver()).as(\"Expected text not found at page\").contains(text);\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
Parameters
----------
num_terms, int
Returns
-------
dict | [
"def get_lexicons(self, num_terms=10):\n '''\n \n '''\n return {k: v.index[:num_terms]\n for k, v in self.lexicons.items()}"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// parse list of comma separated alias/prefix=sse key values entered on command line and
// construct a map of alias to prefix and sse pairs. | [
"func parseEncryptionKeys(sseKeys string) (encMap map[string][]prefixSSEPair, err *probe.Error) {\n\tencMap = make(map[string][]prefixSSEPair)\n\tif sseKeys == \"\" {\n\t\treturn\n\t}\n\tprefix := \"\"\n\tindex := 0 // start index of prefix\n\tvs := 0 // start index of sse-c key\n\tsseKeyLen := 32\n\tdelim := 1\... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Removes autologin cookies with user generated token
@param int $id | [
"public function removeAutoLoginTokenAndCookie(int $id)\n {\n $authtok = new AuthToken($this->db);\n $authtok->setId($id);\n $authtok->deleteUserToken();\n\n setcookie($this->cookie_name, '', 1, '/');\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Delete all specs and notes for self recursively | [
"def delete_all_specs_and_notes(obj = nil)\n obj = self if obj.nil?\n obj.delete_all_specs\n obj.delete_all_notes\n obj.delete_all_exhibits\n obj.children.each do |_name, child|\n next unless child.has_specs?\n delete_all_specs_and_notes(child)\n end\n end"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Technology:"
} |
Unsubscribe a client from the channel. | [
"def unsubscribe(self, client):\n \"\"\"\"\"\"\n if client in self.clients:\n self.clients.remove(client)\n log(\"Unsubscribed client {} from channel {}\".format(client, self.name))"
] | [
"@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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetInstanceType sets the InstanceType field's value. | [
"func (s *ResourceConfig) SetInstanceType(v string) *ResourceConfig {\n\ts.InstanceType = &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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get a list of subadmin groups associated to a user.
:param user_name: name of user
:returns: list of subadmin groups
:raises: HTTPResponseError in case an HTTP error status was returned | [
"def get_user_subadmin_groups(self, user_name):\n \n\n res = self._make_ocs_request(\n 'GET',\n self.OCS_SERVICE_CLOUD,\n 'users/' + user_name + '/subadmins',\n )\n\n if res.status_code == 200:\n tree = ET.fromstring(res.content)\n s... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// GenerateRSA generates an RSA credential based on the provided parameters. | [
"func (ch *CredHub) GenerateRSA(name string, gen generate.RSA, overwrite Mode) (credentials.RSA, error) {\n\tvar cred credentials.RSA\n\terr := ch.generateCredential(name, \"rsa\", gen, overwrite, &cred)\n\treturn cred, err\n}"
] | [
"function(algo) {\n switch (algo) {\n // Algorithm-Specific Fields for RSA encrypted session keys:\n // - MPI of RSA encrypted value m**e mod n.\n case enums.publicKey.rsa_encrypt:\n case enums.publicKey.rsa_encrypt_sign:\n return [type_mpi];\n\n // Algorithm-Specific Fi... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Encryption:"
} |
Configure the pipeline for a cleartext useing Prior-Knowledge method to start http2. | [
"private void configureClearTextWithPriorKnowledge(SocketChannel ch) {\n ch.pipeline().addLast(connectionHandler,\n new PrefaceFrameWrittenEventHandler(),\n new UserEventLogger());\n configureEndOfPipeline(ch.pipeline());\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Permanently stop sending heartbeats. | [
"def stop(self):\n \"\"\"\"\"\"\n if not self.stopped:\n self.stopped = True\n if self.pendingHeartbeat is not None:\n self.pendingHeartbeat.cancel()\n self.pendingHeartbeat = None"
] | [
"def update_state\n Thread.new do\n Dictionary.commands.each do |zone, commands|\n Dictionary.commands[zone].each do |command, info|\n info[:values].each do |value, _|\n if value == 'QSTN'\n send(Parser.parse(command + \"QSTN\"))\n # If we s... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
数据是否符合检查规则,不抛出异常而是返回boolean.
@param array $values
@param array $rules
@return bool | [
"public function is(array $values, array $rules)\n {\n try {\n $this->execute($values, $rules);\n } catch (\\Exception $ex) {\n return false;\n }\n\n return true;\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Import a record into a table, id field is required.
Basic safety checks only. Lobs are supported.
@param string $table name of database table to be inserted into
@param mixed $dataobject object or array with fields in the record
@return bool success | [
"public function import_record($table, $dataobject) {\n $dataobject = (object)$dataobject;\n\n $columns = $this->get_columns($table);\n $cleaned = array();\n foreach ($dataobject as $field=>$value) {\n if (!isset($columns[$field])) {\n continue;\n }\n... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Accepts: float
Returns: float | [
"def publish(self, value):\n \n value = super(Float, self).publish(value)\n if isinstance(value, int):\n value = float(value)\n return value"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Accepts xmlQuery String and returns xml response String. No object manipulation is done in this method. | [
"def XmlRawQuery(self, xml, dumpXml=None):\n\t\t\n\n\t\tif (dumpXml == None):\n\t\t\tdumpXml = self._dumpXml\n\n\t\turi = self.Uri() + '/nuova'\n\t\tif (dumpXml in _AffirmativeList):\n\t\t\tprint '%s ====> %s' % (self._ucs, xml)\n\t\t# req = urllib2.Request(url=uri,data=xml)\n\t\t# f = urllib2.urlopen(req)\n\t\tw =... | [
"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:"
} |
Updates the file_name.
Args:
file_name: | [
"def file_name(self, file_name):\n \n if not self.can_update():\n self._tcex.handle_error(910, [self.type])\n\n self._data['fileName'] = file_name\n request = {'fileName': file_name}\n return self.tc_requests.update(self.api_type, self.api_sub_type, self.unique_id, requ... | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the Github description about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about Software development:"
} |
Returns the escaped and translated prompt text to display according to the type.
@return string | [
"protected function getPromptText()\n {\n if ($this->prompt === null) {\n $isMulti = ends_with($this->getDisplayMode(), 'multi');\n $this->prompt = $isMulti\n ? 'backend::lang.fileupload.upload_file'\n : 'backend::lang.fileupload.default_prompt';\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
shipping
options
:service => 'DOM.EP'
:notification_email
:packing_instructions
:show_postage_rate
:cod, :cod_amount, :insurance, :insurance_amount, :signature_required, :pa18, :pa19, :hfp, :dns, :lad | [
"def build_shipment_request(origin, destination, package, line_items = [], options = {})\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.public_send('non-contract-shipment', :xmlns => \"http://www.canadapost.ca/ws/ncshipment\") do\n xml.public_send('delivery-spec') do\n shipmen... | [
"def get_discount_payments(cart_id)\n\n\t\t\tdiscount_payments = Auth.configuration.payment_class.constantize.where(:cart_id => cart_id, :discount_id.nin => [\"\", nil], :payment_status => 1)\n\t\t\tdiscount_payments\n\t\tend"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
将XML内容写入文件
@param content XML内容
@param filename 需要写入的文件
@param encoding 文件编码
@throws NoSuchPathException 写入文件时, 无法发现路径引发的异常
@throws IOException 文件写入异常 | [
"public void writeToFile(StringBuffer content, String filename, String encoding) throws NoSuchPathException, IOException{\n\t\ttry {\n\t\t\tOutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(filename), encoding);\n\t\t\twriter.write(content.toString(), 0, content.length());\n\t\t\twriter.flush(... | [
"public static String getAbsolutePath(String path, Class<?> baseClass) {\r\n\t\tString normalPath;\r\n\t\tif (path == null) {\r\n\t\t\tnormalPath = StrUtil.EMPTY;\r\n\t\t} else {\r\n\t\t\tnormalPath = normalize(path);\r\n\t\t\tif (isAbsolutePath(normalPath)) {\r\n\t\t\t\t// 给定的路径已经是绝对路径了\r\n\t\t\t\treturn normalPat... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about text processing:"
} |
@param array $config Config
@param string $pathname Configuration file pathname
@return array
@throws \Darvin\AdminBundle\Metadata\Configuration\ConfigurationException | [
"private function processConfiguration(array $config, $pathname)\n {\n $processor = new Processor();\n\n try {\n return $this->parameterBag->resolveValue($processor->processConfiguration(new Configuration(), $config));\n } catch (InvalidConfigurationException $ex) {\n t... | [
"protected function _setupRouter()\n {\n //powołanie routera z konfiguracją\n return new \\Mmi\\Mvc\\Router(\\App\\Registry::$config->router ? \\App\\Registry::$config->router : new \\Mmi\\Mvc\\RouterConfig);\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Visit first index index node.
@param visitor the visitor
@return the index node | [
"public IndexNode visitFirstIndex(Consumer<? super IndexNode> visitor) {\n visitor.accept(this);\n IndexNode refresh = refresh();\n refresh.getChildren().forEach(n -> n.visitFirstIndex(visitor));\n return refresh;\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Construct the API Endpoint for the request
@return string | [
"protected function buildEndpoint()\n {\n $endpoint = $this->authorization->apiEndpoint . '/tables/' . $this->tableName . '/';\n\n // If there is a specific record ID, append that to the endpoint\n if ($this->recordID) { $endpoint .= $this->recordID; }\n\n return $endpoint;\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the description about Graph API:",
"pos": "Represent the code about Graph API:",
"neg": "Represent the code:"
} |
// Decrement adds a decrement operation to this mutation operation set. | [
"func (spec MutateInSpec) Decrement(path string, delta int64, opts *MutateInSpecCounterOptions) MutateInOp {\n\tif opts == nil {\n\t\topts = &MutateInSpecCounterOptions{}\n\t}\n\tvar flags SubdocFlag\n\tif opts.CreatePath {\n\t\tflags |= SubdocFlagCreatePath\n\t}\n\tif opts.IsXattr {\n\t\tflags |= SubdocFlagXattr\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get the EntityManager(Metadata)Provider
@return \Concrete\Core\Database\EntityManager\Provider\DefaultPackageProvider|\Concrete\Core\Package\Package | [
"public function getEntityManagerProvider()\n {\n if ($this->pkg instanceof ProviderInterface) {\n $provider = $this->pkg;\n } elseif ($this->pkg instanceof ProviderAggregateInterface) {\n $provider = $this->pkg->getEntityManagerProvider();\n } else {\n $prov... | [
"public function choices(): HasMany\n {\n return $this->hasMany(\\Iocaste\\Microservice\\Foundation\\Data\\Models\\Parameter\\Choice::class);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Checks an embedded asset embed code for URL's that are safe (or in other words, are whitelisted).
@param EmbeddedAsset $embeddedAsset
@return bool | [
"public function isEmbedSafe(EmbeddedAsset $embeddedAsset): bool\n\t{\n\t\t$isSafe = $this->checkWhitelist($embeddedAsset->url);\n\n\t\tif ($isSafe)\n\t\t{\n\t\t\t$dom = $this->getEmbedCode($embeddedAsset);\n\n\t\t\tif ($dom)\n\t\t\t{\n\t\t\t\tforeach ($dom->getElementsByTagName('iframe') as $iframeElement)\n\t\t\t... | [
"public function get() {\n $storeId = '';\n $requestHeaders = $this->currentRequest->headers;\n if ($requestHeaders->has('X-ACM-UUID')) {\n $storeId = $requestHeaders->get('X-ACM-UUID');\n }\n\n \\Drupal::logger('acm')->info(\"Verifying mapping for acm_uuid \" . $storeId . \".\");\n\n // Retu... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Get a human file size.
@param string $file The file path
@return string The human size | [
"public function humanFileSize($file)\n {\n $size = filesize($file);\n $mod = 1024;\n $units = explode(' ', 'B KB MB GB TB PB');\n for ($i = 0; $size > $mod; ++$i) {\n $size /= $mod;\n }\n\n return round($size, 2).' '.$units[$i];\n }"
] | [
"public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Counterpart to |setInput| for moving the cursor.
@param cursor A JS object shaped like { start: x, end: y } | [
"function(cursor) {\n this._caretChange = Caret.NO_CHANGE;\n this._processCaretChange({\n typed: this.terminal.inputElement.value,\n cursor: cursor\n });\n }"
] | [
"def focus_left(pymux):\n \" \"\n _move_focus(pymux,\n lambda wp: wp.xpos - 2, # 2 in order to skip over the border.\n lambda wp: wp.ypos)"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Key for sorting PEP8 results.
Global fixes should be done first. This is important for things like
indentation. | [
"def _priority_key(pep8_result):\n \n priority = [\n # Fix multiline colon-based before semicolon based.\n 'e701',\n # Break multiline statements early.\n 'e702',\n # Things that make lines longer.\n 'e225', 'e231',\n # Remove extraneous whitespace before break... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
set the output type | [
"public function type($mimetype) {\n\t\t// if the type is correct\n\t\tif(in_array($mimetype, $this->Allowed)) {\n\t\t\t// set the type\n\t\t\t$this->Output = $mimetype;\n\t\t}\n\t\t// return self\n\t\treturn($this);\n\t}"
] | [
"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:"
} |
Stop the mock server | [
"function (options, callback) {\n if (this.stopMockServerFunc) {\n this.stopMockServerFunc(options, callback);\n } else if (this.mockServer) {\n this.mockServer.stop(callback);\n } else {\n callback();\n }\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Render headers partial. Used by the CMS integration to refetch headers after editing. | [
"def show_headers\n mail = with_email_locale { mail_and_body.first }\n render partial: 'rails_email_preview/emails/headers', locals: {mail: mail}\n end"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Language and programming:"
} |
Creates a Doclet from the given comment string
@param {string} comment Comment string.
@constructor
@private | [
"function Doclet(comment) {\n\n\t\t\tthis.comment = comment = unwrap(comment);\n\t\t\tthis.tags = [];\n\n\t\t\tvar m;\n\t\t\tvar lastContent = 0;\n\t\t\tvar lastTag = \"description\";\n\t\t\twhile ((m = rtag.exec(comment)) != null) {\n\t\t\t\tthis._addTag(lastTag, comment.slice(lastContent, m.index));\n\t\t\t\tlast... | [
"public void visitEnd() {\n String classname = workbench.getType().getClassName();\n\n component.addAttribute(new Attribute(\"classname\", classname));\n\n // Generates the provides attribute.\n component.addElement(ElementHelper.getProvidesElement(specifications));\n\n if (workbe... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// evaluate() - evaluates to check whether IP address in values map for AWSSourceIP
// does not fall in one of network. | [
"func (f notIPAddressFunc) evaluate(values map[string][]string) bool {\n\treturn !f.ipAddressFunc.evaluate(values)\n}"
] | [
"public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {\n routes.put(nm, links); // Only one route between two nodes (replace the old route)\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// ParseEUI64 parses a 64-bit hex-encoded string to an EUI64. | [
"func ParseEUI64(input string) (eui EUI64, err error) {\n\tbytes, err := ParseHEX(input, 8)\n\tif err != nil {\n\t\treturn\n\t}\n\tcopy(eui[:], bytes)\n\treturn\n}"
] | [
"def genKw(w,msk,z):\n \n # Hash inputs into a string of bytes\n b = hmac(msk, z + w, tag=\"TAG_PYTHIA_KW\")\n\n # Convert the string into a long value (no larger than the order of Gt),\n # then return a BigInt value.\n return BigInt(longFromString(b) % long(orderGt()))"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Translates arg to enforce proper assignment | [
"def mode_assignment(arg):\n \n arg = arg.upper()\n stream_args = ('STREAM', 'CONSOLE', 'STDOUT')\n try:\n if arg in stream_args:\n return 'STREAM'\n else:\n return arg\n except Exception:\n return None"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric, ProtocolMarshaller protocolMarshaller) {\n\n if (finalHyperParameterTuningJobObjectiveMetric == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Modifies queries in such a way that PostgreSQL/PostGIS results will
match VoltDB results, and then passes the remaining work to the base
class version. | [
"@Override\n public VoltTable runDML(String dml) {\n String modifiedDml = transformDML(dml);\n printTransformedSql(dml, modifiedDml);\n return super.runDML(modifiedDml, false);\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:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Append sorting parameters to {@link SolrQuery}
@param solrQuery
@param sort | [
"protected void appendSort(SolrQuery solrQuery, @Nullable Sort sort, @Nullable Class<?> domainType) {\n\n\t\tif (sort == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (Order order : sort) {\n\t\t\tsolrQuery.addSort(getMappedFieldName(order.getProperty(), domainType),\n\t\t\t\t\torder.isAscending() ? ORDER.asc : ORDER.de... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get Unstarted Submissions.
@param
$project
PDProject
@return Array of PDSubmission that have not been started. | [
"function getUnstartedSubmissions($project) {\n\t\t$submissions = array ();\n\t\t$creatingSubmissions = $this->submissionService->findCreatingSubmissionsByProjectShortCode($project->shortCode)->return;\n\t\tforeach ($creatingSubmissions as &$creatingSubmission){\n\t\t\t$sub = new Submission();\n\t\t\t$sub->ticket =... | [
"def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)"
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Returns all permissions known by the authenticator.
@todo This should be cached
@return string[] | [
"public function getAllPermissions()\n {\n $permissions = [];\n\n // Gather and combine all permissions for roles\n foreach ($this->roleModel->all() as $role) {\n $permissions = array_merge(\n $permissions,\n array_keys(array_filter($role->getPermissi... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Get a float value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"@Api\n\tpublic void getValue(String name, FloatAttribute attribute) {\n\t\tattribute.setValue(toFloat(formWidget.getValue(name)));\n\t}"
] | [
"function onData( addend ) {\n\t\t/**\n\t\t* FUNCTION: onData( newVal, encoding, clbk )\n\t\t*\tData event handler. Performs addition.\n\t\t*\n\t\t* @private\n\t\t* @param {Number} newVal - streamed data value\n\t\t* @param {String} encoding\n\t\t* @param {Function} clbk - callback to invoke after performing additi... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
URI e.g. jre:/java.base/java/lang/Object.class | [
"private FileNode moduleFile(URL url) {\n String module;\n int idx;\n\n module = url.getFile();\n module = Strings.removeLeft(module, \"/\");\n idx = module.indexOf(\"/\");\n if (idx == -1) {\n throw new RuntimeException(\"unexpected jre url: \" + url);\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The projection for the stereonet as a matplotlib transform. This is
primarily called by LambertAxes._set_lim_and_transforms. | [
"def _get_core_transform(self, resolution):\n \"\"\"\"\"\"\n return self._base_transform(self._center_longitude,\n self._center_latitude,\n resolution)"
] | [
"def set_cmap(self, cmap, callback=True):\n \n self.cmap = cmap\n with self.suppress_changed:\n self.calc_cmap()\n # TEMP: ignore passed callback parameter\n # callback=False in the following because we don't want to\n # recursively invoke set_cmap()\... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Compiles a route into a priority, static prefix, regex part and param names. | [
"protected function compileRoute(Route $route): array\n {\n $regex = '';\n $prefix = '';\n $prio = 0;\n $pre = true;\n \n $wildcard = false;\n \n foreach (\\explode('/', $route->pattern) as $level => $entry) {\n if (!$level) {\n co... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Roughly Python/ast.c:fstring_find_literal | [
"def _find_literal(s, start, level, parts, exprs):\n \"\"\"\"\"\"\n i = start\n parse_expr = True\n\n while i < len(s):\n ch = s[i]\n\n if ch in ('{', '}'):\n if level == 0:\n if i + 1 < len(s) and s[i + 1] == ch:\n i += 2\n p... | [
"def forward_char(self, e): # (C-f)\r\n \"\"\"\r\n self.l_buffer.forward_char(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Fetches a chunk corresponding to the current offset. | [
"def _GetChunk(self):\n \"\"\"\"\"\"\n\n found_ref = None\n for ref in self._blob_refs:\n if self._offset >= ref.offset and self._offset < (ref.offset + ref.size):\n found_ref = ref\n break\n\n if not found_ref:\n return None, None\n\n # If self._current_ref == found_ref, then... | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the Github sentence about Data retrieval:",
"pos": "Represent the Github code about Data retrieval:",
"neg": "Represent the Github code:"
} |
// IncreaseTCPSeq increases TCP seq number by incr | [
"func (p *Packet) IncreaseTCPSeq(incr uint32) {\n\tbuffer := p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]\n\tp.tcpHdr.tcpSeq = p.tcpHdr.tcpSeq + incr\n\tbinary.BigEndian.PutUint32(buffer[tcpSeqPos:tcpSeqPos+4], p.tcpHdr.tcpSeq)\n}"
] | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Validates the dateformats
Should not be empty
Keys and Descriptions should not contain HTML
@param string $file File to validate
@param string $key Key to validate
@param array $validate_language Translated language
@return null | [
"public function validateDateformats($file, $key, $validate_language)\n\t{\n\t\tif (empty($validate_language))\n\t\t{\n\t\t\t$this->output->addMessage(Output::FATAL, 'Array must not be empty', $file, $key);\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ($validate_language as $dateformat => $example_time)\n\t\t{\n\t\t\t$this... | [
"public function addSupportedLanguage($language, $name = \"defaultTranslationService\", $selfedit=\"false\") {\n\t\t$this->addTranslationLanguageFromService(($selfedit == \"true\"), $name, $language);\n\t\t\n\t\t// Once more to reaload languages list\n\t\t$this->supportedLanguages($name, $selfedit);\n\t}"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
/*
(non-Javadoc)
@see com.ibm.ws.objectManager.ObjectStore#close() | [
"public synchronized void close()\n throws ObjectManagerException {\n final String methodName = \"close\";\n if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())\n trace.entry(this, cclass, methodName);\n\n super.close();\n\n if (Tracing.isAnyTracing... | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// set middlewares to import | [
"func (pr *pythonResource) setMiddlewares() {\n\tfor _, pm := range pr.Methods {\n\t\tfor _, m := range pm.MiddlewaresArr {\n\t\t\tpr.addMiddleware(m)\n\t\t}\n\t}\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
determines if this node is equal to the given node
@param Node
@return bool | [
"public function isEqualTo(Node $node)\n {\n return (($this->getLeftValue() == $node->getLeftValue()) &&\n ($this->getRightValue() == $node->getRightValue()) &&\n (!$this->hasManyRoots() || ($this->getRootValue() == $node->getRootValue())));\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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
/*
process_login
Called by todo.login_user. Creates a cookie with the session_token we got back from CloudMine
and calls for this user's data for their to-do list.
Parameter:
response: response data from the server, passed in by todo.login_user | [
"function(response){\n if(window.localStorage){\n var save = JSON.stringify({token: response.session_token});\n localStorage.setItem('cloudmineTodoSession', save);\n }\n else {\n document.cookie = 'cloudmineTodoSession=' + response.session_token + '; expires=' + response.expires ... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Write and read attributes in a single request
@param values the values to write
@param clIdent the client ID
@return the read results | [
"@Override\n public AttributeValue_4[] write_read_attributes_4(final AttributeValue_4[] values, final ClntIdent clIdent)\n throws MultiDevFailed, DevFailed {\n MDC.setContextMap(contextMap);\n xlogger.entry();\n checkInitialization();\n\n final String[] names = new String[v... | [
"def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
// Header returns the internal http header | [
"func (rm *responseModifier) Header() http.Header {\n\n\t// Use original header if hijacked\n\tif rm.hijacked {\n\t\treturn rm.rw.Header()\n\t}\n\n\treturn rm.header\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// map3857 contains information for drawing map on EPSG3857 | [
"func (b *bbox) newMap3857(width int) (m map3857, err error) {\n\t// bbox on 3857\n\t// tried using st_MakeEnvelope so that only needed to hit DB once\n\t// but it does not do what I for crossing 180\n\terr = db.QueryRow(`with p as (\n\t\tselect st_transform(st_setsrid(st_makepoint($1, $2), 4326), 3857) as pt \n\t\... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Determine, whether another one of *our* devices is stale or not.
@param userDevice our omemoDevice
@param subject another one of our devices
@param lastReceipt date of last received message from that device
@param maxAgeHours threshold
@return staleness | [
"static boolean isStale(OmemoDevice userDevice, OmemoDevice subject, Date lastReceipt, int maxAgeHours) {\n if (userDevice.equals(subject)) {\n return false;\n }\n\n if (lastReceipt == null) {\n return false;\n }\n\n long maxAgeMillis = MILLIS_PER_HOUR * maxA... | [
"public void away (ClientObject caller, String message)\n {\n BodyObject body = _locator.forClient(caller);\n // we modify this field via an invocation service request because a body object is not\n // modifiable by the client\n body.setAwayMessage(message);\n }"
] | codesearchnet | {
"query": "Represent the comment about Messaging:",
"pos": "Represent the code about Messaging:",
"neg": "Represent the code about Software development:"
} |
Sets the alternating row colors state for this widget.
:param state | <bool> | [
"def setAlternatingRowColors( self, state ):\r\n \r\n self._alternatingRowColors = state\r\n \r\n self.treeWidget().setAlternatingRowColors(state)"
] | [
"def check_arrange_act_spacing(self) -> typing.Generator[AAAError, None, None]:\n \n yield from self.check_block_spacing(\n LineType.arrange,\n LineType.act,\n 'AAA03 expected 1 blank line before Act block, found {}',\n )"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return SyncListPermission ResourceSet | [
"@Override\n public ResourceSet<SyncListPermission> read(final TwilioRestClient client) {\n return new ResourceSet<>(this, client, firstPage(client));\n }"
] | [
"@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Twilio:",
"pos": "Represent the code about Twilio:",
"neg": "Represent the code:"
} |
@Route("/{type}/{widgetId}", name="icap_portfolio_internal_widget_put", requirements={"widgetId" = "\d+"})
@Method({"PUT"})
@ParamConverter("loggedUser", options={"authenticatedUser" = true}) | [
"public function putAction(Request $request, User $loggedUser, $type, $widgetId)\n {\n $this->checkPortfolioToolAccess($loggedUser);\n\n $widgetFindEvent = new WidgetFindEvent($widgetId, $type, $loggedUser);\n\n $this->get('event_dispatcher')->dispatch('icap_portfolio_widget_find_'.$type, $w... | [
"public Map<String, Map<String, Map<String, Map<String, ?>>>> addValidationConstraint(String type,\n\t\t\tString field, Constraint c) {\n\t\tif (StringUtils.isBlank(type) || StringUtils.isBlank(field) || c == null) {\n\t\t\treturn Collections.emptyMap();\n\t\t}\n\t\treturn getEntity(invokePut(Utils.formatMessage(\"... | codesearchnet | {
"query": "Represent the post about Sales Channel API:",
"pos": "Represent the code about Sales Channel API:",
"neg": "Represent the code about programming:"
} |
// Rewatch implements Watcher interface.
//
// TODO(rjeczalik): This is a naive hack. Rewrite might help. | [
"func (t *trg) Rewatch(p string, _, e Event) error {\n\tfi, err := os.Stat(p)\n\tif err != nil {\n\t\treturn err\n\t}\n\tt.Lock()\n\tif err = t.unwatch(p, fi); err == nil {\n\t\t// TODO(rjeczalik): If watch fails then we leave trigger in inconsistent\n\t\t// state. Handle? Panic? Native version of rewatch?\n\t\terr... | [
"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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// generate all python classes from a RAML document | [
"func GenerateAllClasses(apiDef *raml.APIDefinition, dir string, capnp bool) ([]string, error) {\n\t// array of tip that need to be generated in the end of this\n\t// process. because it needs other object to be registered first\n\tdelayedMI := []string{} // delayed multiple inheritance\n\ttemplate := \"./templates... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates the list output.
@param shardRequests the shard requests
@param maxNumber the max number
@return the simple ordered map | [
"public SimpleOrderedMap<Object> createListOutput(boolean shardRequests, int maxNumber) {\n garbageCollect();\n SimpleOrderedMap<Object> output = new SimpleOrderedMap<>();\n output.add(NAME_ENABLED, enabled());\n output.add(NAME_ENABLED, true);\n int numberTotal = data.size();\n ListData listData ... | [
"@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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create input.
@param string $name
@param string $value
@param string $id
@param string $class
@param array $attrs
@return string | [
"public function input($name, $value = '', $id = '', $class = '', array $attrs = array())\n {\n return '<input id=\"' . $id . '\" class=\"' . $class . '\" type=\"' . $this->_type . '\" name=\"' . $name . '\"\n value=\"' . $value . '\" ' . $this->buildAttrs($attrs) . '/>';\n }"
... | [
"public static function typeCheckboxes($value, array $params, array $field)\n {\n // Set multiple: true so checkboxes can easily use min/max counts to control number of options required\n $field['multiple'] = true;\n\n return self::typeArray((array) $value, $params, $field);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.