query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Checks that a reference format exists and if not, raises a helpful exception
[ "def _cli_check_ref_format(fmt):\n ''''''\n\n if fmt is None:\n return None\n\n fmt = fmt.lower()\n if not fmt in api.get_reference_formats():\n errstr = \"Reference format '\" + fmt + \"' does not exist.\\n\"\n errstr += \"For a complete list of formats, use the 'bse list-ref-forma...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
获取JSSDK签名. @author Tian @date 2015-12-08 @return string
[ "public function getSignature()\n {\n /** @var int $timestamp */\n $timestamp = $this->getTimeStamp();\n $nonceStr = $this->getnonceStr();\n $ticket = $this->getTicket();\n\n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] ==...
[ "def _build_msg_content(self, msgtype='text', **kwargs):\n \n data = {'msgtype': msgtype}\n if msgtype == 'text':\n data[msgtype] = {'content': kwargs.get('content')}\n elif msgtype == 'image' or msgtype == 'voice' or msgtype == 'file':\n data[msgtype] = {'media_id'...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Parses a directory (will be then iteratively called for all subdirectories) or loads a file. @param options @param iterationInfo @returns {{}}
[ "function (options, iterationInfo) {\n var files;\n var modules = {};\n\n // check if the counter has reached the desired depth indicated in options.depth\n if (typeof options.depth !== 'undefined' &&\n iterationInfo.currentDepth >= options.depth) {\n return;\n ...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Create takes the representation of a podSecurityPolicySubjectReview and creates it. Returns the server's representation of the podSecurityPolicySubjectReview, and an error, if there is any.
[ "func (c *podSecurityPolicySubjectReviews) Create(podSecurityPolicySubjectReview *security.PodSecurityPolicySubjectReview) (result *security.PodSecurityPolicySubjectReview, err error) {\n\tresult = &security.PodSecurityPolicySubjectReview{}\n\terr = c.client.Post().\n\t\tNamespace(c.ns).\n\t\tResource(\"podsecurity...
[ "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 Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
GET /screenshots/diffs
[ "def diffs\n params[:sort] ||= \"image_file_size desc\"\n @diffs = UiChanged::Screenshot.search(params[:search]).not_in_ignored.where(:diff_found => true).paginate(:page => params[:page],\n :per_page => params[:per_page],\n ...
[ "public JSONObject find(HashMap<String, String> params) throws JSONException { \n return oClient.get(\"/profiles/v2/search/providers\", params);\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about text processing:" }
Return a object mapper instance @return ObjectMapper
[ "protected function mapper($alias = false)\n {\n return Manager::getInstance()->getMapper($alias ? $alias : $this->sMapperAlias);\n }" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
If we limit the number of backups we make, then clean out old ones older than block_id - backup_max_age (given in the constructor) This method does nothing otherwise. Return None on success Raise exception on error
[ "def clear_old_backups(self, block_id):\n \n assert self.setup, \"Not set up yet. Call .db_setup() first!\"\n\n if self.backup_max_age is None:\n # never delete backups\n return \n\n # find old backups \n backup_dir = config.get_backups_directory(self.impl, ...
[ "def time_to_run(self, class_, time_):\n \n app_name = class_.app_name\n try:\n info = self.job_state_database[app_name]\n except KeyError:\n if time_:\n h, m = [int(x) for x in time_.split(':')]\n # only run if this hour and minute is ...
codesearchnet
{ "query": "Represent the comment about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Sets the flat XML input source from which the {@link FlyWeightFlatXmlDataSet} is to be built @param xmlInputUrl The flat XML input as {@link URL} @return The created {@link FlyWeightFlatXmlDataSet} @throws DataSetException
[ "public FlyWeightFlatXmlDataSet build(URL xmlInputUrl) throws DataSetException {\n InputSource inputSource = createInputSourceFromUrl(xmlInputUrl);\n return buildInternal(inputSource);\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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Java programming:" }
Define javadoc for content uri. @param builder the builder @param method the method
[ "private void defineJavadocForContentUri(MethodSpec.Builder builder, SQLiteModelMethod method) {\n\t\tString contentUri = method.contentProviderUri().replace(\"*\", \"[*]\");\n\n\t\tclassBuilder.addJavadoc(\"<tr><td><pre>$L</pre></td><td>{@link $LImpl#$L}</td></tr>\\n\", contentUri, method.getParent().getName(), me...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Set the headers. @param ResponseInterface $response The response.
[ "protected function serveHeaders(ResponseInterface $response)\n {\n header_remove('X-Powered-By');\n foreach ($response->getHeaders() as $header => $values) {\n header($header . ': ' . array_shift($values), true);\n foreach ($values as $value) {\n header($header...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SuspectPeers makes the gossip instance validate identities of suspected peers, and close // any connections to peers with identities that are found invalid
[ "func (g *gossipServiceImpl) SuspectPeers(isSuspected api.PeerSuspector) {\n\tg.certStore.suspectPeers(isSuspected)\n}" ]
[ "func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
/* This method is used to get TutionRequestedYears data to Budget XMLObject from List of BudgetLineItem based on CostElement value of TUITION_COST_ELEMENTS
[ "private void setTutionRequestedYears(Budget budget) {\n ProposalDevelopmentBudgetExtContract budgetEx = s2SCommonBudgetService.getBudget(pdDoc.getDevelopmentProposal());\n\t\tif (budgetEx == null) {\n\t\t\treturn;\n\t\t}\n\t\tScaleTwoDecimal tutionTotal = ScaleTwoDecimal.ZERO;\n\t\tfor (BudgetPeriodContract...
[ "@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Unsets a cloned widget within this cell This is useful if you are deleting a row from an input row. @param integer replicator_id the replicator id of the cloned widget to unset. @see SwatTableViewInputRow::removeReplicatedRow()
[ "public function unsetWidget($replicator_id)\n {\n if (isset($this->widgets[$replicator_id])) {\n unset($this->widgets[$replicator_id]);\n }\n\n if (isset($this->clones[$replicator_id])) {\n unset($this->clones[$replicator_id]);\n }\n }" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param string $extension @return string
[ "protected function createTempFilePath($extension)\n {\n $tempDirectory = $this->getTempDirectory();\n $uniqueId = uniqid('phantom-pdf-', true);\n\n $filePath = sprintf(\n '%s/%s.%s',\n $tempDirectory,\n $uniqueId,\n $extension\n );\n\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Overloaded version of {@link #asTargetBy(String)} that uses the {@link org.hawkular.inventory.api.Relationships.WellKnown} as the name of the relationship. @param relationship the type of the relationship @return a new "related" filter instance
[ "public static Related asTargetBy(Relationships.WellKnown relationship) {\n return new Related(null, relationship.name(), EntityRole.TARGET);\n }" ]
[ "static WebServiceRef createWebServiceRefFromResource(Resource resource, Class<?> typeClass, String jndiName) throws InjectionException {\n // notice we send in 'Service.class' for the 'value' attribute, this is\n // because only service type injections are possible with the @Resource\n // anno...
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// Use templating to substitute in some info about the service. Important because // we won't know the actual Port that the container will bind to, for example.
[ "func (m *Monitor) templateCheckArgs(check *Check, svc *service.Service) string {\n\tfuncMap := template.FuncMap{\n\t\t\"tcp\": func(p int64) int64 { return svc.PortForServicePort(p, \"tcp\") },\n\t\t\"udp\": func(p int64) int64 { return svc.PortForServicePort(p, \"udp\") },\n\t\t\"host\": func() s...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Take in a pandas DataFrame, and return a list of columns that are in that DataFrame AND should be between 0 - 360 degrees.
[ "def get_degree_cols(df):\n \n vals = ['lon_w', 'lon_e', 'lat_lon_precision', 'pole_lon',\n 'paleolon', 'paleolon_sigma',\n 'lon', 'lon_sigma', 'vgp_lon', 'paleo_lon', 'paleo_lon_sigma',\n 'azimuth', 'azimuth_dec_correction', 'dir_dec',\n 'geographic_precision', 'be...
[ "def non_unique_bin_edges_error(func):\n \n message = \"\"\"\n\n An error occurred while computing bins/quantiles on the input provided.\n This usually happens when the input contains too many identical\n values and they span more than one quantile. The quantiles are choosen\n to have the same num...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Sets the storage profiler. Args: storage_profiler (StorageProfiler): storage profiler.
[ "def SetStorageProfiler(self, storage_profiler):\n \n self._storage_profiler = storage_profiler\n if self._storage_file:\n self._storage_file.SetStorageProfiler(storage_profiler)" ]
[ "def _call_custom_creator(self, config):\n \n creator = self._custom_creators[config['driver']](config)\n\n if isinstance(creator, Store):\n creator = self.repository(creator)\n\n if not isinstance(creator, Repository):\n raise RuntimeError('Custom creator should re...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// NewAuthorizer returns new authorizer using backends
[ "func NewAuthorizer(access services.Access, identity services.UserGetter, trust services.Trust) (Authorizer, error) {\n\tif access == nil {\n\t\treturn nil, trace.BadParameter(\"missing parameter access\")\n\t}\n\tif identity == nil {\n\t\treturn nil, trace.BadParameter(\"missing parameter identity\")\n\t}\n\tif tr...
[ "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 Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
{@inheritDoc} @see java.sql.ResultSet#updateClob(int, java.io.Reader, long)
[ "@Override\n\tpublic void updateClob(final int columnIndex, final Reader reader, final long length) throws SQLException {\n\t\twrapped.updateClob(columnIndex, reader, length);\n\t}" ]
[ "public java.sql.Date getDate(Map<String, Object> data, String name) {\n return get(data, name, java.sql.Date.class);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// Update updates a BuildConfig using the OpenShift client.
[ "func (c ClientBuildConfigClient) Update(buildConfig *buildv1.BuildConfig) error {\n\t_, err := c.Client.BuildV1().BuildConfigs(buildConfig.Namespace).Update(buildConfig)\n\treturn err\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Sets up webDriver to be used. @param aWebDriver web driver to use. @param defaultTimeout default timeout to wait, in seconds.
[ "public void setWebDriver(WebDriver aWebDriver, int defaultTimeout) {\n if (webDriver != null && !webDriver.equals(aWebDriver)) {\n webDriver.quit();\n }\n webDriver = aWebDriver;\n\n if (webDriver == null) {\n webDriverWait = null;\n } else {\n we...
[ "public void merge(StandaloneConfiguration other) {\n if (other == null) {\n return;\n }\n\n if (isMergeAble(Integer.class, other.browserTimeout, browserTimeout)) {\n browserTimeout = other.browserTimeout;\n }\n if (isMergeAble(Integer.class, other.jettyMaxThreads, jettyMaxThreads)) {\n ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Gets all of the Content Specification Unique Topic ID's that are used in the process. @return A List of Unique Topic ID's.
[ "protected List<String> getTopicIds() {\n LinkedList<String> topicIds = new LinkedList<String>();\n for (final Entry<String, SpecTopic> specTopicEntry : topics.entrySet()) {\n topicIds.add(specTopicEntry.getKey());\n }\n return topicIds;\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
This method will try to get the next file to be parsed. It will skip over directories if encountered. @param is @throws IOException
[ "private void getNextFile(final InputStream is) throws IOException {\n if (is instanceof java.util.zip.ZipInputStream) {\n ZipEntry ze = ((ZipInputStream) is).getNextEntry();\n while (ze != null && ze.isDirectory())\n ze = ((ZipInputStream) is).getNextEntry();\n }\n }" ]
[ "def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
Reads a packet from the socket. Prior to reading from the socket will check for availability of the connection. @param integer $length Number of bytes to read. @return string|boolean Data or `false` on error.
[ "protected function _read($length = null) {\n\t\tif (!$this->connected) {\n\t\t\t$message = 'No connection found while reading data from socket.';\n\t\t\tthrow new RuntimeException($message);\n\t\t}\n\t\tif ($length) {\n\t\t\tif (feof($this->_connection)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$data = stream_get_...
[ "async def send(self, request):\n \n body = bytes(request)\n msg_id = self._state._get_new_msg_id()\n await self._connection.send(\n struct.pack('<qqi', 0, msg_id, len(body)) + body\n )\n\n body = await self._connection.recv()\n if len(body) < 8:\n ...
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Computer Science:" }
// SetPolicyNames sets the PolicyNames field's value.
[ "func (s *ListRolePoliciesOutput) SetPolicyNames(v []*string) *ListRolePoliciesOutput {\n\ts.PolicyNames = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Sets the location of this software system. @param location a Location instance
[ "public void setLocation(Location location) {\n if (location != null) {\n this.location = location;\n } else {\n this.location = Location.Unspecified;\n }\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Check if some tracked fields have changed
[ "def _has_changed(instance):\n \n for field, value in instance._original_fields.items():\n if field != 'pk' and \\\n not isinstance(instance._meta.get_field(field), ManyToManyField):\n try:\n if field in getattr(instance, '_tracked_fields', []):\n ...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// SetField implements starlark.HasSetField.
[ "func (m *Message) SetField(name string, val starlark.Value) error {\n\tfd, ok := m.typ.fields[name]\n\tif !ok {\n\t\treturn fmt.Errorf(\"proto message %q has no field %q\", m.Type(), name)\n\t}\n\n\t// Setting a field to None removes it completely.\n\tif val == starlark.None {\n\t\tif err := m.checkMutable(); err ...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SubOptionMonitorSSHExtractor provides a way to specify metadata extractor for SSH monitors.
[ "func SubOptionMonitorSSHExtractor(extractor extractors.EventMetadataExtractor) LinuxMonitorOption {\n\treturn func(cfg *linuxmonitor.Config) {\n\t\tcfg.EventMetadataExtractor = extractor\n\t}\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Writing specifies the amount of time the motor will run when using the `run-timed` command. Reading returns the current value. Units are in milliseconds.
[ "def time_sp(self):\n \n self._time_sp, value = self.get_attr_int(self._time_sp, 'time_sp')\n return value" ]
[ "function startServo(timeOffset, timeInterval, angle)\n{\n // Start running this instance after timeOffset milliseconds\n setTimeout(function()\n {\n // run this instance every timeInterval milliseconds\n setInterval(function()\n {\n servo.setAngle(angle);\n conso...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Upgrade module @param string $module @param string $version @param array $options @throws \Exception
[ "public function upgrade($module, $version, array $options = null){\n \n /**\n * Fetch previous version for module\n */\n $oldVersion = $this->getModuleVersion($module);\n $oldVersion = new SoftwareVersion($oldVersion);\n \n if($oldVersion->isLt($version)){\n ...
[ "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Method to write a string to the FTP server @param string $remote FTP path to file to write to @param string $buffer Contents to write to the FTP server @return boolean True if successful @since 1.0
[ "public function write($remote, $buffer)\n\t{\n\t\t// Determine file type\n\t\t$mode = $this->_findMode($remote);\n\n\t\t// If native FTP support is enabled let's use it...\n\t\tif (FTP_NATIVE)\n\t\t{\n\t\t\t// Turn passive mode on\n\t\t\tif (@ftp_pasv($this->conn, true) === false)\n\t\t\t{\n\t\t\t\tLog::add(__METH...
[ "public function setOutputDestination(string $destination): PdfInterface\n {\n /**\n * Destinations can be sent to the following:\n * - I/B [Inline] - Sends output to browser (browser plug-in is used if avaialble)\n * If a $filename is given, the browser'...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Get the primary attribute name. For example, if "name.0" is given, "name.*" will be returned. @param string $attribute @return string
[ "protected function getPrimaryAttribute($attribute)\n {\n foreach ($this->implicitAttributes as $unparsed => $parsed) {\n if (in_array($attribute, $parsed)) {\n return $unparsed;\n }\n }\n\n return $attribute;\n }" ]
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Get the path info of an request, supporting sync and async requests. @param aRequest Source request. May be <code>null</code>. @return Empty string if request is <code>null</code> or a the path info.
[ "@Nonnull\n public static String getRequestPathInfo (@Nullable final HttpServletRequest aRequest)\n {\n String ret = null;\n if (aRequest != null)\n try\n {\n // They may return null!\n if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())\n ret = (String) aRequest...
[ "private void required(String attributeName, String attributValue) throws ApplicationException {\n\tif (StringUtil.isEmpty(attributValue))\n\t throw new ApplicationException(\"invalid attribute constellation for the tag zip\", \"attribute [\" + attributeName + \"] is required, if action is [\" + action + \"]\");...
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:" }
Make sure that both emotive and emotional records are actually able to express and/or receive emotions
[ "def ensure_valid_associated_record(association)\n value = send(association)\n predicate = :\"#{association}?\"\n\n if !value.class.respond_to?(predicate) || !value.class.send(predicate)\n errors.add association, I18n.t(:invalid, scope: [:errors, :messages])\n end\n end" ]
[ "func (rl *resignLeadership) Execute(state State) (*State, error) {\n\t// TODO(fwereade): this hits a lot of interestingly intersecting problems.\n\t//\n\t// 1) we can't yet create a sufficiently dumbed-down hook context for a\n\t// leader-deposed hook to run as specced. (This is the proximate issue,\n\t// an...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
==========================================================================
[ "public String[] get_attribute_alias_list(Database database, String wildcard)\n throws DevFailed {\n DeviceData argIn = new DeviceData();\n argIn.insert(wildcard);\n DeviceData argOut = command_inout(database, \"DbGetAttributeAliasList\", argIn);\n return argOut.extractStringA...
[ "def closeEvent(self, event):\n \n\n self.save_config(self.gui_settings['gui_settings'])\n self.script_thread.quit()\n self.read_probes.quit()\n event.accept()\n\n print('\\n\\n======================================================')\n print('================= Closin...
codesearchnet
{ "query": "Represent the instruction about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
Execute the console command.
[ "public function handle()\n {\n $this->processOptions();\n $this->checkIfSpatieMenuAlreadyInstalled();\n $this->installSpatieMenu();\n $this->publishSpatieMenu();\n $this->publishSpatieMenuConfig();\n }" ]
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *DeploymentTriggerPolicy) DeepCopyInto(out *DeploymentTriggerPolicy) {\n\t*out = *in\n\tif in.ImageChangeParams != nil {\n\t\tin, out := &in.ImageChangeParams, &out.ImageChangeParams\n\t\t*out = new(DeploymentTriggerImageChangeParams)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\treturn\n}" ]
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Takes a static snapshot of the page @param page @param ph @param {pageResultCallback} callback
[ "function takeSnapshot(page, ph, callback) {\n page.evaluate(function () {\n return document.documentElement.outerHTML;\n }, function (document) {\n if (document) {\n callback(null, page, ph, document);\n } else {\n callback('Nothing retrieved', page, ph, null);\n ...
[ "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 comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Gets the proxy factory. @param persistentClass the persistent class @param interfaces the interfaces @return the proxy factory @throws PersistenceException the persistence exception
[ "public static Class getProxyFactory(Class persistentClass, Class[] interfaces) throws PersistenceException\r\n {\r\n Enhancer e = new Enhancer();\r\n e.setSuperclass(interfaces.length == 1 ? persistentClass : null);\r\n e.setInterfaces(interfaces);\r\n e.setCallbackTypes(new Class[] ...
[ "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 Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
execute command by coroutine @param mixed $class @param string $method @param bool $server @param array $bindParams
[ "private function executeCommandByCoroutine($class, string $method, bool $server, $bindParams)\n {\n Coroutine::create(function () use ($class, $method, $server, $bindParams) {\n $this->beforeCommand(\\get_parent_class($class), $method, $server);\n PhpHelper::call([$class, $method], ...
[ "public function call($args = [])\n {\n if (count($args) == 0 || empty($args[2]))\n throw new NoticeException('Command \"'.$this->key.'\": Expecting a name.');\n\n $this->setName($args[2]);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Run MSMS on this structure and store the residue depths/ca depths in the corresponding ChainProp SeqRecords
[ "def get_msms_annotations(self, outdir, force_rerun=False):\n \n # Now can run on Biopython Model objects exclusively thanks to Biopython updates\n # if self.file_type != 'pdb':\n # raise ValueError('{}: unable to run MSMS with \"{}\" file type. Please change file type to \"pdb\"'.fo...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// timeRangesCoverEntries returns true if the time ranges fully cover the entries.
[ "func timeRangesCoverEntries(merger timeRangeMerger, entries []IndexEntry) (covers bool) {\n\tif len(entries) == 0 {\n\t\treturn true\n\t}\n\n\tmustCover := entries[0].MinTime\n\tts, ok := merger.Pop()\n\n\tfor len(entries) > 0 && ok {\n\t\tswitch {\n\t\t// If the tombstone does not include mustCover, we\n\t\t// kn...
[ "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:" }
// lostSinceLastTime returns the number of lost samples since the last call to // lostSinceLastTime(), the pipeLock must be held for writing.
[ "func (nm *NodeMonitor) lostSinceLastTime() uint64 {\n\tdelta := nm.lost - nm.lostLast\n\tnm.lostLast = nm.lost\n\treturn delta\n}" ]
[ "boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
@param ContainerInterface $container @return array @throws ContainerExceptionInterface @throws NotFoundExceptionInterface
[ "private function getSettings(ContainerInterface $container): array\n {\n $appConfig = null;\n\n /** @var CacheSettingsProviderInterface $settingsProvider */\n if ($container->has(CacheSettingsProviderInterface::class) === true &&\n ($settingsProvider = $container->get(CacheSettin...
[ "public function init(ModuleManagerInterface $manager)\n {\n if (!$manager instanceof ModuleManager) {\n $errMsg = sprintf('Module manager not implement %s', ModuleManager::class);\n throw new Exception\\InvalidArgumentException($errMsg);\n }\n\n /** @var ServiceLocator...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
绑定预处理参数 @param string|int $name @param mixed $value @param int $dataType @return static
[ "public function bindValue($name, $value, $dataType = \\PDO::PARAM_STR)\n {\n $this->binds[$name] = $value;\n return $this;\n }" ]
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the Github summarization about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code:" }
Read a hashed password from password. SHA* hash it once to match what we will get from the wire protocol and then hex encode it
[ "private static String extractPassword(String password, ClientAuthScheme scheme) {\n MessageDigest md = null;\n try {\n md = MessageDigest.getInstance(ClientAuthScheme.getDigestScheme(scheme));\n } catch (final NoSuchAlgorithmException e) {\n hostLog.l7dlog(Level.FATAL, Lo...
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Converts a Step into a JSON-encodable structure. @param Step $step @param array $options @return array
[ "public function serialize(Step $step, array $options = [])\n {\n $serialized = [\n 'id' => $step->getUuid(),\n 'parameters' => $this->serializeParameters($step),\n 'picking' => $this->serializePicking($step),\n 'items' => $this->serializeItems($step, $options),...
[ "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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Return the given amount of elements at random indices @param {[any[], number]} params @returns {any[]}
[ "function $rands(params) {\n if (\n Array.isArray(params) &&\n params.length === 2 &&\n Array.isArray(params[0]) &&\n typeof params[1] === 'number'\n ) {\n return Array(params[1])\n .fill()\n .map(() =>\n params[0].splice(\n ...
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Serialize given datetime to timestamp.
[ "def _serialize(self, value, attr, obj, **kwargs):\n \"\"\"\"\"\"\n if value is None:\n return None\n\n return int(datetime_to_timestamp(value))" ]
[ "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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Converts data from $value to $storageFieldValue. @param \eZ\Publish\SPI\Persistence\Content\FieldValue $value @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue $storageFieldValue
[ "public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue)\n {\n $storageFieldValue->dataInt = $value->data ? 1 : null;\n }" ]
[ "protected function getLimitationByIdentifier($identifier)\n {\n switch ($identifier) {\n case APILimitation::CONTENTTYPE:\n return new \\eZ\\Publish\\API\\Repository\\Values\\User\\Limitation\\ContentTypeLimitation();\n\n case APILimitation::LANGUAGE:\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
We deactivate the plugin and reset the configuration @param string $configClass The name of the plugin.
[ "public static function deactivatePlugin($configClass)\n {\n if (static::$plugins[$configClass][static::IS_ACTIVE] !== true) {\n // We will not purge everything for a already deactivated plugin.\n return;\n }\n\n // Purge all settings in the underlying registration clas...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Render the webbook_width dropdown. @param array $args
[ "function renderWebbookWidthField( $args ) {\n\t\tunset( $args['label_for'], $args['class'] );\n\t\t$this->renderSelect(\n\t\t\t[\n\t\t\t\t'id' => 'webbook_width',\n\t\t\t\t'name' => 'pressbooks_theme_options_' . $this->getSlug(),\n\t\t\t\t'option' => 'webbook_width',\n\t\t\t\t'value' => ( isset( $this->options['we...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetSchema sets the Schema field's value.
[ "func (s *GetMLModelOutput) SetSchema(v string) *GetMLModelOutput {\n\ts.Schema = &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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Parse 'sfx.py:percent' into {'suffix':'sfx', 'extension':'py', 'format_name':'percent'}
[ "def long_form_one_format(jupytext_format, metadata=None, update=None):\n \"\"\"\"\"\"\n if isinstance(jupytext_format, dict):\n if update:\n jupytext_format.update(update)\n return validate_one_format(jupytext_format)\n\n if not jupytext_format:\n return {}\n\n common_na...
[ "def configure(self, listener):\n \n listener.capture([{re.compile('^_.+'): {'source': {'space': self._event_space, 'id': self._source_id}}}])" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns an array of backups @return array
[ "protected function getListBackup()\n {\n $options = $this->query_filter;\n $options['limit'] = $this->data_limit;\n return $this->backup->getList($options);\n }" ]
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the post about database:", "pos": "Represent the code about database:", "neg": "Represent the code:" }
Append to the argument list the given argument values with the specified types. @param types the actual types to use, rather than getClass @param values the value(s) to append @return a new Binder
[ "public Binder append(Class<?>[] types, Object... values) {\n return new Binder(this, new Insert(type().parameterCount(), types, values));\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 sentence about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code about programming:" }
Register paths to be published by the publish command. @param array $paths @param string $group
[ "protected function publishes( array $paths, $group = null )\n\t{\n\t\t$class = static::class;\n\n\t\tif ( !array_key_exists( $class, static::$publishes ) )\n\t\t\tstatic::$publishes[$class] = [];\n\n\t\tstatic::$publishes[$class] = array_merge( static::$publishes[$class], $paths );\n\n\t\tif ( $group )\n\t\t{\n\t\...
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Show runs the show action.
[ "func (c *WorkItemBoardController) Show(ctx *app.ShowWorkItemBoardContext) error {\n\tvar board *workitem.Board\n\terr := application.Transactional(c.db, func(appl application.Application) error {\n\t\tb, err := appl.Boards().Load(ctx, ctx.BoardID)\n\t\tif err != nil {\n\t\t\treturn errs.WithStack(err)\n\t\t}\n\t\t...
[ "@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 post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Custom finder for distance. Options: - lat (required) - lng (required) - tableName - distance - sort @param \Cake\ORM\Query $query Query. @param array $options Array of options as described above @return \Cake\ORM\Query
[ "public function findDistance(Query $query, array $options) {\n\t\t$options += ['tableName' => null, 'sort' => true];\n\t\t$sql = $this->distanceExpr($options['lat'], $options['lng'], null, null, $options['tableName']);\n\n\t\tif ($query->autoFields() === null) {\n\t\t\t$query->autoFields(true);\n\t\t}\n\n\t\t$quer...
[ "public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerArgument('resultSet', SearchResultSet::class, 'The context searchResultSet', true);\n $this->registerArgument('document', SearchResult::class, 'The document to highlight', true);\n $this->regi...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Computer Science:" }
Adds one or more hashprefixes @param string[] $prefixes @param string $list
[ "public function addHashPrefixes($prefixes, $list)\n {\n $listdir=$this->getListStorageDir($list);\n if(!is_dir($listdir)){\n mkdir($listdir, 0777, true);\n }\n $new_prefixes=array_map('bin2hex',$prefixes);\n if(is_file($listdir.$this->prefixes_filename)){\n $existing_prefixes=explode(\"\\...
[ "def doc_uri(self, args, range=None):\n \"\"\"\"\"\"\n self.log.debug('doc_uri: in')\n self.send_at_position(\"DocUri\", False, \"point\")" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns all registered param converters. @return array An array of param converters
[ "public function all()\n {\n krsort($this->converters);\n\n $converters = [];\n foreach ($this->converters as $all) {\n $converters = array_merge($converters, $all);\n }\n\n return $converters;\n }" ]
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Succeed signals the lifecycle that work on this task has been completed, // and removes the task from the worker queue.
[ "func (t *Task) Succeed() error {\n\treturn t.guardResolution(func() error {\n\t\treturn t.lifecycle.Complete(t)\n\t})\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Get the date string for an attribute. @param attr the attribute @return the date
[ "protected final String getDate(final Attribute attr) {\n final GetDateVisitor visitor = new GetDateVisitor();\n attr.accept(visitor);\n return visitor.getDate();\n }" ]
[ "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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// ConfigureQorResource a method used to config Widget for qor admin
[ "func (widgetSetting *QorWidgetSetting) ConfigureQorResource(res resource.Resourcer) {\n\tif res, ok := res.(*admin.Resource); ok {\n\t\tres.Meta(&admin.Meta{Name: \"PreviewIcon\", Valuer: func(result interface{}, context *qor.Context) interface{} {\n\t\t\tif setting, ok := result.(QorWidgetSettingInterface); ok {\...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters.
[ "@Nonnull\n\tpublic static LDblToCharFunction dblToCharFunctionFrom(Consumer<LDblToCharFunctionBuilder> buildingFunction) {\n\t\tLDblToCharFunctionBuilder builder = new LDblToCharFunctionBuilder();\n\t\tbuildingFunction.accept(builder);\n\t\treturn builder.build();\n\t}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// validateUserIdentity validates that the user identity for a start task has been well specified // it should have a auto_user block or a user_name defined, but not both at the same time.
[ "func validateUserIdentity(userIdentity *batch.UserIdentity) error {\n\tif userIdentity == nil {\n\t\treturn errors.New(\"user_identity block needs to be specified\")\n\t}\n\n\tif userIdentity.AutoUser == nil && userIdentity.UserName == nil {\n\t\treturn errors.New(\"auto_user or user_name needs to be specified in ...
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* CACHE { uuid: { clientId: uuid parentClientId: uuid, instance: brix } } return { name: root, children: [ { name: moduleId + ',' + clientId, children: [ { name children } ] } ] }
[ "function tree() {\n var result = {\n name: 'root',\n children: []\n }\n\n function _parseChildren(parentClientId, children) {\n Util.each(CACHE, function(item) {\n if (item.parentClientId === parentClientId) {\n ...
[ "function exported (options) {\n var exp = arrayify(options.data.root).find(where({ '!kind': 'module', id: this.id }))\n return exp || this\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Parses <DerivedParameter> @param node: Node containing the <DerivedParameter> element @type node: xml.etree.Element
[ "def parse_derived_parameter(self, node):\n \n\n #if self.current_context.context_type != Context.COMPONENT_TYPE:\n # self.raise_error('Dynamics must be defined inside a ' +\n # 'component type')\n\n if 'name' in node.lattrib:\n name = node.lattri...
[ "def _MakeGroupFromRootSection(root_section, undefined_str):\n \n group = {}\n for statement in root_section.Statements():\n if isinstance(statement, six.string_types):\n continue\n func, args = statement\n # here the function acts as ID for the block type\n if func i...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// Add calls the custom Add function if defined
[ "func (f *FakeCustomStore) Add(obj interface{}) error {\n\tif f.AddFunc != nil {\n\t\treturn f.AddFunc(obj)\n\t}\n\treturn nil\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Get the number of parameters in the signature. @return the number of parameters
[ "public int getNumParameters() {\n int count = 0;\n for (Iterator<String> i = parameterSignatureIterator(); i.hasNext();) {\n i.next();\n ++count;\n }\n return count;\n }" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
[ "func (chr *chr_US) WeekdayAbbreviated(weekday time.Weekday) string {\n\treturn chr.daysAbbreviated[weekday]\n}" ]
[ "func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about datetime:" }
Gets Showtime Infos from a div. @param Crawler $resultDiv @return ShowtimeInfo
[ "private function parseShowtimeInfo(Crawler $resultDiv)\n {\n $showtimeSpans = $resultDiv->filter('.times')->first();\n\n return $this->parseShowtime($showtimeSpans);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Sets schedulers for API calls observables and adds logging. @param obs Observable to set schedulers for. @param log Logger instance. @param <E> Class of the service call result. @return Observable for API call.
[ "<E> Observable<E> wrapObservable(@NonNull Observable<E> obs, @NonNull Logger log, final String msg) {\n return obs.subscribeOn(Schedulers.io()).observeOn(Schedulers.io())\n .doOnNext(r -> log(log, (ComapiResult) r, msg))\n .doOnError(t -> log(log, t, msg));\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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Hparams for machine translation with ~1.1B parameters.
[ "def transformer_tpu_1b():\n \"\"\"\"\"\"\n hparams = transformer_tpu()\n hparams.hidden_size = 2048\n hparams.filter_size = 8192\n hparams.num_hidden_layers = 8\n # smaller batch size to avoid OOM\n hparams.batch_size = 1024\n hparams.activation_dtype = \"bfloat16\"\n hparams.weight_dtype = \"bfloat16\"\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetStatus sets the Status field's value.
[ "func (s *NodeSummary) SetStatus(v string) *NodeSummary {\n\ts.Status = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// NewSimpleTask returns a new *SimpleTask instance.
[ "func NewSimpleTask() *SimpleTask {\n\treturn &SimpleTask{\n\t\tch: make(chan *Update),\n\t\twg: new(sync.WaitGroup),\n\t}\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 Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Given a stream of bytes or text, if any of the items in the stream are bytes convert them to text. This function can be removed once we return text streams instead of byte streams.
[ "async def stream_as_text(stream):\n \n async for data in stream:\n if not isinstance(data, six.text_type):\n data = data.decode('utf-8', 'replace')\n yield data" ]
[ "def _read(self):\n \"\"\"\"\"\"\n with open(self.path, 'r') as file_handle:\n\n content = file_handle.read()\n\n # Py27 INI config parser chokes if the content provided is not unicode.\n # All other versions seems to work appropriately. Forcing the value to\n # unicode...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
{@inheritDoc} @see org.jboss.shrinkwrap.api.Archive#addHandlers(org.jboss.shrinkwrap.api.Filter, org.jboss.shrinkwrap.api.ArchiveEventHandler)
[ "@Override\n public T addHandlers(ArchiveEventHandler... handlers) {\n for (ArchiveEventHandler handler : handlers) {\n this.getArchive().addHandlers(handler);\n }\n return covarientReturn();\n }" ]
[ "protected InvokerExtensionProcessor getInvokerExtensionProcessor(com.ibm.ws.webcontainer.webapp.WebApp app)\n {\n return new com.ibm.ws.webcontainer.osgi.extension.InvokerExtensionProcessor(app, config.getInvokerAttributes());\n }" ]
codesearchnet
{ "query": "Represent the Github description about org.archive.wayback.resourceindex:", "pos": "Represent the Github code about org.archive.wayback.resourceindex:", "neg": "Represent the Github code about programming:" }
Parse the "@attribute" section of the ARFF file. @param br Input @param names List (to fill) of attribute names @param types List (to fill) of attribute types @throws IOException
[ "private void parseAttributeStatements(BufferedReader br, ArrayList<String> names, ArrayList<String> types) throws IOException {\n String line;\n // Load attribute metadata\n while(true) {\n line = br.readLine();\n if(line == null) {\n throw new AbortException(ARFF_HEADER_DATA + \" not fou...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the instruction about Data parsing:", "pos": "Represent the code about Data parsing:", "neg": "Represent the code:" }
Set the result of the future to the given exception. Args: exception (:exc:`Exception`): The exception raised.
[ "def set_exception(self, exception):\n \n # Sanity check: A future can only complete once.\n if self.done():\n raise RuntimeError(\"set_exception can only be called once.\")\n\n # Set the exception and trigger the future.\n self._exception = exception\n self._tri...
[ "def error(self):\n \"\"\"\"\"\"\n # Copy the error from any failed item to be the error for the whole\n # barrier. The first error seen \"wins\". Also handles the case where\n # the WorkItems passed into the barrier have already completed and\n # been marked with errors.\n ...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Natural Language Processing:" }
Reads the XER file table and row structure ready for processing. @param is input stream @throws MPXJException
[ "private void processFile(InputStream is) throws MPXJException\n {\n int line = 1;\n\n try\n {\n //\n // Test the header and extract the separator. If this is successful,\n // we reset the stream back as far as we can. The design of the\n // BufferedInputStream class...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Builds an INITIATE command, incrementing the passed nonce. // This executes on the client.
[ "func (c *initiateCommand) build(clientShortNonce shortNoncer,\n\tclientLongNonce *longNonce,\n\tcookie serverCookie,\n\tpermClientPrivkey permanentClientPrivkey,\n\tpermClientPubkey permanentClientPubkey,\n\tpermServerPubkey permanentServerPubkey,\n\tephServerPubkey ephemeralServerPubkey,\n\tephClientPrivkey ephem...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Comparison check @param mixed $value 検証する値 @param string $operator 演算子 @param array $options オプション @return bool 検証に合格した場合:true、検証に失敗した場合:false
[ "public static function Comparison ($value, $operator, $operand, $options) {\n\t\t$converter = static::GetConverter($options['type'] ?? null);\n\t\tif (is_callable($converter)) {\n\t\t\t$value\t\t= $converter($value);\n\t\t\t$operand\t= $converter($operand);\n\t\t}\n\n \t\tif (is_object($value) && is_callable($valu...
[ "public function setMetadata(array $metadata)\n {\n $this->metadata = $this->validator->parseMetadata(array_filter($metadata, function ($field): bool {\n // 文字列型以外の (明らかに構文解析済みである) フィールドは構文解析器にかけない\n return is_string($field);\n })) + $metadata;\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
The current section the site is in. This can be one or more values. Think of it like a server-side css-class. @since 2.1 @param string $Section The name of the section @param string $Method One of: - add - remove - set - get
[ "public static function Section($Section, $Method = 'add') {\n $Section = array_fill_keys((array)$Section, TRUE);\n \n \n switch (strtolower($Method)) {\n case 'add':\n self::$_Section = array_merge(self::$_Section, $Section);\n break;\n case 'remove':\n ...
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Container returns the name of the container whose cgroup will be used.
[ "func (c CgroupSpec) Container() string {\n\tparts := strings.SplitN(string(c), \":\", 2)\n\tif len(parts) > 1 {\n\t\treturn parts[1]\n\t}\n\treturn \"\"\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Repository log @museDescription Shows the past and pending changelog for the repository @return void
[ "public function log()\n\t{\n\t\t$mode = $this->output->getMode();\n\t\t$length = ($this->arguments->getOpt('length')) ? (int)$this->arguments->getOpt('length') : 20;\n\t\t$start = ($this->arguments->getOpt('start')) ? (int)$this->arguments->getOpt('start') : null;\n\t\t$upcoming = $this->arguments->ge...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// NewConversation constructs a server-side authentication conversation. // Conversations cannot be reused, so this must be called for each new // authentication attempt.
[ "func (s *Server) NewConversation() *ServerConversation {\n\ts.RLock()\n\tdefer s.RUnlock()\n\treturn &ServerConversation{\n\t\tnonceGen: s.nonceGen,\n\t\thashGen: s.hashGen,\n\t\tcredentialCB: s.credentialCB,\n\t}\n}" ]
[ "func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
<p> The Amazon VPC prefixes to advertise to the Direct Connect gateway. </p> @param allowedPrefixesToDirectConnectGateway The Amazon VPC prefixes to advertise to the Direct Connect gateway.
[ "public void setAllowedPrefixesToDirectConnectGateway(java.util.Collection<RouteFilterPrefix> allowedPrefixesToDirectConnectGateway) {\n if (allowedPrefixesToDirectConnectGateway == null) {\n this.allowedPrefixesToDirectConnectGateway = null;\n return;\n }\n\n this.allowed...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Run validation on the generated WDL output using wdltool.
[ "def _validate(wdl_file):\n \n start_dir = os.getcwd()\n os.chdir(os.path.dirname(wdl_file))\n print(\"Validating\", wdl_file)\n subprocess.check_call([\"wdltool\", \"validate\", wdl_file])\n os.chdir(start_dir)" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Landing page @return Void
[ "public function adminAction() {\n $ini = Zend_Registry::get('config');\n $pageTitle = 'Garp CMS';\n if (!empty($ini->app->name)) {\n $pageTitle .= ' | ' . $ini->app->name;\n }\n\n $this->view->imagesCdn = $this->view->assetUrl('') . $ini->cdn->path->upload->image . '/'...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
@param string $field @param mixed $value @return self
[ "public function filterGte(string $field, $value): self\n {\n $this->filters[] = new IndexQueryFilter($field, IndexQueryFilterOperator::GREATER_THAN_OR_EQUAL_TO(), $value);\n return $this;\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 text about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code:" }
Takes a signed transaction hex binary (and coin_symbol) and decodes it to JSON. Does NOT broadcast the transaction to the bitcoin network. Especially useful for testing/debugging and sanity checking
[ "def decodetx(tx_hex, coin_symbol='btc', api_key=None):\n '''\n \n '''\n\n assert is_valid_coin_symbol(coin_symbol)\n assert api_key, 'api_key required'\n\n url = make_url(coin_symbol, **dict(txs='decode'))\n\n params = {'token': api_key}\n data = {\n 'tx': tx_hex,\n 'token': a...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Convert a color defined in hexvalues to corresponding dezimal values @access private @param string $hex color value in hexformat (e.g. '#FF0000') @return array associative array with color values in dezimal format (fields: 'red', 'green', 'blue')
[ "function _hexToDecColor($hex)\n {\n $length = strlen($hex);\n $color['red'] = hexdec(substr($hex, $length - 6, 2));\n $color['green'] = hexdec(substr($hex, $length - 4, 2));\n $color['blue'] = hexdec(substr($hex, $length - 2, 2));\n return $color;\n }" ]
[ "def invert(color):\n \n if isinstance(color, Number):\n # invert(n) and invert(n%) are CSS3 filters and should be left\n # intact\n return String.unquoted(\"invert(%s)\" % (color.render(),))\n\n expect_type(color, Color)\n r, g, b, a = color.rgba\n return Color.from_rgb(1 - r, 1...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
@param Collection $contentCollection @param array $params @return FacadeInterface
[ "public function transform($contentCollection, array $params = array())\n {\n $facade = $this->newFacade();\n\n foreach ($contentCollection as $content) {\n $facade->addContent($this->getContext()->transform('content', $content));\n }\n\n return $facade;\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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Execute the export This will return the results as a Cursor. The cursor can then be used to iterate the results. @throws Exception @return ExportCursor
[ "public function execute()\n {\n $data = [\n self::ENTRY_FLUSH => $this->_flush,\n self::ENTRY_COUNT => true\n ];\n\n if ($this->_batchSize > 0) {\n $data[self::ENTRY_BATCHSIZE] = $this->_batchSize;\n }\n\n if ($this->_limit > 0) {\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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Gets a specific propel (renamed) property from the build. @param string $name @return mixed
[ "public function getBuildProperty($name)\n {\n return isset($this->buildProperties[$name]) ? $this->buildProperties[$name] : null;\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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Compute a hash using NapiProjekt's algorithm. :param str video_path: path of the video. :return: the hash. :rtype: str
[ "def hash_napiprojekt(video_path):\n \n readsize = 1024 * 1024 * 10\n with open(video_path, 'rb') as f:\n data = f.read(readsize)\n return hashlib.md5(data).hexdigest()" ]
[ "def from_dict(raw_data):\n \"\"\"\"\"\"\n url = None\n width = None\n height = None\n try:\n url = raw_data['url']\n width = raw_data['width']\n height = raw_data['height']\n except KeyError:\n raise ValueError('Unexpected image ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Write writes a structure pointer to the Augeas tree
[ "func (n *Narcissus) Write(val interface{}) error {\n\tref, err := structRef(val)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid interface: %v\", err)\n\t}\n\n\terr = n.Autoload(ref)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to autoload file: %v\", err)\n\t}\n\n\tpath, err := getPath(ref)\n\tif err !=...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }