query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// Reduce runs the reducer registered to the reducerId,
// combining all rows into one row | [
"func (d *Dataset) Reduce(name string, reducerId gio.ReducerId) (ret *Dataset) {\n\n\tname = name + \".Reduce\"\n\n\tret = d.LocalReduceBy(name+\".LocalReduce\", reducerId, nil)\n\tif len(d.Shards) > 1 {\n\t\tret = ret.MergeTo(name, 1).LocalReduceBy(name+\".LocalReduce2\", reducerId, nil)\n\t}\n\treturn ret\n}"
] | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
// Remove the integer x from the bitmap | [
"func (rb *Bitmap) Remove(x uint32) {\n\thb := highbits(x)\n\ti := rb.highlowcontainer.getIndex(hb)\n\tif i >= 0 {\n\t\tc := rb.highlowcontainer.getWritableContainerAtIndex(i).iremoveReturnMinimized(lowbits(x))\n\t\trb.highlowcontainer.setContainerAtIndex(i, c)\n\t\tif rb.highlowcontainer.getContainerAtIndex(i).get... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Updates foreign keys into master table.
@param metadata
the metadata
@param id
the id
@param relationHolders
the relation holders | [
"private void updateForeignKeys(EntityMetadata metadata, Object id, List<RelationHolder> relationHolders)\n {\n for (RelationHolder rh : relationHolders)\n {\n String linkName = rh.getRelationName();\n Object linkValue = rh.getRelationValue();\n if (linkName != null... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
/* Flatten facial parts. | [
"function flatten(keys) {\n var result = []\n var index = -1\n var length = keys.length\n\n while (++index < length) {\n if (own.call(alias, keys[index])) {\n result = result.concat(flatten(alias[keys[index]]))\n } else if (Array.isArray(keys[index])) {\n result = result.concat(keys[index])\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// copy returns an independent copy of the state. | [
"func (s *State) copy() *State {\n\tcopy := &State{\n\t\tRelationId: s.RelationId,\n\t\tChangedPending: s.ChangedPending,\n\t}\n\tif s.Members != nil {\n\t\tcopy.Members = map[string]int64{}\n\t\tfor m, v := range s.Members {\n\t\t\tcopy.Members[m] = v\n\t\t}\n\t}\n\treturn copy\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Atari parameters with world model as policy. | [
"def ppo_original_world_model():\n \"\"\"\"\"\"\n hparams = ppo_original_params()\n hparams.policy_network = \"next_frame_basic_deterministic\"\n hparams_keys = hparams.values().keys()\n video_hparams = basic_deterministic_params.next_frame_basic_deterministic()\n for (name, value) in six.iteritems(video_hpar... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets methods.
@param privileged the privileged
@return the methods | [
"public Set<Method> getMethods(boolean privileged) {\n if (privileged) {\n return Collections.unmodifiableSet(Sets.union(methods, declaredMethods));\n } else {\n return Collections.unmodifiableSet(methods);\n }\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 sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns a successful update result.
@param result the update result
@param <T> the result type
@return the successful result | [
"public static <T> CollectionUpdateResult<T> ok(T result) {\n return new CollectionUpdateResult<>(Status.OK, result);\n }"
] | [
"@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 description about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Software development:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public EClass getNewUserAdded() {\r\n\t\tif (newUserAddedEClass == null) {\r\n\t\t\tnewUserAddedEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(LogPackage.eNS_URI).getEClassifiers()\r\n\t\t\t\t\t.get(7);\r\n\t\t}\r\n\t\treturn newUserAddedEClass;\r\n\t}"
] | [
"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 description about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Get the DPI when nonsquare DPI is tolerable | [
"def get_page_dpi(pageinfo, options):\n \"\"\n xres = max(\n pageinfo.xres or VECTOR_PAGE_DPI,\n options.oversample or 0,\n VECTOR_PAGE_DPI if pageinfo.has_vector else 0,\n )\n yres = max(\n pageinfo.yres or VECTOR_PAGE_DPI,\n options.oversample or 0,\n VECTOR_P... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
This is called upon unpickling, rather than the default which doesn't
have arguments and breaks __new__. | [
"def _new_Index(cls, d):\n \n # required for backward compat, because PI can't be instantiated with\n # ordinals through __new__ GH #13277\n if issubclass(cls, ABCPeriodIndex):\n from pandas.core.indexes.period import _new_PeriodIndex\n return _new_PeriodIndex(cls, **d)\n return cls.__n... | [
"def _handle_byref_decl(self, node, scope, ctxt, stream):\n \n self._dlog(\"handling byref decl\")\n field = self._handle_node(node.type.type, scope, ctxt, stream)\n\n # this will not really be used (maybe except for introspection)\n # with byref function params\n # see iss... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about writing:"
} |
// SecondExampleV1 retrieves the SecondExampleV1Client | [
"func (c *Clientset) SecondExampleV1() secondexamplev1.SecondExampleV1Interface {\n\treturn &fakesecondexamplev1.FakeSecondExampleV1{Fake: &c.Fake}\n}"
] | [
"@Override\n public void perform() throws PortalException {\n // push the change into the PLF\n if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {\n // remove the parm edit\n ParameterEditManager.removeParmEditDirective(nodeId, name, person);\n }\n // pu... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
This method is static to avoid concurrent access issues. | [
"private static void harvestPackageList(BundlePackages packages, Bundle bundle) {\n // Double check that the bundle is (still) installed:\n if (bundle.getLocation() != null && bundle.getState() != Bundle.UNINSTALLED) {\n BundleManifest manifest = new BundleManifest(bundle);\n /*\... | [
"static ImmutableSet<ExecutableElement> abstractMethodsIn(\n ImmutableSet<ExecutableElement> methods) {\n Set<Name> noArgMethods = new HashSet<>();\n ImmutableSet.Builder<ExecutableElement> abstracts = ImmutableSet.builder();\n for (ExecutableElement method : methods) {\n if (method.getModifiers(... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Return the HTML or CLI debug report.
@param array $backtrace
@return string | [
"public static function getReport(array $backtrace) {\n\t\t$r = '';\n\n\t\tif(static::$format === 'html') {\n\t\t\t$request = \\Asgard\\Http\\Request::singleton();\n\t\t\t$r .= static::getHTMLBacktrace($request, $backtrace);\n\t\t\t$r .= static::getHTMLRequest($request);\n\t\t}\n\t\telse\n\t\t\t$r .= static::getCLI... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get customised data if we have a customiser set
@param TaskLogCollection $collection
@return array | [
"private function getCustomisedData(TaskLogCollection $collection)\n {\n $data = [];\n\n if (!is_null($this->rowCustomiser)) {\n foreach ($collection as $taskLogEntity) {\n $newCustomiser = $this->rowCustomiser->bindTo($taskLogEntity, $taskLogEntity);\n\n $d... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get review image.
@param \simplehtmldom_1_5\simple_html_dom $top_area
@return string | [
"private function getReviewImage($top_area)\n {\n $image = $top_area->find('table', 0);\n $image = $image->find('td', 0)->find('img', 0)->src;\n\n return Helper::imageUrlCleaner($image);\n }"
] | [
"def single(self):\n \n return 'display: none;' not in self._looking_for_xpb.li(id='ajax_single').\\\n one_(self._profile.profile_tree).attrib['style']"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Adds the corner of Polygon.
@param x The x-coordinate of a new added corner.
@param y The y-coordinate of a new added corner. | [
"public void vertex(double x, double y) {\n MODE = LINES;\n this.cornerX.add(x);\n this.cornerY.add(y);\n this.cornerZ.add(0d);\n setNumberOfCorner(this.cornerX.size());\n calcG();\n }"
] | [
"def collides(self, other):\n \"\"\"\"\"\"\n\n angle = self.angle\n width = self.width\n height = self.height\n\n if angle == 0:\n return other.collides(Rect(-0.5 * width,\n -0.5 * height, width, height))\n\n # Phase 1\n ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns an {@link AuthnRequest} which is mapped to the specified identity provider. | [
"private AuthnRequest createAuthRequest(SamlIdentityProviderConfig idp, String defaultHostname) {\n requireNonNull(idp, \"idp\");\n\n final AuthnRequest authnRequest = build(AuthnRequest.DEFAULT_ELEMENT_NAME);\n\n final Issuer issuer = build(Issuer.DEFAULT_ELEMENT_NAME);\n issuer.setValu... | [
"private Subject authenticateWithCertificateChain(SSLSession session) throws SSLPeerUnverifiedException, AuthenticationException, CredentialExpiredException, CredentialDestroyedException {\n Subject transportSubject = null;\n if (session != null) {\n Certificate[] certificateChain = session... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
包装字段名<br>
有时字段与SQL的某些关键字冲突,导致SQL出错,因此需要将字段名用单引号或者反引号包装起来,避免冲突
@param entity 被包装的实体
@return 包装后的字段名 | [
"public Entity wrap(Entity entity){\r\n\t\tif(null == entity) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tfinal Entity wrapedEntity = new Entity();\r\n\t\t\r\n\t\t//wrap table name\r\n\t\twrapedEntity.setTableName(wrap(entity.getTableName()));\r\n\t\t\r\n\t\t//wrap fields\r\n\t\tfor (Entry<String, Object> entry... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Reply to native ping (from browser's native websocket layer) with native pong | [
"@Override\n protected void wsPingReceived(NextFilter nextFilter, IoSession session, WsPingMessage wsPing) throws Exception {\n WsPongMessage reply = new WsPongMessage(wsPing.getBytes());\n nextFilter.filterWrite(session, new DefaultWriteRequestEx(reply));\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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Strategy directly computes dependency graph node based on
`classes_by_source`, `runtime_classpath`, `product_deps_by_src` parameters and
stores the result to the build cache. | [
"def calculating_node_creator(self, classes_by_source, runtime_classpath, product_deps_by_src,\n target_to_vts):\n \n analyzer = JvmDependencyAnalyzer(get_buildroot(), runtime_classpath)\n targets = self.context.targets()\n targets_by_file = analyzer.targets_by_file(targets... | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Get the current values for a metric.
Returns a dictionary with metric values accumulated for the seconds,
minutes, hours, day, week, month, and year. | [
"def get_metric(self, slug):\n \n results = OrderedDict()\n granularities = self._granularities()\n keys = self._build_keys(slug)\n for granularity, key in zip(granularities, keys):\n results[granularity] = self.r.get(key)\n return results"
] | [
"def count(self):\n \n # Save the existing rows and start parameters to see how many results were actually expected\n _rows = self._solr_params.get('rows', None)\n _start = self._solr_params.get('start', 0)\n if not self._solr_cache:\n # Get the count for everything\n ... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// RemoveIdentity removes identity
// key: registrar private key
// cert: registrar enrollment certificate | [
"func (c *fabricCAAdapter) RemoveIdentity(key core.Key, cert []byte, request *api.RemoveIdentityRequest) (*api.IdentityResponse, error) {\n\n\tlogger.Debugf(\"Removing identity [%s]\", request.ID)\n\n\t// Create remove request\n\treq := caapi.RemoveIdentityRequest{\n\t\tCAName: request.CAName,\n\t\tForce: request.... | [
"func registerFlags(c *cli.Config, f *flag.FlagSet) {\n\tf.StringVar(&c.CertFile, \"cert\", \"\", \"Client certificate that contains the public key\")\n\tf.StringVar(&c.KeyFile, \"key\", \"\", \"private key for the certificate\")\n\tf.StringVar(&c.CABundleFile, \"ca-bundle\", \"\", \"path to root certificate store\... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Draw bar graph.
Now handles positive and negative values gracefully. | [
"def draw(svg, coords, options = {})\n coords.each_with_index do |coord,idx|\n next if coord.nil?\n x, y, bar_height = (coord.first), coord.last, 1#(height - coord.last)\n \n valh = max_value + min_value * -1 #value_height\n maxh = max_value * height / valh #positive area... | [
"def data_class_detection(self, data):\n \n assert(isinstance(data, list) or isinstance(data, tuple))\n if not isinstance(self, (LineChart, BarChart, ScatterChart)):\n # From the link above:\n # Simple encoding is suitable for all other types of chart\n # re... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Validates map coordinates
@return boolean|null | [
"protected function validateDataMapStore()\n {\n $field = 'data.map';\n $value = $this->getSubmitted($field);\n\n if (empty($value)) {\n return null;\n }\n\n $label = $this->translation->text('Map');\n\n if (!is_array($value) || count($value) != 2) {\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Density function for uniform distribution
@param x Location to get density for
@param min {number} Minimum value
@param max {number} Maximum value
@returns {number} Density of the function given the location and parameters | [
"function(x, min, max) {\n x = this._v(x, \"r\");\n min = this._v(min, \"r\", 0);\n max = this._v(max, \"r\", 1);\n if(min > max) throw new Error(\"Minimum value cannot be greater than maximum value\");\n\n if(x < min || ... | [
"def _pdf_value(pdf, population, fitnesses, fitness_threshold):\n \n # Add the chance of obtaining a solution from the pdf\n # when the fitness for that solution exceeds a threshold\n value = 0.0\n for solution, fitness in zip(population, fitnesses):\n if fitness >= fitness_threshold:\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns the path where the models should be stored.
@return string | [
"protected function getInformationTargetPath()\n {\n if ($path = array_get($this->config, 'path')) {\n return $path;\n }\n\n return rtrim($this->getInformationTargetBasePath(), DIRECTORY_SEPARATOR)\n . DIRECTORY_SEPARATOR\n . $this->getInformationTargetRela... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get the type of output script that will be used for sending to the address. This is either
{@link ScriptType#P2WPKH} or {@link ScriptType#P2WSH}.
@return type of output script | [
"@Override\n public ScriptType getOutputScriptType() {\n int version = getWitnessVersion();\n checkState(version == 0);\n int programLength = getWitnessProgram().length;\n if (programLength == WITNESS_PROGRAM_LENGTH_PKH)\n return ScriptType.P2WPKH;\n if (programLengt... | [
"@Override\n @Deprecated\n public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {\n throw new UnsupportedOperationException(\"Use `execute(parameters, body, output)`\");\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Sets some global parameters to Smarty engine (such as self link, etc.), returns
modified shop object.
@param object $oShop Object to modify some parameters
@return object | [
"public function addGlobalParams($oShop = null)\n {\n $myConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $oLang = \\OxidEsales\\Eshop\\Core\\Registry::getLang();\n\n $oShop = parent::addGlobalParams($oShop);\n\n // override cause of admin dir\n $sURL = $myConfig->g... | [
"private function _init()\n {\n // TODO: check if self::$instance is required here or if we can only set\n // decorated object\n\n // initialize and store the instance of template engine for further access\n self::$instance = Doozr_Loader_Serviceloader::load($this->library, $this->res... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
<p>
Validates whether the properties of the <code>JobDetail</code> are valid
for submission into a <code>Scheduler</code>.
@throws IllegalStateException
if a required property (such as Name, Group, Class) is not set. | [
"public void validate () throws SchedulerException\n {\n if (m_sName == null)\n {\n throw new SchedulerException (\"Trigger's name cannot be null\");\n }\n\n if (m_sGroup == null)\n {\n throw new SchedulerException (\"Trigger's group cannot be null\");\n }\n\n if (m_sJobName == null)... | [
"private void checkConfiguration(JobExecutorXml jobExecutorXml) {\n Map<String, String> properties = jobExecutorXml.getProperties();\n for (Entry<String, String> entry : properties.entrySet()) {\n LOGGER.warning(\"Property \" + entry.getKey() + \" with value \" + entry.getValue() + \" from bpm-platform.x... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Expected to return \Zend\ServiceManager\Config object or array to
seed such an object.
@return array|\Zend\ServiceManager\Config | [
"public function getServiceConfig()\n {\n return [\n 'factories' => [\n 'doctrine.entitymanager.orm_sro_account' => new Service\\EntityManagerFactory('orm_sro_account'),\n 'doctrine.connection.orm_sro_account' => new Service\\DBALConnectionFactory('orm_sro_account'... | [
"protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters. | [
"@Nonnull\n\tpublic static <T, R> LObjIntCharFunction<T, R> objIntCharFunctionFrom(Consumer<LObjIntCharFunctionBuilder<T, R>> buildingFunction) {\n\t\tLObjIntCharFunctionBuilder builder = new LObjIntCharFunctionBuilder();\n\t\tbuildingFunction.accept(builder);\n\t\treturn builder.build();\n\t}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Initialize all components
@param array $options Options passed to application
@return $this | [
"public function initSystems(array $options): self\n {\n $appSystemList = $this->obtainAppSystemList();\n $this->declaredOptions = $options;\n $this->runTasks = new \\BFW\\RunTasks([], 'BfwApp');\n \n foreach ($appSystemList as $name => $className) {\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:"
} |
Returns the constant representation (internal) of a given type.
@param int $type
The type as an integer
@return string
The string representation | [
"public static function typeToString($type)\n {\n switch ($type) {\n case self::EOF_TYPE:\n return 'EOF';\n case self::BANG_TYPE:\n return '!';\n case self::DOLLAR_TYPE:\n return '$';\n case self::PAREN_L_TYPE:\n ... | [
"@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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Get API key details. | [
"def find_by_id(key: str, user: str=None) -> Optional['ApiKey']:\n \n return ApiKey.from_db(db.get_key(key, user))"
] | [
"@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 summarization about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code about Programming:"
} |
Wrapper for options for a find call
@class
@param {Object} options | [
"function SymbolicLinkFinder(options) {\n this.scanDirs = options && options.scanDirs || ['.'];\n this.extensions = options && options.extensions || ['.js'];\n this.ignore = options && options.ignore || null;\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// NewMemberSpaceLimitsChangeCustomQuotaType returns a new MemberSpaceLimitsChangeCustomQuotaType instance | [
"func NewMemberSpaceLimitsChangeCustomQuotaType(Description string) *MemberSpaceLimitsChangeCustomQuotaType {\n\ts := new(MemberSpaceLimitsChangeCustomQuotaType)\n\ts.Description = Description\n\treturn s\n}"
] | [
"public Descriptor replaceAllTopicCalls(PSequence<TopicCall<?>> topicCalls) {\n return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetFlowArn sets the FlowArn field's value. | [
"func (s *RevokeFlowEntitlementOutput) SetFlowArn(v string) *RevokeFlowEntitlementOutput {\n\ts.FlowArn = &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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
/*
@see org.osgi.service.url.URLStreamHandlerService#openConnection(java.net.URL) | [
"@Override\n @SuppressWarnings(\"unused\")\n public URLConnection openConnection(URL url) throws IOException {\n try {\n return (URLConnection) _openConnection.invoke(getInstance(), new Object[] { url });\n } catch (Exception e) {\n FFDCFilter.processException(e, getClass()... | [
"public static void enableJava2SecurityIfSet(BootstrapConfig bootProps, List<URL> urlList) {\n if (bootProps.get(BootstrapConstants.JAVA_2_SECURITY_PROPERTY) != null) {\n\n NameBasedLocalBundleRepository repo = new NameBasedLocalBundleRepository(bootProps.getInstallRoot());\n urlList.ad... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Determine if value is empty
@param {*} value
@return {boolean} | [
"function isEmpty(value) {\n\tif (Array.isArray(value)) {\n\t\t// If first item in array is undefined, we assume there are no parameters\n\t\t// This happens as a result of using the rest operator in a mixin\n\t\treturn value.length === 0 || value[0] === undefined;\n\t}\n\n\treturn value === undefined;\n}"
] | [
"function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',... | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Detect if auto-indent required
@param string $string
@return bool | [
"public function need_indent($string){\n\t\t$first_letter = mb_substr($string, 0, 1, 'UTF-8');\n\t\t$match = !preg_match('/[ 【《〔〝『「(”\"\\'’—\\(\\)]/u', $first_letter, $matches);\n\t\treturn (bool)$match;\n\t}"
] | [
"protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
print the list
NOTE: for test only | [
"public synchronized void printList(){\n Entry<E, T> entry = this.head.next;\n \n System.out.println(\"\\n|----- key list----|\");\n while( entry != this.tail)\n {\n System.out.println(\" -> \" + entry.key );\n entry = entry.next;\n }\n System.o... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Example: number = 123; return = false
Example: number = 12321; return = true | [
"function isPalindrome(number) {\n if (isNumber(number)) {\n var reverseNumber = reverseOfNumber(number);\n return (isNumber(reverseNumber) && number === reverseNumber);\n }\n else {\n return false;\n }\n }"
] | [
"function () {\n var n,\n r,\n E = '',\n H = '-'; // r = result , n = numeric variable for positional checks\n\n // if \"n\" is not 9 or 14 or 19 or 24 return a random number or 4\n // if \"n\" is not 15 generate a random number from 0 to 15\n // `(n ^ 20... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Returns true if the server can open a connection. | [
"@Override\n public boolean canOpenWarm()\n {\n State state = _state;\n\n if (state == State.ACTIVE) {\n return true;\n }\n else if (state.isEnabled()) {\n long now = CurrentTime.currentTime();\n\n if (isFailed(now)) {\n return false;\n }\n\n long firstSuccessTime = _fi... | [
"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:"
} |
Returns all the cp option categories matching the UUID and company.
@param uuid the UUID of the cp option categories
@param companyId the primary key of the company
@return the matching cp option categories, or an empty list if no matches were found | [
"@Override\n\tpublic List<CPOptionCategory> getCPOptionCategoriesByUuidAndCompanyId(\n\t\tString uuid, long companyId) {\n\t\treturn cpOptionCategoryPersistence.findByUuid_C(uuid, companyId);\n\t}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Creates an undefine-attribute operation using the specified address and name.
@param address a resource path
@param name an attribute name
@return an undefine-attribute operation | [
"public static ModelNode createUndefineAttributeOperation(PathAddress address, String name) {\n return createAttributeOperation(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION, address, name);\n }"
] | [
"def _handle_byref_decl(self, node, scope, ctxt, stream):\n \n self._dlog(\"handling byref decl\")\n field = self._handle_node(node.type.type, scope, ctxt, stream)\n\n # this will not really be used (maybe except for introspection)\n # with byref function params\n # see iss... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about writing:"
} |
// Some helper functions for not having to create temp variables all over the place | [
"func int64ptr(i interface{}) *int64 {\n\tv := reflect.ValueOf(i)\n\tif !v.Type().ConvertibleTo(rTypeInt64) {\n\t\treturn nil\n\t}\n\tj := v.Convert(rTypeInt64).Interface().(int64)\n\treturn &j\n}"
] | [
"function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Render the previous link.
@return string | [
"protected function getPrevLink()\n {\n if(!($sCall = $this->xPaginator->getPrevCall()))\n {\n return '';\n }\n return $this->xTemplate->render('pagination::links/prev',\n ['call' => $sCall, 'text' => $this->xPaginator->getPreviousText()]);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Add the gmaf frequency
Args:
variant_obj (puzzle.models.Variant)
gemini_variant (GeminiQueryRow) | [
"def _add_gmaf(self, variant_obj, gemini_variant):\n \n max_af = gemini_variant['max_aaf_all']\n if max_af:\n max_af = float(max_af)\n if max_af != -1.0:\n variant_obj.set_max_freq(max_af)"
] | [
"def get_type(data):\n \n if data[\"analysis\"].lower().startswith(\"var\") or dd.get_variantcaller(data):\n return tz.get_in((\"config\", \"algorithm\", \"effects\"), data, \"snpeff\")"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Creates a Node with information from the OpenCensus library and environment variables. | [
"static Node getNodeInfo(String serviceName) {\n String jvmName = ManagementFactory.getRuntimeMXBean().getName();\n Timestamp censusTimestamp = Timestamp.fromMillis(System.currentTimeMillis());\n return Node.newBuilder()\n .setIdentifier(getProcessIdentifier(jvmName, censusTimestamp))\n .setL... | [
"@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:"
} |
Display text on screen
@param string $text text value
@param string $dataType The data type
@return Renderer The renderer object
@throws | [
"public function textRenderer(string $text, string $dataType = 'text'): Renderer\n {\n if (!$this->allowedTypeExist($dataType)) {\n throw new Server500(new \\ArrayObject(array(\"explain\" => 'Undefined {'.$dataType.'} type for text render',\n \"solution\" => \"Please set the allo... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Setup feed items. | [
"private function setup_feeds() {\n\t\tif ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {\n\t\t\t// Load SimplePie Instance.\n\t\t\t$feed = fetch_feed( $this->feeds );\n\t\t\t// TODO report error when is an error loading the feed.\n\t\t\tif ( is_wp_error( $feed ) ) {\n\t\t\t\tret... | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Deletes all vision styles except for default style
:param verbose: print more
:returns: default: successful operation | [
"def deleteAllStyles(self, verbose=None):\n \n\n response=api(url=self.___url+'styles', method=\"DELETE\", verbose=verbose)\n return response"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Implementation of DOMErrorHandler.handleError that
adds copy of error to list for later retrieval. | [
"public boolean handleError(DOMError error) {\n boolean fail = true;\n String severity = null;\n if (error.getSeverity() == DOMError.SEVERITY_WARNING) {\n fail = false;\n severity = \"[Warning]\";\n } else if (error.getSeverity() == DOMError.SEVERITY_ERROR) {\n ... | [
"function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
@param string $name
@throws NotFoundException
@return FilterFactoryInterface | [
"public function getFilterFactoryByName(string $name): FilterFactoryInterface\n {\n if (!isset($this->filterFactories[$name])) {\n throw new NotFoundException(sprintf(\"Filter factory with name '%s' was not found.\", $name));\n }\n\n return $this->filterFactories[$name];\n }"
] | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// discover will get and store and endpoint using the Discoverer. | [
"func (c *EndpointCache) discover(d Discoverer, endpointKey string) (Endpoint, error) {\n\tendpoint, err := d.Discover()\n\tif err != nil {\n\t\treturn Endpoint{}, err\n\t}\n\n\tendpoint.Key = endpointKey\n\tc.Add(endpoint)\n\n\treturn endpoint, nil\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Uninstall a theme.
@param string $theme
@return bool | [
"public function uninstall($theme)\n {\n /** @var Filesystem $filesystem */\n $filesystem = app(Filesystem::class);\n $dir = $this->getDirectoryPath($theme);\n\n return $filesystem->deleteDirectory($dir);\n }"
] | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Loads environment variables.
@param string $filename Path to the .env file. | [
"public static function load(string $filename) {\n\t\tif(class_exists(Dotenv::class)) {\n\t\t\t$dotenv = new Dotenv($filename);\n\t\t\t$dotenv->load();\n\t\t}\n\t}"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
TODO : PR to wilmogrod to make this function protected instead of private | [
"private function cacheAsset(AssetInterface $asset)\n {\n \treturn $this->configuration->getCacheEnabled()\n \t? new AssetCache($asset, new FilesystemCache($this->configuration->getCachePath()))\n \t: $asset;\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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Gets the sort order of the overlay. See SetOverlaySortOrder for how this works. | [
"def getOverlaySortOrder(self, ulOverlayHandle):\n \"\"\"\"\"\"\n\n fn = self.function_table.getOverlaySortOrder\n punSortOrder = c_uint32()\n result = fn(ulOverlayHandle, byref(punSortOrder))\n return result, punSortOrder.value"
] | [
"@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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Calculates the duration of the given CumulativeData in seconds. | [
"private static double getDurationInSecs(\n ViewData.AggregationWindowData.CumulativeData cumulativeData) {\n return toDoubleSeconds(cumulativeData.getEnd().subtractTimestamp(cumulativeData.getStart()));\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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Lints a git repository [default command] | [
"def lint(ctx):\n \n lint_config = ctx.obj[0]\n msg_filename = ctx.obj[3]\n\n # Let's determine where our input data is coming from:\n # Order of precedence:\n # 1. Any data specified via --msg-filename\n # 2. Any data sent to stdin\n # 3. Fallback to reading from local repository\n stdin... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
This method does not apply to EJB 3.0 business interfaces. All mappings
should be based on the EJB 2.1 specification, and the exceptions new
in EJB 3.0 should not be used, even for EJB 2.1 component interfaces
in an EJB 3.0 module. <p> | [
"@Override\n public Exception\n mapCSITransactionRolledBackException(EJSDeployedSupport s, CSITransactionRolledbackException ex)\n throws com.ibm.websphere.csi.CSIException\n {\n //d180095\n // Ensure root is set before doing the mapping.\n ... | [
"private boolean isInternalUnprotectedMethod(EJBMethodMetaData methodMetaData) {\n EJBMethodInterface interfaceType = methodMetaData.getEJBMethodInterface();\n /***\n * For TIMED_OBJECT, the code references EJB 2.1 spec section 22.2.2 and matches a\n * method signature, which is necess... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
%prog alignextend bedpefile ref.fasta
Similar idea to alignextend, using mates from BEDPE and FASTA ref. See AMOS
script here:
https://github.com/nathanhaigh/amos/blob/master/src/Experimental/alignextend.pl | [
"def alignextend(args):\n \n p = OptionParser(alignextend.__doc__)\n p.add_option(\"--len\", default=100, type=\"int\",\n help=\"Extend to this length\")\n p.add_option(\"--qv\", default=31, type=\"int\",\n help=\"Dummy qv score for extended bases\")\n p.add_option(\"-... | [
"def pasa(args):\n \n p = OptionParser(pasa.__doc__)\n opts, args = p.parse_args(args)\n\n if len(args) != 2:\n sys.exit(not p.print_help())\n\n pasa_db, fastafile = args\n\n termexons = \"pasa.terminal_exons.gff3\"\n if need_update(fastafile, termexons):\n cmd = \"$ANNOT_DEVEL/PA... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the JSON string for the object.
@param obj the object
@return the JSON string | [
"public static String toJSONString(final Object obj) {\n try {\n return mapper.writeValueAsString(obj);\n } catch (final JsonProcessingException e) {\n logger.error(\"Cannot to JSON string\", e);\n }\n return null;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Read the base path from the options
@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInterface instance
@return string The base path | [
"protected function handleBasePath(InputInterface $input, OutputInterface $output)\n\t{\n\t\t$path = realpath($input->getOption('basepath'));\n\t\t$this->writeln($output, 'Joomla! installation expected in ' . $path, OutputInterface::VERBOSITY_DEBUG);\n\n\t\treturn $path;\n\t}"
] | [
"protected function configure()\n {\n\n // initialize the command with the required/optional options\n $this->setName(CommandNames::IMPORT_CREATE_CONFIGURATION_FILE)\n ->setDescription('Create\\'s a configuration file from the given entity\\'s template')\n ->addOption(InputO... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// SetStopTime sets the StopTime field's value. | [
"func (s *StopContinuousExportOutput) SetStopTime(v time.Time) *StopContinuousExportOutput {\n\ts.StopTime = &v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the date for {@code value}. Returns null if the value couldn't be
parsed. | [
"public static Date parse(String value) {\n try {\n return STANDARD_DATE_FORMAT.get().parse(value);\n } catch (ParseException ignore) {\n }\n for (String formatString : BROWSER_COMPATIBLE_DATE_FORMATS) {\n try {\n return new SimpleDateFormat(formatStr... | [
"protected function asDateTime($value)\n {\n // If this value is already a Carbon instance, we shall just return it as is.\n // This prevents us having to re-instantiate a Carbon instance when we know\n // it already is one, which wouldn't be fulfilled by the DateTime check.\n if ($va... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Make sure family name does not begin with a digit.
Font family names which start with a numeral are often not
discoverable in Windows applications. | [
"def com_google_fonts_check_name_familyname_first_char(ttFont):\n \n from fontbakery.utils import get_name_entry_strings\n failed = False\n for familyname in get_name_entry_strings(ttFont, NameID.FONT_FAMILY_NAME):\n digits = map(str, range(0, 10))\n if familyname[0] in digits:\n yield FAIL, (\"Font ... | [
"public static void encodeURIAttribute(Writer writer, final String string, final String characterEncoding)\n throws IOException\n {\n //StringBuilder sb = null; //create later on demand\n int start = 0;\n String app;\n char c;\n boolean endLoop = false;\n int l... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Delete unused less.php files | [
"public static function CleanCache(){\n\t\tstatic $clean = false;\n\n\n\t\tif( $clean || empty(Less_Cache::$cache_dir) ){\n\t\t\treturn;\n\t\t}\n\n\t\t$clean = true;\n\n\t\t// only remove files with extensions created by less.php\n\t\t// css files removed based on the list files\n\t\t$remove_types = array('lesscach... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Wrap guzzle errors into
@param RequestInterface $request
@param array $skipCodes Method should return null if code matched.
@return ResponseInterface | [
"private function run(RequestInterface $request, array $skipCodes = []): ?ResponseInterface\n {\n try {\n return $this->client->send($request);\n } catch (GuzzleException $e) {\n if (in_array($e->getCode(), $skipCodes)) {\n return null;\n }\n\n ... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the comment about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Programming:"
} |
Get a menu.
@param string $name menu name
@return \TypiCMS\Modules\Menus\Models\Menu|null | [
"public function getMenu($name)\n {\n try {\n $menu = app('TypiCMS.menus')->first(function (Menu $menu) use ($name) {\n return $menu->name == $name;\n });\n } catch (Exception $e) {\n Log::info('No menu found with name “'.$name.'”');\n\n re... | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
API repr (JSON format) for entry. | [
"def to_api_repr(self):\n \n info = super(StructEntry, self).to_api_repr()\n info[\"jsonPayload\"] = self.payload\n return info"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
alterColumn
@param string $operation
@param string $table
@param string $column
@param string $type
@param bool $signed
@param bool $allowNull
@param null $default
@param null $position
@param string $comment
@return string | [
"public static function alterColumn(\n $operation,\n $table,\n $column,\n $type = 'text',\n $signed = true,\n $allowNull = true,\n $default = null,\n $position = null,\n $comment = ''\n ) {\n $query = static::getQuery();\n\n $column = $... | [
"public function exists(string $statement, ...$params): bool\n {\n /**\n * @var string|int|float|bool|null $result\n */\n $result = $this->single($statement, $params);\n return !empty($result);\n }"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software Development:"
} |
compare stuff
:param molecules:
:param ensemble_lookup:
:param options:
:return: | [
"def compare(molecules, ensemble_lookup, options):\n \n\n print(\" Analyzing differences ... \")\n print('')\n sort_order = classification.get_sort_order(molecules)\n\n ensemble1 = sorted(ensemble_lookup.keys())[0]\n ensemble2 = sorted(ensemble_lookup.keys())[1]\n\n stats = {}\n stats['heade... | [
"def _process_function(chaining, routine):\n \n\n def processing(*args, **kwargs):\n \"\"\"Execute routine with input args and kwargs and add reuslt in\n chaining.___.\n\n :param tuple args: routine varargs.\n :param dict kwargs: routine kwargs.\n :return: chaining chaining.... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param int $code
@param string $reasonPhrase
@return ResponseInterface | [
"public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface\n {\n $response = new Response('php://memory', $code, []);\n $response = $response->withStatus($code, $reasonPhrase);\n\n foreach ($this->config->baseHeaders() as $header => $value) {\n ... | [
"public function warTrace($text)\n {\n //====================================================================//\n // Build Error Trace\n $trace = (new Exception())->getTrace()[1];\n\n //====================================================================//\n // Push Warning to ... | codesearchnet | {
"query": "Represent the Github comment about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
Validate a Bech32 string, and determine HRP and data. | [
"def bech32_decode(bech):\n \"\"\"\"\"\"\n if ((any(ord(x) < 33 or ord(x) > 126 for x in bech)) or\n (bech.lower() != bech and bech.upper() != bech)):\n return None, None\n bech = bech.lower()\n pos = bech.rfind('1')\n if pos < 1 or pos + 7 > len(bech) or len(bech) > 90:\n re... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Performs squaring
@param array $x
@return array
@access private | [
"function _square($x = false)\n {\n return count($x) < 2 * self::KARATSUBA_CUTOFF ?\n $this->_trim($this->_baseSquare($x)) :\n $this->_trim($this->_karatsubaSquare($x));\n }"
] | [
"final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Parse a QUOTA response (RFC 2087 [5.1]).
@param Horde_Imap_Client_Interaction_Pipeline $pipeline Pipeline
object.
@param Horde_Imap_Client_Tokenize $data The server response. | [
"protected function _parseQuota(\n Horde_Imap_Client_Interaction_Pipeline $pipeline,\n Horde_Imap_Client_Tokenize $data\n )\n {\n $c = &$pipeline->data['quotaresp'];\n\n $root = $data->next();\n $c[$root] = array();\n\n $data->next();\n\n while (($curr = $data-... | [
"public function setContent($resource, $charset = MailMimeParser::DEFAULT_CHARSET)\n {\n $stream = Psr7\\stream_for($resource);\n $this->attachContentStream($stream, $charset);\n // this->onChange called in attachContentStream\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:"
} |
Reads data for an event.
@param [String => Mixed] $opts
@return [String => Mixed]
@override Event | [
"public function read(array $opts) {\n $statement = array_merge_recursive(parent::read($opts), [\n 'verb' => [\n 'id' => 'http://adlnet.gov/expapi/verbs/attended',\n 'display' => $this->readVerbDisplay($opts),\n ],\n 'object' => [\n ... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Unions a set of ranges, or returns null if the set is empty. | [
"public static <T extends Comparable<T>> RangeSet<T> unionRanges(final Iterable<Range<T>> ranges)\n {\n RangeSet<T> rangeSet = null;\n for (Range<T> range : ranges) {\n if (rangeSet == null) {\n rangeSet = TreeRangeSet.create();\n }\n rangeSet.add(range);\n }\n return rangeSet;\n ... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
run driver`s work.
@return mixed | [
"public function run()\n {\n if (!$this->beforeRun()) {\n return;\n }\n $result = null;\n if (is_callable($this->work)) {\n $result = call_user_func_array($this->work, [$this, $this->getData()]);\n }\n\n return $this->afterRun($result);\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Bookmarks returns a pointer to a slice of Bookmark | [
"func (post *UserPost) Bookmarks() *[]Bookmark {\n\tret := []UserPostBookmark{}\n\tDb().Model(UserPostBookmark{}).Where(&UserPostBookmark{Hpid: post.ID()}).Scan(&ret)\n\tvar retBookmarks []Bookmark\n\tfor _, b := range ret {\n\t\tbookmark := b\n\t\tretBookmarks = append(retBookmarks, Bookmark(&bookmark))\n\t}\n\n\t... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github sentence about Text analysis:",
"pos": "Represent the Github code about Text analysis:",
"neg": "Represent the Github code about programming:"
} |
// Iter returns an iterator that can be used to traverse the b-tree
// starting from the specified key or its successor. | [
"func (tree *btree) Iter(key Key) Iterator {\n\tif tree.root == nil {\n\t\treturn nilIterator()\n\t}\n\n\treturn tree.root.find(key)\n}"
] | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get Memory Limit
@return string
@throws \Exception | [
"protected function getMemoryLimit()\n {\n if (!isset($this->config['mp3']['memoryLimit'])) {\n throw new \\Exception(\n $this->translate->translate(\n 'memoryLimit is not currently set',\n 'mp3'\n )\n );\n }\... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Prepares the query criteria or new document object.
PHP field names and types will be converted to those used by MongoDB. | [
"public function prepareQueryOrNewObj(array $query, bool $isNewObj = false) : array\n {\n $preparedQuery = [];\n\n foreach ($query as $key => $value) {\n // Recursively prepare logical query clauses\n if (in_array($key, ['$and', '$or', '$nor'], true) && is_array($value)) {\n ... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Patch content with extracted parts metadata
@param {string} content Module content
@param {Object} parts Extracted parts metadata | [
"function patchContent (content, parts) {\n return Object.keys(parts).reduce((content, type) => {\n let paths = parts[type].filter(({ valid }) => valid).map(({ path }) => path)\n return patchType(content, type, paths)\n }, content)\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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetBGColorFunction applies the input ColorFunc to the receiving Waveform
// struct for background use. | [
"func (w *Waveform) SetBGColorFunction(function ColorFunc) error {\n\treturn w.SetOptions(BGColorFunction(function))\n}"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param string $compression
@return DeCompressorInterface
@throws InvalidCompressionTypeException | [
"public function getDeCompressor($compression)\n {\n if (isset($this->deCompressors[$compression])) {\n return $this->deCompressors[$compression];\n } else {\n throw new InvalidCompressionTypeException($compression);\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 aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// NewCommand returns a new instance of an argocd command | [
"func NewCommand() *cobra.Command {\n\tvar (\n\t\tlogLevel string\n\t)\n\n\tvar command = &cobra.Command{\n\t\tUse: cliName,\n\t\tShort: \"argocd-util has internal tools used by Argo CD\",\n\t\tRun: func(c *cobra.Command, args []string) {\n\t\t\tc.HelpFunc()(c, args)\n\t\t},\n\t}\n\n\tcommand.AddCommand(cli.NewVe... | [
"@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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get URL to redirect to and ensure that it is local. | [
"def get_safe_redirect_target(arg='next'):\n \"\"\"\"\"\"\n for target in request.args.get(arg), request.referrer:\n if not target:\n continue\n if is_local_url(target):\n return target\n return None"
] | [
"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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
// Convert_storage_VolumeAttachmentStatus_To_v1beta1_VolumeAttachmentStatus is an autogenerated conversion function. | [
"func Convert_storage_VolumeAttachmentStatus_To_v1beta1_VolumeAttachmentStatus(in *storage.VolumeAttachmentStatus, out *v1beta1.VolumeAttachmentStatus, s conversion.Scope) error {\n\treturn autoConvert_storage_VolumeAttachmentStatus_To_v1beta1_VolumeAttachmentStatus(in, out, s)\n}"
] | [
"func Convert_v1_CommonSpec_To_build_CommonSpec(in *v1.CommonSpec, out *build.CommonSpec, s conversion.Scope) error {\n\treturn autoConvert_v1_CommonSpec_To_build_CommonSpec(in, out, s)\n}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Check if the current IP address is allowed to look at the front end.
@return bool | [
"public function frontend_allowed_ip_addresses($request)\n {\n $frontend_allowed_ip_addresses = config('lasallecmsfrontend.frontend_allowed_ip_addresses');\n\n // \"true\" = allowed\n if (empty($frontend_allowed_ip_addresses)) return true;\n\n $requestIPAddress = $this->customAdminAut... | [
"@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 NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Programming:"
} |
Get the respondent object
@return \Gems_Tracker_Respondent | [
"public function getRespondent()\n {\n if (! $this->_respondent instanceof \\Gems_Tracker_Respondent) {\n if ($this->_getParam(\\MUtil_Model::REQUEST_ID1) && $this->_getParam(\\MUtil_Model::REQUEST_ID2)) {\n $this->_respondent = parent::getRespondent();\n\n } else {\n ... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// log writes a string verbatim to the sink.
//
// It returns the number of bytes "n" written to the sink and the error "err",
// if one was encountered. | [
"func (l *Logger) log(str string) (n int, err error) {\n\treturn fmt.Fprint(l.sink, str)\n}"
] | [
"func ErrToRejectErr(err error) (wire.RejectCode, string) {\n\t// Return the reject code along with the error text if it can be\n\t// extracted from the error.\n\trejectCode, found := extractRejectCode(err)\n\tif found {\n\t\treturn rejectCode, err.Error()\n\t}\n\n\t// Return a generic rejected string if there is n... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Advance the buffer pointer. | [
"func skip(parser *yaml_parser_t) {\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\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 post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// SliceToString converts a slice of strings into a natural-language list with
// appropriately placed commas and a custom and/or separator. | [
"func SliceToString(ss []string, andor string) string {\n\tl := len(ss)\n\tif l == 0 {\n\t\treturn \"\"\n\t}\n\tif l == 1 {\n\t\treturn ss[0]\n\t}\n\tif l == 2 {\n\t\tif andor == \".\" {\n\t\t\ttmp := strings.Title(ss[1][:1]) + ss[1][1:]\n\t\t\treturn fmt.Sprintf(\"%s%s %s\", ss[0], andor, tmp)\n\t\t}\n\t\treturn f... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Encode request into client_message | [
"def encode_request(timeout, durability, transaction_type, thread_id):\n \n client_message = ClientMessage(payload_size=calculate_size(timeout, durability, transaction_type, thread_id))\n client_message.set_message_type(REQUEST_TYPE)\n client_message.set_retryable(RETRYABLE)\n client_message.append_l... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Read a public key off the disk. | [
"def get_rsa_pub_key(path):\n '''\n \n '''\n log.debug('salt.crypt.get_rsa_pub_key: Loading public key')\n if HAS_M2:\n with salt.utils.files.fopen(path, 'rb') as f:\n data = f.read().replace(b'RSA ', b'')\n bio = BIO.MemoryBuffer(data)\n key = RSA.load_pub_key_bio(bio... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get an output stream for writing to a file.
@param aFile
The file to write to. May not be <code>null</code>.
@return <code>null</code> if the file could not be opened | [
"@Nullable\n public static OutputStream getOutputStream (@Nonnull final Path aFile)\n {\n return getOutputStream (aFile, EAppend.DEFAULT);\n }"
] | [
"def openSafeReplace(filepath, mode='w+b'):\n \n tempfileName = None\n #Check if the filepath can be accessed and is writable before creating the\n #tempfile\n if not _isFileAccessible(filepath):\n raise IOError('File %s is not writtable' % (filepath, ))\n with tempfile.NamedTemporaryFile(d... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.