query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// Pipeline returns the number of items in flight that need to be drained across all configured forwarders | [
"func (p *gateway) Pipeline() int64 {\n\tvar totalForwarded int64\n\tfor _, f := range p.forwarders {\n\t\ttotalForwarded += f.Pipeline()\n\t}\n\treturn totalForwarded\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
a method to validate user can access heroku account | [
"def _validate_login(self):\r\n \r\n ''' '''\r\n \r\n title = '%s.validate_login' % self.__class__.__name__\r\n \r\n # verbosity\r\n windows_insert = ' On windows, run in cmd.exe'\r\n self.printer('Checking heroku credentials ... ', flush=True)\r\n\r\n # v... | [
"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:"
} |
// RestoreTemplates populates the object cache from templates on the filesystem
// at the specified path. | [
"func RestoreTemplates(stateDir string) error {\n\t// Simplest implementation: Just garbage-collect everything.\n\t// In future we should make this smarter.\n\tpath := filepath.Join(stateDir, defaults.TemplatesDir)\n\terr := os.RemoveAll(path)\n\tif err == nil || os.IsNotExist(err) {\n\t\treturn nil\n\t}\n\treturn ... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
returns true if the user may view the step.
@param bool $bRedirectToPreviousPermittedStep
@return bool | [
"protected function AllowAccessToStep($bRedirectToPreviousPermittedStep = false)\n {\n $bAllowAccess = parent::AllowAccessToStep($bRedirectToPreviousPermittedStep);\n $shopService = $this->getShopService();\n $oBasket = $shopService->getActiveBasket();\n // validate previous steps...\... | [
"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 comment about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about File management:"
} |
// GetExecPathFromPID returns the process's executable path for given PID. | [
"func GetExecPathFromPID(pid uint32) (string, error) {\n\tbuf := make([]byte, procpidpathinfosize)\n\t_, _, errno := syscall.Syscall6(\n\t\tsyscall.SYS_PROC_INFO,\n\t\tproccallnumpidinfo,\n\t\tuintptr(pid),\n\t\tprocpidpathinfo,\n\t\t0,\n\t\tuintptr(unsafe.Pointer(&buf[0])),\n\t\tprocpidpathinfosize)\n\tif errno !=... | [
"function(ts, pid, comm, prio, fromPid) {\n // The the pids that get passed in to this function are Linux kernel\n // pids, which identify threads. The rest of trace-viewer refers to\n // these as tids, so the change of nomenclature happens in the following\n // construction of the wakeup objec... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// Describe mocks base method | [
"func (m *MockCounter) Describe(arg0 chan<- *prometheus.Desc) {\n\tm.ctrl.Call(m, \"Describe\", arg0)\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a Seaborn linear regression plot with marginal distribution | [
"def _dlinear_seaborn_(self, label=None, style=None, opts=None):\n \n color, size = self._get_color_size(style)\n try:\n fig = sns.jointplot(self.x, self.y, color=color,\n size=size, data=self.df, kind=\"reg\")\n fig = self._set_with_height(f... | [
"def data_class_detection(self, data):\n \n assert(isinstance(data, list) or isinstance(data, tuple))\n if not isinstance(self, (LineChart, BarChart, ScatterChart)):\n # From the link above:\n # Simple encoding is suitable for all other types of chart\n # re... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets the version of the JVM in the form "VM_Name - Vendor - Spec/Version".
@return The JVM version. | [
"public static String getJvmVersion() {\n\t\ttry {\n\t\t\tfinal RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();\n\t\t\treturn bean.getVmName() + \" - \" + bean.getVmVendor() + \" - \" + bean.getSpecVersion() + '/' + bean.getVmVersion();\n\t\t}\n\t\tcatch (Throwable t) {\n\t\t\treturn UNKNOWN;\n\t\t}\n\t}... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Create a new link to a given ref
@param text the text content
@param ref the ref
@return the link | [
"public static Link create(final String text, final String ref) {\n\t\treturn new Link(text, null, '#'+ref);\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 Github comment about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
// SetEnabled sets the Enabled field's value. | [
"func (s *DistributionSummary) SetEnabled(v bool) *DistributionSummary {\n\ts.Enabled = &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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// SetRemoteAccessSession sets the RemoteAccessSession field's value. | [
"func (s *GetRemoteAccessSessionOutput) SetRemoteAccessSession(v *RemoteAccessSession) *GetRemoteAccessSessionOutput {\n\ts.RemoteAccessSession = 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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Remove column from grid.
@param string $name
@return $this | [
"public function removeColumn($name)\n {\n unset($this->columns[$name]);\n if ($this->last_column == $name) {\n $this->last_column = null;\n }\n\n return $this;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Delete network level account.
@author Vova Feldman (@svovaf)
@since 2.0.0
@param bool $check_user Enforce checking if user have plugins activation privileges. | [
"function delete_network_account_event( $check_user = true ) {\r\n $this->_logger->entrance( 'slug = ' . $this->_slug );\r\n\r\n if ( $check_user && ! $this->is_user_admin() ) {\r\n return;\r\n }\r\n\r\n $this->do_action( 'before_network_account_delete' );\... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
https://developer.zendesk.com/rest_api/docs/core/apps#install-app | [
"def apps_installation_create(self, data, **kwargs):\n \"\"\n api_path = \"/api/v2/apps/installations.json\"\n return self.call(api_path, method=\"POST\", data=data, **kwargs)"
] | [
"def zendesk_ticket(self):\n \n if self.api and self.zendesk_ticket_id:\n return self.api._get_zendesk_ticket(self.zendesk_ticket_id)"
] | codesearchnet | {
"query": "Represent the comment about developer.zendesk.com:",
"pos": "Represent the code about developer.zendesk.com:",
"neg": "Represent the code:"
} |
property_list : property_assignment
| property_list COMMA property_assignment | [
"def p_property_list(self, p):\n \n if len(p) == 2:\n p[0] = [p[1]]\n else:\n p[1].append(p[3])\n p[0] = p[1]"
] | [
"def add_molecular_activity(_activity_identifier)\n argument(\n term(\n function(\n identifier('molecularActivity')),\n argument(\n parameter(\n prefix(nil),\n value(\n identifier('kin'))))))\n end"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*
Processes the result object from old run() API.
@deprecated: command services should implement execute() instead. | [
"function(result) {\n\t\t\t\t\t\tif (typeof result === \"object\" && result) { //$NON-NLS-0$\n\t\t\t\t\t\t\tif (result.text) {\n\t\t\t\t\t\t\t\teditor.setText(result.text);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (result.selection) {\n\t\t\t\t\t\t\t\tif (editor.setSelection) {\n\t\t\t\t\t\t\t\t\teditor.setSelection(resu... | [
"@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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Export data from a Pod
@param string|object $pod The pod name or Pods object
@param array $params An associative array of parameters
@return array Data arrays of all exported pod items
@since 1.7.1 | [
"public function export( $pod = null, $params = null ) {\n\n\t\tif ( empty( $pod ) ) {\n\t\t\t$pod = $this->pod;\n\t\t}\n\n\t\t$find = array(\n\t\t\t'limit' => - 1,\n\t\t\t'search' => false,\n\t\t\t'pagination' => false\n\t\t);\n\n\t\tif ( ! empty( $params ) && isset( $params['params'] ) ) {\n\t\t\t$find =... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Called at beginning of init, to execute all pre-init plugins. | [
"function( root ) { //jshint ignore:line\n for ( var i = 0; i < preInitPlugins.length; i++ ) {\n var thisLevel = preInitPlugins[ i ];\n if ( thisLevel !== undefined ) {\n for ( var j = 0; j < thisLevel.length; j++ ) {\n thisLevel[ j ]( root );\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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceGroupSpec. | [
"func (in *InstanceGroupSpec) DeepCopy() *InstanceGroupSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(InstanceGroupSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (resource *Bundle) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Bundle\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Bundle), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Gets the union of the {@code keySet()}s of all provided {@link Multimap}s. | [
"public static <K> ImmutableSet<K> allMultimapKeys(final Iterable<? extends Multimap<K, ?>> multimaps) {\n final ImmutableSet.Builder<K> builder = ImmutableSet.builder();\n\n for (final Multimap<K, ?> multimap : multimaps) {\n builder.addAll(multimap.keySet());\n }\n\n return builder.build();\n }"... | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// SetPathWithQueryString sets the PathWithQueryString field's value. | [
"func (s *TestInvokeAuthorizerInput) SetPathWithQueryString(v string) *TestInvokeAuthorizerInput {\n\ts.PathWithQueryString = &v\n\treturn s\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetClusterSubnetGroupName sets the ClusterSubnetGroupName field's value. | [
"func (s *DescribeClusterSubnetGroupsInput) SetClusterSubnetGroupName(v string) *DescribeClusterSubnetGroupsInput {\n\ts.ClusterSubnetGroupName = &v\n\treturn s\n}"
] | [
"func (m *metadata) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error) {\n\treturn \"\", errors.New(\"InstanceTypeByProviderID not implemented\")\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// GetCompareFunc gets a compare function for the field type. | [
"func GetCompareFunc(tp *types.FieldType) CompareFunc {\n\tswitch tp.Tp {\n\tcase mysql.TypeTiny, mysql.TypeShort, mysql.TypeInt24, mysql.TypeLong, mysql.TypeLonglong, mysql.TypeYear:\n\t\tif mysql.HasUnsignedFlag(tp.Flag) {\n\t\t\treturn cmpUint64\n\t\t}\n\t\treturn cmpInt64\n\tcase mysql.TypeFloat:\n\t\treturn cm... | [
"@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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Reverse32 set reverse the bit order for 32-bit variable | [
"func Reverse32(value uint32) (uint32) {\n value = ((value >> 1) & 0x55555555) | ((value & 0x55555555) << 1)\n value = ((value >> 2) & 0x33333333) | ((value & 0x33333333) << 2)\n value = ((value >> 4) & 0x0F0F0F0F) | ((value & 0x0F0F0F0F) << 4)\n value = ((value >> 8) & 0x00FF00FF) | ((value & 0x00FF00F... | [
"def read_plain_boolean(file_obj, count):\n \"\"\"\"\"\"\n # for bit packed, the count is stored shifted up. But we want to pass in a count,\n # so we shift up.\n # bit width is 1 for a single-bit boolean.\n return read_bitpacked(file_obj, count << 1, 1, logger.isEnabledFor(logging.DEBUG))"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Forbid an ability to the model.
@param mixed $ability
@param mixed|null $model
@return \Silber\Bouncer\Conductors\ForbidsAbilities|$this | [
"public function forbid($ability = null, $model = null)\n {\n if (is_null($ability)) {\n return new ForbidsAbilities($this);\n }\n\n (new ForbidsAbilities($this))->to($ability, $model);\n\n return $this;\n }"
] | [
"public function applyFilters($filters, FilterFactory $filterFactory, ConditionAwareRepository $repository)\n {\n // @see Ipunkt\\LaravelJsonApi\\Services\\FilterApplier\\FilterApplier\n \\FilterApplier::applyFiltersToRepository($filters, $filterFactory, $repository);\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Base calendar class. This class doesn't do any formatting. It simply
provides data to subclasses.
@param {Number} firstweekday
@throws {IllegalWeekdayError} If the provided firstweekday is invalid.
@api public | [
"function Calendar(firstweekday) {\n this._firstweekday = typeof(firstweekday) === \"undefined\" ? 0 : firstweekday;\n\n if(firstweekday < 0 || firstweekday > 6) {\n throw new IllegalWeekdayError();\n }\n\n this._oneday = 1000 * 60 * 60 * 24;\n this._onehour = 1000 * 60 * 60;\n }"... | [
"def resolve(self, year: int = YEAR_ANY) -> MDate:\n \n year = year or self.year\n if year:\n return self._resolve(year)\n raise ValueError('Unable resolve the date without a specified year.')"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
// DeleteGlobal delete global state | [
"func DeleteGlobal(stateDriver core.StateDriver) error {\n\tmasterGc := &mastercfg.GlobConfig{}\n\tmasterGc.StateDriver = stateDriver\n\terr := masterGc.Read(\"\")\n\tif err == nil {\n\t\terr = masterGc.Clear()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Setup global state\n\tgCfg := &gstate.Cfg{}\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// NewHilOpticalFlow returns a new HilOpticalFlow | [
"func NewHilOpticalFlow(TIME_USEC uint64, FLOW_COMP_M_X float32, FLOW_COMP_M_Y float32, GROUND_DISTANCE float32, FLOW_X int16, FLOW_Y int16, SENSOR_ID uint8, QUALITY uint8) *HilOpticalFlow {\n\tm := HilOpticalFlow{}\n\tm.TIME_USEC = TIME_USEC\n\tm.FLOW_COMP_M_X = FLOW_COMP_M_X\n\tm.FLOW_COMP_M_Y = FLOW_COMP_M_Y\n\t... | [
"protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {\n return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Validate and returns disqus_shortname config value.
:returns: disqus_shortname config value.
:rtype: str | [
"def get_shortname(self):\n \n disqus_shortname = self.state.document.settings.env.config.disqus_shortname\n if not disqus_shortname:\n raise ExtensionError('disqus_shortname config value must be set for the disqus extension to work.')\n if not RE_SHORTNAME.match(disqus_shortn... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
startup callback
Trim all submitted data.
@param Event $event
@return void | [
"public function startup(Event $event)\n {\n $controller = $event->subject();\n if (!empty($controller->request->data) && !Configure::read('DataPreparation.notrimRequestData')) {\n $controller->request->data = $this->_trimDeep($controller->request->data);\n }\n if (!empty($... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Auto Generated Code | [
"def get_stp_mst_detail_output_msti_port_auto_edge(self, **kwargs):\n \n config = ET.Element(\"config\")\n get_stp_mst_detail = ET.Element(\"get_stp_mst_detail\")\n config = get_stp_mst_detail\n output = ET.SubElement(get_stp_mst_detail, \"output\")\n msti = ET.SubElement(o... | [
"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 post about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about File management:"
} |
Set ip.
@since 1.1.0
@uses \string Ip::get() → get IP
@link https://github.com/Josantonius/PHP-Ip | [
"private function setIp()\n {\n if (class_exists($Ip = 'Josantonius\\Ip\\Ip')) {\n $ip = $Ip::get();\n $this->setOption('IP', ($ip) ? $ip : 'unknown');\n }\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Switch on/off the speaker's dialog mode.
:param dialog_mode: Enable or disable dialog mode
:type dialog_mode: bool
:raises NotSupportedException: If the device does not support
dialog mode. | [
"def dialog_mode(self, dialog_mode):\n \n if not self.is_soundbar:\n message = 'This device does not support dialog mode'\n raise NotSupportedException(message)\n\n self.renderingControl.SetEQ([\n ('InstanceID', 0),\n ('EQType', 'DialogLevel'),\n ... | [
"def fix_config(self, options):\n \n options = super(ContainerValuePicker, self).fix_config(options)\n\n opt = \"value\"\n if opt not in options:\n options[opt] = \"Model\"\n if opt not in self.help:\n self.help[opt] = \"The name of the container value to pic... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Find stores within a zip code.
@param address a valid address, address fragment, or pair of coordinates | [
"function findStoresInZip(address, callback) {\n geo.geocode(address, function(err, georesult) {\n if (err) return callback(err);\n\n snapdb.findStoresInZip(georesult.zip5, function(err, stores) {\n if (err) return callback(err);\n georesult.stores = stores;\n return callback(null, georesult);... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GetStream 获取直播流
// @describe 每一次都生成新的流实例,不检查流名的唯一性,并且同一个名字会生成不同的实例的,
// 所以,使用时候,请自行确保流名的唯一性 | [
"func (l *Live) GetStream(streamName string) *Stream {\n\tif \"\" == streamName {\n\t\treturn nil\n\t}\n\n\tvar credentials *StreamCredentials\n\tif nil != l.streamCert {\n\t\tcredentials = l.streamCert.Clone()\n\t}\n\n\treturn &Stream{\n\t\tdomainName: l.liveReq.DomainName,\n\t\tappName: l.liveReq.AppNa... | [
"protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Iterate over a cursor and load entities.
@param cls The model class.
@param cursor The result cursor.
@return The list of entities. | [
"public static <T extends Model> List<T> processCursor(Class<T> cls, Cursor cursor) {\n\t\tfinal List<T> entities = new ArrayList<T>();\n\t\ttry {\n\t\t\tConstructor<T> entityConstructor = cls.getConstructor();\n\t\t\tif (cursor.moveToFirst()) {\n\t\t\t\tdo {\n\t\t\t\t\tT entity = getEntity(cls, cursor.getLong(curs... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *DatastoreActivity) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DatastoreActivity\"}\n\tif s.DatastoreName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DatastoreName\"))\n\t}\n\tif s.DatastoreName != nil && len(*s.DatastoreName) < 1 {\n\t\tinvalidParams.Add(r... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
打包到当前目录
@param srcPath 源文件路径
@param charset 编码
@return 打包好的压缩文件
@throws UtilException IO异常 | [
"public static File zip(String srcPath, Charset charset) throws UtilException {\r\n\t\treturn zip(FileUtil.file(srcPath), charset);\r\n\t}"
] | [
"private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ... | codesearchnet | {
"query": "Represent the Github comment about Encryption:",
"pos": "Represent the Github code about Encryption:",
"neg": "Represent the Github code:"
} |
Headwords generator.
@param string|\rhoone\extension\Extension|\rhoone\models\Extension|mixed $class
`string` if extension class.
@param string[] $words
@throws InvalidParamException | [
"public function getHeadwords($class = null, $words = [])\n {\n // Method One:\n if ($class === null || $class === false || (is_string($class) && empty($class))) {\n $query = Headword::find();\n } else {\n $extensions = ExtensionManager::getModels($class);\n ... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Execute the extension function. | [
"public Object extFunction(String ns, String funcName, Vector argVec,\n Object methodKey) throws javax.xml.transform.TransformerException {\n try {\n\n if ( funcName == null ) {\n String fmsg = XSLMessages.createXPATHMessage(\n XPATHErrorResources.ER_ARG_CA... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// String returns a string representation of the Date abiding by the OFX spec | [
"func (od Date) String() string {\n\tformat := od.Format(ofxDateFormats[0])\n\tzonename, zoneoffset := od.Zone()\n\tif zoneoffset < 0 {\n\t\tformat += \"[\" + fmt.Sprintf(\"%+d\", zoneoffset/3600)\n\t} else {\n\t\tformat += \"[\" + fmt.Sprintf(\"%d\", zoneoffset/3600)\n\t}\n\tfractionaloffset := (zoneoffset % 3600)... | [
"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 post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(EntityAggregate entityAggregate, ProtocolMarshaller protocolMarshaller) {\n\n if (entityAggregate == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(entityAggregate.getE... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetNotificationArns sets the NotificationArns field's value. | [
"func (s *CreateProvisionedProductPlanInput) SetNotificationArns(v []*string) *CreateProvisionedProductPlanInput {\n\ts.NotificationArns = v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// toMiloBuildInMemory converts a buildbucket build to a milo build in memory.
// Does not make RPCs.
// In case of an error, returns a build with a description of the error
// and logs the error. | [
"func toMiloBuildInMemory(c context.Context, msg *bbv1.ApiCommonBuildMessage) (*ui.MiloBuildLegacy, error) {\n\t// Parse the build message into a deprecated.Build struct, filling in the\n\t// input and output properties that we expect to receive.\n\tvar b deprecated.Build\n\tvar props struct {\n\t\tRevision string ... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get a document from this class' internal cache.
@param string $documentId ID to get from cache.
@return \Chill\Document[]|array|null | [
"protected function getCache($documentId)\n {\n if (isset($this->cache[$documentId])) {\n return $this->cache[$documentId];\n }\n\n return null;\n }"
] | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns a reference to a random item from the list
@return mixed | [
"public function &random(){\n\t\n\t\tif($this->isEmpty()){\n\t\t\tthrow new \\UnderflowException(\\get_called_class() . ' is empty');\n\t\t}\n\t\t\n\t\treturn $this->_Arr[\\array_rand($this->_Arr, 1)];\n\t\t\n\t}"
] | [
"@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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
/* --- public methods --- /*
--- sort ( ) method ---
This method sort the categories on the category name.
The user language is used to select the correct name
and taking account of the local settings for the sort | [
"function ( ) {\n\t\t\t\t_PinCategories = _PinCategories.sort ( \n\t\t\t\t\tfunction ( a, b ) {\n\t\t\t\t\t\treturn a.CategoryName.localeCompare \n\t\t\t\t\t\t( \n\t\t\t\t\t\t\tb.CategoryName,\n\t\t\t\t\t\t\t_Translator.UserLanguage\n\t\t\t\t\t\t);\n\t\t\t\t\t} \n\t\t\t\t);\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 sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
---------------------------------------------------------------------- | [
"public static function estimateBitsModeNum($size)\r\n {\r\n $w = (int)$size / 3;\r\n $bits = $w * 10;\r\n\r\n switch($size - $w * 3) {\r\n case 1:\r\n $bits += 4;\r\n break;\r\n case 2:\r\n $bits += 7;\r\n bre... | [
"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 summarization about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code:"
} |
Initializes the config for the object
Called from {@link __construct()} as a first step of object instantiation.
@param ObjectConfig $config Configuration options
@return void | [
"protected function _initialize(ObjectConfig $config)\n {\n $config->append(array(\n 'data' => array(),\n 'parameters' => array(),\n 'model' => 'lib:model.empty',\n 'content' => '',\n 'url' => $this->getObject('lib:ht... | [
"protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Get the file size in a human-readable string.
@param size
@return
@author paulburke | [
"public static String getReadableFileSize(int size) {\n final int BYTES_IN_KILOBYTES = 1024;\n final DecimalFormat dec = new DecimalFormat(\"###.#\");\n final String KILOBYTES = \" KB\";\n final String MEGABYTES = \" MB\";\n final String GIGABYTES = \" GB\";\n float fileSiz... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Creates the "_rels" folder under the "xl" folder
@return FileSystemHelper
@throws \Box\Spout\Common\Exception\IOException If unable to create the folder | [
"protected function createXlRelsFolder()\n {\n $this->xlRelsFolder = $this->createFolder($this->xlFolder, self::RELS_FOLDER_NAME);\n return $this;\n }"
] | [
"@Override\n public void setContent(final InputStream content, final String contentType,\n final Collection<URI> checksums, final String originalFileName,\n final StoragePolicyDecisionPoint storagePolicyDecisionPoint)\n throws UnsupportedOperationExc... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Java programming:"
} |
Payment fail action.
@param Request $request Request element
@return Response | [
"public function failureAction(Request $request)\n {\n $orderId = $request\n ->query\n ->get('id', false);\n\n $failureRoute = $this\n ->redirectionRoutes\n ->getRedirectionRoute('failure');\n\n $redirectUrl = $this\n ->urlGenerator\n ... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Create temporary resource which will removed on fclose or end of process.
@param string $content
@return resource | [
"private function createTemporaryResource(string $content)\n {\n $tempResource = fopen('php://memory', 'r+');\n fwrite($tempResource, $content);\n rewind($tempResource);\n\n return $tempResource;\n }"
] | [
"def end(self):\n \n\n # Note: Vend is just a macro; use 'Vfinish' instead\n # Note also the the same C function is used to end\n # the VS interface\n _checkErr('vend', _C.Vfinish(self._hdf_inst._id),\n \"cannot terminate V interface\")\n self._hdf_inst = N... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
retrieve the last $number versions.
@param Integer $number the number of record to return.
@return PropelCollection|array \Dealer\Model\DealerVersion[] List of \Dealer\Model\DealerVersion objects | [
"public function getLastVersions($number = 10, $criteria = null, $con = null)\n {\n $criteria = ChildDealerVersionQuery::create(null, $criteria);\n $criteria->addDescendingOrderByColumn(DealerVersionTableMap::VERSION);\n $criteria->limit($number);\n\n return $this->getDealerVersions($... | [
"public function onMerge(MergeUsersEvent $event)\n {\n // Replace user of CasUser nodes\n $casUserCount = $this->casManager->replaceCasUserUser($event->getRemoved(), $event->getKept());\n $event->addMessage(\"[ClarolineAuthenticationBundle] updated CasUser count: $casUserCount\");\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Generate a string representation of HTML attributes for the Google reCAPTCHA tag.
@return string | [
"public function recaptchaHtmlAttr()\n {\n $params = $this->recaptchaParameters();\n\n $attributes = [];\n foreach ($params as $key => $val) {\n if ($val !== null) {\n $attributes[] = sprintf('data-%s=\"%s\"', $key, htmlspecialchars($val, ENT_QUOTES));\n ... | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// getTokens returns a map of tokenID->tokenSecret. It ensures the token is
// valid for signing. | [
"func (e *Signer) getTokens() map[string]string {\n\tret := map[string]string{}\n\tsecretObjs := e.listSecrets()\n\tfor _, secret := range secretObjs {\n\t\ttokenID, tokenSecret, ok := validateSecretForSigning(secret)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check and warn for duplicate secrets. Behavior here... | [
"def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// getField returns an Int with the bits set representing all of the times that
// the field represents or error parsing field value. A "field" is a comma-separated
// list of "ranges". | [
"func getField(field string, r bounds) (uint64, error) {\n\tvar bits uint64\n\tranges := strings.FieldsFunc(field, func(r rune) bool { return r == ',' })\n\tfor _, expr := range ranges {\n\t\tbit, err := getRange(expr, r)\n\t\tif err != nil {\n\t\t\treturn bits, err\n\t\t}\n\t\tbits |= bit\n\t}\n\treturn bits, nil\... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
加载一个文件夹下的所有语料
@param folderPath
@return | [
"public static Map<String, String[]> loadCorpusWithException(String folderPath, String charsetName) throws IOException\n {\n if (folderPath == null) throw new IllegalArgumentException(\"参数 folderPath == null\");\n File root = new File(folderPath);\n if (!root.exists()) throw new IllegalArgum... | [
"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 description about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
Generate an HTML image element.
@param string $url
@param string $alt
@param array $attributes
@param bool $secure
@return string | [
"public static function image($url, $alt = null, $attributes = array(), $secure = null)\n {\n $html = self::getInstance()->html;\n $args = func_get_args();\n return call_user_func_array(array($html, __FUNCTION__), $args);\n }"
] | [
"public static function file(string $name, array $attributes = null) : string\n {\n // Set the input type\n $attributes['type'] = 'file';\n\n return Form::input($name, '', $attributes);\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Bootstrap any application services.
@return void | [
"public function boot()\n {\n //\n $this->loadViewsFrom(__DIR__ . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'views',\n 'Modules\\Upload');\n\n Upload::deleted(\n function ($upload) {\n //\n $upload->deleteFile(false);\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// Wrap this Descriptor, recursively | [
"func wrapThisDescriptor(sl []*Descriptor, desc *descriptor.DescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) []*Descriptor {\n\tsl = append(sl, newDescriptor(desc, parent, file, index))\n\tme := sl[len(sl)-1]\n\tfor i, nested := range desc.NestedType {\n\t\tsl = wrapThisDescript... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Executes HTTP request, parses response headers, leaves body as a string
Based on http://snipplr.com/view/17242/
@param resource $ch cURL handle
@return \stdClass Containing headers, body, responseCode properties | [
"protected static function execute($ch)\n {\n $content = curl_exec($ch);\n $result = new \\stdClass;\n $result->body = trim($content);\n $result->responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n return $result;\n }"
] | [
"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 Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Print a single literal | [
"public static String print(final Literal literal) {\n return literal.match(new Literal.MatchBlock<String>() {\n @Override\n public String _case(StringLiteral x) {\n return x.content;\n }\n\n @Override\n public String _case(FloatingPointLi... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Klasa filtracji tekstów do url
@param mixed $value wartość
@throws \Mmi\App\KernelException jeśli filtrowanie $value nie jest możliwe
@return mixed | [
"public function filter($value)\n {\n if (!is_array($value)) {\n $ascii = new \\Mmi\\Filter\\Ascii;\n return preg_replace('!\\-+!', '-', preg_replace('/[^\\p{L}\\p{N}]/u', '-', strtolower(trim($ascii->filter($value), '-'))));\n }\n foreach ($value as $key => $val) {\n ... | [
"public function send($headers = true)\n {\n //wysłanie nagłówków\n $headers ? $this->sendHeaders() : null;\n //opcjonalne uruchomienie panelu deweloperskiego\n if ($this->_debug) {\n //debugger wykonuje zmianę w contencie\n new \\Mmi\\Http\\ResponseDebugger;\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
(Re)Index all the collections that are marked as to be (re)indexed.
@return int returns the number of reindexed pages | [
"public static function reindexPendingPages()\n {\n $app = Application::getFacadeApplication();\n\n $indexStack = $app->make(IndexManagerInterface::class);\n\n $num = 0;\n $db = $app['database']->connection();\n $r = $db->execute('select cID from PageSearchIndex where cRequires... | [
"def ObjectInitializedEventHandler(analysis, event):\n \n\n # Initialize the analysis if it was e.g. added by Manage Analysis\n wf.doActionFor(analysis, \"initialize\")\n\n # Try to transition the analysis_request to \"sample_received\". There are\n # some cases that can end up with an inconsistent s... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
The IN expression.
@param e1 The first expression.
@param e2 The second expression.
@return The expression. | [
"public static Expression in(final Expression e1, final Expression e2) {\n return new RepeatDelimiter(IN, e1.isEnclosed() ? e1 : e1.enclose(), e2.isEnclosed() ? e2 : e2.enclose());\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetOKActions sets the OKActions field's value. | [
"func (s *PutMetricAlarmInput) SetOKActions(v []*string) *PutMetricAlarmInput {\n\ts.OKActions = v\n\treturn s\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:"
} |
Creates a "deactivate" list action.<p>
@param id the action id
@return the list action | [
"private CmsListDirectAction createDeactivateAction(String id) {\n\n CmsListDirectAction deactAction = new CmsListDirectAction(id) {\n\n /**\n * @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()\n */\n @Override\n public boolean isVisibl... | [
"def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Reference fields. Filter by index and indicator.
@return array Array of referenced fields | [
"private function referenceFields()\n {\n if ($this->fields = $this->cache->getData($this->spec['field'])) {\n return $this->fields;\n }\n\n if (!$this->fields = $this->referenceFieldsByTag()) {\n return;\n }\n\n /*\n * filter by indizes\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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Create a Css Selector Transform | [
"public static CssSel sel(String selector, String value) {\n\treturn j.sel(selector, value);\n }"
] | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Create paymentUrl
@param PaymentRequestInterface $payment
@return string | [
"public function createPaymentUrl(PaymentRequestInterface $payment)\n {\n $params = $payment->toArray();\n $params = array_merge($params, array(\n 'alias' => $this->alias,\n 'mac' => $this->calculateMac($payment)\n ));\n\n return sprintf('%s?%s', $this->endpoin... | [
"@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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Delete a learning plan template
@param int $id The learning plan template id
@param boolean $deleteplans True to delete the plans associated to template or false to unlink them
@return boolean | [
"public static function delete_template($id, $deleteplans = true) {\n $params = self::validate_parameters(self::delete_template_parameters(), array(\n 'id' => $id,\n 'deleteplans' => $deleteplans,\n ));\n\n $template = api::read_template($params['id']);\n self::vali... | [
"public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// GenericSymbol draws the symbol defined by style at (x,y). | [
"func GenericSymbol(bg BasicGraphics, x, y int, style Style) {\n\tf := style.SymbolSize\n\tif f == 0 {\n\t\tf = 1\n\t}\n\tif style.LineWidth <= 0 {\n\t\tstyle.LineWidth = 1\n\t}\n\n\tif style.SymbolColor == nil {\n\t\tstyle.SymbolColor = style.LineColor\n\t\tif style.SymbolColor == nil {\n\t\t\tstyle.SymbolColor = ... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Helper function for shell commands (to be used by grunt.utils.async lib) | [
"function run(cmd) {\n return function (callback, options) {\n grunt.verbose.or.ok(\"Executing \" + cmd);\n exec(cmd, options || {}, function (error, stdout, stderr) {\n if (error) {\n grunt.fatal(\"'\" + cmd + \"' failed with :\" + stderr);\n ... | [
"function() {\n if (options.servePacked) {\n ss.bundler.forEach(function(bundler) {\n bundler.useLatestsPackedId();\n });\n }\n ss.bundler.load();\n //TODO convert options.dirs to relative paths stripping the lead '/' if present\n\n // Cache instances of code formatte... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// resolvePath
// Return Pathfound, Extension found, or an error
// It will search base on path then extension | [
"func (s *Sprocket) resolvePath(assetPath string, baseDir string, forceRebuild bool) (string, *types.ExtensionInfo, error) {\n\tvar err error\n\text := filepath.Ext(assetPath)\n\textInfo := s.getExtensionInfoOrDefault(ext)\n\tif forceRebuild == false {\n\t\tassetPublicPath, _ := s.checkPublicPath(assetPath, baseDir... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Send delivers to all subscribed channels simultaneously.
// It returns the number of subscribers that the value was sent to. | [
"func (f *Feed) Send(value interface{}) (nsent int) {\n\trvalue := reflect.ValueOf(value)\n\n\tf.once.Do(f.init)\n\t<-f.sendLock\n\n\t// Add new cases from the inbox after taking the send lock.\n\tf.mu.Lock()\n\tf.sendCases = append(f.sendCases, f.inbox...)\n\tf.inbox = nil\n\n\tif !f.typecheck(rvalue.Type()) {\n\t... | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github summarization about Messaging:",
"pos": "Represent the Github code about Messaging:",
"neg": "Represent the Github code about File management:"
} |
Parse the arguments, and pass the config object on to run. | [
"def main(args=sys.argv):\n \"\"\"\"\"\"\n # Don't make changes to sys.argv\n args = list(args)\n\n # Remove arg[0]\n args.pop(0)\n\n # Pop off the options\n clear_opt = False\n if '-c' in args:\n args.remove('-c')\n clear_opt = True\n elif '--clear' in args:\n args.r... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
获取ZK prefix
@return | [
"@NoAuth\n @RequestMapping(value = \"/prefix\", method = RequestMethod.GET)\n @ResponseBody\n public ValueVo getPrefixUrl() {\n\n ValueVo confItemVo = new ValueVo();\n confItemVo.setStatus(Constants.OK);\n confItemVo.setValue(zooConfig.getZookeeperUrlPrefix());\n\n return confIt... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Indent a value by `n` `character`s
:param value: string to indent
:param n: number of characters to indent by
:param character: character to indent with | [
"def indent(value, n=2, character=' '):\n \n\n prefix = n * character\n return '\\n'.join(prefix + line for line in value.splitlines())"
] | [
"def l_sa_check(template, literal, is_standalone):\n \"\"\"\"\"\"\n\n # If there is a newline, or the previous tag was a standalone\n if literal.find('\\n') != -1 or is_standalone:\n padding = literal.split('\\n')[-1]\n\n # If all the characters since the last newline are spaces\n if p... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
The tty-table gem is normally used to output tabular data. This method accepts a Table
object as used by the tty-table gem, and generates CSV output. It returns a string
with crlf encoding | [
"def render_csv(t)\n io = StringIO.new\n io.puts (\n t.header.collect do |v|\n v ? \"\\\"#{v.to_s.gsub(/\"/, '\"\"')}\\\"\" : \"\"\n end.join(',')\n ) unless @options[:plain]\n t.each do |row|\n next if row === t.header\n io.puts (\n row.collect do |... | [
"def reify_from_row(row)\n #the tap method allows preconfigured methods and values to\n #be associated with the instance during instantiation while also automatically returning\n #the object after its creation is concluded.\n self.new.tap do |card|\n self.attributes.keys.each.with_index d... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Tries to get the Authorization Token in this order:
1. Header: X-Authorization
2. GET "token"
3. POST "token"
@throws HTTPException 401 If token is not found
@return string | [
"protected function getAuthToken()\n {\n $token = $this->request->getHeader('X_AUTHORIZATION');\n if (!$token) {\n $request = $this->getDI()->get('request');\n $token = $request->getQuery('token') ?: $request->getPost('token');\n }\n\n $token = trim(str_ireplace(... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
/*
Add element - DATE
@param string Name of element
@param string Element label
@param array Custom element configuration overrides (optional)
@return void | [
"protected function addElement_date ($name, $label, $customElementConfig=array())\n {\n $defaultElementConfig = array(\n 'name' => $name,\n 'attributes' => array(\n 'id' => $name,\n ),\n 'options' => array(\n 'label... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
生成线条、雪花
@param int $level | [
"protected function createLine($level = 1) {\n //线条\n for ($i = 0; $i < 6; $i ++) {\n imageline(\n $this->image,\n mt_rand(0, $this->width),\n mt_rand(0, $this->height),\n mt_rand(0, $this->width),\n mt_rand(0, $this... | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Finds the given Django management command and default options,
excluding this command, and calls it with the given arguments
and override options. | [
"def call_command(self, name, *arguments, **options):\n \n command, defaults = get_command_and_defaults(\n name,\n exclude_packages=self.get_exclude_packages(),\n exclude_command_class=self.__class__)\n if command is None:\n raise management.CommandEr... | [
"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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// AuthorizationV1beta1 mocks base method | [
"func (m *MockInterface) AuthorizationV1beta1() v1beta12.AuthorizationV1beta1Interface {\n\tret := m.ctrl.Call(m, \"AuthorizationV1beta1\")\n\tret0, _ := ret[0].(v1beta12.AuthorizationV1beta1Interface)\n\treturn ret0\n}"
] | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*!
\private
\return The unicode values for the data entry \a $data. | [
"function extractUnicodeValues( $data )\n {\n $type = $data['type'];\n if ( $type == 'string' )\n {\n return $this->ISOUnicodeCodec->convertString( $data['value'] );\n }\n else if ( $type == 'ascii' )\n {\n return array( $data['value'] );\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 post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
Finds the first cell matching the query.
:param query: A literal string to match or compiled regular expression.
:type query: str, :py:class:`re.RegexObject` | [
"def find(self, query):\n \n try:\n return self._finder(finditem, query)\n except StopIteration:\n raise CellNotFound(query)"
] | [
"def compile_replace(pattern, repl, flags=0):\n \"\"\"\"\"\"\n\n call = None\n if pattern is not None and isinstance(pattern, _RE_TYPE):\n if isinstance(repl, (str, bytes)):\n if not (pattern.flags & DEBUG):\n call = _cached_replace_compile(pattern, repl, flags, type(repl))... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Replies a byte at the specified offset.
@param offset is the position of the byte to read.
@return the byte.
@throws IOException in case of problems | [
"public byte read(int offset) throws IOException {\n\t\tif (ensureBuffer(offset, 1) > 0) {\n\t\t\tthis.pos = offset + 1;\n\t\t\treturn this.buffer[offset];\n\t\t}\n\t\tthrow new EOFException();\n\t}"
] | [
"@Override\n public Message deserialize(ByteBuffer in) throws ProtocolException, IOException {\n // A Bitcoin protocol message has the following format.\n //\n // - 4 byte magic number: 0xfabfb5da for the testnet or\n // 0xf9beb4d9 for production\n //... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Execute query.
@param stmt
the statement
@param em
the entity manager
@return the list | [
"public List executeQuery(Statement stmt, EntityMetadata em)\n {\n N1qlQuery query = N1qlQuery.simple(stmt, N1qlParams.build().consistency(ScanConsistency.REQUEST_PLUS));\n N1qlQueryResult list = bucket.query(query);\n LOGGER.debug(\"Executed query : \" + query.toString() + \" on the \" + bu... | [
"public void open() throws DBException\n {\n if (this.isOpen())\n return; // Ignore if already open\n this.getRecord().handleInitialKey(); // Set up the smaller key\n this.getRecord().handleEndKey(); // Set up the larger key\n // You can't ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns true if the target widget is vertically scrolled into view.
@param minPixels the minimum number of pixels that must be visible to count as "in view". | [
"public static boolean isScrolledIntoView (Widget target, int minPixels)\n {\n int wtop = Window.getScrollTop(), wheight = Window.getClientHeight();\n int ttop = target.getAbsoluteTop();\n if (ttop > wtop) {\n return (wtop + wheight - ttop > minPixels);\n } else {\n ... | [
"function scrollOnePage(element, downward) {\n\n // Determine the item visible just at the edge of direction we're heading.\n // We'll select that item if it's not already selected.\n const scrollTarget = element.scrollTarget;\n const edge = scrollTarget.scrollTop + (downward ? scrollTarget.clientHeight : 0);\n... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// wrapCastFunction will wrap a cast if the targetTp is not equal to the arg's. | [
"func (a *aggregationEliminateChecker) wrapCastFunction(ctx sessionctx.Context, arg expression.Expression, targetTp *types.FieldType) expression.Expression {\n\tif arg.GetType() == targetTp {\n\t\treturn arg\n\t}\n\treturn expression.BuildCastFunction(ctx, arg, targetTp)\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Determine if an object is selected.
@param object the object
@return object is selected | [
"static boolean isSelected(IChemObject object, RendererModel model) {\n if (object.getProperty(StandardGenerator.HIGHLIGHT_COLOR) != null) return true;\n if (model.getSelection() != null) return model.getSelection().contains(object);\n return false;\n }"
] | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Several API calls are lumped under the 'action' API. This
is the generic handler for such calls. | [
"def action(self, item, action_type, body={}):\n \n uri = \"/%s/%s/action\" % (self.uri_base, utils.get_id(item))\n action_body = {action_type: body}\n return self.api.method_post(uri, body=action_body)"
] | [
"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 instruction about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code about Software development:"
} |
Register the decorator. If you want to extend the decorator you would basically copy
what this method does in start/global.php or your own service provider. | [
"public function registerDecorator()\n {\n $this->app->singleton('presenter.decorator', function ($app) {\n $decorator = new Decorator();\n\n // This isn't really doing anything here however if you want to extend the decorator\n // with your own instance then you need to d... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public void setFMName(String newFMName) {\n\t\tString oldFMName = fmName;\n\t\tfmName = newFMName;\n\t\tif (eNotificationRequired())\n\t\t\teNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.EFM__FM_NAME, oldFMName, fmName));\n\t}"
] | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the instruction about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
Sets the oid of this extension.
@param oid the oid of this extension. Cannot not null. | [
"public void setOid(String oid) {\n\tif (oid == null) {\n\t throw new IllegalArgumentException(i18n.getMessage(\"oidNull\"));\n\t}\n\tthis.oid = oid;\n }"
] | [
"def sanitize(self):\n '''\n \n '''\n super(MapRegisterMessage, self).sanitize()\n\n # P: This is the proxy-map-reply bit, when set to 1 an ETR sends a Map-\n # Register message requesting for the Map-Server to proxy Map-Reply.\n # The Map-Server will send non-author... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Provide custom validator for Bean Validation (JSR303)
@return ManagerFactoryBuilder
@see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#bean-validation" target="_blank">Bean validation</a> | [
"public T withBeanValidator(javax.validation.Validator validator) {\n if (validator != null) {\n configMap.put(BEAN_VALIDATION_VALIDATOR, validator);\n configMap.put(BEAN_VALIDATION_ENABLE, true);\n }\n return getThis();\n }"
] | [
"public static void generateJavadocGeneratedBy(Builder builder) {\n\t\tif (!BindDataSourceSubProcessor.JUNIT_TEST_MODE) {\n\t\t\tbuilder.addJavadoc(\"<p><strong>This class is generated by Kripton Annotation Processor - v. $L</strong></p>\\n\", Version.getVersion());\n\t\t\tbuilder.addJavadoc(\"<p><strong>Generation... | codesearchnet | {
"query": "Represent the Github description about Healthcare IT:",
"pos": "Represent the Github code about Healthcare IT:",
"neg": "Represent the Github code:"
} |
Task create a temporal task item
@param {Object} entry Options for entry {time, task} | [
"function Task(entry) {\n if (!(this instanceof Task)) {\n return new Task(entry);\n }\n\n this.called = 0;\n this.now = this.calledAt = hrTime();\n\n if (resolutionDivisor !== DEFAULT_RESOLUTION) {\n entry.time = ~~(entry.time * (DEFAULT_RESOLUTION / resolutionDivisor));\n }\n\n // Side table property... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// PrepareMux sets up the API | [
"func PrepareMux(flags *env.Flags) *web.Mux {\n\t// Set up a new logger\n\tlog := logrus.New()\n\n\t// Set the formatter depending on the passed flag's value\n\tif flags.LogFormatterType == \"text\" {\n\t\tlog.Formatter = &logrus.TextFormatter{\n\t\t\tForceColors: flags.ForceColors,\n\t\t}\n\t} else if flags.LogFor... | [
"@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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds the given argument to the method call. The list of arguments will be
initialized if it is <code>null</code>.
@param call
method call
@param arg
argument value | [
"public static void addArgument(MethodCallExpr call, Expression arg) {\n List<Expression> args = call.getArgs();\n if (args == null) {\n args = new ArrayList<Expression>();\n call.setArgs(args);\n }\n args.add(arg);\n }"
] | [
"void parameter(Object value) {\n // TODO check on supported types?\n if (value instanceof Observable)\n throw new IllegalArgumentException(\n \"use parameters() method not the parameter() method for an Observable\");\n parameters(Observable.just(value));\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.