query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Garbage collector for the cached items
@method clean
@private
@return {Undefined} undefined | [
"function () {\n\t\treturn utility.iterate( cache.items, function ( v, k ) {\n\t\t\tif ( cache.expired( k ) ) {\n\t\t\t\tcache.expire( k, true );\n\t\t\t}\n\t\t});\n\t}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// downloadChunk downloads the chunk from s3 | [
"func (d *downloader) downloadChunk(chunk dlchunk) error {\n\tin := &s3.GetObjectInput{}\n\tawsutil.Copy(in, d.in)\n\n\t// Get the next byte range of data\n\tin.Range = aws.String(chunk.ByteRange())\n\n\tvar n int64\n\tvar err error\n\tfor retry := 0; retry <= d.partBodyMaxRetries; retry++ {\n\t\tvar resp *s3.GetOb... | [
"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 about AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code:"
} |
Sets parameters in a query.
@param query
Query to set parameters for.
@param streamId
Unique stream identifier that has the parameter values. | [
"protected final void setJpqlParameters(final Query query, final StreamId streamId) {\r\n final List<KeyValue> params = new ArrayList<>(streamId.getParameters());\r\n if (params.size() == 0) {\r\n params.add(new KeyValue(\"streamName\", streamId.getName()));\r\n }\r\n for (int... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// setHasVote sets the HasVote status of all the given machines to hasVote. | [
"func setHasVote(ms []*machineTracker, hasVote bool) error {\n\tif len(ms) == 0 {\n\t\treturn nil\n\t}\n\tlogger.Infof(\"setting HasVote=%v on machines %v\", hasVote, ms)\n\tfor _, m := range ms {\n\t\tif err := m.stm.SetHasVote(hasVote); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot set voting status of %q to %v:... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Set atomically changes where this logger logs to | [
"func (l *Hierarchy) Set(logger Logger) {\n\tl.logger.Store(atomicStruct{logger})\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:"
} |
Attempts to set the formatting template and returns a string which
contains the formatted version of the digits entered so far. | [
"def _attempt_to_choose_formatting_pattern(self):\n \"\"\"\"\"\"\n # We start to attempt to format only when at least MIN_LEADING_DIGITS_LENGTH digits of national\n # number (excluding national prefix) have been entered.\n if len(self._national_number) >= _MIN_LEADING_DIGITS_LENGTH:\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 text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
<p>
Information about the task invocation results per invocation.
</p>
@return Information about the task invocation results per invocation. | [
"public java.util.List<MaintenanceWindowExecutionTaskInvocationIdentity> getWindowExecutionTaskInvocationIdentities() {\n if (windowExecutionTaskInvocationIdentities == null) {\n windowExecutionTaskInvocationIdentities = new com.amazonaws.internal.SdkInternalList<MaintenanceWindowExecutionTaskInvo... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// Flush deletes all NAT mappings from the given table. | [
"func (m *Map) Flush() int {\n\tif m.v4 {\n\t\treturn int(doFlush4(m).deleted)\n\t}\n\treturn int(doFlush6(m).deleted)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns true if this there is no existing one or the same schema has already been registered (this must be done
on application startup).
<p>
NOTE: This is only supported when {@link RuntimeEnv#ID_STRATEGY} is {@link DefaultIdStrategy}. | [
"public static <T> boolean register(Class<T> typeClass, Schema<T> schema)\r\n {\r\n if (ID_STRATEGY instanceof DefaultIdStrategy)\r\n return ((DefaultIdStrategy) ID_STRATEGY).registerPojo(typeClass,\r\n schema);\r\n\r\n throw new RuntimeException(\r\n \"... | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Read index settings
@param root dir within the classpath
@param index index name
@return Settings
@throws IOException if connection with elasticsearch is failing | [
"public static String readSettings(String root, String index) throws IOException {\n\t\tif (root == null) {\n\t\t\treturn readSettings(index);\n\t\t}\n\t\treturn readSettings(root, index, Defaults.IndexSettingsFileName);\n\t}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization about Elasticsearch:",
"pos": "Represent the Github code about Elasticsearch:",
"neg": "Represent the Github code:"
} |
// NewTransportWith wraps roundTripper and returns a new transport which logs
// all submitted requests with the default logger. | [
"func NewTransport(roundTripper http.RoundTripper) http.RoundTripper {\n\treturn NewTransportWith(events.DefaultLogger, roundTripper)\n}"
] | [
"func WithNamespace(ctx context.Context, namespace string) context.Context {\n\tctx = context.WithValue(ctx, namespaceKey{}, namespace) // set our key for namespace\n\n\t// also store on the grpc headers so it gets picked up by any clients that\n\t// are using this.\n\treturn withGRPCNamespaceHeader(ctx, namespace)... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about consul address:"
} |
Terminate VM
:arg vm_id: string | [
"async def terminate_vm(self, vm_id):\n '''\n \n '''\n try:\n await self.nova.servers.force_delete(vm_id)\n except JSONDecodeError as exc:\n logging.info(\"nova sent 'content-type: application/json' but no content appeared, whatever\")\n pass\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Tries conversion of any value to an integer | [
"public static int toInteger(Object value, EvaluationContext ctx) {\n if (value instanceof Boolean) {\n return ((Boolean) value) ? 1 : 0;\n }\n else if (value instanceof Integer) {\n return (Integer) value;\n }\n else if (value instanceof BigDecimal) {\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Create an api gw response from a wsgi app and environ. | [
"def create_gw_response(app, wsgi_env):\n \n response = {}\n buf = []\n result = []\n\n def start_response(status, headers, exc_info=None):\n result[:] = [status, headers]\n return buf.append\n\n appr = app(wsgi_env, start_response)\n close_func = getattr(appr, 'close', None)\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SchedPolicyGet returns schedule policy matching given name. | [
"func (c *ClusterManager) SchedPolicyGet(name string) (*sched.SchedPolicy, error) {\n\treturn c.schedManager.SchedPolicyGet(name)\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 text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Appends a string literal to the formatter.
<p>
This string will be output during a print.
<p>
If the literal is empty, nothing is added to the formatter.
@param literal the literal to append, not null
@return this, for chaining, not null | [
"public DateTimeFormatterBuilder appendLiteral(String literal) {\n Jdk8Methods.requireNonNull(literal, \"literal\");\n if (literal.length() > 0) {\n if (literal.length() == 1) {\n appendInternal(new CharLiteralPrinterParser(literal.charAt(0)));\n } else {\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 text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Returns a list of (key, value) pairs as 2-tuples. | [
"def items(self):\n \"\"\n return (list(self._pb.IntMap.items()) + list(self._pb.StringMap.items()) +\n list(self._pb.FloatMap.items()) + list(self._pb.BoolMap.items()))"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link TopoPointType }{@code >}
@param value
Java instance representing xml element's value.
@return
the new instance of {@link JAXBElement }{@code <}{@link TopoPointType }{@code >} | [
"@XmlElementDecl(namespace = \"http://www.opengis.net/gml\", name = \"TopoPoint\")\n public JAXBElement<TopoPointType> createTopoPoint(TopoPointType value) {\n return new JAXBElement<TopoPointType>(_TopoPoint_QNAME, TopoPointType.class, null, value);\n }"
] | [
"@XmlElementDecl(namespace = \"http://schema.intuit.com/finance/v3\", name = \"IntuitBatchRequest\")\n public JAXBElement<IntuitBatchRequest> createIntuitBatchRequest(IntuitBatchRequest value) {\n return new JAXBElement<IntuitBatchRequest>(_IntuitBatchRequest_QNAME, IntuitBatchRequest.class, null, value);... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Return the atomic (xs defined simple type) type associated with a passed in type
@param string|QName|array $type | [
"public function getAtomicType( $type )\r\n\t{\r\n\t\tif ( $type instanceof QName )\r\n\t\t{\r\n\t\t\t$type = \"{$type->prefix}:{$type->localName}\";\r\n\t\t}\r\n\t\telse if ( is_array( $type ) && isset( $type['prefix'] ) && isset( $type['prefix'] ) )\r\n\t\t{\r\n\t\t\t$type = \"{$type['prefix']}:{$type['name']}\";... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// BuildIdentityConfigFromOptions will return an IdentityConfig instance pre-built with Optional interfaces
// provided in fabsdk's WithConfigIdentity(opts...) call | [
"func BuildIdentityConfigFromOptions(opts ...interface{}) (msp.IdentityConfig, error) {\n\t// build a new IdentityConfig with overridden function implementations\n\tc := &IdentityConfigOptions{}\n\tfor _, option := range opts {\n\t\terr := setIdentityConfigWithOptionInterface(c, option)\n\t\tif err != nil {\n\t\t\t... | [
"func (f *Factory) BindFlags(flags *pflag.FlagSet) {\n\t// any flags defined by external projects (not part of pflags)\n\tflags.AddGoFlagSet(flag.CommandLine)\n\n\t// Merge factory's flags\n\tflags.AddFlagSet(f.flags)\n\n\t// Globally persistent flags across all subcommands.\n\t// TODO Change flag names to consts t... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
This function will cancel an existing fax job.
@param serverName
The fax server name
@param faxJobID
The fax job ID | [
"private void winCancelFaxJob(String serverName,int faxJobID)\n {\n synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)\n {\n //pre native call\n this.preNativeCall();\n \n //invoke native\n WindowsJNIFaxClientSpi.cancelFaxJobNative(serverName,... | [
"def registered(self, driver, frameworkId, masterInfo):\n \n log.debug(\"Registered with framework ID %s\", frameworkId.value)\n # Save the framework ID\n self.frameworkId = frameworkId.value"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *EnvVarSource) DeepCopyInto(out *EnvVarSource) {\n\t*out = *in\n\tif in.FieldRef != nil {\n\t\tin, out := &in.FieldRef, &out.FieldRef\n\t\t*out = new(ObjectFieldSelector)\n\t\t**out = **in\n\t}\n\tif in.ResourceFieldRef != nil {\n\t\tin, out := &in.ResourceFieldRef, &out.ResourceFieldRef\n\t\t*out = new(R... | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/* Amazon Kindle | [
"private function detectKindle($ua)\n {\n if (preg_match('/Kindle/u', $ua) && !preg_match('/Fire/u', $ua)) {\n $this->data->os->reset();\n $this->data->device->setIdentification([\n 'manufacturer' => 'Amazon',\n 'series' => 'Kindle',\n ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Extend this method to define fields of your choice. | [
"public function init()\n {\n $this->_init();\n\n if ($this->id_field) {\n $this->addField($this->id_field, [\n 'system' => true,\n ]);\n }\n }"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get a snapshot of the pool infos that is sorted.
@return Sorted snapshot of the pool infos. | [
"public List<PoolInfo> getPoolInfos() {\n Set<PoolInfo> poolInfos = new HashSet<PoolInfo>();\n for (ResourceType type : types) {\n poolInfos.addAll(getPoolInfoMetrics(type).keySet());\n }\n List<PoolInfo> result = new ArrayList<PoolInfo>();\n result.addAll(poolInfos);\n Collections.sort(resul... | [
"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 post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
All general exceptions thrown by services are caught here and translated into http conform responses with a status code {@code 500
Internal Server Error}.
@param ex The exception occurred
@return A response object wraps the server result | [
"@ExceptionHandler(Exception.class)\n public ResponseEntity handleException(Exception ex) {\n EXC_LOGGER.error(\"[P] Presentation Layer Exception: \" + ex.getLocalizedMessage(), ex);\n if (ex instanceof BehaviorAwareException) {\n BehaviorAwareException bae = (BehaviorAwareException) ex;... | [
"@Override\n public void onError(Session session, Throwable thr) {\n if (onError != null) {\n Object args[] = new Object[onError.getMethod().getParameterTypes().length];\n MethodData methodData = onError.getMethodData();\n //check if method has optional Session parameter\n... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Walk the directory and builds pre-calculation reports for all the
job.ini files found. | [
"def do_build_reports(directory):\n \n for cwd, dirs, files in os.walk(directory):\n for f in sorted(files):\n if f in ('job.ini', 'job_h.ini', 'job_haz.ini', 'job_hazard.ini'):\n job_ini = os.path.join(cwd, f)\n logging.info(job_ini)\n try:\n ... | [
"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 Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Add a charset mapping.
@param nioCharsetName
Java NIO charset name
@param cloudhopperCharset
Cloudhopper charset | [
"public void addCharset(String nioCharsetName, Charset cloudhopperCharset) {\n\t\tLOG.debug(\"Added charset mapping nio {} -> {}\", nioCharsetName, cloudhopperCharset);\n\t\tmapCloudhopperCharsetByNioCharsetName.put(nioCharsetName, cloudhopperCharset);\n\t}"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Load the data from the URL.
@param string $url
@return string | [
"protected function _getCURL($url) {\r\n\t\tcurl_setopt($this->_curl, CURLOPT_URL, $url);\r\n\t\t$content = curl_exec($this->_curl);\r\n\t\treturn $content;\r\n\t}"
] | [
"@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 text about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
// Percentile finds the relative standing in a slice of floats
// (note: the "Percentile" method in "stats" is incorrect) | [
"func Percentile(input stats.Float64Data, percent float64) (percentile float64, err error) {\n\n\tif input.Len() == 0 {\n\t\treturn math.NaN(), stats.EmptyInput\n\t}\n\n\tif percent < 0 || percent > 100 {\n\t\treturn math.NaN(), stats.BoundsErr\n\t}\n\n\t// Start by sorting a copy of the slice\n\tsorted := sortedCo... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github post about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Create {@link CoreContainer} for Solr version 4.4+ and handle changes in .
@param solrHomeDirectory
@param solrXmlFile
@return | [
"private CoreContainer createCoreContainer(String solrHomeDirectory, File solrXmlFile) {\n\n\t\tMethod createAndLoadMethod = ClassUtils.getStaticMethod(CoreContainer.class, \"createAndLoad\", String.class,\n\t\t\t\tFile.class);\n\n\t\tif (createAndLoadMethod != null) {\n\t\t\treturn (CoreContainer) ReflectionUtils.... | [
"@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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
generates a secure random string
@param integer $token_length The number of characters including the prefix
@param string $prefix A prefix for the random string
@return string The random string starting with prefix | [
"public function generateToken($token_length=30, $prefix='') {\n $token_length = $token_length - strlen($prefix);\n if ($token_length < 0) { throw new Exception(\"Prefix is too long\", 1); }\n \n $token = \"\";\n while (($len = strlen($token)) < $token_length) {\n $rema... | [
"protected function makeKeyString($key): string {\n //convert numbers to strings.\n $stringValue = (string)$key;\n $length = strlen( $stringValue );\n if( $length == 0 ){\n throw new \\Exception(\"Key values must be string values of at least 1 character. Empty strings cannot b... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about AWS S3:"
} |
begin D196678.10.1 | [
"public ConversationMetaData getMetaData()\n {\n if (tc.isEntryEnabled()) SibTr.entry(this, tc, \"getMetaData\");\n if (tc.isEntryEnabled()) SibTr.exit(this, tc, \"getMetaData\", metaData); \n return metaData; \n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Load the aggregate identified by $aggregateId from the persistent storage.
@param AggregateId $aggregateId
@return AggregateRoot
@throws InvalidArgumentException If the $aggregateId is invalid | [
"public function load(AggregateId $aggregateId)\n {\n $result = $this->getEntityManager()->find($aggregateId->aggregateClass(), $aggregateId->value());\n Preconditions::checkArgument($result !== null, 'Aggregate with ID [%s] does not exist', $aggregateId);\n return $result;\n }"
] | [
"public function validate() {\n if ($this->initializer) {\n Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);\n }\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
将用户输入的 padding 转换成 [top, right, bottom, right] 的模式
@param {Number|Array} padding 输入的padding
@return {Array} 四个padding 值 | [
"function toAllPadding(padding) {\n var top = 0;\n var left = 0;\n var right = 0;\n var bottom = 0;\n\n if (Util.isNumber(padding) || Util.isString(padding)) {\n top = left = right = bottom = padding;\n } else if (Util.isArray(padding)) {\n top = padding[0];\n right = !Util.isNil(pa... | [
"def visible_colors\n Colorscore::Histogram.new( @img, MAX_VISIBLE_COLORS).scores.reject do |per, color|\n # 由于不知道的原因(待查),colorscore 返回的队列中\n # 有些颜色是 nil, 这些应该去除,以免影响后续计算。\n color.nil?\n end\n end"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Factory.
@param IComponent $component
@param array $events
@param string $callbackOnSuccess
@param string $callbackOnException
@return IEventContainer | [
"public static function factory(IComponent $component, array $events, $callbackOnSuccess = 'onSuccess', $callbackOnException = 'onException'): IEventContainer\n {\n $instance = new self($component, $events, $callbackOnSuccess, $callbackOnException);\n return $instance;\n }"
] | [
"public function file(string $path, string $md5)\n {\n //==============================================================================\n // Create Event Object\n $event = new ObjectFileEvent($this->getWebserviceId(), $path, $md5);\n //============================================... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
//Adds the correct fragment to being an DELETE statement | [
"func (me *DefaultAdapter) DeleteBeginSql(buf *SqlBuilder) error {\n\tbuf.Write(me.DeleteClause)\n\treturn nil\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Check if a file exists
@param {string} filePath path and filename: the file to control
@returns {Promise<string>} resolve with the filePath that exists
@throws {error} if the file doesn't exist | [
"function existFile(filePath, mode = fs.constants.W_OK) {\n return new Promise((resolve, reject) => {\n fs.access(filePath, mode, (err) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(filePath);\n });\n });\n}"
] | [
"def _is_path(instance, attribute, s, exists=True):\n \"\"\n if not s:\n # allow False as a default\n return\n if exists:\n if os.path.exists(s):\n return\n else:\n raise OSError(\"path does not exist\")\n else:\n # how do we tell if it's a path i... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get maximum difference between spline and energy trend. | [
"def max_spline_jump(self):\n \n sp = self.spline()\n return max(self.energies - sp(range(len(self.energies))))"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param Asker $asker
@param $modelName
@param $oldName
@param $newName
@param Field $fieldObj
@return ConfirmationQuestion
@since 1.1.0
@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com> | [
"public static function hasFieldRenamed(Asker $asker, $modelName, $oldName, $newName, Field $fieldObj)\n {\n $msg = 'Did you rename %1$s.%2$s to %1$s.%3$s (a %4$s)? [y/N]';\n\n $q = new ConfirmationQuestion(sprintf($msg, $modelName, $oldName, $newName, $fieldObj->getShortClassName()));\n\n r... | [
"public function show($start)\n {\n if (!$start) {\n if (!empty(config('app.project'))) {\n $this->line(config('app.project'));\n }\n if (!empty(config('app.owner'))) {\n $this->line('by '.config('app.owner'));\n }\n $thi... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// CopyMapStringAttribute copies a map of string to Attribute | [
"func CopyMapStringAttribute(in map[string]*Attribute) map[string]*Attribute {\n\tif in == nil {\n\t\treturn nil\n\t}\n\n\tout := make(map[string]*Attribute, len(in))\n\tfor k, v := range in {\n\t\tout[k] = v.Copy()\n\t}\n\treturn out\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Return first postion ignore case, return -1 if not found | [
"public static int indexOfIgnoreCase(final String str, final String searchStr) {// NOSONAR\n\t\tif (searchStr.isEmpty() || str.isEmpty()) {\n\t\t\treturn str.indexOf(searchStr);\n\t\t}\n\t\tfor (int i = 0; i < str.length(); ++i) {\n\t\t\tif (i + searchStr.length() > str.length()) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Check whether an array has duplicates.
@param arr {Array} The array.
@param fn {Function} Optional function to apply to each element. | [
"function hasDuplicates(arr, fn) {\n var obj = {};\n var i, l, elem;\n for (i = 0, l = arr.length; i < l; i++) {\n elem = arr[i];\n if (fn) {\n elem = fn(elem);\n }\n if (obj[elem]) {\n return true;\n }\n obj[elem] = true;\n }\n return false;\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:"
} |
// Import returns details about the package in the directory. | [
"func (dir *Directory) Import(ctx *build.Context, mode build.ImportMode) (*build.Package, error) {\n\tsafeCopy := *ctx\n\tctx = &safeCopy\n\tctx.JoinPath = path.Join\n\tctx.IsAbsPath = path.IsAbs\n\tctx.SplitPathList = func(list string) []string { return strings.Split(list, \":\") }\n\tctx.IsDir = func(path string)... | [
"@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:"
} |
Replace <ktml:content> with the view content
@param string $text The text to parse
@return void | [
"public function filter(&$text)\n {\n $matches = array();\n if(preg_match_all('#<ktml:content(.*)>#siU', $text, $matches))\n {\n foreach($matches[1] as $key => $match) {\n $text = str_replace($matches[0][$key], $this->getTemplate()->content(), $text);\n }... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
COLLAPSE PLUGIN DEFINITION ========================== | [
"function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.collapse')\n var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\n if (!data && options.toggle && option == 'show') option = !optio... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
A reimplemented destructor that destroys the layout widget. | [
"def destroy(self):\n \n layout = self.layout\n if layout is not None:\n layout.removeFromSuperview()\n self.layout = None\n super(UiKitViewGroup, self).destroy()"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// RemoveLast2FA Removes the entry of the last successful 2FA login for this organization - user combination | [
"func (m *Last2FAManager) RemoveLast2FA(globalID string, username string) error {\n\tcondition := []interface{}{\n\t\tbson.M{\"globalid\": globalID},\n\t\tbson.M{\"username\": username},\n\t}\n\treturn m.collection.Remove(bson.M{\"$and\": condition})\n}"
] | [
"func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Imports local string definitions into rendering context.
@return void | [
"protected function _init() {\n\t\tparent::_init();\n\n\t\tif (!$this->_context) {\n\t\t\treturn;\n\t\t}\n\t\t$this->_context->strings($this->_strings);\n\n\t\tif ($this->_config['handlers']) {\n\t\t\t$this->_context->handlers($this->_config['handlers']);\n\t\t}\n\t}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
returns saml logout ticket info | [
"def get_saml_slos(cls, logout_request):\n \"\"\"\"\"\"\n try:\n root = etree.fromstring(logout_request)\n return root.xpath(\n \"//samlp:SessionIndex\",\n namespaces={'samlp': \"urn:oasis:names:tc:SAML:2.0:protocol\"})\n except etree.XMLSynta... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Runs a check in the ThreadPool for the {@link EvaluatorManager} to wait for it to finish its
Event Handling and check its idleness source.
@param manager the {@link EvaluatorManager} | [
"void runCheckAsync(final EvaluatorManager manager) {\n\n final String evaluatorId = manager.getId();\n LOG.log(Level.FINEST, \"Idle check for Evaluator: {0}\", manager);\n\n this.executor.submit(new Runnable() {\n\n @Override\n public void run() {\n\n LOG.log(Level.FINEST, \"Idle check fo... | [
"private void makeJobRunning(JobInProgress job, JobSchedulingInfo oldInfo, \n QueueInfo qi) {\n // Removing of the job from job list is responsibility of the\n //initialization poller.\n // Add the job to the running queue\n qi.addRunningJob(job);\n }"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Adds an unmanaged custom attribute to the element or gets an attribute either from the list
of custom attributes.
@param string $name The name of the attribute.
@param string $value The value of the attribute.
@throws SsmlException
@return static | [
"public function attr(string $name, string $value = null)\n {\n if ($value === null) {\n if (isset($this->customAttributes[$name])) {\n return $this->customAttributes[$name];\n }\n\n throw new SsmlException('Unknown attribute ' . $name . ' in class ' . get_c... | [
"public function initializeArguments()\n {\n $this->registerTagAttribute('enctype', 'string', 'MIME type with which the form is submitted');\n $this->registerTagAttribute('method', 'string', 'Transfer type (GET or POST or dialog)');\n $this->registerTagAttribute('name', 'string', 'Name of fo... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Implement libgreader's interface for authenticated POST request | [
"def post(self, url, postParameters=None, urlParameters=None):\n \n if self._action_token == None:\n self._action_token = self.get(ReaderUrl.ACTION_TOKEN_URL)\n\n if self._http == None:\n self._setupHttp()\n uri = url + \"?\" + self.getParameters(urlParameters)\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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Stores the resources from a directory into a map.
@param directory an existing directory
@return a non-null map (key = the file location, relative to the directory, value = file content)
@throws IOException if something went wrong while reading a file | [
"public static Map<String,byte[]> storeDirectoryResourcesAsBytes( File directory ) throws IOException {\n\t\treturn storeDirectoryResourcesAsBytes( directory, new ArrayList<String>( 0 ));\n\t}"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Return whether the dev configuration directory should used. | [
"def use_dev_config_dir(use_dev_config_dir=USE_DEV_CONFIG_DIR):\r\n \"\"\"\"\"\"\r\n if use_dev_config_dir is not None:\r\n if use_dev_config_dir.lower() in {'false', '0'}:\r\n use_dev_config_dir = False\r\n else:\r\n use_dev_config_dir = DEV or not is_stable_version(__version__)\r... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Technology:"
} |
// RepositoryGroup returns a representation of the given repository group ID. | [
"func (client NexusClient) RepositoryGroup(groupID GroupID) (RepositoryGroup, int, error) {\n\trepoGroup, rc, err := client.repositoryGroup(groupID)\n\tif err != nil {\n\t\treturn RepositoryGroup{}, rc, err\n\t}\n\tif rc != 200 {\n\t\treturn RepositoryGroup{}, rc, nil\n\t}\n\treturn canonicalize(repoGroup), rc, nil... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Append a middleware to the validate step.
@param callable $middleware Middleware function to add.
@param string $name Name of the middleware. | [
"public function appendValidate(callable $middleware, $name = null)\n {\n $this->add(self::VALIDATE, $name, $middleware);\n }"
] | [
"private function route(ServerRequestInterface $request)\n {\n $route = $request->getAttribute('route', false);\n if (! $route instanceof Route) {\n throw new BadHttpStackConfigurationException(\n \"Dispatcher works with router middleware in order to process incoming reque... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about PHP:"
} |
The end key position is in this record... Save it! | [
"public void handleEndKey()\n {\n KeyArea keyArea = this.getKeyArea(-1);\n if (keyArea == null)\n return;\n BaseBuffer buffer = new VectorBuffer(null);\n boolean[] rgbModified = keyArea.getModified();\n boolean[] rgbNullable = keyArea.setNullable(true);\n keyA... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
From the API:
Returns the 10 most recent files accepted by the 'magic' file selection
algorithm. Currently any files with 10 or more likes are magic.
Returns:
List of SharedFile objects | [
"def get_magic_shake(self, before=None, after=None):\n \n if before and after:\n raise Exception(\"You cannot specify both before and after keys\")\n\n endpoint = '/api/magicfiles'\n\n if before:\n endpoint += '/before/{key}'.format(key=before)\n elif after:\... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// OrganizationsInterfaceRoutes is routing for /organizations root endpoint | [
"func OrganizationsInterfaceRoutes(r *mux.Router, i OrganizationsInterface) {\n\tr.Handle(\"/organizations\", alice.New(newOauth2oauth_2_0Middleware([]string{}).Handler).Then(http.HandlerFunc(i.CreateNewOrganization))).Methods(\"POST\")\n\tr.Handle(\"/organizations/{globalid}\", alice.New(newOauth2oauth_2_0Middlewa... | [
"func movies(app *mvc.Application) {\n\t// Add the basic authentication(admin:password) middleware\n\t// for the /movies based requests.\n\tapp.Router.Use(middleware.BasicAuth)\n\n\t// Create our movie repository with some (memory) data from the datasource.\n\trepo := repositories.NewMovieRepository(datasource.Movi... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
---------------------------------------------------------------------------- Partition Provider ---------------------------------------------------------------------------- | [
"function scoresProvider(publicAPI, model) {\n publicAPI.setScores = (scores) => {\n model.scores = [].concat(scores);\n const scoreMapByValue = {};\n model.scores.forEach((score) => {\n scoreMapByValue[score.value] = score;\n });\n model.scoreMapByValue = scoreMapByValue;\n publicAPI.fireSc... | [
"private void celerioWelcomeBanner() {\n // http://ascii.mastervb.net/\n // font : varsity.ftl\n int currentYear = Calendar.getInstance().get(Calendar.YEAR);\n getLog().info(\"\");\n getLog().info(\" ______ __ _ \");\n getLog().info(... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about language and writing:"
} |
// PayloadStreamClientInterceptor returns a new streaming client interceptor that logs the paylods of requests and responses. | [
"func PayloadStreamClientInterceptor(logger *zap.Logger, decider grpc_logging.ClientPayloadLoggingDecider) grpc.StreamClientInterceptor {\n\treturn func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {\n\t\t... | [
"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 summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Returns a suitable description of this field for South. | [
"def south_field_triple(self):\n \n # We'll just introspect the _actual_ field.\n from south.modelsinspector import introspector\n try:\n # Check if the field provides its own 'field_class':\n field_class = self.translated_field.south_field_triple()[0]\n exce... | [
"@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 Computer programming or scientific field:",
"pos": "Represent the code about Computer programming or scientific field:",
"neg": "Represent the code:"
} |
all members loaded | [
"@Override\n public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException {\n super.loadFromJSONObject(jobj, db);\n m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) );\n m_sortDirection = SortDirectionType.get( jobj.getString( Members.SO... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
{@literal '[<=1000]'}などの数値の条件を組み立てる
@param formatter 現在の組み立て中のフォーマッタのインスタンス。
@param token 条件式のトークン。
@return 演算子の条件式。
@throws IllegalArgumentException 処理対象の条件として一致しない場合 | [
"protected ConditionOperator setupConditionOperator(final ConditionFormatter formatter, final Token.Condition token) {\r\n\r\n final Matcher matcher = PATTERN_CONDITION_OPERATOR.matcher(token.getValue());\r\n if(!matcher.matches()) {\r\n throw new IllegalArgumentException(\"not match condit... | [
"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 Github text about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code about Software development:"
} |
Tries to determine if a module is a python std import, third party import, or project code:
if it can't determine - it assumes it is project code | [
"def place_module(self, module_name: str) -> Optional[str]:\n \n return self.finder.find(module_name)"
] | [
"def get_root_path(self, name):\n \n module = modules.get(name)\n if module is not None and hasattr(module, '__file__'):\n return dirname(abspath(module.__file__))\n\n # Flask keeps looking at this point. We instead set the root path to None,\n # assume that the user do... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
drop overwrite function | [
"function (e) {\n // save a reference to this to use in the timeout\n var self = this;\n // call the super function\n this._super(me.DroptargetEntity, \"draw\", [e]);\n // indicate a succesful drop\n this.color = \"green\";\n // set the color back to red after a seco... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Retrieve storage instance
@return \Zend\Authentication\Storage\StorageInterface
@ValuService\Exclude | [
"public function getStorage()\n\t{\n\t if(!$this->storage && $this->getServiceLocator()->has(self::STORAGE_LOCATOR_KEY)){\n\t $this->setStorage($this->getServiceLocator()->get(self::STORAGE_LOCATOR_KEY));\n\t }\n\t \n\t return $this->storage;\n\t}"
] | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Bind the service API urls to a flask app. | [
"def bind(self, flask_app, service, group=None):\n \"\"\"\"\"\"\n if group not in self.services[service]:\n raise RuntimeError(\n 'API group {} does not exist in service {}'.format(\n group, service)\n )\n for name, api in self.services[se... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param mixed $instantiator
@return self | [
"public static function fromInvalidInstantiator($instantiator) : self\n {\n return new self(sprintf(\n 'Invalid instantiator given, expected `callable`, `%s` given.',\n is_object($instantiator) ? get_class($instantiator) : gettype($instantiator)\n ));\n }"
] | [
"final protected function sEav($c = EavSetup::class) {return dfc($this, function($c) {return\n\t\tdf_new_om($c, ['setup' => $this->_setup])\n\t;}, [$c]);}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// This is how we handle a beacon coming into our UDP socket;
// this may be from other peers or an echo of our own broadcast
// beacon: | [
"func (agent *agent_t) handle_beacon() (err error) {\n\n\tmsg, err := agent.udp.RecvMessage(0)\n\tif len(msg[0]) != 16 {\n\t\treturn errors.New(\"Not a uuid\")\n\t}\n\n\t// If we got a UUID and it's not our own beacon, we have a peer\n\tuuid := uuid.UUID(msg[0])\n\tif bytes.Compare(uuid, agent.uuid_bytes) != 0 {\n... | [
"private static void startNetworkServices() {\n // We've rebooted the JVM recently. Tell other Nodes they can ignore task\n // prior tasks by us. Do this before we receive any packets\n UDPRebooted.T.reboot.broadcast();\n\n // Start the MultiReceiverThread, to listen for multi-cast requests from\n //... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Decodes four chars into an 24 bit number
@name decode4
@param {String} s the chars to decode
@returns {Number} a 24 bit number | [
"function decode4(s) {\n assert.equal(s.length, 4)\n const [ upper, belowUpper, aboveLower, lower ] = s\n return (decode(upper) << 18) | (decode(belowUpper) << 12)\n | (decode(aboveLower) << 6) | decode(lower)\n}"
] | [
"def create_response_pdu(self, data):\n \n log.debug('Create single bit response pdu {0}.'.format(data))\n bytes_ = [data[i:i + 8] for i in range(0, len(data), 8)]\n\n # Reduce each all bits per byte to a number. Byte\n # [0, 0, 0, 0, 0, 1, 1, 1] is intepreted as binary en is deci... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Retorna a raiz do valor atual pelo operando indicado.
@param int $dPlaces
Total de casas decimais a serem levadas em conta.
@return RealNumber | [
"public function sqrt(int $dPlaces = 0) : RealNumber\n {\n return new RealNumber(bcsqrt($this->value(), $this->useDecimalPlaces($dPlaces)));\n }"
] | [
"def associar_assinatura(self, sequencia_cnpj, assinatura_ac):\n \n retorno = super(ClienteSATLocal, self).\\\n associar_assinatura(sequencia_cnpj, assinatura_ac)\n # (!) resposta baseada na redação com efeitos até 31-12-2016\n return RespostaSAT.associar_assinatura(retorn... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the remote URL
@return string | [
"public function getRemoteUrl() {\n\t\ttry {\n\t\t\t$values = $this->extractFromCommand ( 'git config --get remote.origin.url', function ($str) {\n\t\t\t\treturn trim ( $str );\n\t\t\t} );\n\t\t\tif (isset ( $values )) {\n\t\t\t\treturn implode ( \" \", $values );\n\t\t\t}\n\t\t} catch ( \\Cz\\Git\\GitException $e ... | [
"@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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
// SetPlatform sets the Platform field's value. | [
"func (s *ResourceInventory) SetPlatform(v string) *ResourceInventory {\n\ts.Platform = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Performs the move operation for a single VFS resource.<p>
@param source the source VFS path
@param target the target VFS path
@param sitePrefix the site prefix
@throws CmsException if moving the resource fails | [
"protected void performSingleMoveOperation(String source, String target, String sitePrefix) throws CmsException {\n\n // calculate the target name\n String finalTarget = getCms().getRequestContext().getFileTranslator().translateResource(target);\n finalTarget = CmsLinkManager.getAbsoluteUri(fin... | [
"@Override\n protected void alreadyProcessed(ClientlibRef ref, VisitorMode mode, ClientlibResourceFolder folder) {\n if (mode == EMBEDDED) {\n LOG.warn(\"Trying to embed already embedded / dependency {} again at {}\", ref, folder);\n }\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@deprecated this method will be removed in BjyAuthorize 2.0.x
@param ResourceProvider $provider
@return self | [
"public function addResourceProvider(ResourceProvider $provider)\n {\n $this->loaded && $this->loaded->__invoke();\n\n $this->resourceProviders[] = $provider;\n\n return $this;\n }"
] | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
UNSUBSCRIBE
@param array $topics Topic Filters
@return bool
@throws Exception | [
"public function unsubscribe(array $topics)\n {\n foreach ($topics as $topic_filter) {\n $this->topics_to_unsubscribe[] = $topic_filter;\n }\n list($last_unsubscribe_msgid, $last_unsubscribe_topics) = $this->do_unsubscribe();\n $this->unsubscribe_awaits[$last_unsubscribe_ms... | [
"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 Text processing:",
"pos": "Represent the code about Text processing:",
"neg": "Represent the code about Programming:"
} |
Sets the set of exclude patterns. Patterns may be separated by a comma
or a space.
@param string the string containing the exclude patterns
@return void
@throws BuildException | [
"public function setExcludes($excludes)\n {\n if ($this->isReference()) {\n throw $this->tooManyAttributes();\n }\n if ($excludes !== null && strlen($excludes) > 0) {\n $tok = strtok($excludes, \", \");\n while ($tok !== false) {\n $o = $this->... | [
"def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke... | codesearchnet | {
"query": "Represent the Github instruction about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code about programming:"
} |
// Object will return the object of the value, or nil if value is not an object.
//
// This method will not do any implicit conversion. For example, calling this method on a string primitive value will not return a String object. | [
"func (value Value) Object() *Object {\n\tswitch object := value.value.(type) {\n\tcase *_object:\n\t\treturn _newObject(object, value)\n\t}\n\treturn nil\n}"
] | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Render the List-of-Analyses overview page. | [
"def get(self):\n \"\"\"\"\"\"\n return self.render(\n 'index.html',\n databench_version=DATABENCH_VERSION,\n meta_infos=self.meta_infos(),\n **self.info\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 Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
API decorator for common tests (sessions open, etc.) and throttle
limitation (calls per second). | [
"def _api(fn):\n \"\"\"\"\"\"\n @_functools.wraps(fn)\n def _fn(self, *args, **kwargs):\n self._throttle_wait()\n if not self._SID:\n raise RuntimeError('Session closed. Invoke connect() before.')\n return fn(self, *args, **kwargs)\n return... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
To Nested
Takes an object that was flattened by toUnnested
and re-nests it.
@param val the flattened object to be nested. | [
"function toNested(val, def) {\n function nest(src) {\n var dest = {};\n for (var p in src) {\n if (src.hasOwnProperty(p))\n if (/\\./g.test(p))\n object_1.set(dest, p, src[p]);\n else\n dest[p] = src[p];\n }\n ... | [
"function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `prop... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Get comparison value
@param $validator
@param $comparisonField
@return null | [
"protected function getComparisonValue($validator, $comparisonField)\r\n {\r\n $comparisonFieldValue = isset($validator->getData()[$comparisonField]) ? $validator->getData()[$comparisonField] : null;\r\n return $comparisonFieldValue;\r\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Set serializers
@param array $serializers An array of serializer
@throws \Exception
@return $this Return $this, allow chaining | [
"public function setSerializers(array $serializers)\n {\n $this->serializers = [];\n\n foreach ($serializers as $serializer) {\n if (!($serializer instanceof SerializerInterface)) {\n throw new \\Exception('SerializerManager manage only ' . __NAMESPACE__ . '\\\\SerializerI... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SQLMaxOpenConns sets the MaxOpenConns option | [
"func SQLMaxOpenConns(max int) SQLStoreOption {\n\treturn func(o *SQLStoreOptions) error {\n\t\to.MaxOpenConns = max\n\t\treturn nil\n\t}\n}"
] | [
"protected void handleSqlCount(ActionRuntime runtime) {\n final CallbackContext context = CallbackContext.getCallbackContextOnThread();\n if (context == null) {\n return;\n }\n final SqlStringFilter filter = context.getSqlStringFilter();\n if (filter == null || !(filter... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Executes the task for MySQL databases. | [
"protected function _mysql()\n\t{\n\t\t$this->_msg(sprintf('Setting label and status values'), 0);\n\t\t$this->_status( '' );\n\n\t\tforeach ($this->_mysql as $table => $stmts)\n\t\t{\n\t\t\t$this->_msg(sprintf('Checking table \"%1$s\": ', $table), 1);\n\n\t\t\tif ($this->_schema->tableExists($table)) {\n\t\t\t\t$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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// List returns a slice describing each of the registered Facades. | [
"func (f *Registry) List() []Description {\n\tnames := make([]string, 0, len(f.facades))\n\tfor name := range f.facades {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\tdescriptions := make([]Description, 0, len(f.facades))\n\tfor _, name := range names {\n\t\tfacades := f.facades[name]\n\t\tdescri... | [
"@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 summarization about Agent Identity Management:",
"pos": "Represent the code about Agent Identity Management:",
"neg": "Represent the code about Programming:"
} |
returns true if the payment transaction was successful
@return boolean result of payment | [
"public function paymentSuccessful() {\n if ($this->requestHasSucceeded() && $this->requestMethod->isDirectPayment()) {\n return $this->requestMethod->getTransactionSuccessfulCode() == $this->response['resultPayment'];\n }\n\n return false;\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Escape an application version string.
@param s
@return The escaped app version. | [
"public static String escapeAppVersion(String s) {\n s = cleanWS(s);\n s = replaceAll(s, BackSlashPtn, EscBackSlash);\n s = replaceAll(s, LParenPtn, EscLParen);\n return s;\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 comment about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Associates the given {@link JFXTooltip} tooltip to the given node.
The tooltip will be shown according to the given {@link Pos} pos
@param node
@param tooltip | [
"public static void install(Node node, JFXTooltip tooltip, Pos pos) {\n tooltip.setPos(pos);\n BEHAVIOR.install(node, tooltip);\n }"
] | [
"private void bindTitle(final ServiceTask<?> task, final StringProperty titleProperty) {\n\n // Perform this binding into the JAT to respect widget and task API\n JRebirth.runIntoJAT(\"Bind Title for \" + task.getServiceHandlerName(),\n // Bind the task title\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Infer the antibiotics resistance of the given record.
Arguments:
record (`~Bio.SeqRecord.SeqRecord`): an annotated sequence.
Raises:
RuntimeError: when there's not exactly one resistance cassette. | [
"def find_resistance(record):\n \n for feature in record.features:\n labels = set(feature.qualifiers.get(\"label\", []))\n cassettes = labels.intersection(_ANTIBIOTICS)\n if len(cassettes) > 1:\n raise RuntimeError(\"multiple resistance cassettes detected\")\n elif len(c... | [
"def get_monomer_pattern(model, agent, extra_fields=None):\n \"\"\"\"\"\"\n try:\n monomer = model.monomers[_n(agent.name)]\n except KeyError as e:\n logger.warning('Monomer with name %s not found in model' %\n _n(agent.name))\n return None\n # Get the agent si... | codesearchnet | {
"query": "Represent the summarization about Data Science:",
"pos": "Represent the code about Data Science:",
"neg": "Represent the code about Computer Science:"
} |
Decrypt message.
@param string $msgSignature
@param string $nonce
@param string $timestamp
@param string $postXML
@throws EncryptionException
@return array | [
"public function decryptMsg($msgSignature, $nonce, $timestamp, $postXML)\n {\n try {\n $array = XML::parse($postXML);\n } catch (BaseException $e) {\n throw new EncryptionException('Invalid xml.', EncryptionException::ERROR_PARSE_XML);\n }\n\n $encrypted = $array... | [
"private function addMacSignature(Dataset $dataset)\n {\n $macSource = $this->getMacSource($dataset, 'payment');\n $keyPath = $this->getPkcKeyPath();\n\n $signature = $this->signWithPrivateKey($keyPath, $macSource);\n\n $mac = bin2hex($signature);\n $dataset->setParam('mac', $m... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Removes all auth items of the specified type.
@param int $type the auth item type (either Item::TYPE_PERMISSION or Item::TYPE_ROLE) | [
"protected function removeAllItems($type)\n {\n $rows = (new Query)\n ->select(['name'])\n ->from($this->itemCollection)\n ->where(['type' => $type])\n ->all($this->db);\n if (empty($rows)) {\n return;\n }\n\n $names = ArrayHelper... | [
"public Map<String, MethodConstraint> getUserDataMap(int table) {\n if (tc.isDebugEnabled())\n Tr.debug(tc, \"Getting user data map of which attribute is either confidential or integral\");\n return getMethodSet(table, UD_CONFIDENTIAL_OR_INTEGRAL_NO_EX_CHECK);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Thrown when a data object operation is denied
@param {string=} message - The error message
@param {string=} innerMessage - The error inner message
@param {string=} model - The target model
@constructor
@extends DataError | [
"function AccessDeniedError(message, innerMessage, model) {\n AccessDeniedError.super_.bind(this)('EACCESS', ('Access Denied' || message) , innerMessage, model);\n this.statusCode = 401;\n}"
] | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
finds the resource from the enclosing resource. Raise CantFindSingleton if there is no enclosing resource | [
"def find_resource(controller)\n ResourcesController.raise_cant_find_singleton(name, klass) unless controller.enclosing_resource\n controller.enclosing_resource.send(source)\n end"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Set Twitter search or stream criteria for the selection of tweets | [
"def searchTag(self,HTAG=\"#python\"):\n \"\"\"\"\"\"\n self.t = Twython(app_key =self.app_key ,\n app_secret =self.app_secret ,\n oauth_token =self.oauth_token ,\n oauth_token_secret =... | [
"protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Data synchronization:"
} |
// RedefineResource deinitializes a resource. | [
"func (rm *StateResourceManager) RedefineResource(id, desc string, rsrcCfg interface{}) error {\n\n\trsrc, alreadyExists, err := rm.findResource(id, desc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !alreadyExists {\n\t\treturn core.Errorf(\"No resource found for description: %q and id: %q\",\n\t\t\tdesc, id)\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 text about Technical Support:",
"pos": "Represent the code about Technical Support:",
"neg": "Represent the code about programming:"
} |
Retrieves all paired bridge devices.
@param bool $refresh Set true to force device discovery
@return mixed
@throws \Exception | [
"public function getPairedDevices($refresh = false)\n {\n if ($refresh === false) {\n $device = Discovery::lookupDevice('ip', $this->ip);\n if (isset($device['device']) && is_array($device['device'])) {\n return $device['device'];\n }\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 Github text about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code about Programming:"
} |
Removes from session
@param string $key | [
"public static function remove($key) {\n static::init();\n if (isset($_SESSION[self::$prepend . $key]))\n unset($_SESSION[self::$prepend . $key]);\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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.