query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
获取当前时间
@return float | [
"private function getCurrentTime()\n {\n list ($msec, $sec) = explode(\" \", microtime());\n return (float)$msec + (float)$sec;\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sets the asset link local service.
@param assetLinkLocalService the asset link local service | [
"public void setAssetLinkLocalService(\n\t\tcom.liferay.asset.kernel.service.AssetLinkLocalService assetLinkLocalService) {\n\t\tthis.assetLinkLocalService = assetLinkLocalService;\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Make the {@link java.sql.Connection} underlying this {@link Session} read/write
@param session | [
"private void makeReadWrite(final Session session)\n\t{\n\t\tsession.doWork(SetJDBCConnectionReadOnlyWork.READ_WRITE);\n\t\tsession.setHibernateFlushMode(FlushMode.AUTO);\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Set the join clause on the query.
@param \Nova\Database\ORM\Builder|null $query
@return void | [
"protected function setJoin(Builder $query = null)\n {\n $query = $query ?: $this->query;\n\n $foreignKey = $this->related->getTable().'.'.$this->related->getKeyName();\n\n $localKey = $this->parent->getTable().'.'.$this->secondKey;\n\n $query->join($this->parent->getTable(), $localKe... | [
"protected function addToDb(Database\\Model &$object)\n {\n $this->FKValue[1] = $object->id;\n $this->doQuery($this->addToDbQuery());\n }"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// ResponseHeadersDecodeError builds a YARPC error with code
// yarpcerrors.CodeInvalidArgument that represents a failure to
// decode the response headers. | [
"func ResponseHeadersDecodeError(req *transport.Request, err error) error {\n\treturn newClientEncodingError(req, true /*isResponse*/, true /*isHeader*/, err)\n}"
] | [
"public static RpcRequest rpcRequest(MethodDescriptor<?, ?> method, Object message) {\n // We don't actually use the RpcRequest for request processing since it doesn't fit well with streaming.\n // We still populate it with a reasonable method name for use in logging. The service type is currently\n ... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
--------------------------------------------------------------------------- mv.inputqnum_cross() Crossのques(問題データ)に0~4を入力する。 mv.inputcrossMark() Crossの黒点を入力する。 --------------------------------------------------------------------------- | [
"function(){\n\t\tvar cross = this.getcross();\n\t\tif(cross.isnull || cross===this.mouseCell){ return;}\n\n\t\tif(cross!==this.cursor.getx()){\n\t\t\tthis.setcursor(cross);\n\t\t}\n\t\telse{\n\t\t\tthis.inputqnum_main(cross);\n\t\t}\n\t\tthis.mouseCell = cross;\n\t}"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// NewRepoFile generates an empty repositories file.
//
// Generated and APIVersion are automatically set. | [
"func NewRepoFile() *RepoFile {\n\treturn &RepoFile{\n\t\tAPIVersion: APIVersionV1,\n\t\tGenerated: time.Now(),\n\t\tRepositories: []*Entry{},\n\t}\n}"
] | [
"func (cc *ClientConn) fallbackToDefaultServiceConfig(sc string) bool {\n\tif cc.dopts.disableServiceConfig {\n\t\treturn true\n\t}\n\t// The logic below is temporary, will be removed once we change the resolver.State ServiceConfig field type.\n\t// Right now, we assume that empty service config string means resolv... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Delete a file or folder from a project
:param project_name: str: name of the project containing a file we will delete
:param remote_path: str: remote path specifying file to delete | [
"def delete_file(self, project_name, remote_path):\n \n project = self._get_or_create_project(project_name)\n remote_file = project.get_child_for_path(remote_path)\n remote_file.delete()"
] | [
"function (src, target) {\n /*\n * Copy a file from one path relative to the src, to another relative to the\n * target.\n * @param {String} from - the path to copy from, relative to the src.\n * @param {String} to - the path to copy to.\n * @return {Promise} - promise to copy\n */\n this.copy = funct... | codesearchnet | {
"query": "Represent the description about Metadata management:",
"pos": "Represent the code about Metadata management:",
"neg": "Represent the code about Software development:"
} |
Run main entry for AutoMLBoard.
Args:
args: args parsed from command line | [
"def run_board(args):\n \n init_config(args)\n\n # backend service, should import after django settings initialized\n from backend.collector import CollectorService\n\n service = CollectorService(\n args.logdir,\n args.reload_interval,\n standalone=False,\n log_level=args.... | [
"def run(self, args): # pylint: disable=unused-argument\n \n logging.basicConfig(stream=sys.stdout, level=logging.INFO)\n\n # This is used as a tool only to segment translation files when adding a\n # new segment. In the regular workflow, the work is done by the extract\n # phas... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get a named action output that was registered in the current request.
@param name the name of the action output.
@param request the current ServletRequest
@see #addActionOutput | [
"public static Object getActionOutput( String name, ServletRequest request )\n {\n Map map = InternalUtils.getActionOutputMap( request, false );\n return map != null ? map.get( name ) : null;\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 about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Determine whether 50 Cent is a topic. | [
"def detector_50_Cent(text):\n \"\"\"\"\"\"\n keywords = [\n \"50 Cent\",\n \"rap\",\n \"hip hop\",\n \"Curtis James Jackson III\",\n \"Curtis Jackson\",\n \"Eminem\",\n \"Dre\",\n \"Get Rich or Die Tryin'\",\n \"G-Unit\",\n \"Street King I... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver. | [
"func (c *UserConfig) Complete() completedConfig {\n\tcfg := completedConfig{\n\t\tc.GenericConfig.Complete(),\n\t\t&c.ExtraConfig,\n\t}\n\n\treturn cfg\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Remove the metadata from the given filename. | [
"def delete(self, filename):\n \"\"\"\"\"\"\n\n self._failed_atoms.clear()\n self.clear()\n self.save(filename, padding=lambda x: 0)"
] | [
"@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 Metadata management:",
"pos": "Represent the Github code about Metadata management:",
"neg": "Represent the Github code:"
} |
Remove all devices as listed in the deviceList. These devices can be different types.
Make sure the VM is powered off before calling this method.
If destroyDeviceBacking is true, it deletes backings for example files in datastore. BE CAREFUL! | [
"public Task removeDevices(List<VirtualDevice> deviceList, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException {\r\n List<VirtualDeviceConfigSpec>... | [
"func (v *azureVolumeSource) ReleaseVolumes(ctx context.ProviderCallContext, volumeIds []string) ([]error, error) {\n\t// Releasing volumes is not supported, see azureStorageProvider.Releasable.\n\t//\n\t// When managed disks can be moved between resource groups, we may want to\n\t// support releasing unmanaged dis... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Retrieve the final document as a list of paginated bitmap files
@param int $zoomFactor
@param string $format
@return array
@throws BitmapsException
@throws InvalidException | [
"protected function getPaginatedBitmaps($zoomFactor , $format , $from , $to)\n {\n if ( $from > $to ) {\n throw new InvalidException('Start page for bitmaps must be inferior to end page');\n }\n\n $ret = array();\n try {\n $result = $this->getSoapClient()->GetBit... | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Main starts mc application | [
"func Main() {\n\tif len(os.Args) > 1 {\n\t\tswitch os.Args[1] {\n\t\tcase \"mc\", \"-install\", \"-uninstall\":\n\t\t\tmainComplete()\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Enable profiling supported modes are [cpu, mem, block].\n\t// ``MC_PROFILER`` supported options are [cpu, mem, block].\n\tswitch os.Getenv(\"MC_PRO... | [
"@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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Accepts the standard node argument, along with an optional omit
flag - it should be an iterable that lists out all attributes
that should be omitted from the repr output. | [
"def walk(\n self, node, omit=(\n 'lexpos', 'lineno', 'colno', 'rowno'),\n indent=0, depth=-1,\n pos=False,\n _level=0):\n \n\n if not depth:\n return '<%s ...>' % node.__class__.__name__\n\n attrs = []\n children = no... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Gets a representation of a CLOB/LONGVARCHAR value suitable for use in a SQL statement.
@param mixed $clob Clob object or string data.
@return string | [
"protected function getClobSql($clob)\n {\n // they took magic __toString() out of PHP5.0.0; this sucks\n if (is_object($clob)) {\n return $this->getPlatform()->quote($clob->__toString());\n } else {\n return $this->getPlatform()->quote($clob);\n }\n }"
] | [
"@ScalarFunction(value = \"like\", hidden = true)\n @LiteralParameters(\"x\")\n @SqlType(StandardTypes.BOOLEAN)\n public static boolean likeVarchar(@SqlType(\"varchar(x)\") Slice value, @SqlType(LikePatternType.NAME) Regex pattern)\n {\n // Joni can infinite loop with UTF8Encoding when invalid UT... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Assign the roles to the given authority.
@param \Illuminate\Database\Eloquent\Model|array|int $authority
@return bool | [
"public function to($authority)\n {\n $authorities = is_array($authority) ? $authority : [$authority];\n\n $roles = Models::role()->findOrCreateRoles($this->roles);\n\n foreach (Helpers::mapAuthorityByClass($authorities) as $class => $ids) {\n $this->assignRoles($roles, $class, ne... | [
"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 Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Returns the saved + add - removed elements.
@api | [
"public function all()\n {\n $documents = array_merge($this->getSaved(), $this->getAdd());\n\n foreach ($this->getRemove() as $document) {\n if (false !== $key = array_search($document, $documents)) {\n unset($documents[$key]);\n }\n }\n\n return a... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Convert_storage_CSIDriver_To_v1beta1_CSIDriver is an autogenerated conversion function. | [
"func Convert_storage_CSIDriver_To_v1beta1_CSIDriver(in *storage.CSIDriver, out *v1beta1.CSIDriver, s conversion.Scope) error {\n\treturn autoConvert_storage_CSIDriver_To_v1beta1_CSIDriver(in, out, s)\n}"
] | [
"func NewProtoWrapperWithSerializer(db keyval.CoreBrokerWatcher, serializer keyval.Serializer) *ProtoWrapper {\n\t// OBSOLETE, use NewProtoWrapper\n\treturn NewProtoWrapper(db, serializer)\n}"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Simplify the given graph based on the configured value.
@param graph input graph
@param <T> graph key type
@return output graph
@throws Exception on error | [
"public <T extends Comparable<T>> Graph<T, NullValue, NullValue> simplify(Graph<T, NullValue, NullValue> graph, int parallelism)\n\t\t\tthrows Exception {\n\t\tswitch (value) {\n\t\t\tcase DIRECTED:\n\t\t\t\tgraph = graph\n\t\t\t\t\t.run(new org.apache.flink.graph.asm.simple.directed.Simplify<T, NullValue, NullValu... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
receive response callback function | [
"def on_recv_rsp(self, rsp_pb):\n \"\"\"\"\"\"\n ret_code, msg, data = OrderDetail.unpack_rsp(rsp_pb)\n\n if ret_code != RET_OK:\n return ret_code, msg\n else:\n return RET_OK, data"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Read run information from a passed YAML file. | [
"def _run_info_from_yaml(dirs, run_info_yaml, config, sample_names=None,\n is_cwl=False, integrations=None):\n \n validate_yaml(run_info_yaml, run_info_yaml)\n with open(run_info_yaml) as in_handle:\n loaded = yaml.safe_load(in_handle)\n fc_name, fc_date = None, None\n i... | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// IsThinWaist returns whether a Multiaddr starts with "Thin Waist" Protocols.
// This means: /{IP4, IP6}[/{TCP, UDP}] | [
"func IsThinWaist(m ma.Multiaddr) bool {\n\tm = zoneless(m)\n\tif m == nil {\n\t\treturn false\n\t}\n\tp := m.Protocols()\n\n\t// nothing? not even a waist.\n\tif len(p) == 0 {\n\t\treturn false\n\t}\n\n\tif p[0].Code != ma.P_IP4 && p[0].Code != ma.P_IP6 {\n\t\treturn false\n\t}\n\n\t// only IP? still counts.\n\tif... | [
"def getLL64(self):\n \"\"\"\"\"\"\n print '%s call getLL64' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v IPv6:LinkLocalAddress')[0])"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initiates execution of the background task.
@param array $settings Settings which will be passed to the execute method of the BackgroundTask (must be JSON serialisable)
@return BackgroundTaskStatus The status object for this task. | [
"public static function initiate($settings)\n {\n // Create an entry in our database.\n $taskStatus = new BackgroundTaskStatus();\n $taskStatus->TaskClass = get_called_class();\n $taskStatus->TaskSettings = $settings;\n $taskStatus->save();\n\n $task = new static();\n\n ... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Synchronously execute the specified GP task. Parameters are passed
in either in order or as keywords. | [
"def Execute(self, *params, **kw):\n \"\"\"\"\"\"\n fp = self.__expandparamstodict(params, kw)\n return self._get_subfolder('execute/', GPExecutionResult, fp)"
] | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Maps ("folds") the given string, returning an unique label ID.
This allows several constant labels to be initialized to the same address
thus saving memory space.
:param str_: the string to map
:return: the unique label ID | [
"def add_string_label(self, str_):\n \n if self.STRING_LABELS.get(str_, None) is None:\n self.STRING_LABELS[str_] = backend.tmp_label()\n\n return self.STRING_LABELS[str_]"
] | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Same as get_token(), but interprets col_offset as a UTF8 offset, which is what `ast` uses. | [
"def get_token_from_utf8(self, lineno, col_offset):\n \n return self.get_token(lineno, self._line_numbers.from_utf8_col(lineno, col_offset))"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Build the handler result.
@param credentials the provided credentials
@param profile the retrieved user profile
@param client the client
@return the built handler result
@throws GeneralSecurityException On authentication failure. | [
"protected AuthenticationHandlerExecutionResult createResult(final ClientCredential credentials, final UserProfile profile,\n final BaseClient client) throws GeneralSecurityException {\n if (profile == null) {\n throw new FailedLoginEx... | [
"def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetCursor sets the the cursor position. | [
"func (a *CellView) SetCursor(x, y int) {\n\ta.cursorX = x\n\ta.cursorY = y\n\ta.model.SetCursor(x, y)\n}"
] | [
"def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns a newly-created {@link CentralDogma} instance.
@throws UnknownHostException if failed to resolve the host names from the DNS servers | [
"public CentralDogma build() throws UnknownHostException {\n final Endpoint endpoint = endpoint();\n final String scheme = \"none+\" + (isUseTls() ? \"https\" : \"http\") + \"://\";\n final String uri = scheme + endpoint.authority();\n final ClientBuilder builder =\n newCl... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get description.
@param string $desc description.
@return string|null description if enabled, or null if disabled. | [
"public function setDescription($desc)\n {\n $descAttribute = $this->descriptionAttribute;\n return is_string($descAttribute) ? $this->$descAttribute = $desc : 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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Map Synchro constraints to MPXJ constraints.
@param task task
@param row Synchro constraint data | [
"private void setConstraints(Task task, MapRow row)\n {\n ConstraintType constraintType = null;\n Date constraintDate = null;\n Date lateDate = row.getDate(\"CONSTRAINT_LATE_DATE\");\n Date earlyDate = row.getDate(\"CONSTRAINT_EARLY_DATE\");\n\n switch (row.getInteger(\"CONSTRAINT_TYPE\")... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Executes scheduled callbacks based on the provided time. | [
"private void tick(long index, long timestamp) {\n this.currentIndex = index;\n\n // If the entry timestamp is less than the current state machine timestamp\n // and the delta is not yet set, set the delta and do not change the current timestamp.\n // If the entry timestamp is less than the current stat... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set the named arguments.
@param vars
the new named arguments | [
"@SuppressWarnings(\"unchecked\")\n public void setVars(final Map<String, ? extends Object> vars) {\n this.vars = (Map<String, Object>)vars;\n }"
] | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
设置群组资料
@param GroupAttributes $attributes
@return BaseResponse|GetGroupInfoResponse
@throws Exception\TIMException | [
"public function setInfo(GroupAttributes $attributes)\n {\n $request = new SetGroupInfoRequest($this->groupId);\n $request->setParameters($attributes->getItems());\n $response = new GetGroupInfoResponse();\n return $this->client->sendRequest($request, $response);\n }"
] | [
"public function handle(PacketEventParam $e)\n {\n if(!Worker::isWorkerStartAppComplete())\n {\n $GLOBALS['WORKER_START_END_RESUME_COIDS'][] = Coroutine::getuid();\n Coroutine::suspend();\n }\n // 上下文创建\n RequestContext::create();\n RequestContext::... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Validate and parse DNS record data for SPF record(s)
:param rdata: DNS record data
:return: dict w/fields | [
"def spf_rec(rdata):\n '''\n \n '''\n spf_fields = rdata.split(' ')\n if not spf_fields.pop(0).startswith('v=spf'):\n raise ValueError('Not an SPF record')\n\n res = OrderedDict()\n mods = set()\n for mech_spec in spf_fields:\n if mech_spec.startswith(('exp', 'redirect')):\n ... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github instruction about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code:"
} |
Never ever call this Method from an event handler for those
two buttons - endless loop!
@param newLoopValue
@since 11.01.2012 | [
"public void setLoopValue(int newLoopValue)\n\t{\n\t\tif (newLoopValue==Helpers.PLAYER_LOOP_DEACTIVATED)\n\t\t{\n\t\t\tgetPlayerSetUp_fadeOutLoops().setSelected(false);\n\t\t\tgetPlayerSetUp_ignoreLoops().setSelected(false);\n\t\t}\n\t\telse\n\t\tif (newLoopValue==Helpers.PLAYER_LOOP_FADEOUT)\n\t\t{\n\t\t\tgetPlaye... | [
"public void setHeader(String name, String s) {\n if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15\n logger.logp(Level.FINE, CLASS_NAME,\"setHeader\", \" name --> \" + name + \" value --> \" + PasswordNullifier.nullifyParams(s), \"[\"+this+\"... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Add multiple ordering criteria.
@param array $order Optional, the ordering criteria ( ['_position' => 'ASC', '_leftnode' => 'ASC'] by default )
@return PageQueryBuilder | [
"public function orderByMultiple($order = ['_position' => 'ASC', '_leftnode' => 'ASC'])\n {\n if (true === empty($order)) {\n $order = ['_position' => 'ASC', '_leftnode' => 'ASC'];\n }\n\n $this->resetDQLPart('orderBy');\n foreach ($order as $field => $sort) {\n ... | [
"public static function getPageAuthority($url = false)\n {\n $data = static::getCols('34359738368', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['upa'];\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Fills the model's properties with the source from Stripe.
@param \Stripe\Card|\Stripe\BankAccount|null $card
@return $this | [
"protected function fillCardDetails($card)\n {\n if ($card instanceof StripeCard) {\n $this->card_brand = $card->brand;\n $this->card_last_four = $card->last4;\n } elseif ($card instanceof StripeBankAccount) {\n $this->card_brand = 'Bank Account';\n $this... | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Returns true if the current application user (or the optionally given user)
is authenticated because they have introduced their credentials (username
and password).
@param null $user
@return bool | [
"public function isFullyAuthenticated($user = null)\n {\n $user = $user ?: $this->getUser();\n\n return $this->isGranted('IS_AUTHENTICATED_FULLY', $user);\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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Returns a {@link QualifiedName} for a type in {@code packageName}. If {@code nestedTypes} is
empty, it is a top level type called {@code topLevelType}; otherwise, it is nested in that
type. | [
"public static QualifiedName of(String packageName, String topLevelType, String... nestedTypes) {\n requireNonNull(!packageName.isEmpty());\n checkArgument(!topLevelType.isEmpty());\n return new QualifiedName(\n unshadedName(packageName), // shadowJar modifies string literals; unshade them here\n ... | [
"public String getNotifierClass()\n {\n StringBuffer sb = new StringBuffer(getShortName());\n sb.append(\"Notifier\");\n\n //\n // If the event set declaration has any parameterized types, then include them on\n // the notifier class as well. Currently, these can only be param... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Utility for adding the contents of an iterable to a collection.
@hide unsupported on Android | [
"public static <T> T[] addAllTo(Iterable<T> source, T[] target) {\n int i = 0;\n for (T item : source) {\n target[i++] = item;\n }\n return target;\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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get tokeniser function from the hash settings.
This function takes a FieldHashingProperties object. It returns a
function that takes a string and tokenises based on those properties. | [
"def get_tokenizer(fhp # type: Optional[field_formats.FieldHashingProperties]\n ):\n # type: (...) -> Callable[[Text, Optional[Text]], Iterable[Text]]\n \n\n def dummy(word, ignore=None):\n # type: (Text, Optional[Text]) -> Iterable[Text]\n \"\"\"\n Null tokenizer ret... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param string $queueName
@param int $chunkSize
@param array $options
@return \Generated\Shared\Transfer\QueueReceiveMessageTransfer[] | [
"public function receiveMessages($queueName, $chunkSize = 100, array $options = [])\n {\n $this->channel->callbacks = [];\n\n /** @var \\Generated\\Shared\\Transfer\\RabbitMqConsumerOptionTransfer $rabbitMqOption */\n $rabbitMqOption = $options['rabbitmq'];\n\n $this->channel->basic_q... | [
"public function setSubscriptionAddon(SetAddon\\RequestData $requestData)\n {\n $request = new SetAddon\\Request($requestData);\n\n return $this->sendRequest($request, SetAddon\\ApiResponse::class);\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Generates a stack trace while skipping internal and self calls.
@return array | [
"public static function filtered($classes = array(), $files = array(), &$stack = null)\n {\n $skip_self_trace = 0;\n if ($stack === null) {\n $stack = debug_backtrace();\n }\n\n $classes = array_merge((array) $classes, array(__CLASS__));\n // Note: in a php backtrace... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
End a transaction. | [
"public static void endTransaction() {\n ifNotNullThen(localConnection.get(),\n () -> {\n Connection connection = localConnection.get();\n ifThen(connection.isRollbackOnClose(), connection::close);\n localConnection.remove();\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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
@param string $property
@param string $value
@param array|null $shorthands
@return array
@version 1.0
@see merge_4value_shorthands() | [
"public function dissolve_4value_shorthands($property, $value, $shorthands = null) {\n\t\tif (is_null($shorthands)) {\n\t\t\t$shorthands = & $this->parser->data['csstidy']['shorthands'];\n\t\t}\n\t\tif (!is_array($shorthands[$property])) {\n\t\t\t$return[$property] = $value;\n\t\t\treturn $return;\n\t\t}\n\n\t\t$im... | [
"def _do_magic_import(self, rule, p_selectors, p_parents, p_children, scope, media, c_lineno, c_property, c_codestr, code, name):\n \n if callable(STATIC_ROOT):\n files = sorted(STATIC_ROOT(name))\n else:\n glob_path = os.path.join(STATIC_ROOT, name)\n files = g... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Yields an estimated percentage slice of: 1 to 80
@return \Generator
@throws \Exception | [
"public function convertGenerator() : \\Generator {\n\n\t\tyield 1 => $this->generatorPrefix . __( 'Initializing', 'pressbooks' );\n\n\t\t// Sanity check\n\n\t\tif ( empty( $this->tmpDir ) || ! is_dir( $this->tmpDir ) ) {\n\t\t\t$this->logError( '$this->tmpDir must be set before calling convert().' );\n\t\t\tthrow ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Text analysis:",
"pos": "Represent the code about Text analysis:",
"neg": "Represent the code:"
} |
Try to order if the Commit message is ready to be ordered. | [
"def tryOrder(self, commit: Commit):\n \n canOrder, reason = self.canOrder(commit)\n if canOrder:\n self.logger.trace(\"{} returning request to node\".format(self))\n self.doOrder(commit)\n else:\n self.logger.debug(\"{} cannot return request to node: {}\... | [
"def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
This method is called to ensure that after a project file has been
read, the cached unique ID values used to generate new unique IDs
start after the end of the existing set of unique IDs. | [
"public void updateUniqueCounters()\n {\n //\n // Update task unique IDs\n //\n for (Task task : m_parent.getTasks())\n {\n int uniqueID = NumberHelper.getInt(task.getUniqueID());\n if (uniqueID > m_taskUniqueID)\n {\n m_taskUniqueID = uniqueID;\n ... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// determines if an event occurs within the time set in the request object and is the right type | [
"func checkIfEventSatisfiesRequest(request *Request, event *Event) bool {\n\tstartTime := request.StartTime\n\tendTime := request.EndTime\n\teventTime := event.Timestamp\n\tif !startTime.IsZero() {\n\t\tif startTime.After(eventTime) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !endTime.IsZero() {\n\t\tif endTime.Before(... | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the post about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Get authentication method according to classpath. Windows native authentication is using
Waffle-jna.
@return authentication method | [
"public static GssapiAuth getAuthenticationMethod() {\n try {\n //Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication\n if (Platform.isWindows()) {\n try {\n Class.forName(\"waffle.windows.auth.impl.WindowsAuthProviderImpl\");\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:"
} |
%prog refallele vcffile > out.refAllele
Make refAllele file which can be used to convert PLINK file to VCF file. | [
"def refallele(args):\n \n p = OptionParser(refallele.__doc__)\n opts, args = p.parse_args(args)\n\n if len(args) != 1:\n sys.exit(not p.print_help())\n\n vcffile, = args\n fp = open(vcffile)\n for row in fp:\n if row[0] == '#':\n continue\n atoms = row.split()\n... | [
"def runner(self):\n \n logging.info('Starting {} analysis pipeline'.format(self.analysistype))\n if not self.pipeline:\n # If the metadata has been passed from the method script, self.pipeline must still be false in order to\n # get Sippr() to function correctly, but the ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
The available combined character width when all padding is
removed. | [
"def viewable_width(self):\n \n return sum(self.widths) + sum(x['padding'] for x in self.colspec)"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get Resource Url for UpdateLocalizedContents
@param attributeFQN Fully qualified name for an attribute.
@return String Resource Url | [
"public static MozuUrl updateLocalizedContentsUrl(String attributeFQN)\r\n\t{\r\n\t\tUrlFormatter formatter = new UrlFormatter(\"/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/LocalizedContent\");\r\n\t\tformatter.formatUrl(\"attributeFQN\", attributeFQN);\r\n\t\treturn new MozuUrl(format... | [
"public void addClass(ClassDescriptorDef classDef)\r\n {\r\n classDef.setOwner(this);\r\n // Regardless of the format of the class name, we're using the fully qualified format\r\n // This is safe because of the package & class naming constraints of the Java language\r\n _classDefs.put... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// GetDuplicates returns all the duplicate evaluations and blocks until the
// passed timeout. | [
"func (b *BlockedEvals) GetDuplicates(timeout time.Duration) []*structs.Evaluation {\n\tvar timeoutTimer *time.Timer\n\tvar timeoutCh <-chan time.Time\nSCAN:\n\tb.l.Lock()\n\tif len(b.duplicates) != 0 {\n\t\tdups := b.duplicates\n\t\tb.duplicates = nil\n\t\tb.l.Unlock()\n\t\treturn dups\n\t}\n\n\t// Capture chans i... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Write the content of this RtfHeaderFooterGroup. | [
"public void writeContent(final OutputStream result) throws IOException\n {\n if(this.mode == MODE_SINGLE) {\n \theaderAll.writeContent(result);\n } else if(this.mode == MODE_MULTIPLE) {\n if(headerFirst != null) {\n \theaderFirst.writeContent(result);\n }\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 sentence about text:",
"pos": "Represent the code about text:",
"neg": "Represent the code:"
} |
Get a request parameter. Check GET then POST data, then optionally any json body data.
@param string $str_key
@param mixed $str_default
@param bool $check_json_body
@return mixed | [
"protected function getParam($str_key, $str_default = null, $check_json_body = false)\n {\n $str_query = $this->getQuery($str_key);\n if (null !== $str_query) {\n return $str_query;\n }\n $str_post = $this->getPost($str_key);\n if (NULL !== $str_post) {\n ... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
<p>
An array of patches and patch status.
</p>
@return An array of patches and patch status. | [
"public java.util.List<EffectivePatch> getEffectivePatches() {\n if (effectivePatches == null) {\n effectivePatches = new com.amazonaws.internal.SdkInternalList<EffectivePatch>();\n }\n return effectivePatches;\n }"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the comment about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code:"
} |
Wrap a computation in a lazy computation.
@param supplier the computation
@param <A> the value type
@return the new {@link Lazy} | [
"public static <A> Lazy<A> lazy(Supplier<A> supplier) {\n return new Later<>(fn0(supplier));\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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Build the https app url
@param theServer - The server where the app is running (used to get the port)
@param root - the root context of the app
@param app - the specific app to run
@return - returns the full url to invoke
@throws Exception | [
"public String buildAppSecureUrl(LibertyServer theServer, String root, String app) throws Exception {\n\n return SecurityFatHttpUtils.getServerSecureUrlBase(theServer) + root + \"/rest/\" + app + \"/\" + MpJwtFatConstants.MPJWT_GENERIC_APP_NAME;\n\n }"
] | [
"def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Configure a network interface.
@param name The name of the interface.
@param expression The expression to define the interface.
@return The container. | [
"public Container iface(String name, String expression) {\n this.interfaces.add(new Interface(name, expression));\n return this;\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 post about network configuration:",
"pos": "Represent the code about network configuration:",
"neg": "Represent the code about programming:"
} |
Gets a value of object by path
@memberOf util | [
"function getPropertyOfPath(obj, path) {\n const [child, last] = getLeafOfPath(obj, path, false);\n return child && last ? child[last] : undefined;\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Parse usage/overall. | [
"def _usage_overall(raw):\n '''\n \n '''\n data = {}\n for line in raw.split(\"\\n\")[1:]:\n keyset = [item.strip() for item in re.sub(r\"\\s+\", \" \", line).split(\":\", 1) if item.strip()]\n if len(keyset) == 2:\n key = re.sub(r\"[()]\", \"\", keyset[0]).replace(\" \", \"_... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Parses each line of crontab content and creates new TaskInterface objects
@param string $cron
@param TaskInterface $task_class
@return array | [
"public static function parseCrontab($cron, $task_class)\n {\n $cron_array = explode(PHP_EOL, $cron);\n $comment = null;\n $result = array();\n foreach ($cron_array as $c) {\n $c = trim($c);\n if (empty($c)) {\n continue;\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Delete file or folder
@param mixed $path
@return bool | [
"public static function delete($path)\n {\n if (is_file($path)) {\n return unlink($path);\n }\n\n $files = array_diff(scandir($path), array('.', '..'));\n\n foreach ($files as $file) {\n (is_dir(\"$path/$file\")) ? Filesystem::delete(\"$path/$file\") : unlink(\"$path/$file\");\n }\n\n r... | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// warnSkippedSettings prints a log warning message about skipped settings
// in a SigningProfile, usually due to remote signer. | [
"func (p *Signing) warnSkippedSettings() {\n\tconst warningMessage = `The configuration value by \"usages\", \"issuer_urls\", \"ocsp_url\", \"crl_url\", \"ca_constraint\", \"expiry\", \"backdate\", \"not_before\", \"not_after\", \"cert_store\" and \"ct_log_servers\" are skipped`\n\tif p == nil {\n\t\treturn\n\t}\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string | [
"func (o *GetEndpointURL) WithBasePath(bp string) *GetEndpointURL {\n\to.SetBasePath(bp)\n\treturn o\n}"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// no documentation yet | [
"func (r Network_Firewall_Update_Request) UpdateRuleNote(fwRule *datatypes.Network_Component_Firewall_Rule, note *string) (resp bool, err error) {\n\tparams := []interface{}{\n\t\tfwRule,\n\t\tnote,\n\t}\n\terr = r.Session.DoRequest(\"SoftLayer_Network_Firewall_Update_Request\", \"updateRuleNote\", params, &r.Optio... | [
"public static void main(String[] args) {\n /*\n * Developers Notes:\n *\n * -No corresponding Junit test class currently\n * provided. Test by eyeball of the output.\n *\n * -Add a menu with Help(About)\n * --> TBD.\n *\n * -Figure out... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Call on content change to update the layout.<p> | [
"public void onContentChange() {\n\n Scheduler.get().scheduleDeferred(new ScheduledCommand() {\n\n public void execute() {\n\n Widget parent = getParent();\n while (parent != null) {\n if (parent instanceof CmsGalleryDialog) {\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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
*
@return String a string that represents the current object | [
"public function toString()\n {\n\n $request = array();\n $request['Reference'] = $this->reference;\n $request['PagSeguroPreApprovalCode'] = $this->preApprovalCode;\n\n return \"PagSeguroPaymentCharge: \" . var_export($request, true);\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 instruction about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code:"
} |
Return a dictionary with the values of all children, and place holders for all of the section
argumemts. It combines props and arg_props | [
"def all_props(self):\n \"\"\"\"\"\"\n\n d = self.arg_props\n d.update(self.props)\n\n return d"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
{@inheritDoc}
@see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar) | [
"@Override\n\tpublic Timestamp getTimestamp(final String columnLabel, final Calendar cal) throws SQLException {\n\t\treturn wrapped.getTimestamp(columnLabel, cal);\n\t}"
] | [
"public void registerOutParameter(int parameterIndex, int sqlType, String typeName) {\n record(parameterIndex, getDeclaredMethod(CallableStatement.class, \"registerOutParameter\", int.class, int.class, int.class), parameterIndex, sqlType, typeName);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Load syntax-specific output profiles. These are essentially
an extension to syntax snippets
@param {Object} profiles Dictionary of profiles | [
"function(profiles) {\n\t\t\tprofiles = utils.parseJSON(profiles);\n\t\t\tvar snippets = {};\n\t\t\tObject.keys(profiles).forEach(function(syntax) {\n\t\t\t\tvar options = profiles[syntax];\n\t\t\t\tif (!(syntax in snippets)) {\n\t\t\t\t\tsnippets[syntax] = {};\n\t\t\t\t}\n\t\t\t\tsnippets[syntax].profile = normali... | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Attach the acces_token to a request. | [
"def _add_auth_headers(self, base):\n \"\"\"\"\"\"\n if 'access_token' in self.creds:\n return _extend(base, {\n 'authorization': 'Bearer ' + self.creds['access_token']\n })\n return base"
] | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Returns the data for the requested element, or <code>null</code> if the element has not been cached yet.<p>
@param resourceTypeName the element resource type
@return the element data | [
"public CmsContainerElementData getCachedNewElement(String resourceTypeName) {\n\n if (m_newElements.containsKey(resourceTypeName)) {\n return m_newElements.get(resourceTypeName);\n }\n return null;\n }"
] | [
"public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Get a toolbar by identifier.
@return AnControllerToolbarAbstract | [
"public function getToolbar($toolbar, $config = array())\n {\n if (is_string($toolbar)) {\n if (strpos($toolbar, '.') === false) {\n $identifier = clone $this->getIdentifier();\n $identifier->path = array('controller', 'toolbar');\n $identifier->name... | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// IsValidServiceAccountKeyFile returns true if a valid public RSA key can be read from the given file | [
"func IsValidServiceAccountKeyFile(file string) bool {\n\t_, err := keyutil.PublicKeysFromFile(file)\n\treturn err == nil\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
convert naive datetime to timezone-aware datetime | [
"def datetime_to_timezone(date, tz=\"UTC\"):\n \n if not date.tzinfo:\n date = date.replace(tzinfo=timezone(get_timezone()))\n return date.astimezone(timezone(tz))"
] | [
"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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Factory method
@param object $init the IDS_Init object
@param string $type the caching type
@return object the caching facility | [
"public static function factory($init, $type) \n {\n \n \t$object = false;\n $wrapper = preg_replace(\n\t\t\t'/\\W+/m', \n\t\t\tnull, \n\t\t\tucfirst($init->config['Caching']['caching'])\n\t\t);\n $class = 'IDS_Caching_' . $wrapper;\n $path = dirname(__FILE__) . DIRECTORY_SEP... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Customizable Lazy Exploit Pattern Utility. | [
"def main(argument, sets, big_endian, optimal, output, clipboard,\n quiet, verbose):\n \"\"\"\"\"\"\n logger = logging.getLogger()\n handler = logging.StreamHandler(sys.stderr)\n handler.setFormatter(LevelFormatter())\n logger.addHandler(handler)\n logger.setLevel(logging.WARNING + (quiet-... | [
"protected void addDefaultComponents(final ContextInitializer initializer) {\n initializer.addComponents(\n // PROCESSORS.\n // Assets:\n new AssetService(), new SkinAssetAnnotationProcessor(),\n // Locale:\n new LocaleService(),\n ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
As per {@link #loadModelGuess(InputStream)} but (optionally) allows copying to the specified temporary directory
@param stream Stream of the model file
@param tempDirectory Temporary/working directory. May be null. | [
"public static Model loadModelGuess(InputStream stream, File tempDirectory) throws Exception {\n //Currently (Nov 2017): KerasModelImport doesn't support loading from input streams\n //Simplest solution here: write to a temporary file\n File f;\n if(tempDirectory == null){\n f... | [
"private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *CreateAuthorizerInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateAuthorizerInput\"}\n\tif s.AuthorizerFunctionArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"AuthorizerFunctionArn\"))\n\t}\n\tif s.AuthorizerName == nil {\n\t\tinvalidParams.Add(reque... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Gets the current authorization token.
<p>
In the very first call, this method creates a new token before returning.
If currently stored token is expired, this method creates a new one.
@return Valid OAuthToken instance.
@throws Exception | [
"public OAuthToken getToken() throws Exception {\r\n OAuthToken token = storageStrategy.get(getEnvKey());\r\n \r\n if (token == null || token.IsExpired()) {\r\n storeToken(this.root.getAuthenticationManager().createToken());\r\n }\r\n \r\n return storageStrategy.... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\r\n\tpublic EClass getIfcPointOnCurve() {\r\n\t\tif (ifcPointOnCurveEClass == null) {\r\n\t\t\tifcPointOnCurveEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(432);\r\n\t\t}\r\n\t\treturn ifcPointOnCurveEClass;\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 text about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Reflectively loads the COLT-related class. If the class is not
immediately loadable from the existing classpath, then this method will
attempt to use the {@code colt.path} system environment variable to load
it from an external resource. | [
"private static Class<?> loadColtClass(String className) \n throws ClassNotFoundException { \n try {\n Class<?> clazz = \n Class.forName(className);\n return clazz;\n \n } catch (ClassNotFoundException cnfe) {\n\n // If we see a CNF... | [
"@Override\n public Enumeration<URL> findResources(final String name) throws IOException {\n if (name == null) {\n return null;\n }\n // On iOS, every resource is resolved by the SystemClassLoader, so\n // any URL in this class loader will, too.\n return Collections.... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
// TTYResize resizes the tty of the specified container | [
"func (c *HyperClient) TTYResize(containerID, execID string, height, width int32) error {\n\t_, err := c.client.TTYResize(c.ctx, &types.TTYResizeRequest{\n\t\tContainerID: containerID,\n\t\tExecID: execID,\n\t\tHeight: height,\n\t\tWidth: width,\n\t})\n\n\treturn err\n}"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets up the global $PAGE and performs the access checks.
@param int $userid | [
"protected function prepare_global_page_access($userid) {\n global $PAGE, $SITE, $USER;\n\n // Guest users or not logged users (but the users during the signup process) are not allowed to access to this page.\n $newsignupuser = \\cache::make('core', 'presignup')->get('tool_policy_issignup');\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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Check if a directory exists
@param path {string} - Path to the directory to check | [
"async function dirExists(path) {\n try {\n const stats = await stat(path);\n return stats.isDirectory() ? true : false;\n } catch (err) {\n return false;\n }\n}"
] | [
"function (src, target) {\n /*\n * Copy a file from one path relative to the src, to another relative to the\n * target.\n * @param {String} from - the path to copy from, relative to the src.\n * @param {String} to - the path to copy to.\n * @return {Promise} - promise to copy\n */\n this.copy = funct... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Get the route by id
@param string $id The id of the route
@return false|array | [
"public function getRoute($id)\n {\n return isset($this->routes[$id]) ? $this->routes[$id] : false;\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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Adapts ANXTrade's to a Trades Object
@param anxTrades
@return | [
"public static Trades adaptTrades(List<ANXTrade> anxTrades) {\n\n List<Trade> tradesList = new ArrayList<>();\n long latestTid = 0;\n for (ANXTrade anxTrade : anxTrades) {\n long tid = anxTrade.getTid();\n if (tid > latestTid) {\n latestTid = tid;\n }\n tradesList.add(adaptTrade(... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Hydrates a row to a DomainObject | [
"public function hydrate($row)\n {\n $hydrated = $this->_schema->hydrate($row);\n\n // apply any eager-loaded includes\n foreach($this->_includes as $prop=>$includer) {\n $hydrated->override($prop, function($prop, $obj) use($includer) {\n return $includer->get($obj,... | [
"@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:"
} |
Signal that the executor will no longer accept job submission.
Worker threads/processes are now allowed to terminate after all
jobs have been are completed. Without a call to close(), they will
stay around forever waiting for more jobs to come. | [
"def close(self):\n\t\t\n\t\twith self.lock:\n\t\t\tif self.closed:\n\t\t\t\treturn\n\t\t\tself.waitqueue.put(StopIteration)\n\t\t\tself.closed = True"
] | [
"def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param array $array1
@param array $array2
@return array | [
"public function mergeArrays(array $array1, array $array2)\n {\n $allKeysNumeric = true;\n\n $config1Keys = array_keys($array1);\n $config2Keys = array_keys($array2);\n\n foreach ($config1Keys as $configKey) {\n if ( ! is_numeric($configKey)) {\n $allKeysNume... | [
"public static function castDimensions(Image\\Dimensions $dimensions, array $a, Stub $stub, $isNested, $filter = 0)\n {\n $stub->class .= sprintf(' \"%s\"', (string) $dimensions);\n\n return $a;\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get the names of any classes in the type descriptor or type signature.
@param classNames
the class names | [
"@Override\n protected void findReferencedClassNames(final Set<String> classNames) {\n final MethodTypeSignature methodSig = getTypeSignature();\n if (methodSig != null) {\n methodSig.findReferencedClassNames(classNames);\n }\n final MethodTypeSignature methodDesc = getType... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Return a primitive value for this object.
@return int|float|string|float | [
"public function toPrimitive()\n {\n if (empty($this->args)) {\n throw new \\InvalidArgumentException(\"Args shouldn't be empty\");\n }\n\n $values = array_keys($this->args);\n\n return implode($this->glue, $values);\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates a store writer with the specified <code>stream</code> as destination.
<p>
The writer will only write bytes to the stream when {@link StoreWriter#close() }
is called.
@param stream output stream
@param config configuration
@return a store writer | [
"public static StoreWriter createWriter(OutputStream stream, Configuration config) {\n return StoreImpl.createWriter(stream, config);\n }"
] | [
"public void writeOut(Writer out) throws IOException {\n\t if (writer == null) {\n\t out.write(strBuffer.toString()); // PK33136\n\t // Flush not called as the writer passed could be a BodyContent and\n\t // it doesn't allow to flush.\n\t }\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about writing:"
} |
Get the bbox of a tile
@name tileToBBOX
@param {Array<number>} tile
@returns {Array<number>} bbox
@example
var bbox = tileToBBOX([5, 10, 10])
//=bbox | [
"function tileToBBOX(tile) {\n var e = tile2lon(tile[0] + 1, tile[2]);\n var w = tile2lon(tile[0], tile[2]);\n var s = tile2lat(tile[1] + 1, tile[2]);\n var n = tile2lat(tile[1], tile[2]);\n return [w, s, e, n];\n}"
] | [
"function Tri() {\n Triangle.apply( this, arguments );\n this.target = {vec: null, t: 0};\n this.vertices = [\"p0\",\"p1\",\"p2\"];\n this.colorId = 1 + (colorToggle % 3);\n}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.