query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
A reserved word cannot be preceded by a "." in order to differentiate "mytable.from" from the token "from".
@param $previous
@return bool | [
"protected static function isReservedPrecededByDotCharacter($previous)\n {\n return !$previous || !isset($previous[Tokenizer::TOKEN_VALUE]) || $previous[Tokenizer::TOKEN_VALUE] !== '.';\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 comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Logs process error | [
"def _on_process_error(self, error):\n \n if self is None:\n return\n if error not in PROCESS_ERROR_STRING:\n error = -1\n if not self._prevent_logs:\n _logger().warning(PROCESS_ERROR_STRING[error])"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Takes an identifier token, and tranforms its type to
match Ruby keywords where the identifier is actually a keyword.
Reserved words are defined in S.8.5.1 of the Ruby spec. | [
"def translate_keyword_tokens( token )\n keywords = [\"__LINE__\", \"__ENCODING__\", \"__FILE__\", \"BEGIN\", \n \"END\", \"alias\", \"and\", \"begin\", \"break\", \"case\",\n \"class\", \"def\", \"defined?\", \"do\", \"else\", \"elsif\",\n \"end\", \"ensure... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param string $name
@return FileContentArea|null | [
"public function getFile(string $name)\n {\n return $this->fileContentAreas->where(function (FileContentArea $contentArea) use ($name) {\n return $contentArea->name === $name;\n })->first();\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Inverse cumulative standard Gaussian distribution
Based on Winitzki, S. (2008) | [
"def inv_std_norm_cdf(x):\n \n z = 2*x -1\n ln1z2 = np.log(1-z**2)\n a = 8*(np.pi -3)/(3*np.pi*(4-np.pi))\n b = 2/(np.pi * a) + ln1z2/2\n inv_erf = np.sign(z) * np.sqrt( np.sqrt(b**2 - ln1z2/a) - b )\n return np.sqrt(2) * inv_erf"
] | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the type signature of the class.
@return The class type signature, if available, otherwise returns null. | [
"public ClassTypeSignature getTypeSignature() {\n if (typeSignatureStr == null) {\n return null;\n }\n if (typeSignature == null) {\n try {\n typeSignature = ClassTypeSignature.parse(typeSignatureStr, this);\n typeSignature.setScanResult(scanR... | [
"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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Add a given role to the given user id
@param int $userId
@param string $roleName | [
"public function addRoleForUser($userId, $roleName)\n {\n $roleIdExpression = new Expression(\n '(SELECT `id` from `user_roles` WHERE `name` = ?)',\n $roleName\n );\n\n $query = $this->getSqlObject()\n ->insert()\n ->values([\n 'user... | [
"def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// Stat via afero.Fs.Stat | [
"func (fs *fakeFs) Stat(name string) (os.FileInfo, error) {\n\treturn fs.a.Fs.Stat(name)\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Decoder for deserializing numpy data types. | [
"def decode(obj):\n \n\n typ = obj.get('typ')\n if typ is None:\n return obj\n elif typ == 'timestamp':\n freq = obj['freq'] if 'freq' in obj else obj['offset']\n return Timestamp(obj['value'], tz=obj['tz'], freq=freq)\n elif typ == 'nat':\n return NaT\n elif typ == 'pe... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
/* (non-Javadoc)
@see org.joml.Vector4dc#mul(double, org.joml.Vector4d) | [
"public Vector4d mul(double scalar, Vector4d dest) {\n dest.x = x * scalar;\n dest.y = y * scalar;\n dest.z = z * scalar;\n dest.w = w * scalar;\n return dest;\n }"
] | [
"@Pure\n\t@Inline(value = \"new Vector2ifx(Math.cos($1), Math.sin($1))\", imported = {Vector2ifx.class})\n\tpublic static Vector2ifx toOrientationVector(double angle) {\n\t\treturn new Vector2ifx(Math.cos(angle), Math.sin(angle));\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about mathematics:"
} |
// Int returns an int if it exists in the set flags. | [
"func (f Flag) Int(name string) (int, error) {\n\tv, err := f.value(name)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\ti, err := strconv.Atoi(v)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn i, nil\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Retrieve the "count" result of the query.
@param string $columns
@return int | [
"public function count($columns = '*')\n {\n if (! is_array($columns)) {\n $columns = [$columns];\n }\n\n return (int) $this->aggregate(__FUNCTION__, $columns);\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Resize an image and then center crop it
@param ImageInterface $image
@param string $width new width
@param string $height new height
@return ImageInterface | [
"protected function resizeCrop(ImageInterface $image, $width, $height)\n {\n list($optimalWidth, $optimalHeight) = $this->getOptimalCrop($image->getSize(), $width, $height);\n\n // Find center - this will be used for the crop\n $centerX = ($optimalWidth / 2) - ($width / 2);\n $centerY... | [
"public function thumb(String $fpath, Array $set) : String\n {\n # If the image file is not found, an exception is thrown.\n $this->throwExceptionImageFileIfNotExists($filePath = $this->cleanURLFix($fpath));\n \n # If the file is not a valid image file, an exception is thrown.\n ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Convert a number of different types of objects to unicode. | [
"def to_unicode(data, encoding='UTF-8'):\n \"\"\"\"\"\"\n if isinstance(data, unicode_type):\n return data\n\n if isinstance(data, bytes):\n return unicode_type(data, encoding=encoding)\n\n if hasattr(data, '__iter__'):\n try:\n dict(data)\n except TypeError:\n ... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Parses headers to an array
@param $headers | [
"private function parseHeaders($headers)\n {\n $headers_temp = array();\n\n $requests = explode(\"\\r\\n\\r\\n\", $headers);\n // follow eventual redirections\n for ($index = 0; $index < count($requests) - 1; $index++) {\n\n foreach (explode(\"\\r\\n\", $requests[$index]) a... | [
"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 Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Store uploaded file by configured path pattern and fill data to this model.
@param Symfony\Component\HttpFoundation\File\UploadedFile $file
@return Illuminate\Database\Eloquent\Model | [
"public function upload(UploadedFile $file)\n {\n self::$generic_file->moveUploadedFile(new File($file,\n $file->getClientOriginalName()), null, $this);\n\n return $this;\n }"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Remove the first key-value pair with key *key*.
If a pair was removed, return its value. Otherwise if *default* was
provided, return *default*. Otherwise a ``KeyError`` is raised. | [
"def pop(self, key, default=UNSET):\n \n self._find_lt(key)\n node = self._path[0][2]\n if node is self._tail or key < node[0]:\n if default is self.UNSET:\n raise KeyError('key {!r} not in list')\n return default\n self._remove(node)\n ... | [
"def _is_process_filtered(self, process, key=None):\n \"\"\"\"\"\"\n if key is None:\n key = self.filter_key\n try:\n # If the item process[key] is a list, convert it to a string\n # in order to match it with the current regular expression\n if isinst... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Loads the data for all languages.
@return string[][] | [
"public function loadAllLanguagesData()\n {\n try {\n return $this->innerGateway->loadAllLanguagesData();\n } catch (DBALException $e) {\n throw new RuntimeException('Database error', 0, $e);\n } catch (PDOException $e) {\n throw new RuntimeException('Databas... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Prints the tags. | [
"public void printTags() {\n for (TagValue ie : tags.getTags()) {\n try {\n String name = \"\" + ie.getId();\n if (TiffTags.hasTag(ie.getId()))\n name = TiffTags.getTag(ie.getId()).getName();\n String val = ie.toString();\n String type = TiffTags.tagTypes.get(ie.getType(... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Encode raw transaction ouputs.
@param {Array<Output>} outputs
@returns {Buffer} Encoded outputs
@throws {Error} | [
"function encodeOutputs(outputs) {\n\n //Initialize buffer and offset\n let offset = 0;\n var buffer = Buffer.allocUnsafe(100000);\n //Write number of inputs\n offset += bufferutils.writeVarInt(buffer, outputs.length, offset);\n\n outputs.forEach((output) => {\n //Write value as 8byte integ... | [
"async function signTransaction (tx) {\n const networkId = this.getNetworkId()\n const rlpBinaryTx = Crypto.decodeBase64Check(Crypto.assertedType(tx, 'tx'))\n // Prepend `NETWORK_ID` to begin of data binary\n const txWithNetworkId = Buffer.concat([Buffer.from(networkId), rlpBinaryTx])\n\n const signatures = [a... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Transaction Management:"
} |
:param from_value: string like "image:tag" or "image:tag AS name"
:return: tuple of the image and stage name, e.g. ("image:tag", None) | [
"def image_from(from_value):\n \n regex = re.compile(r\"\"\"(?xi) # readable, case-insensitive regex\n \\s* # ignore leading whitespace\n (?P<image> \\S+ ) # image and optional tag\n (?: # optional \"AS name\" clause for st... | [
"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 summarization about storage:",
"pos": "Represent the code about storage:",
"neg": "Represent the code about programming:"
} |
Writes model histograms to Tensorboard. | [
"def write(self)->None:\n \"\"\n for param_name, values in self.params: self._write_histogram(param_name=param_name, values=values)"
] | [
"def _get_result_paths(self, data):\n \n\n # Swarm OTU map (mandatory output)\n return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,\n IsWritten=True)}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Remove the event listener matching the same signature used for
adding it. This will remove AT MOST one entry meeting the signature
requirements. | [
"def remove_listener(self, event, callback, single=None, priority=None):\n \n event_stack = self._events[event]\n for x in event_stack:\n if x['callback'] == callback and \\\n (single is None or x['single'] == single) and \\\n (priority is None or x['prior... | [
"function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
extraction of module package
@param Listener $listener
@param String $category
@param array $input | [
"public function extract(Listener $listener, $category = null, array $input)\n {\n\n try {\n $subdir = !is_null($category) ? $category : 'addons';\n $target = realpath(app_path() . \"/../src/modules/{$subdir}\");\n if (!is_dir($target)) {\n throw new \\Excep... | [
"function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
validates the iso8601 format
raises value error if the value for fieldname does not match the format
is iso8601 eg #"2007-06-20T12:34:40+03:00" | [
"def validate_format_iso8601(validator, fieldname, value, format_option):\n \n try:\n iso8601.parse_date(value)\n except ValueError:\n raise ValidationError(\n \"Value %(value)r of field '%(fieldname)s' is not in \"\n \"'iso8601 YYYY-MM-DDThh:mm:ss(+/-)hh:mm' format\" % ... | [
"func DateToNative(v sqltypes.Value, loc *time.Location) (time.Time, error) {\n\t// Valid format string offsets for a DATE\n\t// |DATE |10\n\t// |---------|\n\t// \"2006-01-02 00:00:00.000000\"\n\treturn parseISOTime(v.ToString(), loc, 10, 10)\n}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Create a copy of this animation. Note that the frames
are not duplicated but shared with the original
@return A copy of this animation | [
"public Animation copy() {\r\n\t\tAnimation copy = new Animation();\r\n\t\t\r\n\t\tcopy.spriteSheet = spriteSheet;\r\n\t\tcopy.frames = frames;\r\n\t\tcopy.autoUpdate = autoUpdate;\r\n\t\tcopy.direction = direction;\r\n\t\tcopy.loop = loop;\r\n\t\tcopy.pingPong = pingPong;\r\n\t\tcopy.speed = speed;\r\n\t\t\r\n\t\t... | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
getProfile
@param string $type
@param integer $key
@return string | [
"protected static function getProfile($type, $key = null)\n {\n $type = strtolower($type);\n\n if (array_key_exists($type, static::$typeDefinitions)) {\n return static::$typeDefinitions[$type][$key];\n }\n\n if (array_key_exists($type, self::$typeDefinitions)) {\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Delete user account. (relyingparty.deleteAccount)
@param Google_IdentitytoolkitRelyingpartyDeleteAccountRequest $postBody
@param array $optParams Optional parameters.
@return Google_Service_IdentityToolkit_DeleteAccountResponse | [
"public function deleteAccount(Google_Service_IdentityToolkit_IdentitytoolkitRelyingpartyDeleteAccountRequest $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('deleteAccount', array($params), \"Google_Servic... | [
"public function send(string $userId, \\Google_Service_Gmail_Message $message): \\Google_Service_Gmail_Message\n {\n return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->send($userId, $message);\n }"
] | codesearchnet | {
"query": "Represent the Github comment about accounts.authinfo:",
"pos": "Represent the Github code about accounts.authinfo:",
"neg": "Represent the Github code about PHP programming:"
} |
Computes the distance from this postcode to another postcode using the
Haversine formula
@return [Float] | [
"def distance(other)\n earth_radius = 6371\n Δlat = radians(other.latitude - latitude)\n Δlong = radians(other.longitude - longitude)\n a = sin(Δlat / 2) * sin(Δlat / 2) +\n cos(radians(latitude)) * cos(radians(other.latitude)) *\n sin(Δlong / 2) * sin(Δlong / 2)\n c = 2 *... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Draw the line graph | [
"function drawLine(values, style, minY) {\n style = style || {}\n var color = self.options.style.line\n c.strokeStyle = style.line || color\n\n c.moveTo(0, 0)\n c.beginPath();\n c.lineTo(getXPixel(0), getYPixel(values[0], minY));\n\n for(var k = 1; k < values.length; k++) {\n c.lineTo(getX... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// matchImageCondition determines the result of an ImageCondition or the provided arguments. | [
"func matchImageCondition(condition *imagepolicy.ImageCondition, integrated RegistryMatcher, attrs *ImagePolicyAttributes) bool {\n\tresult := matchImageConditionValues(condition, integrated, attrs)\n\tklog.V(5).Infof(\"image matches conditions for %q: %t(invert=%t)\", condition.Name, result, condition.InvertMatch)... | [
"@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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@coroutine
@param int $code
@return \Generator
@resolve \Icicle\Http\Message\Response | [
"protected function createDefaultErrorResponse(int $code): \\Generator\n {\n $sink = new MemorySink(sprintf('%d Error', $code));\n\n $headers = [\n 'Connection' => 'close',\n 'Content-Type' => 'text/plain',\n 'Content-Length' => $sink->getLength(),\n ];\n\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 instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
// WriteVarInt64 writes u to w. | [
"func WriteVarInt64(w io.Writer, i int64) error {\n\tvar b []byte\n\t_, err := w.Write(appendSleb128(b, i))\n\treturn err\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns true if the PropertyMap contains one or more values for the specified
PropertySet, false otherwise | [
"public boolean containsPropertySet(Class<? extends Annotation> propertySet)\n {\n if (_annotElem.isAnnotationPresent(propertySet))\n return true;\n\n //\n // Call up to superclass for delegation\n //\n return super.containsPropertySet(propertySet);\n }"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Removes any external reference from the role | [
"def remove_external_references(self):\n \n for ex_ref_node in self.node.findall('externalReferences'):\n self.node.remove(ex_ref_node)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Stop the current section block.
@return null | [
"public function stop()\n {\n if (is_null($this->sectionName)) {\n throw new LogicException(\n 'You must start a section before you can stop it.'\n );\n }\n\n $content = ob_get_clean();\n\n if ($this->appendSection && isset($this->sections[$this->s... | [
"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:"
} |
Add multiple verb to a pattern and stages.
@param array $verbs
@param callable|string|HttpPipeline|array $stages $stages
@throws \Moon\Moon\Exception\InvalidArgumentException | [
"public function map(string $pattern, array $verbs, $stages): void\n {\n $pipeline = new HttpPipeline($verbs, $this->prefix.$pattern, $this->routerStages);\n $pipeline->pipe($stages);\n $this->pipelineCollection->add($pipeline);\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Extracts the values from a string that represents a dict and returns them
sorted by key.
Args:
str_in (string) that contains python dict
Returns:
(list) with values or None if no valid dict was found
Raises:
- | [
"def str2dict_values(str_in):\n '''\n \n '''\n tmp_dict = str2dict(str_in)\n if tmp_dict is None:\n return None\n return [tmp_dict[key] for key in sorted(k for k in tmp_dict)]"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Scan a php file
@param FileContext $file | [
"public function scan (FileContext $file) \n\t{\n\t\t$filename = $file->getName();\n\n\t\t$code = file_get_contents ($filename);\n\n\t\ttry \n\t\t{\n\t\t $stmts = $this->parser->parse ($code);\n\t\t\t$traverser = $this->factory->createTraverser ($file);\n\t\t $traverser->traverse ($stmts);\n\t\t} \n\t\tcatch ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code:"
} |
Transformer which either immediately invokes `all` when everything has finished loading or queues the arguments. | [
"function transformer(tree, file, next) {\n if (loadError) {\n next(loadError)\n } else if (config.checker) {\n all(tree, file, config)\n next()\n } else {\n queue.push([tree, file, config, next])\n }\n }"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
Get the module name.
@return string | [
"public function getModuleName()\n {\n $module = $this->argument('module') ?: app('modules')->getUsedNow();\n\n $module = app('modules')->findOrFail($module);\n\n return $module->getStudlyName();\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *BatchDeleteTableVersionInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"BatchDeleteTableVersionInput\"}\n\tif s.CatalogId != nil && len(*s.CatalogId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"CatalogId\", 1))\n\t}\n\tif s.DatabaseName == nil {\n\t\tinvalidPa... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
The values of the transform as three 2D column vectors | [
"def column_vectors(self):\n \"\"\"\"\"\"\n a, b, c, d, e, f, _, _, _ = self\n return (a, d), (b, e), (c, f)"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Replace a dict map, key to its value in the stirng
:param subject_dict: dict
:param string: string
:return: string | [
"def dict_replace(subject_dict, string):\n \n for i, j in subject_dict.items():\n string = string.replace(i, j)\n return string"
] | [
"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:"
} |
Temporarily overrides the old value with the new one. | [
"def override(self, value):\n \"\"\"\"\"\"\n if self._value is not value:\n return _ScopedValueOverrideContext(self, value)\n else:\n return empty_context"
] | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Make the HTML element that toggles all the checkboxes on or off.
@param string $key A unique key for this control - inserted in the classes.
@return string | [
"public function make_toggle($key) {\n $attrs = array('href' => '#');\n\n // Do proper lang strings for title attributes exist for the given key?\n $strmanager = \\get_string_manager();\n $titleall = get_string('all');\n $titlenone = get_string('none');\n if ($strmanager->s... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Returns an array holding width, height and an image resource for the
specified image. If these details cannot be obtained, FALSE is returned.
@param mixed $image to get information for
@return array|FALSE image information on success, FALSE otherwise | [
"public static function getInfo(/*mixed*/ $image) {\n if(\n is_string($image) &&\n false !== ($info = getimagesizefromstring($image)) &&\n !!($width = $info[0]) && !!($height = $info[1])\n ) {\n $result = imagecreatefromstring($image);\n } else if(\n is_resource($image) &&\n !... | [
"function Uploadfs() {\n var tempPath, imageSizes;\n var scaledJpegQuality;\n var self = this;\n /**\n * Initialize uploadfs. The init method passes options to the backend and invokes a callback when the backend is ready.\n * @param {Object} options: backend, imageSizes, orientOriginals, tempPath, copyOr... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// InsertPlan means inserting plan between two plans. | [
"func InsertPlan(parent Plan, child Plan, insert Plan) error {\n\terr := child.ReplaceParent(parent, insert)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\terr = parent.ReplaceChild(child, insert)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tinsert.AddChild(child)\n\tinsert.AddParent(parent)\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Function to set currency.
@param string $currency
@throws \Exception
@return $this | [
"public function setCurrency($currency = 'USD')\n {\n $allowedCurrencies = ['AUD', 'BRL', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'INR', 'JPY', 'MYR', 'MXN', 'NOK', 'NZD', 'PHP', 'PLN', 'GBP', 'SGD', 'SEK', 'CHF', 'TWD', 'THB', 'USD', 'RUB'];\n\n // Check if provided currency is valid.\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Accepts another handler function to be used on close().
$until_level defaults to CRITICAL. | [
"public static function init ($handler, $until_level = 2) {\n\t\tself::$handler = $handler;\n\n\t\treturn function ($info) use ($until_level) {\n\t\t\tLevelBuffer::$buffer .= vsprintf (\\Analog\\Analog::$format, $info);\n\t\t\tif ($info['level'] <= $until_level) {\n\t\t\t\t// flush and reset the buffer\n\t\t\t\tLev... | [
"def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns the User ID associated with a reset password token
@param $token
@return null|int | [
"public function getUserIdByResetPasswordToken($token)\n {\n $tokenData = (new UserPasswordReset())->getTokenData($token);\n return $tokenData == false ? null : $tokenData->user_id;\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 description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Generate a header of page. | [
"private function paintReportHeader()\n {\n $isAggregateReport = !empty($this->reportMetadata['dimension']);\n\n // Graph-only report\n static $graphOnlyReportCount = 0;\n $graphOnlyReport = $isAggregateReport && $this->displayGraph && !$this->displayTable;\n\n // Table-only re... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Groups set of values into one value separated with Resources::SEPARATOR.
@param array $values array of values to be grouped
@return string | [
"public function groupQueryValues(array $values)\n {\n $joined = Resources::EMPTY_STRING;\n\n foreach ($values as $value) {\n if (!is_null($value) && !empty($value)) {\n $joined .= $value.Resources::SEPARATOR;\n }\n }\n\n return trim($joined, Resou... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Closes all available channels | [
"protected function closeChannels()\n {\n foreach ($this->channels as $key => $channel) {\n // channels[0] is this connection object, so don't close it yet\n if ($key === 0) {\n continue;\n }\n try {\n $channel->close();\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 comment about Computer Networking:",
"pos": "Represent the code about Computer Networking:",
"neg": "Represent the code about Software development:"
} |
Clean up a query string for searching.
Removes unmatched parentheses and joining operators.
Arguments:
q (str): Query string to be cleaned
Returns:
str: The clean query string. | [
"def _clean_query_string(q):\n \n q = q.replace(\"()\", \"\").strip()\n if q.endswith(\"(\"):\n q = q[:-1].strip()\n # Remove misplaced AND/OR/NOT at end\n if q[-3:] == \"AND\" or q[-3:] == \"NOT\":\n q = q[:-3]\n elif q[-2:] == \"OR\":\n q = q[:-2]\n\n # Balance parenthese... | [
"def _getStrippedValue(value, strip):\n \"\"\"\"\"\"\n if strip is None:\n value = value.strip() # Call strip() with no arguments to strip whitespace.\n elif isinstance(strip, str):\n value = value.strip(strip) # Call strip(), passing the strip argument.\n elif strip is False:\n pas... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software Engineering:"
} |
Quick way of notifying admin
Note: right now only via email
@param string $title
@param string $text
@return bool Success | [
"protected function _notification($title, $text) {\n\t\tif (!isset($this->Email)) {\n\t\t\t$this->Email = new Email();\n\t\t} else {\n\t\t\t$this->Email->reset();\n\t\t}\n\n\t\t$this->Email->to(Configure::read('Config.adminEmail'), Configure::read('Config.adminName'));\n\t\t$this->Email->subject($title);\n\t\t$this... | [
"public function init()\n\t{\n\t\t$this->help_str = 'Send a mail using the instance mail configuration. '.PHP_EOL;\n\n\t\t$this->setNewParam( 'S', 'subject', 'Mail subject.', true, true );\n\t\t$this->setNewParam( 'F', 'filecontent', 'Mail body. Don\\'t define this params to send the stdin', true, true );\n\t\t$th... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Walk functions step through the major pieces of the template structure,
// generating output as they go. | [
"func (s *state) walk(dot reflect.Value, node parse.Node) {\n\ts.at(node)\n\tswitch node := node.(type) {\n\tcase *parse.ActionNode:\n\t\t// Do not pop variables so they persist until next end.\n\t\t// Also, if the action declares variables, don't print the result.\n\t\tval := s.evalPipeline(dot, node.Pipe)\n\t\tif... | [
"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:"
} |
Create a Python dict representing the PGM, with additional metadata for
JSON output. | [
"def create_pgm_dict(\n lambdaFile: str,\n asts: List,\n file_name: str,\n mode_mapper_dict: dict,\n save_file=False,\n) -> Dict:\n \n\n lambdaStrings = [\"import math\\n\\n\"]\n state = PGMState(lambdaStrings)\n generator = GrFNGenerator()\n generator.mode_mapper = mode_mapper_dict\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Convert given query condition value which is supposed to contain types
identifiers to integer identifiers
This function will take care of awaited query format | [
"public function convertQueryCondition($value)\n {\n // First fetch the type\n if (null === $value) {\n return 0;\n }\n\n if (!is_array($value)) {\n $value = [$value];\n }\n\n $hasOperator = false;\n\n // FIXME Sorry for this\n if (!Mi... | [
"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 Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@param Subject $subject
@return Assignment|null | [
"public function getAssignmentForSubject(Subject $subject)\n {\n return $this->assignmentStorage->getAssignment($subject->getSubjectId(), $subject->getSubjectName());\n }"
] | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// runStart handles the executes the flow of "minikube start" | [
"func runStart(cmd *cobra.Command, args []string) {\n\tconsole.OutStyle(\"happy\", \"minikube %s on %s (%s)\", version.GetVersion(), runtime.GOOS, runtime.GOARCH)\n\tvalidateConfig()\n\n\toldConfig, err := cfg.Load()\n\tif err != nil && !os.IsNotExist(err) {\n\t\texit.WithCode(exit.Data, \"Unable to load config: %v... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
///
// decodeMessage checks that the message payload was signed by Auth service key
// and deserializes it. | [
"func (s *AuthService) decodeMessage(m *pubSubMessage, certs *signing.PublicCertificates) (*protocol.ChangeNotification, error) {\n\t// Key name used to sign.\n\tkeyName := m.Message.Attributes[\"X-AuthDB-SigKey-v1\"]\n\tif keyName == \"\" {\n\t\treturn nil, fmt.Errorf(\"X-AuthDB-SigKey-v1 attribute is not set\")\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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Hydrate the pivot table relationship on the models.
@param array $models
@return void | [
"protected function hydratePivotRelation(array $models)\n\t{\n\t\t// To hydrate the pivot relationship, we will just gather the pivot attributes\n\t\t// and create a new Pivot model, which is basically a dynamic model that we\n\t\t// will set the attributes, table, and connections on so it they be used.\n\t\tforeac... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Don't use this function manually - it is meant to interface with exploration techniques. | [
"def successors(self, state, successor_func=None, **run_args):\n \n if successor_func is not None:\n return successor_func(state, **run_args)\n return self._project.factory.successors(state, **run_args)"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Adds the commerce user segment entry to the database. Also notifies the appropriate model listeners.
@param commerceUserSegmentEntry the commerce user segment entry
@return the commerce user segment entry that was added | [
"public static com.liferay.commerce.user.segment.model.CommerceUserSegmentEntry addCommerceUserSegmentEntry(\n\t\tcom.liferay.commerce.user.segment.model.CommerceUserSegmentEntry commerceUserSegmentEntry) {\n\t\treturn getService().addCommerceUserSegmentEntry(commerceUserSegmentEntry);\n\t}"
] | [
"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 sentence about e-commerce:",
"pos": "Represent the code about e-commerce:",
"neg": "Represent the code about Software development:"
} |
Splits a large CSS file into several smaller files, each one
containing less than the IE 4096 selector limit. | [
"def split_css_for_ie_selector_limit(input_file, output_file):\n \n from .modules import bless, utils\n\n if not isinstance(input_file, str):\n raise RuntimeError('CSS splitter takes only a single input file.')\n\n return {\n 'dependencies_fn': utils.no_dependencies,\n 'compiler_fn'... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetDistributionConfig sets the DistributionConfig field's value. | [
"func (s *DistributionConfigWithTags) SetDistributionConfig(v *DistributionConfig) *DistributionConfigWithTags {\n\ts.DistributionConfig = v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// SetEc2AvailabilityZone sets the Ec2AvailabilityZone field's value. | [
"func (s *Ec2InstanceAttributes) SetEc2AvailabilityZone(v string) *Ec2InstanceAttributes {\n\ts.Ec2AvailabilityZone = &v\n\treturn s\n}"
] | [
"func (g *Cloud) GetLoadBalancerName(ctx context.Context, clusterName string, svc *v1.Service) string {\n\t// TODO: replace DefaultLoadBalancerName to generate more meaningful loadbalancer names.\n\treturn cloudprovider.DefaultLoadBalancerName(svc)\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param Request $request
@Config\Route("/new", name="open_orchestra_user_admin_new")
@Config\Method({"GET", "POST"})
@return Response | [
"public function newAction(Request $request)\n {\n $this->denyAccessUnlessGranted(ContributionActionInterface::CREATE, UserInterface::ENTITY_TYPE);\n\n $userClass = $this->container->getParameter('open_orchestra_user.document.user.class');\n /** @var UserInterface $user */\n $user = n... | [
"public function init(Application $application)\n {\n $application->addService('staticController', new StaticControllerService());\n $application->any(':all', $application->getService('staticController'));\n }"
] | codesearchnet | {
"query": "Represent the comment about Symfony:",
"pos": "Represent the code about Symfony:",
"neg": "Represent the code about programming:"
} |
Mutator for the cosignatoryOf object collection.
@return \NEM\Models\ModelCollection | [
"public function cosignatoryOf(array $data = null)\n {\n $multisigs = $data ?: $this->getAttribute(\"cosignatoryOf\") ?: [];\n return (new CollectionMutator())->mutate(\"account\", $multisigs);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
----------------------------------------------------------------------- | [
"protected void assemble(Fields fields) {\n if (getBase() == null) {\n super.assemble(fields);\n\n fields.era = ERA_FIELD;\n fields.monthOfYear = new BasicMonthOfYearDateTimeField(this, 12);\n fields.months = fields.monthOfYear.getDurationField();\n }\n }... | [
"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 text about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
Change initial settings of this widget.
@param option {@link org.geomajas.hammergwt.client.option.GestureOption}
@param value T look at {@link org.geomajas.hammergwt.client.option.GestureOptions}
interface for all possible types
@param <T>
@since 1.0.0 | [
"@Api\n\tpublic <T> void setOption(GestureOption<T> option, T value) {\n\t\thammertime.setOption(option, value);\n\t}"
] | [
"@Override\n\tprotected void setEventBus(MapEventBus eventBus) {\n\t\tsuper.setEventBus(eventBus);\n\t\tthis.wmsConfig.setParentLayer(eventBus, this);\n\t\tthis.wmsConfig.setCrs(viewPort.getCrs()); // Overwrite this value. TODO Should we give a warning here???\n\t}"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about language and writing:"
} |
End install (Stap #5).
@param Request $request
@param string $from
@return Response | [
"public function endAction(Request $request, $from = '')\n {\n // app already installed\n if ($this->container->getParameter('anime_db.catalog.installed')) {\n return $this->redirect($this->generateUrl('home'));\n }\n\n $response = $this->getCacheTimeKeeper()->getResponse()... | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// OemBlacklist sets the optional parameter "oemBlacklist": | [
"func (c *GroupDeleteCall) OemBlacklist(oemBlacklist string) *GroupDeleteCall {\n\tc.urlParams_.Set(\"oemBlacklist\", oemBlacklist)\n\treturn c\n}"
] | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
This function is called when the user clicks the 'Lock aspect'
checkbox. `tf` is True if checked, False otherwise. | [
"def _lock_aspect_cb(self, w, tf):\n \n self._lock_aspect = tf\n self.w.aspect.set_enabled(tf)\n if self._lock_aspect:\n self._set_aspect_cb()\n else:\n wd, ht = self.get_wdht()\n _as = self.calc_aspect_str(wd, ht)\n self.w.aspect.set_te... | [
"function(terria) {\n CatalogMember.call(this, terria);\n\n this._enabledDate = undefined;\n this._shownDate = undefined;\n this._loadForEnablePromise = undefined;\n this._lastLoadInfluencingValues = undefined;\n\n // The catalog item to show in the Now Viewing when this item is enabled, instead of this item.... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// enumerateQueuedBlobs yields blobs from the on-disk sorted.KeyValue store.
// This differs from enumeratePendingBlobs, which sends from the in-memory pending list. | [
"func (sh *SyncHandler) enumerateQueuedBlobs(dst chan<- blob.SizedRef, intr <-chan struct{}) error {\n\tdefer close(dst)\n\tit := sh.queue.Find(\"\", \"\")\n\tfor it.Next() {\n\t\tbr, ok := blob.Parse(it.Key())\n\t\tsize, err := strconv.ParseUint(it.Value(), 10, 32)\n\t\tif !ok || err != nil {\n\t\t\tsh.logf(\"ERRO... | [
"func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(\n\t_ context.Context, _ DiskBlockCacheType) (bool, error) {\n\t// We won't be kicking off long syncing prefetching via the remote\n\t// cache, so just pretend the cache has space.\n\treturn true, nil\n}"
] | codesearchnet | {
"query": "Represent the Github comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Make a form builder.
@return Form | [
"public function form()\n {\n $permissionModel = config('admin.database.permissions_model');\n\n $form = new Form(new $permissionModel());\n\n $form->display('id', 'ID');\n\n $form->text('slug', trans('admin.slug'))->rules('required');\n $form->text('name', trans('admin.name'))... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Define getter function on object as a configurable and enumerable property.
@param {Object} `obj` Object to define property on.
@param {String} `prop` Property to define.
@param {Function} `getter` Getter function to define. | [
"function defineProperty(obj, prop, getter) {\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: getter\n });\n}"
] | [
"function(type){\n return function(prop){\n var accessor = this.getAccessor(prop, type),\n accessorName = this._accessorName;\n\n /**\n * Prevent recursive get calls by checking if it's currently accessing\n * and if the accessor name is the same as the property arg. If a... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about text processing:"
} |
Return php-schema definition that reflects the structural expectations towards state (yaml)data.
@return mixed[] | [
"private function getStateSchema(): array\n {\n return [\n \"type\" => \"assoc\" ,\n \"required\" => false,\n \"properties\" => [\n \"class\" => [ \"type\" => \"fqcn\", \"required\" => false ],\n \"initial\" => [\n \"type\" ... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
get method
@param $key string
@param $cache_cb callable
[optional]
@param $cas_token float
[optional]
@return mixed | [
"public function get($key = null, $cache_cb = null, &$cas_token = null)\n {\n\n if (isset($this->cacheListing [$key])) {\n return parent::get($key, $cache_cb, $cas_token);\n }\n\n return false;\n }"
] | [
"function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
---------------- COMMON ---------------- | [
"public static org.apache.hadoop.mapred.JobConf asJobConf(Configuration cfg) {\n return cfg instanceof org.apache.hadoop.mapred.JobConf\n ? (org.apache.hadoop.mapred.JobConf) cfg\n : new org.apache.hadoop.mapred.JobConf(cfg);\n }"
] | [
"protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Helper to calculate when next execution time is. | [
"private void estimateNextExecution() {\r\n\t\tsynchronized (TIMER_LOCK) {\r\n\t\t\tif (fixedDelay) {\r\n\t\t\t\tscheduledExecutionTime = period + System.currentTimeMillis();\r\n\t\t\t} else {\r\n\t\t\t\tif (firstExecution == 0) {\r\n\t\t\t\t\t// save timestamp of first execution\r\n\t\t\t\t\tfirstExecution = sched... | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
.. versionadded:: 2017.7.0
Return Elasticsearch information.
CLI example::
salt myminion elasticsearch.info
salt myminion elasticsearch.info profile=elasticsearch-extra | [
"def info(hosts=None, profile=None):\n '''\n \n '''\n es = _get_instance(hosts, profile)\n\n try:\n return es.info()\n except elasticsearch.TransportError as e:\n raise CommandExecutionError(\"Cannot retrieve server information, server returned code {0} with message {1}\".format(e.st... | [
"def docker(gandi, vm, args):\n \n if not [basedir for basedir in os.getenv('PATH', '.:/usr/bin').split(':')\n if os.path.exists('%s/docker' % basedir)]:\n gandi.echo(\"\"\"'docker' not found in $PATH, required for this command \\\nto work\nSee https://docs.docker.com/installation/#installat... | codesearchnet | {
"query": "Represent the Github sentence about Elasticsearch:",
"pos": "Represent the Github code about Elasticsearch:",
"neg": "Represent the Github code:"
} |
// Overlaps checks whether another IPRange instance has an overlap in IPs with
// the current range. If will return true if there is any cross section between
// the two ranges. | [
"func (ipr *IPRange) Overlaps(o *IPRange) bool {\n\t// if the start of o is less than our start, we need to make sure the end of o\n\t// is less than our start\n\tif bytes.Compare([]byte(o.Start), []byte(ipr.Start)) < 0 {\n\t\treturn bytes.Compare([]byte(o.End), []byte(ipr.Start)) >= 0\n\t}\n\t// if the start of o ... | [
"def _weave_conflicting_selectors(prefixes, a, b, suffix=()):\n \n # OK, what this actually does: given a list of selector chains, two\n # \"conflicting\" selector chains, and an optional suffix, return a new list\n # of chains like this:\n # prefix[0] + a + b + suffix,\n # prefix[0] + b + a +... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Some callers like MuTect incorporate a second caller for indels. | [
"def _get_caller_supplement(caller, data):\n \n if caller == \"mutect\":\n icaller = tz.get_in([\"config\", \"algorithm\", \"indelcaller\"], data)\n if icaller:\n caller = \"%s/%s\" % (caller, icaller)\n return caller"
] | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Método que entrega la firma del SII sobre el nodo DA
@return string Firma en base64
@author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
@version 2015-10-30 | [
"private function getFirma()\n {\n if (!$this->xml) {\n return false;\n }\n $FRMA = $this->xml->getElementsByTagName('FRMA')->item(0);\n return $FRMA ? $FRMA->nodeValue : false;\n }"
] | [
"public function agregar(array $datos)\n {\n $this->recibos[] = [\n '@attributes' => [\n 'version' => '1.0',\n ],\n 'DocumentoRecibo' => array_merge([\n '@attributes' => [\n 'ID' => 'LibreDTE_T'.$datos['TipoDoc'].'F'.$datos[... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Given a matching pattern and a contact, find any exceeded limits (aka caps/budgets).
@param ContactClient $contactClient
@param array $rules
@param null $timezone
@param \DateTime|null $dateSend
@return array|null
@throws \Exception | [
"public function findLimit(\n ContactClient $contactClient,\n $rules = [],\n $timezone = null,\n \\DateTime $dateSend = null\n ) {\n $filters = [];\n $result = null;\n foreach ($rules as $rule) {\n $orx = [];\n $value = $rule['value'... | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the comment about Transaction Management:",
"pos": "Represent the code about Transaction Management:",
"neg": "Represent the code about Software development:"
} |
Setup curl instance with values from ``self.config``. | [
"def process_config(self, grab):\n \n\n # Copy some config for future usage\n self.config_nobody = grab.config['nobody']\n self.config_body_maxsize = grab.config['body_maxsize']\n\n try:\n request_url = normalize_url(grab.config['url'])\n except Exception as ex:\... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create Doctrine2MetaDataDAO instance
@return Doctrine2MetaDataDAO | [
"public static function getInstance()\n {\n $fileManager = new FileManager();\n $serviceManager = ZendFramework2Environnement::getDependence($fileManager);\n $entityManager = $serviceManager->get('doctrine.entitymanager.orm_default');\n\n if (($entityManager instanceof EntityManag... | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(DetectFacesRequest detectFacesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (detectFacesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(detectFaces... | [
"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:"
} |
:param tag:
Checks out specified tag. If set to ``None`` the latest
tag will be checked out
:returns:
A list of all tags, sorted as version numbers, ascending | [
"def tag(self):\n '''\n \n '''\n\n tag = self.m(\n 'getting git tags',\n cmdd=dict(\n cmd='git tag -l --sort=\"version:refname\"',\n cwd=self.local\n ),\n verbose=False,\n )\n if tag.get('returncode')... | [
"def collect_manifest_dependencies(manifest_data, lockfile_data):\n \"\"\"\"\"\"\n output = {}\n\n for dependencyName, dependencyConstraint in manifest_data.items():\n output[dependencyName] = {\n # identifies where this dependency is installed from\n 'source': 'example-package... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
A wizard generator.
@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@param null $firstKey
@return \Generator|\Symfony\Component\Console\Question\Question[] | [
"private function getWizard(InputInterface $input, OutputInterface $output, $firstKey = null)\n {\n $questions = $this->wizardSteps();\n $tryAgain = false;\n $result = null;\n\n // Loop over the questions, parse them, then yield them out\n foreach ($questions as $question) {\n ... | [
"public static function getInheritanceFinder(ConfigInterface $config) {\n if($config instanceof FileConfig){\n $cacheStrategy = new \\Synga\\InheritanceFinder\\File\\CacheStrategy($config);\n } elseif($config instanceof DatabaseConfig){\n $cacheStrategy = new \\Synga\\Inheritance... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
pass the transfer details to aspera and receive back a
populated transfer spec complete with access token | [
"def _create_transfer_spec(self, call_args):\n ''' '''\n _paths = []\n for _file_pair in call_args.file_pair_list:\n _path = OrderedDict()\n if call_args.direction == enumAsperaDirection.SEND:\n _action = \"upload_setup\"\n _path['source'] = ... | [
"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:"
} |
// SetSuggesterName sets the SuggesterName field's value. | [
"func (s *DeleteSuggesterInput) SetSuggesterName(v string) *DeleteSuggesterInput {\n\ts.SuggesterName = &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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Configures a new model, updates an existing model's settings, or updates global settings | [
"function config(name, options) {\n if (isObject(name)) {\n extend(global, name);\n return;\n }\n var previous = (registry[name] && registry[name].$config) ? registry[name].$config() : null,\n base = extend({}, previous ? extend({}, previous) : extend({}, DEFAULTS, DEFAULT_METHODS));\n\n ... | [
"function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
List available endoints for a given endpoint technology.
@param string $tech Technology of the endpoints (sip,iax2,...)
@return \phparia\Resources\Endpoint[]
@throws NotFoundException | [
"public function getEndpointsByTech($tech)\n {\n $uri = \"endpoints/$tech\";\n try {\n $response = $this->client->getEndpoint()->get($uri);\n } catch (RequestException $e) {\n $this->processRequestException($e);\n }\n\n $endpoints = [];\n foreach (\... | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Get width and heigth of an image resized in order fit a target size.
@param string $file The image to resize
@param int $target The final max width/height
@return array array of ($width, $height). One of them must be $target | [
"static public function getResizedImageSize($file, $target=25){\n\t\tlist($width, $height, , ) = getimagesize($file);\n\t\t$max = max($width, $height);\n\t\t$rapp = $target / $max;\n\t\t$width = intval($rapp * $width);\n\t\t$height = intval($rapp * $height);\n\t\treturn array($width, $height);\n\t}"
] | [
"function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// ReadReceipt retrieves a specific transaction receipt from the database, along with
// its added positional metadata. | [
"func ReadReceipt(db ethdb.Reader, hash common.Hash, config *params.ChainConfig) (*types.Receipt, common.Hash, uint64, uint64) {\n\t// Retrieve the context of the receipt based on the transaction hash\n\tblockNumber := ReadTxLookupEntry(db, hash)\n\tif blockNumber == nil {\n\t\treturn nil, common.Hash{}, 0, 0\n\t}\... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Return a new ``Message`` instance. The arguments are
passed to the ``marrow.mailer.Message`` constructor. | [
"def new(self, **kwargs):\n ''''''\n app = self.app or current_app\n mailer = app.extensions['marrowmailer']\n msg = mailer.new(**kwargs)\n msg.__class__ = Message\n return msg"
] | [
"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 Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Provides a function that returns the value of the entry when invoked.
@param <K> key type of the entry
@param <V> value type of the entry
@return a function that when applied to a given entry will return the value | [
"public static <K, V> Function<Map.Entry<K, V>, V> entryToValueFunction() {\n return EntryToValueFunction.getInstance();\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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.