query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
perform this use case
[ "public void apply()\r\n {\r\n String in = readLineWithMessage(\"Delete Product with id:\");\r\n int id = Integer.parseInt(in);\r\n\r\n // We don't have a reference to the selected Product.\r\n // So first we have to lookup the object,\r\n // we do this by a query by example (Q...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// formatFields converts logrus Fields (containing arbitrary types) into a string slice.
[ "func formatFields(fields logrus.Fields) []string {\n\tvar results []string\n\n\tfor k, v := range fields {\n\t\tvalue, ok := v.(string)\n\t\tif !ok {\n\t\t\t// convert non-string value into a string\n\t\t\tvalue = fmt.Sprint(v)\n\t\t}\n\n\t\tresults = append(results, fmt.Sprintf(\"%s=%q\", k, value))\n\t}\n\n\tret...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// GetPost チ-ム名と記事番号を指定して記事を取得する
[ "func (p *PostService) GetPost(teamName string, postNumber int) (*PostResponse, error) {\n\tvar postRes PostResponse\n\n\tpostNumberStr := strconv.Itoa(postNumber)\n\n\tpostURL := PostURL + \"/\" + teamName + \"/posts\" + \"/\" + postNumberStr\n\tres, err := p.client.get(postURL, url.Values{}, &postRes)\n\tif err !...
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Value returns the current value of the counter for the given key.
[ "func (c *SafeCounter) Value(key string) int {\n\tc.mux.Lock()\n\t// Lock so only one goroutine at a time can access the map c.v.\n\tdefer c.mux.Unlock()\n\treturn c.v[key]\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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// NewStringMap returns a new StringMap
[ "func NewStringMap(name string) *StringMap {\n\tv := &StringMap{values: make(map[string]string)}\n\tPublish(name, v)\n\treturn 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:" }
Return a reverse ordering by upper endpoint over ranges. @param <C> range endpoint type @return a reverse ordering by upper endpoint over ranges
[ "public static <C extends Comparable> Ordering<Range<C>> reverseOrderingByUpperEndpoint() {\n Ordering<Range<C>> orderingByUpperEndpoint = orderingByUpperEndpoint();\n return orderingByUpperEndpoint.reverse();\n }" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
almost same as mailflute
[ "protected SqlAnalyzer createSqlAnalyzer(String templateText, boolean blockNullParameter) {\n final SqlAnalyzer analyzer = new SqlAnalyzer(templateText, blockNullParameter) {\n @Override\n protected String filterAtFirst(String sql) {\n return sql; // keep body\n ...
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Scans the current installation and picks up all the SilverStripe modules that contain a `docs` folder. @return void
[ "public function populateEntitiesFromInstall()\n {\n if ($this->automaticallyPopulated) {\n // already run\n return;\n }\n\n foreach (scandir(BASE_PATH) as $key => $entity) {\n if ($key == \"themes\") {\n continue;\n }\n\n ...
[ "public function run(array $args)\n {\n Index::info('Help Menu');\n Index::info('- `eve generate <schema*> <namespace>` Generates files based on schema');\n Index::info('- `eve database <schema*>` Generates database table/s schema');\n Index::info('- `eve install` ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
This will get the model. There is no order for the arguments. @params string path to the model @params array data to send to the model @return $this
[ "public function set_cached_model(){\n\t\t$args = \\func_get_args();\n\t\t$die = 1;\n\t\tforeach ( $args as $a ){\n\t\t\tif ( \\is_string($a) && \\strlen($a) ){\n\t\t\t\t$path = $a;\n\t\t\t}\n\t\t\telse if ( \\is_array($a) ){\n\t\t\t\t$data = $a;\n\t\t\t}\n else if ( \\is_int($a) ){\n $ttl = $a;\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Send a message to the google chat room specified in the webhook url. .. code-block:: bash salt '*' google_chat.send_message "https://chat.googleapis.com/v1/spaces/example_space/messages?key=example_key" "This is a test message"
[ "def send_message(url, message):\n '''\n \n '''\n headers = {'Content-Type': 'application/json'}\n data = {'text': message}\n result = __utils__['http.query'](url,\n 'POST',\n data=json.dumps(data),\n ...
[ "def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
// move returns the cell in the direction dir from position r, c. // It returns ok==false if there is no cell in that direction.
[ "func (m *Maze) move(x, y int, dir Dir) (nx, ny int, ok bool) {\n\tnx = x + dirs[dir].δx\n\tny = y + dirs[dir].δy\n\tok = 0 <= nx && nx < m.w && 0 <= ny && ny < m.h\n\treturn\n}" ]
[ "private void switchToForward() {\n assert((checkDir < 0 && seq == rawSeq) || (checkDir == 0 && pos == limit));\n if(checkDir < 0) {\n // Turn around from backward checking.\n start = segmentStart = pos;\n if(pos == segmentLimit) {\n limit = rawLimit;\n ...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param $repository @param $type @param $format @return \PUGX\Badge\Model\Badge
[ "public function createDownloadsBadge($repository, $type, $format)\n {\n return $this->createBadgeFromRepository($repository, self::SUBJECT, self::COLOR, $format, $type);\n }" ]
[ "public function getTokenStatusDescriptionForBridge(\\MUtil_Model_Bridge_TableBridgeAbstract $bridge, $addDescription = false)\n {\n return \\MUtil_Lazy::method($this, 'getStatusDescription', $bridge->getLazy('token_status'));\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Returns an array of payment methods @return array
[ "protected function getListPayment()\n {\n $id = $this->getParam(0);\n\n if (!isset($id)) {\n $list = $this->payment->getList();\n $this->limitArray($list);\n return $list;\n }\n\n $method = $this->payment->get($id);\n\n if (empty($method)) {\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(HierarchyLevel hierarchyLevel, ProtocolMarshaller protocolMarshaller) {\n\n if (hierarchyLevel == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(hierarchyLevel.getId(),...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Compute E3 pixel. @param a The a value. @param b The b value. @param d The d value. @param e The e value. @param g The g value. @param h The h value. @return The computed value.
[ "private static int computeE3(int a, int b, int d, int e, int g, int h)\r\n {\r\n if (d == b && e != g || d == h && e != a)\r\n {\r\n return d;\r\n }\r\n return e;\r\n }" ]
[ "public static Matrix copy(Matrix m) {\n\t\tif (m==null) throw new NullPointerException();\n\t\tMatrix copy=createMatrix(m.getRowCount(), m.getColumnCount());\n\t\tfor (int row=0; row<m.getRowCount(); row++) for (int col=0; col<m.getColumnCount(); col++)\n\t\t\tcopy.set(row, col, m.getQuick(row, col));\n\t\treturn ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
check command line Judge the target platforms. if the command line includes platform names, call grunt cordova_register_platform:<platform>. see '$ cordova compile --help'
[ "function parsePlatforms() {\n var supportPlatforms = [\n { platform: 'android', regexp: /android/ig },\n { platform: 'ios', regexp: /ios/ig },\n { platform: 'firefoxos', regexp: /firefoxos/ig },\n { platform: ...
[ "func (r *printRun) RegisterIDFlag() {\n\tr.Flags.BoolVar(&r.id, \"id\", false, doc(`\n\t\tPrint only build ids.\n\n\t\tIntended for piping the output into another bb subcommand:\n\t\t\tbb ls -cl myCL -id | bb cancel\n\t`))\n}" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Start the service. This causes a transition to the C{'idle'} state, and then calls L{connect} to attempt an initial conection.
[ "def startService(self):\n \n service.Service.startService(self)\n self._toState('idle')\n\n try:\n self.connect()\n except NoConsumerError:\n pass" ]
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets tenant context data. Must be called after {@link #setTenant}. @param data data to set into context
[ "void setData(Map<String, Object> data) {\n Objects.requireNonNull(data, \"data can't be null\");\n\n // @adovbnya DO NOT CHANGE !!!!\n // allow tenant change only from initial (empty) value or only from super tenant\n if (this.dataMap.isEmpty()) {\n this.dataMap = ValueHolder...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// NewListTask instantiates a new *ListTask instance with the given message.
[ "func NewListTask(msg string) *ListTask {\n\treturn &ListTask{\n\t\tmsg: msg,\n\t\tch: make(chan *Update, 1),\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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Build SQL query for a filter @param string $field @param string $type @param string $filter @param mixed $value @return boolean True on success
[ "protected function buildFilter($field, $type, $filter, $value)\n {\n if (strlen($field) == 0)\n throw new \\Exception(\"Empty 'field'\");\n if (strlen($type) == 0)\n throw new \\Exception(\"Empty 'type'\");\n\n if ($type == Table::TYPE_DATETIME) {\n if ($fil...
[ "public function addFilterRule(string $field, string $value, $operator = null, int $crud = READRULES)\n {\n // if an existing rule is detected, over write\n $this->rules[$field] = new FilterRule($field, $value, $operator, $crud);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Method ignoring GenerateDeployment events if deployment is already done. @param eventContext Event to check
[ "public void blockGenerateDeploymentWhenNeeded(@Observes EventContext<GenerateDeployment> eventContext) {\n if (!extensionEnabled()) {\n eventContext.proceed();\n }\n else if (suiteDeploymentGenerated) {\n // Do nothing with event.\n debug(\"Blocking GenerateDep...
[ "@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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetProcessName sets the ProcessName field's value.
[ "func (s *AwsSecurityFindingFilters) SetProcessName(v []*StringFilter) *AwsSecurityFindingFilters {\n\ts.ProcessName = v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
A set operation at the hive level (full path).
[ "async def set(self, full, valu):\n '''\n \n '''\n node = await self._getHiveNode(full)\n\n oldv = node.valu\n\n node.valu = await self.storNodeValu(full, valu)\n\n await node.fire('hive:set', path=full, valu=valu, oldv=oldv)\n\n return oldv" ]
[ "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 about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
This will get a view. @param string $path @param string $mode @param array $data @return string|false
[ "public function get_view(string $path, string $mode = 'html', array $data=null){\n if ( !router::is_mode($mode) ){\n die(\"Incorrect mode $path $mode\");\n }\n $view = null;\n if ( $this->has_view($path, $mode) ){\n $view = self::$loaded_views[$mode][$path];\n }\n else if ( $info = $thi...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Adds an embed field. @param EmbeddedPropMetadata $embed @return self
[ "public function addEmbed(EmbeddedPropMetadata $embed)\n {\n $this->validateEmbed($embed);\n $this->embeds[$embed->getKey()] = $embed;\n ksort($this->embeds);\n return $this;\n }" ]
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
A simple demo to be used from command line.
[ "def _main():\n \n import sys\n\n def log(message):\n print(message)\n\n def print_usage():\n log('usage: %s <application key> <application secret> send <number> <message> <from_number>' % sys.argv[0])\n log(' %s <application key> <application secret> status <message_id>' % sy...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Initializes the sub handlers maps for the given value count.<p> @param count the value count
[ "protected void initHandlers(int count) {\r\n\r\n if (count == 0) {\r\n m_handlers.clear();\r\n } else {\r\n while (m_handlers.size() < count) {\r\n m_handlers.add(new HashMap<String, CmsAttributeHandler>());\r\n }\r\n }\r\n m_handlerById.c...
[ "@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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Check for inital comment and patterns that distinguish Rexx from other C-like languages.
[ "def analyse_text(text):\n \n if re.search(r'/\\*\\**\\s*rexx', text, re.IGNORECASE):\n # Header matches MVS Rexx requirements, this is certainly a Rexx\n # script.\n return 1.0\n elif text.startswith('/*'):\n # Header matches general Rexx requirement...
[ "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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Use this API to add clusternodegroup resources.
[ "public static base_responses add(nitro_service client, clusternodegroup resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tclusternodegroup addresources[] = new clusternodegroup[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i+...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the summarization about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code about Natural Language Processing:" }
var RE_full_content = new RegExp('<(' + full_content_tags.join('|') + ')[^>]*>|<\\/(' + full_content_tags.join('|') + ')>', 'g');
[ "function _cleanNodes (nodes) {\n nodes.forEach(function (tag) {\n // avoiding circular structure\n delete tag._parent;\n\n // removing temporary tester\n delete tag.match_closer;\n\n // cleaning empty attributes\n if( tag.attrs && Object.keys(tag.attrs).length === 0 ) delete tag.attrs;\n\n //...
[ "public function autop($content)\n {\n // If br set, this will convert all remaining line-breaks after paragraphing.\n $br = true;\n $content = preg_replace('|<br />\\s*<br />|', \"\\n\\n\", $content . \"\\n\");\n\n // Space things out a little\n $allBlocks = '(?:table|thead|tf...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
----------------------------------------------------------------------
[ "public static function splitStringToQRinput($string, QRinput $input, $modeHint, $casesensitive = true)\r\n {\r\n if(is_null($string) || $string == '\\0' || $string == '') {\r\n throw new Exception('empty string!!!');\r\n }\r\n\r\n $split = new QRsplit($string, $input, $modeHint);...
[ "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 about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
// ContainerCDNDisable disables CDN access to a container.
[ "func (c *RsConnection) ContainerCDNDisable(container string) error {\n\th := swift.Headers{\"X-CDN-Enabled\": \"false\"}\n\n\t_, _, err := c.manage(swift.RequestOpts{\n\t\tContainer: container,\n\t\tOperation: \"PUT\",\n\t\tErrorMap: swift.ContainerErrorMap,\n\t\tNoResponse: true,\n\t\tHeaders: h,\n\t})\n\t...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetRequesterPays sets the RequesterPays field's value.
[ "func (s *UpdateNFSFileShareInput) SetRequesterPays(v bool) *UpdateNFSFileShareInput {\n\ts.RequesterPays = &v\n\treturn s\n}" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Add HashTable item @param PHPExcel_IComparable $pSource Item to add @throws PHPExcel_Exception
[ "public function add(PHPExcel_IComparable $pSource = null)\n {\n $hash = $pSource->getHashCode();\n if (!isset($this->items[$hash])) {\n $this->items[$hash] = $pSource;\n $this->keyMap[count($this->items) - 1] = $hash;\n }\n }" ]
[ "final public function getArray()\n {\n $res = $this->getArrayInternal();\n if (!$this->isArray($res) && !$this->isArrayObject($res)) {\n $errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';\n $errorMessage .= ' Make sure you have provided a v...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Match a URL to a registered pattern. :param url: URL :return: Matched route :raises kua.RouteError: If there is no match
[ "def match(self, url: str) -> RouteResolved:\n \n url = normalize_url(url)\n parts = self._deconstruct_url(url)\n return self._match(parts)" ]
[ "def _get_current_route(self, flask_request):\n \n endpoint = flask_request.endpoint\n method = flask_request.method\n\n route_key = self._route_key(method, endpoint)\n route = self._dict_of_routes.get(route_key, None)\n\n if not route:\n LOG.debug(\"Lambda funct...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Edit form submit
[ "public function editTransversalSubmit(array &$form, FormStateInterface $form_state)\n {\n if (!$this->manager->getSiteContext()->isTemporary()) {\n\n // @todo Generate a better token (random).\n $token = drupal_get_token();\n $layout = $this->manager->getSiteContext()->g...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// IndexFunc renders a colon separated list enclosed by square brackets. Use for array / slice indexes and definitions.
[ "func (g *Group) IndexFunc(f func(*Group)) *Statement {\n\ts := IndexFunc(f)\n\tg.items = append(g.items, s)\n\treturn s\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Adds the members of newArray to the list if they are not already members of the array.
[ "public void union(IntArray newArray)\n {\n for (int i = 0; i < newArray._size; i++) {\n if (! contains(newArray._data[i]))\n add(newArray._data[i]);\n }\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GroupTransactionsIntoBundles groups the given transactions into groups of bundles. // Note that the same bundle can exist in the return slice multiple times, though they // are reattachments of the same transfer.
[ "func GroupTransactionsIntoBundles(txs transaction.Transactions) Bundles {\n\tbundles := Bundles{}\n\n\tfor i := range txs {\n\t\ttx := &txs[i]\n\t\tif tx.CurrentIndex != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tbundle := Bundle{*tx}\n\t\tlastIndex := int(tx.LastIndex)\n\t\tcurrent := tx\n\t\tfor x := 1; x <= lastIndex; x...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// ReadWait sets the amount of time to wait before a websocket read times out. // It should only be used in the constructor - not Goroutine-safe.
[ "func ReadWait(readWait time.Duration) func(*wsConnection) {\n\treturn func(wsc *wsConnection) {\n\t\twsc.readWait = readWait\n\t}\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Do a full refresh of all devices and automations.
[ "def refresh(self):\n \"\"\"\"\"\"\n self.get_devices(refresh=True)\n self.get_automations(refresh=True)" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
生成 @author nash.tang <112614251@qq.com>
[ "public function run()\n {\n if(Schema::hasTable(strtolower($this->model)))\n {\n $tableName = strtolower($this->model);\n }elseif(Schema::hasTable(strtolower($this->model).\"s\")) {\n $tableName = strtolower($this->model.\"s\");\n }else{\n $tableName ...
[ "func (bc *BaiduClient) BaiduLogin(username, password, verifycode, vcodestr string) (lj *LoginJSON) {\n\tlj = &LoginJSON{}\n\tenpass, err := bdcrypto.RSAEncryptOfWapBaidu(bc.rsaPublicKeyModulus, []byte(password+bc.serverTime))\n\tif err != nil {\n\t\tlj.ErrInfo.No = \"-1\"\n\t\tlj.ErrInfo.Msg = \"RSA加密失败, \" + err....
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Emit one line of the error message report. By default, error messages are printed to System.err. Subclasses may override. @param line one line of the error report
[ "@Override\n protected void emitLine(String line) {\n if (writer == null) {\n super.emitLine(line);\n return;\n }\n line = line.replaceAll(\"\\t\", \" \");\n writer.println(line);\n }" ]
[ "def __do_parse(self, pattern_str):\n \n in_ = antlr4.InputStream(pattern_str)\n lexer = STIXPatternLexer(in_)\n lexer.removeErrorListeners() # remove the default \"console\" listener\n token_stream = antlr4.CommonTokenStream(lexer)\n\n parser = STIXPatternParser(token_str...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Creates and sets the authentication string for accessing the reverse lookup servlet. No return, the string is set as an attribute to the client instance. :param username: Username. :param password: Password.
[ "def __set_revlookup_auth_string(self, username, password):\n '''\n \n '''\n auth = b2handle.utilhandle.create_authentication_string(username, password)\n self.__revlookup_auth_string = auth" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Create a form from an object. @param string|object $entity @return \CmsCommon\Form\FormInterface
[ "public function createForm($entity)\n {\n $formSpec = ArrayUtils::iteratorToArray($this->getFormSpecification($entity));\n if (!isset($formSpec['options']['merge_input_filter'])) {\n $formSpec['options']['merge_input_filter'] = true;\n }\n\n return $this->getFormFactory()-...
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Paints the barcode. If no exception was thrown a valid barcode is available.
[ "public void paintCode() {\n int maxErr, lenErr, tot, pad;\n if ((options & PDF417_USE_RAW_CODEWORDS) != 0) {\n if (lenCodewords > MAX_DATA_CODEWORDS || lenCodewords < 1 || lenCodewords != codewords[0]) {\n throw new IllegalArgumentException(\"Invalid codeword size.\");\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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param string $eventName @param object $fileReference @param FileMetadata $metadata @return IUploadEvent
[ "public function dispatch($eventName, $fileReference, FileMetadata $metadata)\n {\n $event = new UploadEvent($fileReference, $metadata);\n\n foreach ($this->listeners[$eventName] as $listener) {\n call_user_func($listener, $event);\n }\n\n foreach ($this->subscribers as $su...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// IsAllowedNetwork returns true if the given host (IP or resolvable // hostname) is in the set of allowed networks (CIDR format only).
[ "func IsAllowedNetwork(host string, allowed []string) bool {\n\tif hostNoPort, _, err := net.SplitHostPort(host); err == nil {\n\t\thost = hostNoPort\n\t}\n\n\taddr, err := net.ResolveIPAddr(\"ip\", host)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tfor _, n := range allowed {\n\t\tresult := true\n\t\tif strings....
[ "def lookup_from_headers(cls, headers):\n \n\n # A single address, set by this server, returned as an Array\n remote_addr = cls.ips_from(headers.get(\"REMOTE_ADDR\"))\n\n # Could be a CSV list and/or repeated headers that were concatenated.\n forwarded_ips = cls.ips_from(headers.g...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Extends a service definition. @param string $name @param callable $callable @param boolean $strict @return callable @throws InvalidArgumentException
[ "public function extend($name, $callable, $strict = true)\n {\n if (!$this->services->has($name)) {\n if ($strict) {\n throw new InvalidArgumentException(sprintf('Service \"%s\" is not defined.', $name));\n } else {\n return false;\n }\n ...
[ "function validateService($pluginInstance)\n {\n if (!is_object($pluginInstance))\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof iAuthenticator)\n throw new exContainerInvalidServiceType('Invalid Plugin...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Pushes request data to the open http connection @param connection - the open connection of the http call @param request - the parameters to be passed to the endpoint for the service call
[ "private void writeJsonDataRequest(HttpURLConnection connection, Request request) {\n try (OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream())) {\n wr.write(request.getJsonPayload().toString());\n wr.flush();\n } catch (IOException e) {\n log.e...
[ "def do_threaded_dispatch(participant, msg)\n\n msg = Rufus::Json.dup(msg)\n #\n # the thread gets its own copy of the message\n # (especially important if the main thread does something with\n # the message 'during' the dispatch)\n\n # Maybe at some point a limit on the number...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
transforms `<div><tag @element/></tag><div>` and `<div><@element/></div>` into valid HTML. and then creates a DOM Element
[ "function createDomElementFromTemplate(html) {\n //match container markers like <@element/>\n let containerTags = html.match(rContainerGlobal) || [];\n\n for (let containerTag of containerTags) {\n let [, containerName, attrs = ''] = rContainer.exec(containerTag);\n let template = `<script ty...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Create options for the find query. Note that these are separate from the options for executing the command, which are created in createExecuteOptions(). @return array
[ "private function createQueryOptions()\n {\n $options = [];\n\n if (isset($this->options['cursorType'])) {\n if ($this->options['cursorType'] === self::TAILABLE) {\n $options['tailable'] = true;\n }\n if ($this->options['cursorType'] === self::TAILABL...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Adds a column, or array of column names that would be used for an INSERT INTO statement. @param mixed $columns A column name, or array of column names. @return Query Returns this object to allow chaining.
[ "public function columns($columns)\n {\n if ( is_null($this->columns) ){\n $this->columns = new Element('()', $columns);\n }\n else {\n $this->columns->append($columns);\n }\n\n return $this;\n }" ]
[ "public function doBind( PDOStatement $stmt )\n {\n foreach ( $this->boundValues as $key => $value )\n {\n try\n {\n $stmt->bindValue( $key, $value, $this->boundValuesType[$key] );\n }\n catch ( PDOException $e )\n {\n ...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Before save event. @throws \yii\base\InvalidConfigException
[ "public function beforeSave()\n {\n if ($this->file instanceof UploadedFile) {\n\n if (true !== $this->owner->isNewRecord) {\n /** @var ActiveRecord $oldModel */\n $oldModel = $this->owner->findOne($this->owner->primaryKey);\n $behavior = static::get...
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retrieve a list of the available P3 project names from a directory. @param directory directory containing P3 files @return list of project names
[ "public static final List<String> listProjectNames(File directory)\n {\n List<String> result = new ArrayList<String>();\n\n File[] files = directory.listFiles(new FilenameFilter()\n {\n @Override public boolean accept(File dir, String name)\n {\n return name.toUpperCase()...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Searches for a command of the passed-in type and if found removes it from the user's PLF.
[ "private static void removeDirective(\n String elementId, String attributeName, String type, IPerson person) {\n Document plf = (Document) person.getAttribute(Constants.PLF);\n Element node = plf.getElementById(elementId);\n if (node == null) return;\n\n Element editSet = null...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Geometry retrieves an up-to-date version of the this window's geometry. // It also loads the geometry into the Geom member of Window.
[ "func (w *Window) Geometry() (xrect.Rect, error) {\n\tgeom, err := RawGeometry(w.X, xproto.Drawable(w.Id))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tw.Geom = geom\n\treturn geom, err\n}" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github comment about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code:" }
A mutable builder for a {@link Metadata} object. @param r the resource @return a builder for a {@link Metadata} object
[ "public static Builder builder(final Resource r) {\n return builder(r.getIdentifier()).interactionModel(r.getInteractionModel())\n .container(r.getContainer().orElse(null))\n .memberRelation(r.getMemberRelation().orElse(null))\n .membership...
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// GenerateWithPrefix generates a string with a given prefix then a given number of randomly selected characters.
[ "func GenerateWithPrefix(prefix string, characters uint8) string {\r\n\treturn Prefixed{Prefix: prefix, Len: characters}.Generate()\r\n}" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Handles help requests.
[ "def _HandleHelp(self, request):\n \"\"\"\"\"\"\n help_path = request.path.split(\"/\", 2)[-1]\n if not help_path:\n raise werkzeug_exceptions.Forbidden(\"Error: Invalid help path.\")\n\n # Proxy remote documentation.\n return self._RedirectToRemoteHelp(help_path)" ]
[ "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 Web development:", "pos": "Represent the code about Web development:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(EndpointSendConfiguration endpointSendConfiguration, ProtocolMarshaller protocolMarshaller) {\n\n if (endpointSendConfiguration == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// WriteFileFromReader creates and uploads a "file" JSON schema // composed of chunks of r, also uploading the chunks. The returned // BlobRef is of the JSON file schema blob. // The filename is optional.
[ "func WriteFileFromReader(ctx context.Context, bs blobserver.StatReceiver, filename string, r io.Reader) (blob.Ref, error) {\n\treturn WriteFileFromReaderWithModTime(ctx, bs, filename, time.Time{}, r)\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
Run the module setup This method will be called if the ZFTool setup modules command will be executed.
[ "public function runSetup()\n {\n if ($this->params->forceIsActive) {\n $this->createRootCategory()\n ->createDefaultTypes()\n ->createDefaultPriorities();\n }\n\n if ($this->getParams()->createSampleData) {\n $this->createSampleData();\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return an existing AuthTicket for a given service.
[ "def get_ticket(self, service):\n \"\"\"\"\"\"\n return self.auth_tickets \\\n .filter(expires__gt=datetime.now(timezone.utc), service=service) \\\n .last()" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Determine directory to log import/export reports to
[ "private File determineLogDirectory(final BatchOptions options, String operation) {\n File logDirectoryParent = options != null ? options.getLogDirectoryParent() : null;\n if (logDirectoryParent == null) {\n logDirectoryParent = Files.createTempDir();\n }\n File logDirectory =...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Sets the oauth_client attribute
[ "def set_oauth_client(self, consumer_key, consumer_secret):\n \n self.oauth_client = oauth1.Client(consumer_key, consumer_secret)" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Synchronize and redraw the Pager UI if necessary. @method syncPagerUi @private
[ "function syncPagerUi(page) {\n var carousel = this, numPages, numVisible;\n\n // Don't do anything if the Carousel is not rendered\n if (!carousel._hasRendered) {\n return;\n }\n\n numVisible = carousel.get(\"numVisible\");\n\n if (!JS.isNumber(page)) {\n ...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Iterate over all items in the store.
[ "function iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.ready().then(function() {\n try {\n var keyPrefix = self._dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.leng...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Attepmt to parse an ISO8601 formatted duration based on a start datetime. Accepts a ``duration`` and a start ``datetime``. ``duration`` must be an ISO8601 formatted string. Returns a ``datetime.timedelta`` object.
[ "def parse_duration_with_start(start, duration):\n \n elements = _parse_duration_string(_clean(duration))\n year, month = _year_month_delta_from_elements(elements)\n\n end = start.replace(\n year=start.year + year,\n month=start.month + month\n )\n\n del elements['years']\n del el...
[ "def datetime2literal_rnc(d: datetime.datetime, c: Optional[Dict]) -> str:\n \"\"\"\"\"\"\n # dt = d.strftime(\"%Y-%m-%d %H:%M:%S\")\n # ... can fail with e.g.\n # ValueError: year=1850 is before 1900; the datetime strftime() methods\n # require year >= 1900\n # http://stackoverflow.com/questi...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Validate as integer. @param int|string $number The integer to check @param int $min The minimum integer value @param int $max The maximum integer value @return bool
[ "public function isInteger($number, int $min = null, int $max = null): bool\n {\n return isset($min) || isset($max)\n ? filter_var($number, FILTER_VALIDATE_INT, $this->getIntegerOptionsBetween($min, $max))\n : filter_var($number, FILTER_VALIDATE_INT);\n }" ]
[ "public function isValid()\n {\n $value = $this->field->getValue();\n\n if (is_array($value) || is_object($value)) {\n throw new \\Exception(\"This validator only works on scalar types!\");\n }\n\n // required but not given.\n if ($this->required && strval($value) ==...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
@param SerializerInterface|null $serializer @return SerializerInterface
[ "protected static function prepareSerializer(SerializerInterface $serializer = null)\n {\n if (null === $serializer) {\n $serializer = SerializerFactory::create();\n }\n\n return $serializer;\n }" ]
[ "public function objectFromIndex(IObjectSetWithIdentityByIndex $objects) : ObjectFieldBuilder\n {\n return new ObjectFieldBuilder(\n $this->type(new ObjectIdType(new ObjectIndexOptions($objects), $loadAsObjects = true))\n );\n }" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Changes group's approval mode :param require_admin_approval: True or False :param thread_id: Group ID to remove people from. See :ref:`intro_threads` :raises: FBchatException if request failed
[ "def changeGroupApprovalMode(self, require_admin_approval, thread_id=None):\n \n thread_id, thread_type = self._getThread(thread_id, None)\n\n data = {\"set_mode\": int(require_admin_approval), \"thread_fbid\": thread_id}\n j = self._post(self.req_url.APPROVAL_MODE, data, fix_request=Tru...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
SLIDE 5: Bar Chart: Data Series Colors, majorUnits, and valAxisLabelFormatCode ------
[ "function slide5() {\n\t\tvar slide = pptx.addNewSlide();\n\t\tslide.addNotes('API Docs: https://gitbrent.github.io/PptxGenJS/docs/api-charts.html');\n\t\tslide.addTable( [ [{ text:'Chart Examples: Multi-Color Bars, `catLabelFormatCode`, `valAxisMajorUnit`, `valAxisLabelFormatCode`', options:gOptsTextL },gOptsTextR...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Add this operation to the _Bulk instance `bulkobj`.
[ "def _add_to_bulk(self, bulkobj):\n \"\"\"\"\"\"\n bulkobj.add_update(self._filter, self._doc, False, self._upsert,\n collation=self._collation)" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// UnmarshalCheckpoint tries to unmarshal passed bytes to checkpoint
[ "func (cp *CPUManagerCheckpoint) UnmarshalCheckpoint(blob []byte) error {\n\treturn json.Unmarshal(blob, cp)\n}" ]
[ "func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Update Password @param $username @return mixed
[ "public function mailPasswordResetLink($username)\n {\n return $this->apiClient->callEndpoint(\n sprintf('user/mail/password?username=%s', $username),\n array(),\n null,\n HttpMethod::REQUEST_POST\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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
TD-lambda returns.
[ "def lambda_return(reward, value, length, discount, lambda_):\n \"\"\"\"\"\"\n timestep = tf.range(reward.shape[1].value)\n mask = tf.cast(timestep[None, :] < length[:, None], tf.float32)\n sequence = mask * reward + discount * value * (1 - lambda_)\n discount = mask * discount * lambda_\n sequence = tf.stack...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetRestApiId sets the RestApiId field's value.
[ "func (s *GetIntegrationResponseInput) SetRestApiId(v string) *GetIntegrationResponseInput {\n\ts.RestApiId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Static utility method for facilitating writes on input object @param parent the source object @param matchedElement the current spec (leaf) element that was matched with input @param value to write @param opMode to determine if write is applicable
[ "@SuppressWarnings( \"unchecked\" )\n protected static void setData(Object parent, MatchedElement matchedElement, Object value, OpMode opMode) {\n if(parent instanceof Map) {\n Map source = (Map) parent;\n String key = matchedElement.getRawKey();\n if(opMode.isApplicable( ...
[ "@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 writing:", "pos": "Represent the code about writing:", "neg": "Represent the code:" }
// Get requests a single machine from the registry
[ "func (m *MachinesClient) Get(ctx context.Context, machineID *identity.ID) (*apitypes.MachineSegment, error) {\n\tresp := &apitypes.MachineSegment{}\n\terr := m.client.RoundTrip(ctx, \"GET\", \"/machines/\"+(*machineID).String(), nil, nil, &resp)\n\treturn resp, err\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Apply the given filtering criterion to a copy of this Query, using keyword expressions.
[ "def filter_by(self, **kwargs):\n \n query = self._copy()\n for field, value in kwargs.items():\n query.domain.append(\n (field, '=', value)\n )\n return query" ]
[ "@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:" }
Execute the console command. @return void
[ "public function handle()\n {\n $events = $this->schedule->dueEvents($this->container);\n\n foreach ($events as $event) {\n $this->line('<info>Running scheduled command:</info> ' .$event->getSummaryForDisplay());\n\n $event->run($this->container);\n }\n\n if (cou...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Used to create configuration files, set permissions and so on.
[ "def main(overwrite):\n \n logger.debug(\"Checking existence of '%s'.\", CONF_PATH)\n if not os.path.exists(CONF_PATH):\n logger.debug(\"Directory %s not found! Panicking..\", CONF_PATH)\n raise UserWarning(\n \"Can't find '%s' - it looks like ProFTPD is not installed!\" % (\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 text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Combine --pythonpath and --pants_config_files(pants.ini) files that are in {buildroot} dir with those invalidation_globs provided by users :param bootstrap_options: :return: A list of invalidation_globs
[ "def compute_invalidation_globs(bootstrap_options):\n \n buildroot = get_buildroot()\n invalidation_globs = []\n globs = bootstrap_options.pythonpath + \\\n bootstrap_options.pants_config_files + \\\n bootstrap_options.pantsd_invalidation_globs\n\n for glob in globs:\n glob_relpath = o...
[ "def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
delete the file from the filesystem.
[ "def delete(self):\n \"\"\"\"\"\"\n if self.isfile:\n os.remove(self.fn)\n elif self.isdir:\n shutil.rmtree(self.fn)" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Build SDK client. Can be called only once in onCreate callback on Application class.
[ "public static Observable<RxComapiClient> initialise(@NonNull Application app, @NonNull ComapiConfig config) {\n\n String error = checkIfCanInitialise(app, config, false);\n if (!TextUtils.isEmpty(error)) {\n return Observable.error(new Exception(error));\n }\n\n RxComapiClien...
[ "@Override\n public void handlerAdded(ChannelHandlerContext ctx) throws Exception {\n if (ctx.channel().isRegistered()) {\n // This should always be true with our current DefaultChannelPipeline implementation.\n // The good thing about calling initChannel(...) in handlerAdded(...) is...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Add the version of wily to the help heading. :param f: function to decorate :return: decorated function
[ "def add_version(f):\n \n doc = f.__doc__\n f.__doc__ = \"Version: \" + __version__ + \"\\n\\n\" + doc\n return f" ]
[ "def config_ctx(func):\n \n # Create ConfigurationContext subclass\n class _ConfigurationContext(ConfigurationContext):\n # Set command name for the context class\n cmd = func.__name__\n\n # Set function name for the context class\n fun = func.__name__\n\n # Store the created...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Restart the sequence by resetting the current value. This is the only // method that allows direct manipulation of the sequence state which violates // the monotonically increasing or decreasing rule. Use with care and as a // fail safe if required.
[ "func (s *Sequence) Restart() error {\n\t// Ensure that the sequence has been initialized.\n\tif !s.initialized {\n\t\treturn errors.New(\"sequence has not been initialized\")\n\t}\n\n\t// Ensure unsigned subtraction won't lead to a problem.\n\tif int(s.minvalue)-int(s.increment) < 0 {\n\t\treturn errors.New(\"the ...
[ "public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// CreateVirtualDNS creates a new Virtual DNS cluster. // // API reference: https://api.cloudflare.com/#virtual-dns-users--create-a-virtual-dns-cluster
[ "func (api *API) CreateVirtualDNS(v *VirtualDNS) (*VirtualDNS, error) {\n\tres, err := api.makeRequest(\"POST\", \"/user/virtual_dns\", v)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, errMakeRequestError)\n\t}\n\n\tresponse := &VirtualDNSResponse{}\n\terr = json.Unmarshal(res, &response)\n\tif err != nil {\...
[ "def authorize_proxy_routes\n deny_access unless (authenticate || authenticate_client)\n\n route, params = Engine.routes.router.recognize(request) do |rte, parameters|\n break rte, parameters if rte.name\n end\n\n # route names are defined in routes.rb (:as => :name)\n case route.nam...
codesearchnet
{ "query": "Represent the Github post about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code:" }
Edit changelog & version, git commit, and git tag, to set up for release.
[ "def prepare(c):\n \n # Print dry-run/status/actions-to-take data & grab programmatic result\n # TODO: maybe expand the enum-based stuff to have values that split up\n # textual description, command string, etc. See the TODO up by their\n # definition too, re: just making them non-enum classes period...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Uses ssh-keygen to generate a public/private key pair. @return array
[ "public function generate()\n {\n $tempPath = sys_get_temp_dir() . '/';\n\n // FastCGI fix for Windows machines, where temp path is not available to\n // PHP, and defaults to the unwritable system directory. If the temp\n // path is pointing to the system directory, shift to the 'TEM...
[ "def new_device(self, name, type):\n \n # at least android client also includes a \"cid\" with is derived from the unique device id\n # and encrypted with a public key in the apk. The field appears to be optional\n url = posixpath.join(self.rootpath, name)\n r = self.post(url, {'...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Marca o atendimento como nao compareceu. @param Novosga\Request $request @Route("/nao_compareceu", name="novosga_attendance_naocompareceu", methods={"POST"})
[ "public function naoCompareceu(\n Request $request,\n AtendimentoService $atendimentoService,\n TranslatorInterface $translator\n ) {\n $usuario = $this->getUser();\n $unidade = $usuario->getLotacao()->getUnidade();\n $atual = $atendimentoService->atendimentoAndamento(...
[ "def desbloquear_sat(self):\n \n resp = self._http_post('desbloquearsat')\n conteudo = resp.json()\n return RespostaSAT.desbloquear_sat(conteudo.get('retorno'))" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
If not already created, a new <code>ejb-ref</code> element will be created and returned. Otherwise, the first existing <code>ejb-ref</code> element will be returned. @return the instance defined for the element <code>ejb-ref</code>
[ "public EjbRefType<WebFragmentType<T>> getOrCreateEjbRef()\n {\n List<Node> nodeList = childNode.get(\"ejb-ref\");\n if (nodeList != null && nodeList.size() > 0)\n {\n return new EjbRefTypeImpl<WebFragmentType<T>>(this, \"ejb-ref\", childNode, nodeList.get(0));\n }\n return creat...
[ "private void required(String attributeName, String attributValue) throws ApplicationException {\n\tif (StringUtil.isEmpty(attributValue))\n\t throw new ApplicationException(\"invalid attribute constellation for the tag zip\", \"attribute [\" + attributeName + \"] is required, if action is [\" + action + \"]\");...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Registers that new API call has been made. @param string $api_key @param string $region @param string $app_header
[ "public function registerAppLimits( string $api_key, string $region, string $app_header )\n\t{\n\t\t$limits = self::parseLimitHeaders($app_header);\n\t\t$this->initApp($api_key, $region, $limits);\n\t}" ]
[ "public function writeApiRequestingLog(Events\\ApiRequesting $event)\n {\n Log::debug(\"Requesting To {$event->driver} Api\", [$event->endpoint, $event->payload]);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Render the field. @access public @return mixed|string
[ "public function render()\n\t{\n\t\tswitch ($this->getContext()) {\n\t\t\tcase BaseField::CONTEXT_LIST:\n\t\t\t\treturn '<img src=\"' . asset($this->getValue()). '\" width=\"10%\">';\n\t\t\t\tbreak;\n\t\t\tcase BaseField::CONTEXT_FILTER:\n\t\t\tcase BaseField::CONTEXT_FORM:\n\t\t\t\treturn View::make('krafthaus/bau...
[ "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:" }
// validate makes sure the types are sound
[ "func (typedData *TypedData) validate() error {\n\tif err := typedData.Types.validate(); err != nil {\n\t\treturn err\n\t}\n\tif err := typedData.Domain.validate(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}" ]
[ "function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception\r\n\t{\r\n\t\tcurrent_hostname_responses result = (current_hostname_responses) service.get_payload_formatter().string_to_resource(current_hostname_responses.class, response);\r\n\t\tif(result.errorcode != 0)\...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Prepare content for notification index @api private @param [Object] target Notification target instance @param [Array<Notificaion>] notification_index Array notification index @param [Hash] params Option parameter to send render_notification
[ "def prepare_content_for(target, notification_index, params)\n content_for :notification_index do\n @target = target\n begin\n render_notification notification_index, params\n rescue ActionView::MissingTemplate\n params.delete(:target)\n render_noti...
[ "def set_note_attribute(data):\n \n na = False\n if data.get('link'):\n na = Types.NoteAttributes()\n # add the url\n na.sourceURL = data.get('link')\n # add the object to the note\n return na" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
removes inactive clients (will be run in its own thread, about once every second)
[ "def cleanup(self):\n \n\n while self.inactive_timeout > 0:\n self.time = time.time()\n\n keys = []\n\n for key, client in self.clients.items.items():\n t = getattr(client, \"active_at\", 0)\n if t > 0 and self.time - t > self.inactive_tim...
[ "def _limit_call_handler(self):\n \n # acquire a lock on our threading.Lock() object\n with self.limit_lock:\n # if we have no configured limit, exit. the lock releases based on scope\n if self.limit_per_min <= 0:\n return\n\n now = time.time()\n...
codesearchnet
{ "query": "Represent the Github comment about command or instruction:", "pos": "Represent the Github code about command or instruction:", "neg": "Represent the Github code:" }
读取为文本格式<br> 使用{@link ExcelExtractor} 提取Excel内容 @param withSheetName 是否附带sheet名 @return Excel文本 @since 4.1.0
[ "public String readAsText(boolean withSheetName) {\r\n\t\tfinal ExcelExtractor extractor = getExtractor();\r\n\t\textractor.setIncludeSheetNames(withSheetName);\r\n\t\treturn extractor.getText();\r\n\t}" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }