query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Parameter which indicates an XML file containing AspectJ weaving instructions. Assigning this plugin parameter adds the <code>-xmlConfigured</code> option to ajc. @param xmlConfigured an XML file containing AspectJ weaving instructions.
[ "public void setXmlConfigured( final File xmlConfigured )\n {\n try\n {\n final String path = xmlConfigured.getCanonicalPath();\n if ( !xmlConfigured.exists() )\n {\n getLog().warn( \"xmlConfigured parameter invalid. [\" + path + \"] does not exist.\"...
[ "private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Is flag in column_value on?
[ "def flag_on?(column_value, bitset, flag)\n val = column_value || 0\n (val & bitset.const_get(flag)) != 0\n end" ]
[ "def isValidFieldProperty?( property )\r\n if @validFieldProperties.nil?\r\n @validFieldProperties = %w{ allow_new_choices allowHTML appears_by_default append_only\r\n blank_is_zero bold carrychoices comma_start cover_text currency_format currency_symbol\r\n decimal_places def...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Merge all adjacent tags with the specified tag name. Return the number of merges performed.
[ "def merge_adjacent(dom, tag_name):\n \n for node in dom.getElementsByTagName(tag_name):\n prev_sib = node.previousSibling\n if prev_sib and prev_sib.nodeName == node.tagName:\n for child in list(node.childNodes):\n prev_sib.appendChild(child)\n remove_node(n...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sort the list in ascending order using this algorithm. @param <E> the type of elements in this list. @param list the list that we want to sort
[ "public static <E extends Comparable<E>> void sort(List<E> list) {\n Merge.sort(list, 0, list.size()-1, false);\n }" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// lintVarDecls examines variable declarations. It complains about declarations with // redundant LHS types that can be inferred from the RHS.
[ "func (f *file) lintVarDecls() {\n\tvar lastGen *ast.GenDecl // last GenDecl entered.\n\n\tf.walk(func(node ast.Node) bool {\n\t\tswitch v := node.(type) {\n\t\tcase *ast.GenDecl:\n\t\t\tif v.Tok != token.CONST && v.Tok != token.VAR {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tlastGen = v\n\t\t\treturn true\n\t\tcase *a...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Pre submit data. @param FormEvent $event
[ "public function preSubmitData(FormEvent $event)\n {\n $form = $event->getForm();\n $data = $event->getData();\n\n if (null === $data || '' === $data) {\n $data = array();\n }\n\n foreach ($form as $name => $child) {\n if (!isset($data[$name])) {\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Create a wsgi environment from an apigw request.
[ "def create_wsgi_request(event, server_name='apigw'):\n \n path = urllib.url2pathname(event['path'])\n script_name = (\n event['headers']['Host'].endswith('.amazonaws.com') and\n event['requestContext']['stage'] or '').encode('utf8')\n query = event['queryStringParameters']\n query_stri...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return a list of species tax_ids under *tax_id* such that node under *tax_id* and above the species has two children.
[ "def nary_subtree(self, tax_id, n=2):\n \n if tax_id is None:\n return None\n parent_id, rank = self._node(tax_id)\n if rank == 'species':\n return [tax_id]\n else:\n children = self.children_of(tax_id, 2)\n species_taxids = []\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 sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
// NthPreviousEntry returns the value passed to the nth previous call to Add. // If n is zero then the immediately prior value is returned, if one, then the // next most recent, and so on. If such an element doesn't exist then ok is // false.
[ "func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {\n\tif n >= s.size {\n\t\treturn \"\", false\n\t}\n\tindex := s.head - n\n\tif index < 0 {\n\t\tindex += s.max\n\t}\n\treturn s.entries[index], true\n}" ]
[ "def traverse\n # We use a non-recursive implementation to traverse the tree. This stack\n # keeps track of all the known still to be checked nodes.\n stack = [ [ self, 0 ] ]\n\n while !stack.empty?\n node, position = stack.pop\n\n # Call the payload method. The position marks wher...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// WebService returns a webservice serving api group discovery. // Note: during the server runtime apiGroups might change.
[ "func (s *rootAPIsHandler) WebService() *restful.WebService {\n\tmediaTypes, _ := negotiation.MediaTypesForSerializer(s.serializer)\n\tws := new(restful.WebService)\n\tws.Path(APIGroupPrefix)\n\tws.Doc(\"get available API versions\")\n\tws.Route(ws.GET(\"/\").To(s.restfulHandle).\n\t\tDoc(\"get available API versio...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Zip together the "a" and "b" arrays until one of them runs out of values. Each pair of values is combined into a single value using the supplied zipFunction function. @param a @param b @return
[ "public static IntStream zip(final int[] a, final int[] b, final IntBiFunction<Integer> zipFunction) {\r\n return Stream.zip(a, b, zipFunction).mapToInt(ToIntFunction.UNBOX);\r\n }" ]
[ "function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `prop...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
The function to process missing column information. @throws UnsupportedEncodingException when unknown encoding.
[ "private void processMissingColumnInfo() throws UnsupportedEncodingException {\n for (ColumnMissingInfo columnMissingInfo : columnMissingInfoList) {\n String missedInfo = bytesToString(columnsNamesBytes.get(columnMissingInfo.getTextSubheaderIndex()),\n columnMissingInfo.getOffse...
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Helper for _AddMessageMethods().
[ "def _AddHasFieldMethod(message_descriptor, cls):\n \"\"\"\"\"\"\n\n is_proto3 = (message_descriptor.syntax == \"proto3\")\n error_msg = _Proto3HasError if is_proto3 else _Proto2HasError\n\n hassable_fields = {}\n for field in message_descriptor.fields:\n if field.label == _FieldDescriptor.LABEL_REPEATED:\n...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Internal method to handle special fields in a _User response.
[ "function(attrs) {\n if (attrs.sessionToken) {\n this._sessionToken = attrs.sessionToken;\n delete attrs.sessionToken;\n }\n Parse.User.__super__._mergeMagicFields.call(this, attrs);\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 about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Sorts all blocks in ascending order of CRF. @return the sorted CRF of all blocks
[ "private List<Map.Entry<Long, Double>> getSortedCRF() {\n List<Map.Entry<Long, Double>> sortedCRF = new ArrayList<>(mBlockIdToCRFValue.entrySet());\n sortedCRF.sort(Comparator.comparingDouble(Entry::getValue));\n return sortedCRF;\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 sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Fire the given event for the model. @param string $event @param bool $halt @return mixed
[ "public function fireModelEvent($event, $halt = true, $relationName = null, $ids = [], $idsAttributes = [])\n {\n if (!isset(static::$dispatcher)) {\n return true;\n }\n\n // First, we will get the proper method to call on the event dispatcher, and then we\n // will attempt...
[ "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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
// GetInt8 returns the entry's value as int8, based on its key. // If not found returns -1 and a non-nil error.
[ "func (r *Store) GetInt8(key string) (int8, error) {\n\tv, ok := r.GetEntry(key)\n\tif !ok {\n\t\treturn -1, errFindParse.Format(\"int8\", key)\n\t}\n\treturn v.Int8Default(-1)\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Fetches the given URLs and caches their contents and their assets in the given directory.
[ "def _cache_contents(self, style_urls, asset_url_path):\n \n files = {}\n\n asset_urls = []\n for style_url in style_urls:\n if not self.quiet:\n print(' * Downloading style', style_url, file=sys.stderr)\n r = requests.get(style_url)\n if n...
[ "def process document\n return unless document.valid\n # If we're debugging, output the canonical_url\n emitter.log(document.url.canonical_url.colorize(:green))\n # Attach the emitter to the document\n document.emitter = emitter\n # enqueue any other pages being linked to\n enqueu...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
@param string $controller @return array
[ "public function getActions($controller)\n {\n $actions = [];\n foreach (get_class_methods($controller) as $method) {\n if (preg_match('#^(.*)Action$#', $method, $match)) {\n $actions[] = $match[1];\n }\n }\n\n return $actions;\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set the x location of pivot point around which the contentView is rotated. @param x
[ "public void setContentViewPivotX(float x) {\n if (DBG) Log.v(TAG, \"setContentViewPivotX - x=\" + x);\n mContentView.setPivotY(x);\n }" ]
[ "def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Read the specified attribute from the equivalent HTML5 `data-*` attribute, and (if present) cache the value in the node's internal data store. If no attribute name is specified, read *all* HTML5 `data-*` attributes in this manner.
[ "function(el, name) {\n var readAll = arguments.length === 1;\n var domNames, domName, jsNames, jsName, value, idx, length;\n\n if (readAll) {\n domNames = Object.keys(el.attribs).filter(function(attrName) {\n return attrName.slice(0, dataAttrPrefix.length) === dataAttrPrefix;\n });\n jsNames = dom...
[ "function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parse the any nested key-pair values in the header value @param string $nestedPairs @return array
[ "protected function parseNestedKeyPairHeader($nestedPairs)\n {\n return array_reduce(explode(';', $nestedPairs), function($result, $pair) {\n $keyVal = explode('=', $pair, 2);\n $key = trim(array_shift($keyVal));\n $val = trim(implode('=', $keyVal));\n if ($key ...
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Returns an object of Google Analytics service response @param array $settings @param array $handler @return \Google_Service_AnalyticsReporting_GetReportsResponse @throws OutOfRangeException
[ "public function request(array $settings, array $handler)\n {\n if (empty($settings['ga_profile_id'])) {\n throw new OutOfRangeException('Google Analytics profile ID is empty in the request settings');\n }\n\n $service = $this->getService($settings); // Also loads all needed libra...
[ "public function deleteSubscriptionUsageData($usageDataId)\n {\n $requestData = new DeleteUsageData\\RequestData($usageDataId);\n $request = new DeleteUsageData\\Request($requestData);\n\n return $this->sendRequest($request, DeleteUsageData\\ApiResponse::class);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about accounts.authinfo:", "pos": "Represent the Github code about accounts.authinfo:", "neg": "Represent the Github code about Metadata management:" }
// SetRecommendationText sets the RecommendationText field's value.
[ "func (s *AwsSecurityFindingFilters) SetRecommendationText(v []*StringFilter) *AwsSecurityFindingFilters {\n\ts.RecommendationText = 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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
**************************************** 移除文件夹 ****************************************
[ "async function rmdir(dir) {\n let stats = await stat(dir);\n\n // 判断文件存在\n if (stats) {\n\n // 处理文件夹\n if (stats.isDirectory()) {\n let files = await local.readdir(dir);\n\n // 依次移除子文件\n await Promise.all(\n files.map(file => rmdir(path.resolve...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about N/A:", "pos": "Represent the Github code about N/A:", "neg": "Represent the Github code:" }
// Respond replies to the request with the given response.
[ "func (r *InitRequest) Respond(resp *InitResponse) {\n\tout := &initOut{\n\t\toutHeader: outHeader{Unique: uint64(r.ID)},\n\t\tMajor: kernelVersion,\n\t\tMinor: kernelMinorVersion,\n\t\tMaxReadahead: resp.MaxReadahead,\n\t\tFlags: uint32(resp.Flags),\n\t\tMaxWrite: resp.MaxWrite,\n\t}\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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
only a single data row @param $table @param $cols @param array $options @param int $start @return array
[ "public function getRow($table, $cols, $options = array(), $start = 0)\n {\n // Set Limit\n $options['L'] = $start . \",1\";\n\n // Get Result\n $result = $this->get($table, $cols, $options);\n if (count($result['data']) >= 1) {\n return $result['data'][0];\n ...
[ "final static function f($m, array $stages = []) {return dfcf(function(M $m, array $stages) {\n\t\t/** @var string $c */$c = df_con_hier($m, __CLASS__); return new $c($m, $stages ?: ['', '']);\n\t}, [dfpm($m), $stages]);}" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
TimeSeries of prices.
[ "def prices(self):\n \n # if accessing and stale - update first\n if self._needupdate or self.now != self.parent.now:\n self.update(self.root.now)\n return self._prices.loc[:self.now]" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
checks if the activeMenue is part of given component @param component the AdminComponent which should contain the activeMenue @param activeMenue the menue to check @return
[ "public boolean hasMenuEntry(AdminComponent component, MenuEntry activeMenue) {\n\t\tif (null != component && null != component.getMainMenu()) {\n\t\t\tOptional<MenuEntry> result = component.getMainMenu().flattened()\n\t\t\t\t\t.filter(menu -> checkForNull(menu, activeMenue) ? menu.getName().equals(activeMenue.getN...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the current language for the currently displayed object fields.
[ "def get_form_language(self, request, obj=None):\n \n if self._has_translatable_parent_model():\n return super(TranslatableInlineModelAdmin, self).get_form_language(request, obj=obj)\n else:\n # Follow the ?language parameter\n return self._language(request)" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Creates a token that represents an identifier.
[ "public static Token newIdentifier(String text, int startLine, int startColumn) {\n return new Token(Types.IDENTIFIER, text, startLine, startColumn);\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:" }
Determine the format to use for a bind username going to LDAP. @param string $username @return string
[ "public function getUsername($username)\n {\n if ($this->isValidUserDn($username)) {\n return $username;\n }\n $replacements = [\n $username,\n $this->config->getDomainName(),\n ];\n\n return preg_replace($this->params, $replacements, $this->bin...
[ "@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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// NewGlobalStore creates a new instance of GlobalStore.
[ "func NewGlobalStore() *GlobalStore {\n\treturn &GlobalStore{\n\t\tnodeKeys: make(map[common.Address][][]byte),\n\t\tkeyNodes: make(map[string][]common.Address),\n\t\tnodes: make([]common.Address, 0),\n\t\tkeys: make([][]byte, 0),\n\t\tdata: make(map[string][]byte),\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param $name @return \Monolog\Handler\StreamHandler;
[ "public static function streamHandler($name)\n {\n $suffix = date('Y-m-d-H');\n $date = date('Y-m-d');\n $pathName = str_replace('.', '/', $name);\n $streamHandler = new StreamHandler(storage_path(\"logs/$date/$pathName/$name-$suffix.log\"));\n $streamHandler->setFormatter(new ...
[ "public function runCronArchiving()\n {\n Piwik::checkUserHasSuperUserAccess();\n\n // HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)\n /** @var \\Monolog\\Logger $logger */\n $logger = StaticContainer::get('Psr\\Log\\LoggerInterface')...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Expect the next token optionally to be of the given kind. If the next token is of the given kind, return that token after advancing the lexer. Otherwise, do not change the parser state and return None.
[ "def expect_optional_token(lexer: Lexer, kind: TokenKind) -> Optional[Token]:\n \n token = lexer.token\n if token.kind == kind:\n lexer.advance()\n return token\n\n return None" ]
[ "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 post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
List opened datacenters for given type.
[ "def is_opened(cls, dc_code, type_):\n \"\"\"\"\"\"\n options = {'dc_code': dc_code, '%s_opened' % type_: True}\n datacenters = cls.safe_call('hosting.datacenter.list', options)\n if not datacenters:\n # try with ISO code\n options = {'iso': dc_code, '%s_opened' % t...
[ "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 about AWS Route 53:", "pos": "Represent the Github code about AWS Route 53:", "neg": "Represent the Github code:" }
Run IO loops on the given {@link EventLoopGroup}. @param eventLoopGroup an eventLoopGroup to share @return a new {@link TcpClient}
[ "public final TcpClient runOn(EventLoopGroup eventLoopGroup) {\n\t\tObjects.requireNonNull(eventLoopGroup, \"eventLoopGroup\");\n\t\treturn runOn(preferNative -> eventLoopGroup);\n\t}" ]
[ "public AutoCloseable registerErrorHandler(final EventHandler<Exception> theHandler) {\n this.transport.registerErrorHandler(theHandler);\n return new SubscriptionHandler<>(\n new Exception(\"Token for finding the error handler subscription\"), this.unsubscribeException);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Remove index. @param string $list @param string|int $index @param string $separator @return string
[ "public static function removeIndex(string $list, $index, string $separator): string\n {\n $items = self::explode($separator, $list);\n if (isset($items[$index])) {\n unset($items[$index]);\n }\n return implode($separator, $items);\n }" ]
[ "public static function first(string $text, string $blocktype, string $output = 'json')\n {\n return self::find($text, $blocktype, $output, 1);\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:" }
Routes action and executes the requested function. @see Actions
[ "private static function routeAction()\n {\n $actionQueryString = Request::getInputValue(\"do\", false, true);\n $actionQuery = Actions::parseActionQueryString($actionQueryString);\n \n Addons::executeComponentFunction($actionQuery->name, $actionQuery->method, @$actionQuery->arguments...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Create a new pdf export on the queue @param int $appId @param int $scanId @param array $queryParams @return Response
[ "public function queuePdf($appId, $scanId, array $queryParams = [])\n {\n $response = $this->client->post($this->uri($appId, $scanId, 'pdfs') . '/queues', [\n 'query' => $queryParams,\n ]);\n\n return $this->handleResponse($response);\n }" ]
[ "public function executeAction()\n {\n // get event queue id\n $eventQueueId = $this->getRequest()->getParam('event_queue_id');\n $this->_executeEventQueue($eventQueueId);\n\n // return back to the view\n $this->_redirect('*/*/');\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "public function handle($request, Closure $next)\n {\n if (! $this->checkIfUserCanViewPost($request)) {\n return redirect()->route('/');\n }\n\n return $next($request);\n }" ]
[ "abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the ...
codesearchnet
{ "query": "Represent the sentence about Laravel:", "pos": "Represent the code about Laravel:", "neg": "Represent the code:" }
Return the bcache UUID of a block device. If no device is given, the Cache UUID is returned. CLI example: .. code-block:: bash salt '*' bcache.uuid salt '*' bcache.uuid /dev/sda salt '*' bcache.uuid bcache0
[ "def uuid(dev=None):\n '''\n \n\n '''\n try:\n if dev is None:\n # take the only directory in /sys/fs/bcache and return it's basename\n return list(salt.utils.path.os_walk('/sys/fs/bcache/'))[0][1][0]\n else:\n # basename of the /sys/block/{dev}/bcache/cach...
[ "def _get_migrate_command():\n '''\n \n '''\n tunnel = __salt__['config.option']('virt.tunnel')\n if tunnel:\n salt.utils.versions.warn_until(\n 'Sodium',\n '\\'virt.tunnel\\' has been deprecated in favor of '\n '\\'virt:tunnel\\'. \\'virt.tunnel\\' will stop '...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(SimulationApplicationConfig simulationApplicationConfig, ProtocolMarshaller protocolMarshaller) {\n\n if (simulationApplicationConfig == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMars...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Rendering elementu formularza @param array @return string
[ "protected function _renderImprintElement($element)\n {\n //walidacja\n if (!isset($element['type']) || !isset($element['name'])) {\n return;\n }\n //identyfikator pola\n $fieldId = $this->getId() . '-' . (new \\Mmi\\Filter\\Url)->filter($element['name']);\n\n ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Render element into HTML. @return string HTML serialization @throws Exception
[ "public function toString() {\n\t\t// List of void elements from HTML5, section 8.1.2 as of 2016-09-19\n\t\tstatic $voidElements = [\n\t\t\t'area',\n\t\t\t'base',\n\t\t\t'br',\n\t\t\t'col',\n\t\t\t'embed',\n\t\t\t'hr',\n\t\t\t'img',\n\t\t\t'input',\n\t\t\t'keygen',\n\t\t\t'link',\n\t\t\t'meta',\n\t\t\t'param',\n\t\...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Console 是 writers.Console 的初始化函数
[ "func Console(cfg *config.Config) (io.Writer, error) {\n\toutputIndex, found := cfg.Attrs[\"output\"]\n\tif !found {\n\t\toutputIndex = \"stderr\"\n\t}\n\n\toutput, found := consoleOutputMap[outputIndex]\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"[%v]不是一个有效的控制台输出项\", outputIndex)\n\t}\n\n\tfcIndex, found := cfg.A...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.MPS__RG_LENGTH:\n\t\t\t\tsetRGLength(RG_LENGTH_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.MPS__RESERVED:\n\t\t\t\tsetReserved(RESERVED_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.MPS__FIXED_LEN...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github text about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
create an xsd:anyType reference
[ "def anytype(self):\n \n p, u = Namespace.xsdns\n mp = self.root.findPrefix(u)\n if mp is None:\n mp = p\n self.root.addPrefix(p, u)\n return ':'.join((mp, 'anyType'))" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// entrySnapshot returns a copy of the current cron entry list.
[ "func (c *Cron) entrySnapshot() []*Entry {\n\tentries := []*Entry{}\n\tfor _, e := range c.entries {\n\t\tentries = append(entries, &Entry{\n\t\t\tSchedule: e.Schedule,\n\t\t\tNext: e.Next,\n\t\t\tPrev: e.Prev,\n\t\t\tJob: e.Job,\n\t\t})\n\t}\n\treturn entries\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:" }
This implementation builds a URI based on the URL returned by {@link #getURL()}.
[ "@Override\n public URI getURI() throws IOException {\n URL url = getURL();\n try {\n return ResourceUtils.toURI(url);\n } catch (URISyntaxException ex) {\n throw new RuntimeException(\"Invalid URI [\" + url + \"]\", ex);\n }\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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Check if this host has already been added to the database, if not add it in.
[ "def add_computer(self, ip, hostname, domain, os, instances):\n \n cur = self.conn.cursor()\n\n cur.execute('SELECT * FROM computers WHERE ip LIKE ?', [ip])\n results = cur.fetchall()\n\n if not len(results):\n cur.execute(\"INSERT INTO computers (ip, hostname, domain, ...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Registers the given event, i.e. if it has a timestamp, the timestamp boundaries will be potentially adjusted to accomodate for inclusion of this event. @param event Event to be registered.
[ "public void register(XEvent event) {\n\t\tDate date = XTimeExtension.instance().extractTimestamp(event);\n\t\tif(date != null) {\n\t\t\tregister(date);\n\t\t}\n\t}" ]
[ "function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// Checksumok checks that checksum is a valid checksum for packet.
[ "func checksumok(packet, checksumBuf []byte) bool {\n\tif packet[0] != '$' {\n\t\treturn false\n\t}\n\n\tsum := checksum(packet)\n\ttgt, err := strconv.ParseUint(string(checksumBuf), 16, 8)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn sum == uint8(tgt)\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 description about Networking:", "pos": "Represent the Github code about Networking:", "neg": "Represent the Github code:" }
// executeSumCountShard calculates the sum and count for bsiGroups on a shard.
[ "func (e *executor) executeSumCountShard(ctx context.Context, index string, c *pql.Call, shard uint64) (ValCount, error) {\n\tspan, ctx := tracing.StartSpanFromContext(ctx, \"Executor.executeSumCountShard\")\n\tdefer span.Finish()\n\n\tvar filter *Row\n\tif len(c.Children) == 1 {\n\t\trow, err := e.executeBitmapCal...
[ "@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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Get initialization script. @param bool $defaultValues @return string
[ "public function getScriptInitialization($defaultValues = false)\n {\n $scriptContent = '';\n foreach ($this->variables as $variable) {\n $scriptContent .= $variable->getScriptDeclaration().\"\\n\";\n if ($defaultValues) {\n $scriptContent .= $variable->getScrip...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
We override the default `run_validation`, because the validation performed by validators and the `.validate()` method should be coerced into an error dictionary with a 'non_fields_error' key.
[ "def run_validation(self, data=empty):\n \n (is_empty_value, data) = self.validate_empty_values(data)\n if is_empty_value:\n return data\n\n value = self.to_internal_value(data)\n try:\n self.run_validators(value)\n value = self.validate(value)\n ...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Extract subelement from obj, according to tokens. :param obj: the object source :param bypass_ref: disable JSON Reference errors
[ "def extract(self, obj, bypass_ref=False):\n \n for token in self.tokens:\n obj = token.extract(obj, bypass_ref)\n return obj" ]
[ "def _get_parsing_plan_for_multifile_children(self, obj_on_fs: PersistedObject, desired_type: Type[Any],\n logger: Logger) -> Dict[str, Any]:\n \n raise Exception('This should never happen, since this parser relies on underlying parsers')" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Internal cassandra nodetool wrapper. Some functions are not available via pycassa so we must rely on nodetool.
[ "def _nodetool(cmd):\n '''\n \n '''\n nodetool = __salt__['config.option']('cassandra.nodetool')\n host = __salt__['config.option']('cassandra.host')\n return __salt__['cmd.run_stdout']('{0} -h {1} {2}'.format(nodetool, host, cmd))" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Search the application routes @param string $path @param string $name @return mixed
[ "public function getRoute($path = \"\", $name = \"\")\n {\n for ($i = 0; $i < count($this->routes); $i++)\n {\n $checkRoute = $this->routes[$i];\n\n if($checkRoute->getName() === $name || $checkRoute->getPath() === $path)\n {\n return $checkRoute;\n ...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Compile the JSX template from client-side usage. @param {String} tpl JSX template string. @param {Object} options Compilation configuration. @returns {Function} @api public
[ "function server(tpl, options) {\n options = options || {};\n\n /**\n * The template render method which uses the compiled React-template to do all\n * the things.\n *\n * @param {Object} data Template variables that should be introduced.\n * @param {Object} config Override configuration.\n * @returns...
[ "function () {\n /**\n * Get a valid file path for a template file from a set of directories\n * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details)\n * @param {string} [opts.extname] Periodic extension that may contain view file\n * @param {string} opts.viewna...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return an appropriate icon (green tick, red cross, etc.) for a grade. @param float $fraction grade on a scale 0..1. @param bool $selected whether to show a big or small icon. (Deprecated) @return string html fragment.
[ "protected function feedback_image($fraction, $selected = true) {\n $feedbackclass = question_state::graded_state_for_fraction($fraction)->get_feedback_class();\n\n return $this->output->pix_icon('i/grade_' . $feedbackclass, get_string($feedbackclass, 'question'));\n }" ]
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// FilterByType filters messages based on a query. // If includeAllErrors then MessageUnboxedError are all returned. Otherwise, they are filtered based on type. // Messages whose type cannot be determined are considered errors.
[ "func FilterByType(msgs []chat1.MessageUnboxed, query *chat1.GetThreadQuery, includeAllErrors bool) (res []chat1.MessageUnboxed) {\n\tuseTypeFilter := (query != nil && len(query.MessageTypes) > 0)\n\n\ttypmap := make(map[chat1.MessageType]bool)\n\tif useTypeFilter {\n\t\tfor _, mt := range query.MessageTypes {\n\t\...
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the Github comment about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about programming:" }
Get the HTML hidden field to print in your form to protect it @param string $action The ajax action you are referring to @return string The HTML code to print in your form
[ "public function generateNonceField($action)\n {\n $nonceName = $this->namespace . '_' . $action;\n\n return wp_nonce_field(md5($nonceName), $nonceName, true, false);\n }" ]
[ "public function rejectInlineListTool(Errors &$errors, Meta &$meta)\n {\n if (stristr((string)$meta->getValue(), '://listtool') !== false) {\n $errors->reject('You cannot embed the List Tool inline, use the provided fields and input [[listtool]] into the contents instead.');\n }\n }" ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Loads the rule with the given text, and uses the engine to identify and retrieve references to the input variables and output variables as required @param rule is the rule in text @param engine is the engine from which the rule is part of
[ "public void load(String rule, Engine engine) {\n deactivate();\n setEnabled(true);\n setText(rule);\n StringTokenizer tokenizer = new StringTokenizer(rule);\n String token;\n StringBuilder strAntecedent = new StringBuilder();\n StringBuilder strConsequent = new Stri...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// HostsAuthenticated provides a mock function with given fields: hostIDs
[ "func (_m *ClientInterface) HostsAuthenticated(hostIDs []string) (map[string]bool, error) {\n\tret := _m.Called(hostIDs)\n\n\tvar r0 map[string]bool\n\tif rf, ok := ret.Get(0).(func([]string) map[string]bool); ok {\n\t\tr0 = rf(hostIDs)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(map[string]bool...
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Set pixel index @param int $x @param int $y @return int
[ "public function pixelIndex(Int $x, Int $y) : Int\n {\n return imagecolorat($this->canvas, $x, $y);\n }" ]
[ "def text(self, x, y, text, attr=None):\r\n '''\r\n self.pos(x, y)\r\n self.write_color(text, attr)" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about writing:" }
Callback when an item of the menu is clicked on. @param ManialinkInterface $manialink @param $login @param $params @param $args
[ "public function callbackItemClick(ManialinkInterface $manialink, $login, $params, $args)\n {\n $this->menuContentFactory->create($login);\n\n /** @var ItemInterface $item */\n $item = $args['item'];\n $item->execute($this->menuContentFactory, $manialink, $login, $params, $args);\n ...
[ "public static Link create(final String text, final NamedObject table) {\n return new Link(text, null, '#'+table.getName());\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about text processing:" }
Delete option keys. @since 160524 Uninstall utils.
[ "protected function deleteOptions()\n {\n $WpDb = $this->s::wpDb();\n\n if ($this->Wp->is_multisite && $this->site_counter === 1) {\n $sql = /* Delete network options. */ '\n DELETE\n FROM `'.esc_sql($WpDb->sitemeta).'`\n WHERE...
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Init method. @return @throws Exception
[ "public InmemQueue<ID, DATA> init() throws Exception {\n queue = createQueue(boundary);\n if (!isEphemeralDisabled()) {\n ephemeralStorage = new ConcurrentHashMap<>();\n }\n\n super.init();\n\n return this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetPlatform sets the Platform field's value.
[ "func (s *Device) SetPlatform(v string) *Device {\n\ts.Platform = &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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Return the top n (default 10) highest entities by Karmic value. Use negative numbers for the bottom N.
[ "def top10(rest):\n\t\n\tif rest:\n\t\ttopn = int(rest)\n\telse:\n\t\ttopn = 10\n\tselection = Karma.store.list(topn)\n\tres = ' '.join('(%s: %s)' % (', '.join(n), k) for n, k in selection)\n\treturn res" ]
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Updates a single value with replacement for given key in yml file. @param string $key @param string|array $value @param bool $backup @return bool
[ "public function change($key, $value, $backup = true)\n {\n $yaml = $this->lines->join(\"\\n\");\n\n $pattern = '/^' . str_replace('/', ':.*?', $key) . '(:\\s*)/mis';\n preg_match($pattern, $yaml, $matches, PREG_OFFSET_CAPTURE);\n if (!$matches) {\n // Throw exception by de...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see ca.mjdsystems.jmatio.io.DataOutputStream#write(java.nio.ByteBuffer)
[ "public void write( ByteBuffer byteBuffer ) throws IOException\n {\n byte[] tmp = new byte[BUFFER_SIZE]; \n \n while ( byteBuffer.hasRemaining() )\n {\n int length = Math.min( byteBuffer.remaining(), tmp.length );\n byteBuffer.get( tmp, 0, length);\n w...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the summarization about Java programming:", "pos": "Represent the code about Java programming:", "neg": "Represent the code:" }
Behaviour setup @param Model $model The current model being used @param array $settings Setup array with options @return void
[ "public function setup(Model $model, $settings = array()) {\n\t\t$default = array(\n\t\t\t'fields' => 'title',\n\t\t\t'scope' => false,\n\t\t\t'conditions' => false,\n\t\t\t'slugfield' => 'slug',\n\t\t\t'separator' => '-',\n\t\t\t'overwrite' => false,\n\t\t\t'length' => 256,\n\t\t\t'lower' => true\n\t\t);\n\n\t\t$t...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Updates the vertex's current execution state through the job's executor service. @param newExecutionState the new execution state @param optionalMessage an optional message related to the state change
[ "public void updateExecutionStateAsynchronously(final ExecutionState newExecutionState,\n\t\t\tfinal String optionalMessage) {\n\n\t\tfinal Runnable command = new Runnable() {\n\n\t\t\t/**\n\t\t\t * {@inheritDoc}\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void run() {\n\n\t\t\t\tupdateExecutionState(newExecutionStat...
[ "private void makeJobRunning(JobInProgress job, JobSchedulingInfo oldInfo, \n QueueInfo qi) {\n // Removing of the job from job list is responsibility of the\n //initialization poller.\n // Add the job to the running queue\n qi.addRunningJob(job);\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// ServeHTTP handles request of list a database or table's schemas.
[ "func (vh valueHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\t// parse params\n\tparams := mux.Vars(req)\n\n\tcolID, err := strconv.ParseInt(params[pColumnID], 0, 64)\n\tif err != nil {\n\t\twriteError(w, err)\n\t\treturn\n\t}\n\tcolTp, err := strconv.ParseInt(params[pColumnTp], 0, 64)\n\tif err ...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Pagination "Last" link @param string $value optional text to display in the link @return string Markup for the 'last' page number link
[ "public function last($marker = null)\n\t{\n\t\t$html = '';\n\n\t\t$marker === null and $marker = $this->template['last-marker'];\n\n\t\tif ($this->config['show_last'])\n\t\t{\n\t\t\tif ($this->config['total_pages'] > 1 and $this->config['calculated_page'] != $this->config['total_pages'])\n\t\t\t{\n\t\t\t\t$html = ...
[ "function navMap_post_defaults(map, index, parent){\n\n\treplaceValues(map, {\n\t\t//propertyName : \"forced overide value\"\n\t\t//link : '#',//using this would disable ALL links (including links already defined in the main nav map file)\n\t});\n\n\treturn {\n\t\tdepth: map.location.length,\n\t\tindex: index,\n\t\...
codesearchnet
{ "query": "Represent the Github instruction about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// deriveClonePoint returns a clone of the src parameter.
[ "func deriveClonePoint(src *Point) *Point {\n\tif src == nil {\n\t\treturn nil\n\t}\n\tdst := new(Point)\n\tderiveDeepCopy_6(dst, src)\n\treturn dst\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Convert string-like-thing s to the 'str' type, in all Pythons, even back before Python 2.6. What 'str' means varies by PY3K or not. In Pythons before 3.0, str and bytes are the same type. In Python 3+, this may require a decoding step.
[ "def tostr(s, encoding='ascii'):\n \n if PY3K:\n if isinstance(s, str): # str == unicode in PY3K\n return s\n else: # s is type bytes\n return s.decode(encoding)\n else:\n # for py2.6 on (before 3.0), bytes is same as str; 2.5 has no bytes\n # but handle i...
[ "def _init_io_container(self, init_value):\n \n if isinstance(init_value, CLOB_STRING_IO_CLASSES):\n # already a valid StringIO instance, just use it as it is\n v = init_value\n else:\n # works for strings and unicodes. However unicodes must only contain valid a...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Searches the OS sandbox for the name of the endpoint interface // within the sandbox. This is required for adding/removing IP // aliases to the interface.
[ "func findIfaceDstName(sb *sandbox, ep *endpoint) string {\n\tsrcName := ep.Iface().SrcName()\n\tfor _, i := range sb.osSbox.Info().Interfaces() {\n\t\tif i.SrcName() == srcName {\n\t\t\treturn i.DstName()\n\t\t}\n\t}\n\treturn \"\"\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Marks a Image with Stamp Image. @access public @param string $source File Name of Source Image @param string $target Target Name of Target Image @return bool
[ "public function markImage( $source, $target = NULL )\r\n\t{\r\n\t\tif( !$target )\r\n\t\t\t$target = $source;\r\n\t\t\r\n\t\t$creator\t= new UI_Image_Creator();\r\n\t\t$creator->loadImage( $source );\r\n\t\t$image\t\t= $creator->getResource();\r\n\t\t$type\t\t= $creator->getType();\r\n\r\n\t\t$position\t\t= $this-...
[ "public function create(String $path = NULL) : String\n {\n if( isset($this->sets['filePath']) )\n {\n $path = $this->sets['filePath'];\n }\n\n # It keeps the used filters belonging to the GD class.\n # [5.7.8]added\n $this->sets['filters'] = $this->filters;\n...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Output: m lpc coefficients, excitation energy
[ "float lpc_from_curve(float[] curve, float[] lpc){\n int n=ln;\n float[] work=new float[n+n];\n float fscale=(float)(.5/n);\n int i, j;\n\n // input is a real curve. make it complex-real\n // This mixes phase, but the LPC generation doesn't care.\n for(i=0; i<n; i++){\n work[i*2]=curve[i]*...
[ "def plogdet(K):\n \n \"\"\"\n egvals = eigvalsh(K)\n return npsum(log(egvals[egvals > epsilon]))" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Setup logging configuration
[ "def setup_logging(default_path='logging.yaml', env_key='LOG_CFG'):\n \n path = default_path\n value = os.getenv(env_key, None)\n if value:\n path = value\n if os.path.exists(path):\n with open(path, 'rt') as f:\n configs = yaml.safe_load(f.read())\n logging.config.dic...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
https://developer.zendesk.com/rest_api/docs/core/groups#delete-group
[ "def group_delete(self, id, **kwargs):\n \"\"\n api_path = \"/api/v2/groups/{id}.json\"\n api_path = api_path.format(id=id)\n return self.call(api_path, method=\"DELETE\", **kwargs)" ]
[ "def zendesk_ticket(self):\n \n if self.api and self.zendesk_ticket_id:\n return self.api._get_zendesk_ticket(self.zendesk_ticket_id)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
source expression Try to get source code for the given object and display it.
[ "def do_source(self, arg):\n \n try:\n obj = self._getval(arg)\n except Exception:\n return\n try:\n lines, lineno = getsourcelines(obj, self.get_locals(self.curframe))\n except (IOError, TypeError) as err:\n self.error(err)\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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see org.uiautomation.ios.command.Handler#handle()
[ "@Override\n public Response handle() throws Exception {\n StatusGenerator gen = new StatusGenerator(getServer());\n\n\n JSONObject res = gen.generate();\n\n List<ServerSideSession> sessions = getServer().getSessions();\n Response resp = new Response();\n\n resp.setStatus(0);\n resp.setValue(res)...
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
`PyQuery <https://pythonhosted.org/pyquery/>`_ representation of the :class:`Element <Element>` or :class:`HTML <HTML>`.
[ "def pq(self) -> PyQuery:\n \n if self._pq is None:\n self._pq = PyQuery(self.raw_xml)\n\n return self._pq" ]
[ "def series_contenthandler():\n \n from ligo.lw import (\n ligolw,\n array as ligolw_array,\n param as ligolw_param\n )\n\n @ligolw_array.use_in\n @ligolw_param.use_in\n class ArrayContentHandler(ligolw.LIGOLWContentHandler):\n \"\"\"`~xml.sax.handlers.ContentHandler` t...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the key associated with a registered file object.
[ "def get_key(self, fileobj):\n \n mapping = self.get_map()\n if mapping is None:\n raise RuntimeError(\"Selector is closed\")\n try:\n return mapping[fileobj]\n except KeyError:\n raise KeyError(\"{0!r} is not registered\".format(fileobj))" ]
[ "@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 instruction about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
// CollectClassNames - Returns all class names from specified stylesheet. // styleSheetId - // Returns - classNames - Class name list.
[ "func (c *CSS) CollectClassNames(styleSheetId string) ([]string, error) {\n\tvar v CSSCollectClassNamesParams\n\tv.StyleSheetId = styleSheetId\n\treturn c.CollectClassNamesWithParams(&v)\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Detects which HTTP client handler to use. @return HttpClientInterface
[ "public function detectHttpClientHandler()\n {\n $handler = null;\n if (class_exists('GuzzleHttp\\Client')) {\n $handler = new GuzzleHttpClient();\n } elseif (function_exists('curl_init')) {\n $handler = new CurlHttpClient();\n } else {\n $handler = ne...
[ "@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 instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Programming:" }
@param string $fieldName @param array $filter @param array $options @return array
[ "public function distinct($fieldName, array $filter = [], array $options = [])\n {\n if (!is_string($fieldName)) {\n throw new InvalidArgumentException('$fieldName must be a string.');\n }\n\n if (!$fieldName) {\n throw new InvalidArgumentException('$fieldName cannot be...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// UnmarshalJSON sets the object from the provided JSON representation
[ "func (l *ECSTaskDefinitionHealthCheckList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := ECSTaskDefinitionHealthCheck{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = ECSTaskDefinitionHealthCheckList{item}\n\t\treturn ni...
[ "@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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// KeysById returns the set of keys that have the given key id.
[ "func (el EntityList) KeysById(id uint64) (keys []Key) {\n\tfor _, e := range el {\n\t\tif e.PrimaryKey.KeyId == id {\n\t\t\tvar selfSig *packet.Signature\n\t\t\tfor _, ident := range e.Identities {\n\t\t\t\tif selfSig == nil {\n\t\t\t\t\tselfSig = ident.SelfSignature\n\t\t\t\t} else if ident.SelfSignature.IsPrimar...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Extract data. @param $data @return iterable @throws EtlException
[ "private function extract($data): iterable\n {\n $items = null === $this->extract ? $data : ($this->extract)($data, $this);\n\n if (null === $items) {\n $items = new \\EmptyIterator();\n }\n\n if (!\\is_iterable($items)) {\n throw new EtlException('Could not extr...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
{@inheritDoc} @see \Wslim\Common\StorageInterface::append()
[ "public function append($key, $val, $ttl=null)\n\t{\n\t $old = $this->get($key);\n\t $val = $this->formatter->append($old, $val);\n\t return $this->set($key, $val, $ttl);\n\t}" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Register some signal handlers. @param LOG The slf4j logger
[ "public static void register(final Logger LOG) {\n\t\tsynchronized (SignalHandler.class) {\n\t\t\tif (registered) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tregistered = true;\n\n\t\t\tfinal String[] SIGNALS = OperatingSystem.isWindows()\n\t\t\t\t? new String[]{ \"TERM\", \"INT\"}\n\t\t\t\t: new String[]{ \"TERM\", \"HUP\"...
[ "def end(self):\n \n\n # Note: Vend is just a macro; use 'Vfinish' instead\n # Note also the the same C function is used to end\n # the VS interface\n _checkErr('vend', _C.Vfinish(self._hdf_inst._id),\n \"cannot terminate V interface\")\n self._hdf_inst = N...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Create an gd image according to the specified mime type @param string $path image file @param string $mime @return gd image resource identifier
[ "protected function gdImageCreate($path,$mime){\n\t\tswitch($mime){\n\t\t\tcase 'image/jpeg':\n\t\t\treturn imagecreatefromjpeg($path);\n\n\t\t\tcase 'image/png':\n\t\t\treturn imagecreatefrompng($path);\n\n\t\t\tcase 'image/gif':\n\t\t\treturn imagecreatefromgif($path);\n\n\t\t\tcase 'image/xbm':\n\t\t\treturn ima...
[ "function imageTtfTextErrorHandler($errno, $errstr) {\n // log the error\n Log::addErrorLog('Image Builder error: >' . $errno . '/' . $errstr . '< while processing file >' . $this->media->getServerFilename() . '<');\n \n // change value of useTTF to false so the fallback watermarking can be ...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Get a fresh Guzzle HTTP client instance. @param array $config @return HttpClient
[ "protected function getHttpClient( $config )\n\t{\n\t\t$guzzleConfig = Arr::get( $config, 'guzzle', [] );\n\n\t\treturn new HttpClient( Arr::add( $guzzleConfig, 'connect_timeout', 60 ) );\n\t}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return the deposit address for the given major currency. :param currency: Major currency name in lowercase (e.g. "btc", "eth"). :type currency: str | unicode :return: Deposit address. :rtype: str | unicode
[ "def get_deposit_address(self, currency):\n \n self._validate_currency(currency)\n self._log('get deposit address for {}'.format(currency))\n coin_name = self.major_currencies[currency]\n return self._rest_client.post(\n endpoint='/{}_deposit_address'.format(coin_name)\...
[ "def _validate_none_or_type(t):\n \n def _validate(setting):\n \"\"\"\n Check the setting to make sure it's the right type.\n\n Args:\n setting (object): The setting to check.\n\n Returns:\n object: The unmodified object if it's the proper type.\n\n Rai...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software Engineering:" }
// SetBucket sets the Bucket field's value.
[ "func (s *S3Location) SetBucket(v string) *S3Location {\n\ts.Bucket = &v\n\treturn s\n}" ]
[ "function Entry (content, name, parent) {\n if (!(this instanceof Entry)) return new Entry(content, name, parent);\n\n this._parent = parent; // parent can be a Document or ArrayField\n this._schema = parent._schema; // the root Document\n this._name = name; // the field name supplied by the user\n this._hidde...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }