query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Returns the JavaScript statement to declare the scope declaration (eg. the list of
variables declared in the JavaScript function). | [
"CharSequence scopeDeclaration()\n\t{\n\t\tif (scopeVariables.length == 0)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\tStringBuilder scopeDeclaration = new StringBuilder();\n\t\tscopeDeclaration.append(scopeVariables[0]);\n\t\tfor (int i = 1; i < scopeVariables.length; i++)\n\t\t{\n\t\t\tscopeDeclaration.append(\", \");... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
matching item
item can be ['class'] or ['class' => 'id'] or ['class' => {:foo => 1, :bar => 2}]
@private
@params string $string redis result in json
@params $items
@return (bool) | [
"private static function matchItem($string, $items)\n {\n $decoded = json_decode($string, true);\n\n foreach ($items as $key => $val) {\n # class name only ex: item[0] = ['class']\n if (is_numeric($key)) {\n if ($decoded['class'] == $val) {\n ... | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
@param NotificationInterface $notification
@return NotificationHandlerInterface[] | [
"private function getHandlersFor(NotificationInterface $notification): array\n {\n $handlers = [];\n foreach ($this->notificationHandlers as $notificationHandler) {\n if ($notificationHandler->supports($notification)) {\n $handlers[] = $notificationHandler;\n }\... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Gets upload path in this format: {MODEL_NAME}/{SAFE_UPLOADED_FILENAME}{SUFFIX}.
:param instance: Instance of model or model class.
:param filename: Uploaded file name.
:return: Target upload path. | [
"def auto_cleaned_path(instance, filename: str) -> str:\n \n stem, suffix = parse_filename(filename)\n base_dir = get_base_dir_from_object(instance)\n target_filename = get_safe_path_name(stem)\n\n return os.path.join(base_dir, \"{target_filename}{suffix}\".format(target_filename=target_filename,\n ... | [
"def fix_config(self, options):\n \n options = super(CombineStorage, self).fix_config(options)\n\n opt = \"format\"\n if opt not in options:\n options[opt] = \"\"\n if opt not in self.help:\n self.help[opt] = \"The format to use for generating the combined st... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Adds file to a job synchronously.
@param $jobId
@param AddFileToJobParameters $parameters
@throws SmartlingApiException | [
"public function addFileToJobSync($jobId, AddFileToJobParameters $parameters)\n {\n $endpoint = vsprintf('jobs/%s/file/add', [$jobId]);\n $requestData = $this->getDefaultRequestData('json', $parameters->exportToArray());\n $this->wait($this->sendRequest($endpoint, $requestData, self::HTTP_ME... | [
"public function getFromId( $FileUploadId){\n $rest = $this->getService( self::API_UPLOAD . $FileUploadId);\n $rest->GET();\n\n return $rest->getResult( models\\FileSystem\\FileUpload::class);\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// Parses a string and returns it in proto buffer format. This method
// differs from Parse() in that it always populates the raw_input field of
// the protocol buffer with numberToParse as well as the country_code_source
// field. | [
"func ParseAndKeepRawInput(\n\tnumberToParse, defaultRegion string) (*PhoneNumber, error) {\n\tvar phoneNumber *PhoneNumber = &PhoneNumber{}\n\treturn phoneNumber, ParseAndKeepRawInputToNumber(\n\t\tnumberToParse, defaultRegion, phoneNumber)\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:"
} |
A post_save signal handler which sends a signal for each ``FileField`` that
was committed this save. | [
"def signal_committed_filefields(sender, instance, **kwargs):\n \n for field_name in getattr(instance, '_uncommitted_filefields', ()):\n fieldfile = getattr(instance, field_name)\n # Don't send the signal for deleted files.\n if fieldfile:\n signals.saved_file.send_robust(sende... | [
"def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):\n \n if self.delete_related:\n return super(AuditlogHistoryField, self).bulk_related_objects(objs, using)\n\n # When deleting, Collector.collect() finds related objects using this\n # method. However, because we d... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
//Returns the login landing page constant with the service name and state passed through as a query parameter.
//Note, the 'code' probably should not be passed through the client side code! | [
"func (self *SimplePageMapper) LoginLandingPage(conn OauthConnector, state string, code string) string {\n\tv := url.Values{\n\t\t\"service\": []string{conn.Name()},\n\t\t\"state\": []string{state},\n\t}\n\treturn fmt.Sprintf(\"%s?%s\", self.loginOk, v.Encode())\n}"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Language and programming:"
} |
// SetCreationTimeBefore sets the CreationTimeBefore field's value. | [
"func (s *ListTrainingJobsInput) SetCreationTimeBefore(v time.Time) *ListTrainingJobsInput {\n\ts.CreationTimeBefore = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
term : SUB factor
| ADD factor | [
"def p_factor_unary_operators(self, p):\n \n\n p[0] = p[2]\n if p[1] == '-':\n p[0] = Instruction('-x', context={'x': p[0]})"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Reload the current step from the supplied record.
@param stdClass $record The step record to be loaded.
@param boolean $clean Clean the values.
@return step | [
"protected function reload_from_record($record, $clean = false) {\n $this->id = $record->id;\n $this->tourid = $record->tourid;\n if ($clean) {\n $this->title = clean_param($record->title, PARAM_TEXT);\n $this->content = clean_text($record->content);\n ... | [
"public static function current()\n {\n if (static::$_current === null) {\n if ($token = AuthToken::current()) {\n //\n // TODO: (known bug)\n // When accessing $token->auth inside an observer other than `auth`,\n // the table name of ... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Returns the <code>expiration-cache</code> element
@return the node defined for the element <code>expiration-cache</code> | [
"public Integer getExpirationCache()\n {\n if (childNode.getTextValueForPatternName(\"expiration-cache\") != null && !childNode.getTextValueForPatternName(\"expiration-cache\").equals(\"null\")) {\n return Integer.valueOf(childNode.getTextValueForPatternName(\"expiration-cache\"));\n }\n re... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// NewGetHello creates a new http.Handler for the get hello operation | [
"func NewGetHello(ctx *middleware.Context, handler GetHelloHandler) *GetHello {\n\treturn &GetHello{Context: ctx, Handler: handler}\n}"
] | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// VideoInit initializes the video subsystem, optionally specifying a video driver.
// (https://wiki.libsdl.org/SDL_VideoInit) | [
"func VideoInit(driverName string) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_VideoInit(C.CString(driverName))))\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
UTF-8 aware alternative to ucwords
Uppercase the first character of each word in a string
@param string $str String to be processed
@return string String with first char of each word uppercase
@see http://www.php.net/ucwords
@since 2.0 | [
"public static function ucwords($str, $encoding = null)\n {\n $encoding = $encoding === null ? mb_internal_encoding() : $encoding;\n\n // Note: [\\x0c\\x09\\x0b\\x0a\\x0d\\x20] matches;\n // form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns\n // This correspon... | [
"public function normalizeRules($rules)\n {\n // If you want to use a pipe in a regex, custom message etc,\n // single-quote the string (escaping would be too confusing in regexes):\n //\n // This works with:\n //\n // 'foo?\\'my piped | string\\''\n // \"foo?'my ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Encodes a int value to the byte array.
@param target The byte array to encode to.
@param idx The starting index in the byte array.
@param value The value to encode. | [
"public static void int2(byte[] target, int idx, int value) {\n target[idx + 0] = (byte) (value >>> 8);\n target[idx + 1] = (byte) value;\n }"
] | [
"public void call(String method, Object[] args)\n throws IOException\n {\n int length = args != null ? args.length : 0;\n\n startCall(method, length);\n\n for (int i = 0; i < length; i++)\n writeObject(args[i]);\n\n completeCall();\n }\n\n /**\n * Starts th... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about writing:"
} |
Create default thumbnail
@param array $routes see routes in module config | [
"public function createDefaultThumb(array $routes)\n {\n $originalFile = pathinfo($this->url);\n $dirname = $originalFile['dirname'];\n $filename = $originalFile['filename'];\n $extension = $originalFile['extension'];\n\n Image::$driver = [Image::DRIVER_GD2, Image::DRIVER_GMAGI... | [
"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:"
} |
Unregisters specified handler.
@param id Handler ID
@return Handler, or null if none
@see #register | [
"public static ConnectionHandler unregister(final String id) {\n if (id == null || id.length() == 0) {\n return null; // Not possible\n } // end of if\n\n return handlers.remove(id);\n }"
] | [
"public DeviceData command_inout(TacoTangoDevice tacoDevice, String command, DeviceData argin) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about N/A:"
} |
retrieve a subject based on a token. Valid means we return a participant
invalid means we return None | [
"def validate_token(self, token):\n '''\n '''\n from expfactory.database.models import Participant\n p = Participant.query.filter(Participant.token == token).first()\n if p is not None:\n if p.token.endswith(('finished','revoked')):\n p = None\n else:\n p = p.id\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Performs the folding and unfolding of code regions.
@param {CodeMirror} cm the CodeMirror instance
@param {number| Object} pos | [
"function doFold(cm, pos, options, force) {\n options = options || {};\n force = force || \"fold\";\n if (typeof pos === \"number\") {\n pos = CodeMirror.Pos(pos, 0);\n }\n\n var finder = options.rangeFinder || CodeMirror.fold.auto,\n range,\n widg... | [
"public Selector resolve(Identifier id, PositionAssigner positionAssigner) {\n positionAssigner.assign(id);\n // set the selector domain into the identifier\n id.setSelectorDomain(selectorDomain.toInt());\n return id;\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates an empty mutable {@link TreeSet} instance.
@param comparator
the comparator that should be used. May be <code>null</code> which indicates that the natural ordering
of the items should be used.
@return a new {@link TreeSet}
@since 2.13 | [
"@Pure\n\tpublic static <T> TreeSet<T> newTreeSet(Comparator<? super T> comparator) {\n\t\treturn new TreeSet<T>(comparator);\n\t}"
] | [
"@Override\n public void putAll(Map<? extends K, ? extends V> m) {\n\tfor (Map.Entry<? extends K, ? extends V> e: m.entrySet())\n\t put(e.getKey(), e.getValue());\n }\n\n /**\n * Removes the key (and its corresponding value) from this map. This method does nothing if the key\n * is not in the ma... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sets the param to return videos of a specific format
@param string $value
@return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface | [
"public function setFormat($value = null)\n {\n if ($value != null) {\n $this->_params['format'] = $value;\n } else {\n unset($this->_params['format']);\n }\n return $this;\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 PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Software development:"
} |
Fetch POST data
Get login by cookie
Get Ip
If check parameters is true, check mandatory parameters
@param bool $check
@return array
@throws \common_exception_MissingParameter | [
"protected function getData($check = false)\n {\n $data = $this->getParameters();\n\n if ($this->hasRequestParameter('type')) {\n $type = $this->getRequestParameter('type');\n unset($data['type']);\n\n if ($type !== 'custom_input') {\n foreach ($data ... | [
"public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
创建适配器
@param string $adapter
@param array $config
@return \One\FileSystem\Contracts\Adapter
@throws \RuntimeException | [
"protected function createAdapter(string $adapter, array $config): Adapter\n {\n if ($adapter === 'Local') {\n if (! isset($config['config']['path'])) {\n throw new RuntimeException('Filesystem local adapter must set `path`');\n }\n\n $config = [$config['con... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Private: parses the values of a TopDoc comment.
* `node` {Object} PostCSS node.
* `regex` {RegExp} used to identify TopDoc comments.
* `includeNodes` {Boolean} will include the nodes in the component if true.
Returns {Object} Component | [
"function _parseTopdocComment(node, regex, includeNodes) {\n const content = node.text.replace(regex, '');\n const component = new TopComponent(yaml.safeLoad(content));\n if (includeNodes) component.nodes = [];\n component.commentStart = node.source.start;\n component.commentEnd = node.source.end;\n component... | [
"function getSyntacticAutoCompleteSuggestions(input, startRule = 'prog') {\n const lexResult = JDLLexer.tokenize(input);\n\n // \".input\" is a setter which will reset the parser's internal state.\n parserSingleton.input = lexResult.tokens;\n\n const syntacticSuggestions = parserSingleton.computeContentAssist(s... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Finds the only path from the start node. If there is more than one,
raises ValueError. | [
"def only_path(self):\n \"\"\"\"\"\"\n start = [v for v in self.nodes if self.nodes[v].get('start', False)]\n if len(start) != 1: \n raise ValueError(\"graph does not have exactly one start node\")\n\n path = []\n [v] = start\n while True:\n path.appen... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// NewWebService creates a new restful webservice with the api installer's prefix and version. | [
"func (a *MetricsAPIInstaller) NewWebService() *restful.WebService {\n\tws := new(restful.WebService)\n\tws.Path(a.prefix)\n\t// a.prefix contains \"prefix/group/version\"\n\tws.Doc(\"API at \" + a.prefix)\n\t// Backwards compatibility, we accepted objects with empty content-type at V1.\n\t// If we stop using go-re... | [
"@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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Write part header
@param name
@param filename
@param contentType
@return this request
@throws java.io.IOException | [
"protected OkRequest<T> writePartHeader(final String name,\n final String filename, final String contentType) throws IOException {\n final StringBuilder partBuffer = new StringBuilder();\n partBuffer.append(\"form-data; name=\\\"\").append(name);\n if (... | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Check if the passed node is a file JS node after unwrapping.
@param aNode
The node to be checked - may be <code>null</code>.
@return <code>true</code> if the node implements {@link HCScriptFile}. | [
"public static boolean isJSFileNode (@Nullable final IHCNode aNode)\n {\n final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode);\n return isDirectJSFileNode (aUnwrappedNode);\n }"
] | [
"function checkDefined(key) {\n //noinspection JSPotentiallyInvalidUsageOfThis\n if (! data[`${this.moduleName}.${key}`] && typeof parent.get(key) !== 'undefined' && ! util.squelch()) {\n // Not allowing sub-modules to name variables already defined in the parent (unless using o... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Get articles tags per page
:param article_id: the article id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"def get_tags_of_article_per_page(self, article_id, per_page=1000, page=1):\n \n return self._get_resource_per_page(\n resource=ARTICLE_TAGS,\n per_page=per_page,\n page=page,\n params={'article_id': article_id},\n )"
] | [
"def return_item_count_on_page(self, page=1, total_items=1):\n \n up_to_page = ((page - 1) * self.page_items)\n # Number of items up to the page in question\n\n if total_items > up_to_page:\n # Remove all the items up to the page in question\n #\n cou... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Allows you to attach one TCP and one HTTP service
deprecated:: 2.1.73 use http and tcp specific methods
:param service: A trellio TCP or HTTP service that needs to be hosted | [
"def attach_service(cls, service):\n \n if isinstance(service, HTTPService):\n cls._http_service = service\n elif isinstance(service, TCPService):\n cls._tcp_service = service\n else:\n cls._logger.error('Invalid argument attached as service')\n cl... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Sets a new buffered value and turns this BufferedValueModel into
the buffering state. The buffered value is not provided to the
underlying model until the trigger channel indicates a commit.
@param value the value to be buffered | [
"public void setValue(Object value) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"Setting buffered value to '\" + value + \"'\");\n }\n final Object oldValue = getValue();\n this.bufferedValue = value;\n updateBuffering();\n fireValueChange(oldValue, buffer... | [
"@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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
urispec : schemeAuthorityAndPath (QMARK! query?)? (POUND! fragment_?)?; | [
"@Override\n\tpublic T visitUrispec(UrispecContext ctx) {\n\t\t//on(ctx);\n\t\tappendAst(ctx, tok(URI_SPEC));\n\t\treturn super.visitUrispec(ctx);\n\t}"
] | [
"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 Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Ensure that the given formula is installed.
@param string $formula
@param array $options
@param array $taps
@return void | [
"function ensureInstalled($formula, $options = [], $taps = [])\n {\n if (! $this->installed($formula)) {\n $this->installOrFail($formula, $options, $taps);\n }\n }"
] | [
"public function setMustPass($ref)\n {\n if (null!==$this->getMask($ref)) {\n $this->must_pass = $ref;\n } else {\n throw new \\Exception(sprintf(\"Unknown standard [%s] in Hostname validation!\", $ref));\n }\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Converts the limit angle of the PyPot JSON file to the internal format | [
"def _convert_angle_limit(angle, joint, **kwargs):\n \"\"\"\"\"\"\n angle_pypot = angle\n\n # No need to take care of orientation\n if joint[\"orientation\"] == \"indirect\":\n angle_pypot = 1 * angle_pypot\n\n # angle_pypot = angle_pypot + offset\n\n return angle_pypot * np.pi / 180"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<code>.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig replace_with_info_type_config = 7;
</code> | [
"public com.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig getReplaceWithInfoTypeConfig() {\n if (transformationCase_ == 7) {\n return (com.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig) transformation_;\n }\n return com.google.privacy.dlp.v2.ReplaceWithInfoTypeConfig.getDefaultInstance();\n }"
] | [
"def update(self, ignore_warnings=None):\n \n update_mask_pb = field_mask_pb2.FieldMask()\n\n if self.description is not None:\n update_mask_pb.paths.append(\"description\")\n\n if self.routing_policy_type == RoutingPolicyType.ANY:\n update_mask_pb.paths.append(\"mu... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Adds the edge with the given weight | [
"public void addEdge(DiEdge e, double w) {\n if (!getEdges().contains(e)) { \n super.addEdge(e);\n weights.put(e, w);\n }\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Filter to beliefs above a given threshold. | [
"def filter_belief():\n \"\"\"\"\"\"\n if request.method == 'OPTIONS':\n return {}\n response = request.body.read().decode('utf-8')\n body = json.loads(response)\n stmts_json = body.get('statements')\n belief_cutoff = body.get('belief_cutoff')\n if belief_cutoff is not None:\n bel... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Removes all non oauth parameters from a dict or a list of params. | [
"def filter_oauth_params(params):\n \"\"\"\"\"\"\n is_oauth = lambda kv: kv[0].startswith(\"oauth_\")\n if isinstance(params, dict):\n return list(filter(is_oauth, list(params.items())))\n else:\n return list(filter(is_oauth, params))"
] | [
"def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
eslint-disable-next-line mocha/prefer-arrow-callback | [
"function sendBadge(format, badgeData) {\n if (serverUnresponsive) {\n return\n }\n clearTimeout(serverResponsive)\n // Check for a change in the data.\n let dataHasChanged = false\n if (\n cached !== undefined &&\n cached.data.b... | [
"function es5Plugins(){\n return [\n require('babel-plugin-check-es2015-constants'),\n require('babel-plugin-transform-es2015-arrow-functions'),\n require('babel-plugin-transform-es2015-block-scoped-functions'),\n require('babel-plugin-transform-es2015-block-scoping'),\n require('babel-p... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param array $attributes
@param null|string $group
@return $this | [
"public function addMeta(array $attributes, $group = null)\n {\n $meta = '<meta'.(new Html())->attributes($attributes).' />';\n\n if (is_null($group)) {\n if (isset($attributes['name'])) {\n $group = $attributes['name'];\n } else {\n $group = str_... | [
"public function Field($properties = [])\n {\n Requirements::customCSS('.field.simpleguard { display: none !important; }');\n \n return DBField::create_field('HTMLFragment', $this->honeypot->Field() . $this->timestamp->Field());\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Run the migrations.
@return void | [
"public function up()\n {\n if (DB::connection()->getDriverName() != 'mysql') {\n return;\n }\n\n DB::connection()->getPdo()->exec(self::$PROCEDURE);\n }"
] | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the summarization about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about programming:"
} |
// setFully sets data for a path, creating any parents nodes as necessary.
// The stat returned will be the stat of the final created node. | [
"func (s *Store) setFully(item Item) (stat *zk.Stat, err error) {\n\terr = func() error {\n\t\tidentPath, err := s.identPath(item.Ident)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcurrent := \"/\"\n\t\tsegments := strings.Split(identPath, \"/\")\n\t\tfor i, segment := range segments {\n\t\t\tisLast := i == ... | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Fills the fields referenced by kwargs keys and fill them with
the value | [
"def fill_fields(self, **kwargs):\n \"\"\"\"\"\"\n for name, value in kwargs.items():\n field = getattr(self, name)\n field.send_keys(value)"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Generate require paths from gemspecs if they exist or assume the default
lib directory.
@return [Array<String>] | [
"def generate_require_paths\n return configured_require_paths unless gemspec?\n result = []\n gemspecs.each do |file|\n base = File.dirname(file)\n # @todo Evaluating gemspec files violates the goal of not running\n # workspace code, but this is how Gem::Specification.load does... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Extract the comments at the top of the YAML file,
from the stream handler.
Return the extracted comment as string. | [
"def _extract_yaml_docstring(stream):\n '''\n \n '''\n comment_lines = []\n lines = stream.read().splitlines()\n for line in lines:\n line_strip = line.strip()\n if not line_strip:\n continue\n if line_strip.startswith('#'):\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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetNameBytes will check name for valid UTF-8 string, and set the appropriate
// field | [
"func (e *Entry) SetNameBytes(name []byte) {\n\tif utf8.Valid(name) {\n\t\te.Name = string(name)\n\t} else {\n\t\te.NameRaw = name\n\t}\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 Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// SetPhoneType sets the PhoneType field's value. | [
"func (s *NumberValidateResponse) SetPhoneType(v string) *NumberValidateResponse {\n\ts.PhoneType = &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 Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
FIXME: again wrapper class but hell there is a lot of statics.... | [
"public int decode(byte[] b) throws ParameterException {\n if (b == null || b.length != 1) {\n throw new ParameterException(\"byte[] must not be null and length must be 1\");\n }\n\n this.transimissionMediumUsed = b[0];\n\n return 1;\n }"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Saves the classifier to `filepath`.
Because this classifier needs to save the dataset, it must
be something that can be pickled and not something like an
iterator. | [
"def save(self, filepath):\n \n\n if not filepath or not isinstance(filepath, str):\n raise ValueError(\"Invalid filepath\")\n\n with open(filepath, \"wb\") as filehandler:\n pickle.dump(self, filehandler)"
] | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
创建临时二维码
@param access_token access_token
@param expire_seconds 最大不超过604800秒(即30天)
@param scene_id 场景值ID,32位非0整型 最多10万个
@return QrcodeTicket | [
"public static QrcodeTicket qrcodeCreateTemp(String access_token,int expire_seconds,long scene_id){\n\t\tString json = String.format(\"{\\\"expire_seconds\\\": %d, \\\"action_name\\\": \\\"QR_SCENE\\\", \\\"action_info\\\": {\\\"scene\\\": {\\\"scene_id\\\": %d}}}\",expire_seconds,scene_id);\n\t\treturn qrcodeCreat... | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
*
@param $str_xml
@return PagSeguroPaymentParserData Success | [
"public static function readSuccessXml($str_xml)\n {\n $parser = new PagSeguroXmlParser($str_xml);\n $data = $parser->getResult('checkout');\n $PaymentParserData = new PagSeguroParserData();\n $PaymentParserData->setCode($data['code']);\n $PaymentParserData->setRegistrationDate... | [
"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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
fun(uid_with_str)
fun(uid_with_str, slug = val1, glyph = val2) | [
"def render(self, *args, **kwargs):\n '''\n \n '''\n\n uid_with_str = args[0]\n\n slug = kwargs.get('slug', False)\n\n with_title = kwargs.get('with_title', False)\n\n glyph = kwargs.get('glyph', '')\n\n kwd = {\n 'glyph': glyph\n }\n ... | [
"def anim(host, seq, anim, d):\n \n at(host, 'ANIM', seq, [anim, d])"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parse a STOMP frame into a Frame object.
:param bytes frame: the frame received from the server (as a byte string)
:rtype: Frame | [
"def parse_frame(frame):\n \n f = Frame()\n if frame == b'\\x0a':\n f.cmd = 'heartbeat'\n return f\n\n mat = PREAMBLE_END_RE.search(frame)\n if mat:\n preamble_end = mat.start()\n body_start = mat.end()\n else:\n preamble_end = len(frame)\n body_start = pr... | [
"def export(self, name, columns, points):\n \"\"\"\"\"\"\n logger.debug(\"Export {} stats to ZeroMQ\".format(name))\n\n # Create DB input\n data = dict(zip(columns, points))\n\n # Do not publish empty stats\n if data == {}:\n return False\n\n # Glances env... | codesearchnet | {
"query": "Represent the Github post about AWS S3:",
"pos": "Represent the Github code about AWS S3:",
"neg": "Represent the Github code:"
} |
Returns the list of MoufPropertyDescriptor that can be injected via a public property of the class.
@return MoufPropertyDescriptor[] An associative array. The key is the name of the argument. | [
"public function getInjectablePropertiesByPublicProperty() {\r\n \tif ($this->injectablePropertiesByPublicProperty === null) {\r\n\t \t$moufProperties = array();\r\n\t \tforeach($this->getProperties() as $attribute) {\r\n\t \t\t/* @var $attribute MoufXmlReflectionProperty */\r\n\t \t\t//if ($attribut... | [
"public String getNotifierClass()\n {\n StringBuffer sb = new StringBuffer(getShortName());\n sb.append(\"Notifier\");\n\n //\n // If the event set declaration has any parameterized types, then include them on\n // the notifier class as well. Currently, these can only be param... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Add a point to the RubberBand | [
"function(x, y) {\n\t\tif (lang.isValue(x) && lang.isValue(y)) {\n\t\t\tvar ctxt = this.getContext();\n\t\t\n\t\t\t// Draw the inner bezier curve\n\t\t\tctxt.lineCap= \"round\";\n\t\t\tctxt.strokeStyle=\"green\";\n\t\t\tctxt.lineWidth=\"3\";\n\n\t\t\tctxt.lineTo(x, y);\n\t\t\tctxt.stroke();\n\t }\n\t}"
] | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Applies font to provided TextView.<br/>
Note: this class will only accept fonts under <code>fonts/</code> directory
and fonts starting with <code>font:</code> prefix. | [
"public static void apply(@NonNull TextView textView, @StringRes int fontStringId) {\n apply(textView, textView.getContext().getString(fontStringId));\n }"
] | [
"def fontChar(self, font, char):\n \n font_files = self._getCharFont(self._getFont(font), char)\n print('The character is {0}present in this font.'.format('' if font_files else 'not '))"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get a failed job instance.
@param string $id
@return mixed | [
"public function show($id)\n {\n return (array) $this->jobs->getJobs([$id])->map(function ($job) {\n return $this->decode($job);\n })->first();\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Returns a list of offsets and dates in a 24 hour period
@param *string $format The format of each date to display
@param int $interval The frequency of rows
@return array | [
"public function getOffsetDates($format, $interval = 30)\n {\n Argument::i()\n //argument 1 must be a string\n ->test(1, 'string')\n //argument 2 must be an integer\n ->test(2, 'int');\n\n $dates = array();\n $interval *= 60;\n\n for ($i=-12... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Write metadata about the client. | [
"def WriteClientMetadata(self,\n client_id,\n certificate=None,\n fleetspeak_enabled=None,\n first_seen=None,\n last_ping=None,\n last_clock=None,\n ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
return a boolean indicating whether this feature is downstream of
`other` taking the strand of other into account | [
"def is_downstream_of(self, other):\n \n if self.chrom != other.chrom: return None\n if getattr(other, \"strand\", None) == \"-\":\n # other feature is on - strand, so this must have higher start\n return self.end <= other.start\n return self.start >= other.end"
] | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Helper function that adds trigonometric date/time features to a date in the column `field_name` of `df`. | [
"def add_cyclic_datepart(df:DataFrame, field_name:str, prefix:str=None, drop:bool=True, time:bool=False, add_linear:bool=False):\n \"\"\n make_date(df, field_name)\n field = df[field_name]\n prefix = ifnone(prefix, re.sub('[Dd]ate$', '', field_name))\n series = field.apply(partial(cyclic_dt_features,... | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return a value of 'async' in kwargs or default when async_ is None.
This helper function exists for backward compatibility (See #274).
It shows a warning message when 'async' in kwargs is used to note users. | [
"def check_async(async_, kwargs, default):\n \n if async_ is not None:\n return async_\n elif 'async' in kwargs:\n warnings.warn(\n '\"async\" attribute is deprecated. Use \"async_\" instead.',\n DeprecationWarning,\n )\n return kwargs.pop('async')\n els... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Encode an {@link import("ol/geom/Polygon.js").default} geometry into a logical sequence
of characters.
@param {Geometry} geometry Geometry.
@return {?string} Encoded geometry.
@private
@hidden
@this {FeatureHash} | [
"function writePolygonGeometry_(geometry) {\n if (geometry instanceof olGeomPolygon) {\n const flatCoordinates = geometry.getFlatCoordinates();\n const stride = geometry.getStride();\n const ends = geometry.getEnds();\n const offset = 0;\n const textArray = ['a('];\n encodeRings_.call(this,\n ... | [
"function MultiLineString(input){\n if(input && input.type === \"MultiLineString\" && input.coordinates){\n extend(this, input);\n } else if(isArray(input)) {\n this.coordinates = input;\n } else {\n throw \"Terraformer: invalid input for Terraformer.MultiLineString\";\n }\n\n this.typ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Ring4 returns the value of ((a*a *b) - (a*b*b)). | [
"func (u *Ugen) Ring4(val Input) Input {\n\treturn binOpRing4(u.Rate, u, val, u.NumOutputs)\n}"
] | [
"def log_power(x, a, b, c):\n \"\n return a/(1.+(x/np.exp(b))**c)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Processes the file, recursing as necessary, generating the source code.
<p>
The number of altered files is returned.
@return the number of changed files
@throws Exception if an error occurs | [
"public int process() throws Exception {\r\n int changed = 0;\r\n for (File child : files) {\r\n changed += (processFile(child) != null ? 1 : 0);\r\n }\r\n return changed;\r\n }"
] | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github summarization about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
// isCouldNotComputeBoxModelError unwraps err as a MessageError and determines
// if it is a compute box model error. | [
"func isCouldNotComputeBoxModelError(err error) bool {\n\te, ok := err.(*cdproto.Error)\n\treturn ok && e.Code == -32000 && e.Message == \"Could not compute box model.\"\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 Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
Returns the URL with all of the parameters added to it. If the paramsObj is null or undefined, the URL is returned untouched. paramsObj contains key/values of all of the parameters. | [
"function(url, paramsObj) {\n if(!paramsObj || typeof paramsObj !== \"object\") {\n return url;\n }\n \n _.each(_.keys(paramsObj), function(paramName) {\n var string = paramsObj[paramName];\n if (typeof string === 'object') {\n string = JSON.stringify(string);\n }\... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
企业付款到银行卡接口
:param true_name: 开户人名称
:param bank_card_no: 银行卡号
:param bank_code: 银行编号
:param amount: 付款金额,单位分
:param desc: 付款说明
:param out_trade_no: 可选,商户订单号,需保持唯一性,默认自动生成
:return: 返回的结果信息 | [
"def transfer_bankcard(self, true_name, bank_card_no, bank_code, amount, desc=None, out_trade_no=None):\n \n if not out_trade_no:\n now = datetime.now()\n out_trade_no = '{0}{1}{2}'.format(\n self.mch_id,\n now.strftime('%Y%m%d%H%M%S'),\n ... | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
/*!
\static
Goes trough all attributes and fetches metadata for the ones that is searchable.
\return an array with metadata information. | [
"static function metaDataArray( &$attributes, $skipRelationAttributes = false )\n {\n $metaDataArray = array();\n if ( !is_array( $attributes ) )\n return false;\n foreach( $attributes as $attribute )\n {\n $classAttribute = $attribute->contentClassAttribute();\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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Starts both master and a worker using the configurations in test conf respectively. | [
"public void start() throws Exception {\n // Disable HDFS client caching to avoid file system close() affecting other clients\n System.setProperty(\"fs.hdfs.impl.disable.cache\", \"true\");\n\n resetClientPools();\n\n setupTest();\n startMasters();\n startWorkers();\n startProxy();\n\n // Re... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Try to find a strategy to delete the file alternatives for $media and run it
@param MediaInterface $media | [
"public function deleteAlternatives(MediaInterface $media)\n {\n foreach ($this->strategies as $strategy) {\n if ($strategy->support($media)) {\n $strategy->deleteAlternatives($media);\n\n return;\n }\n }\n\n $this->defaultStrategy->deleteA... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
set name
@param string $name
@return Controller
@throws \InvalidArgumentException | [
"public function setName($name)\n {\n $this->validateName($name);\n\n if (!$this->name) {\n $this->name = $name;\n } elseif ($this->name !== $name) {\n $this->setAliases([$name]);\n }\n return $this;\n }"
] | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about programming:"
} |
// Convert convert e to an error. | [
"func Convert(e interface{}) error {\n\tif err, ok := e.(error); ok {\n\t\treturn err\n\t}\n\treturn fmt.Errorf(\"%v\", e)\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the description about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
Display links to loaded javascripts files and loaded inline script
@return void | [
"public function printScript()\n {\n foreach ($this->scripts as $key => $options) {\n $src = (is_string($options['src'])) ? $options['src'] : $this->getScriptLink($key);\n if ($options['with_version']) {\n $src = call_user_func_array($this->assetInsertMethod, [$src, $t... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
generate a field
@param string The type of input field to create
@param array Array of attributes for the tag
@return string | [
"public function generateField($name, $attr = array())\n {\n $tag = 'input';\n\n if (in_array($attr['type'], $this->customGenerate)) {\n $tag = $attr['type'];\n }\n $attr['name'] = $this->transformName($name);\n\n $attr = $this->getData($name, $attr);\n\n if (... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Defines the entity mapper
@param MapperDefinition $map
@return void | [
"protected function define(MapperDefinition $map)\n {\n $map->type(BlogArticleComment::class);\n\n $map->toTable('article_comments');\n\n $map->idToPrimaryKey('id');\n\n $map->column($map->getOrm()->getNamespace() . 'article_id')->asUnsignedInt();\n $map->relation(BlogArticleCo... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Return the predicate matching the tuple
@return [Function]
@api private | [
"def predicate\n header.reduce(Function::Proposition::Tautology.instance) do |predicate, attribute|\n predicate.and(attribute.eq(attribute.call(self)))\n end\n end"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// Persist saves the FSM snapshot out to the given sink. | [
"func (s *snapshot) Persist(sink raft.SnapshotSink) error {\n\tdefer metrics.MeasureSince([]string{\"fsm\", \"persist\"}, time.Now())\n\n\t// Write the header\n\theader := snapshotHeader{\n\t\tLastIndex: s.state.LastIndex(),\n\t}\n\tencoder := codec.NewEncoder(sink, msgpackHandle)\n\tif err := encoder.Encode(&heade... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the current entity manager.
@param Event $event
@return EntityManager | [
"private static function getEntityManager(Event $event)\n {\n if (null === self::$em) {\n if (null !== self::getApplication($event)) {\n self::$em = self::getApplication($event)->getEntityManager();\n }\n }\n\n return self::$em;\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Load cookies for this username and check if it was logged in.
@param string $username
@return bool | [
"public function autoLogin($username)\n {\n $this->loadCookiesFor($username);\n\n if (!$this->httpClient->cookie('_auth')) {\n return false;\n }\n\n $this->login();\n\n return true;\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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
// Summarize reads the input into a TestSuites structure and summarizes the tests contained within,
// bringing attention to tests that did not succeed. | [
"func Summarize(input io.Reader) (string, error) {\n\tvar testSuites api.TestSuites\n\tif err := xml.NewDecoder(input).Decode(&testSuites); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar summary bytes.Buffer\n\tvar numTests, numFailed, numSkipped uint\n\tvar duration float64\n\tfor _, testSuite := range testSuite... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Receive a list of all webhooks
@link https://help.shopify.com/api/reference/webhook#index
@param array $params
@return Webhook[] | [
"public function all(array $params = array())\n {\n $response = $this->request('/admin/webhooks.json', 'GET', $params);\n return $this->createCollection(Webhook::class, $response['webhooks']);\n }"
] | [
"def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Marshall the given parameter object. | [
"public void marshall(StopLoggingRequest stopLoggingRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (stopLoggingRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(stopLogging... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// NewSlaveHealthChecker creates a slave health checker and return a notification channel.
// Each time the checker thinks the slave is unhealthy, it will send a notification through the channel. | [
"func NewSlaveHealthChecker(slaveUPID *upid.UPID, threshold int, checkDuration time.Duration, timeout time.Duration) *SlaveHealthChecker {\n\ttr := &http.Transport{}\n\tchecker := &SlaveHealthChecker{\n\t\tslaveUPID: slaveUPID,\n\t\tclient: &http.Client{Timeout: timeout, Transport: tr},\n\t\tthreshold: ... | [
"func (m *Manager) removeProxyServiceLocked(proxyID string) {\n\tstate, ok := m.proxies[proxyID]\n\tif !ok {\n\t\treturn\n\t}\n\n\t// Closing state will let the goroutine we started in Ensure finish since\n\t// watch chan is closed.\n\tstate.Close()\n\tdelete(m.proxies, proxyID)\n\n\t// We intentionally leave poten... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
get the schema
@param OperationReference $service service endpoint
@return \stdClass | [
"private function getServiceSchema($service)\n {\n $operation = $service->getOperation();\n $schema = new \\stdClass();\n switch (strtolower($service->getMethod())) {\n case \"post\":\n case \"put\":\n try {\n $parameters = $operation->... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Reset the range from the given left and right with same tag match way
'N': NEXT, 'E': LAST, 'R': NOLEFT, 'L': NORIGHT
@param left
@param right
@param sameTagMatch
@return | [
"protected Betner between(String left, String right, Character sameTagMatch) {\n\t\treturn inrange(left, right, sameTagMatch);\n\t}"
] | [
"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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// MongoUpgradeMode will make all Slave members of the HA
// to shut down their mongo server. | [
"func (c *Client) MongoUpgradeMode(v mongo.Version) (params.MongoUpgradeResults, error) {\n\targ := params.UpgradeMongoParams{\n\t\tTarget: params.MongoVersion{\n\t\t\tMajor: v.Major,\n\t\t\tMinor: v.Minor,\n\t\t\tPatch: v.Patch,\n\t\t\tStorageEngine: string(v.StorageEngine),\n\t\t},\n\t}\n\... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetAdjacentShardToMerge sets the AdjacentShardToMerge field's value. | [
"func (s *MergeShardsInput) SetAdjacentShardToMerge(v string) *MergeShardsInput {\n\ts.AdjacentShardToMerge = &v\n\treturn s\n}"
] | [
"private void startNewTimeAndDims(RowPointer rowPointer)\n {\n int originalIteratorIndex = rowPointer.getIndexNum();\n // Note: at the moment when this operation is performed, markedRowPointersOfOriginalIterators[originalIteratorIndex]\n // doesn't yet contain actual current dimension and metric values. s... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
method to add a new MonomerNotation to a PolymerNotation
@param position
position of the new MonomerNotation
@param polymer
PolymerNotation
@param monomerNotation
new MonomerNotation
@return PolymerNotation with the new MonomerNotation | [
"public final static PolymerNotation addMonomerNotation(int position, PolymerNotation polymer,\r\n\t\t\tMonomerNotation monomerNotation) {\r\n\t\tpolymer.getPolymerElements().getListOfElements().add(position, monomerNotation);\r\n\t\treturn polymer;\r\n\t}"
] | [
"AtomSymbol addAnnotation(TextOutline annotation) {\n List<TextOutline> newAnnotations = new ArrayList<TextOutline>(annotationAdjuncts);\n newAnnotations.add(annotation);\n return new AtomSymbol(element, adjuncts, newAnnotations, alignment, hull);\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param mixed $entityOrClass Entity or class
@return \Darvin\AdminBundle\Metadata\Metadata
@throws \Darvin\AdminBundle\Metadata\MetadataException | [
"public function getMetadata($entityOrClass)\n {\n $this->init();\n\n $entityClass = is_object($entityOrClass) ? ClassUtils::getClass($entityOrClass) : $entityOrClass;\n\n if (isset($this->entityOverride[$entityClass])) {\n $entityClass = $this->entityOverride[$entityClass];\n ... | [
"protected function getEventsFilter(string $filter = null)\n {\n $mappingConfiguration = new PropertyMappingConfiguration();\n $mappingConfiguration->setTypeConverter($this->typeConverterObjectConverter);\n $mappingConfiguration->setTypeConverterOption(\\RGU\\Dvoconnector\\Property\\TypeConv... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
toDatatablesJSONString
@return string | [
"public function toDatatablesJSONString() {\n\t\t$return_object_array = [ ];\n\t\t$fields = $this->getFields ();\n\t\tforeach ( $fields as $field ) {\n\t\t\t$value = call_user_func ( array (\n\t\t\t\t\t$this,\n\t\t\t\t\t'get' . $field \n\t\t\t) );\n\t\t\tif ($value instanceof \\DateTime) {\n\t\t\t\t$value = $value-... | [
"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 post about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about programming:"
} |
// Get retrieves a keys value. | [
"func (h *mapHandler) Get(key string, args ...interface{}) (interface{}, error) {\n\tif len(args) != 0 {\n\t\treturn nil, cfg.ErrArgsNotSupported\n\t}\n\tval, found := h.values[key]\n\tif !found {\n\t\treturn val, cfg.ErrKeyNotFound\n\t}\n\treturn val, nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@throws \LogicException | [
"public function process(ContainerBuilder $container)\n {\n $ioMetadataHandlers = $container->hasParameter('ez_io.metadata_handlers') ?\n $container->getParameter('ez_io.metadata_handlers') :\n array();\n $this->processHandlers(\n $container,\n $container... | [
"public static function install(MoufManager $moufManager) {\n\t\t// Let's create the instances.\n\t\t$annotationReader = InstallUtils::getOrCreateInstance('annotationReader', null, $moufManager);\n\t\t$annotationReader->setCode('// Using composer autoloader\n$loader = require ROOT_PATH . \\'vendor/autoload.php\\';\... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Minimum, ignoring nans. | [
"def min(self):\n \"\"\"\"\"\"\n if \"min\" not in self.attrs.keys():\n\n def f(dataset, s):\n return np.nanmin(dataset[s])\n\n self.attrs[\"min\"] = np.nanmin(list(self.chunkwise(f).values()))\n return self.attrs[\"min\"]"
] | [
"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 Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Determines if the next part(s) of the given expression
are any of the given types. | [
"function (expression, types) {\n var args = types.split(\" | \"),\n i, len, found = false;\n\n for (i=0, len=args.length; i < len && !found && expression.hasNext(); i++) {\n found = this.isType(expression, args[i]);\n }\n\n return found;\n }"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Returns a copy of key. | [
"func (it *Iterator) Key() []byte {\n\tk := it.it.Key()\n\tif k == nil {\n\t\treturn nil\n\t}\n\n\treturn append([]byte{}, k...)\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// UpdateUser updates the provided user with any provided fields and on success
// returns the updated at time. | [
"func (c *Client) UpdateUser(user User) (updateTime time.Time, err error) {\n\tpayload, err := json.Marshal(user)\n\turi := fmt.Sprintf(\"/1/users/%s\", user.ObjectID())\n\tresp, err := c.doWithBody(\"PUT\", uri, bytes.NewReader(payload))\n\tlog.Println(\"OI\", string(payload))\n\tc.trace(\"UpdateUser >\", uri, str... | [
"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 Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Swaps two Elements in List.
@access protected
@static
@param array $list List
@param int $pos1 Position of first Element
@param int $pos1 Position of second Element
@return array | [
"protected static function swap( $list, $pos1, $pos2 )\r\n\t{\r\n\t\t$memory\t= $list[$pos1];\r\n\t\t$list[$pos1] = $list[$pos2];\r\n\t\t$list[$pos2] = $memory;\r\n\t\treturn $list;\r\n\t}"
] | [
"private function parseExpression (){\n\t\t$entities = array();\n\n\t\tdo{\n\t\t\t$e = $this->MatchFuncs(array('parseAddition','parseEntity'));\n\t\t\tif( $e ){\n\t\t\t\t$entities[] = $e;\n\t\t\t\t// operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n\t\t\t\tif( !$this->PeekR... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about mathematics:"
} |
定义行为
@return array | [
"public function behaviors()\n {\n $behaviors = parent::behaviors();\n $behaviors['slug'] = [\n 'class' => AttributeBehavior::className(),\n 'attributes' => [\n ActiveRecord::EVENT_BEFORE_INSERT => ['slug']\n ],\n 'value' => function ($even... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.