query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// retry periodically retries function fn a specified number of attempts.
[ "func retry(attempts int, sleep time.Duration, fn func() error) (err error) { // nolint: unparam\n\tfor i := 0; ; i++ {\n\t\terr = fn()\n\t\tif err == nil {\n\t\t\treturn\n\t\t}\n\t\tif i >= (attempts - 1) {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(sleep)\n\t\tlog.Println(\"retrying after error:\", err)\n\t}\n\treturn f...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
Sort index, add header, and compress. :rtype: bool :returns: True
[ "def compress_and_sort_index(self):\n \n idx_fname = '{name}.{date}.mbox.csv'.format(**self.__dict__)\n try:\n reader = csv.reader(open(idx_fname), dialect='excel-tab')\n except IOError:\n return False\n index = [x for x in reader if x]\n sorted_index ...
[ "def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o" ]
codesearchnet
{ "query": "Represent the Github description about text analysis:", "pos": "Represent the Github code about text analysis:", "neg": "Represent the Github code about programming:" }
Review step @return array
[ "public function review() {\n\t\tif(!$this->canReview()){\n\t\t\treturn $this->redirect($this->Link());\n\t\t}\n\t\t$registration = $this->getCurrentRegistration();\n\t\t$customisations = array(\n\t\t\t'EditLink' => $this->Link('attendee/edit'),\n\t\t\t'DeleteLink' => $this->Link('attendee/delete'),\n\t\t\t'Total' ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Logon logs into the soap server.
[ "func (vb *VirtualBox) Logon() error {\n\trequest := logonRequest{\n\t\tUsername: vb.username,\n\t\tPassword: vb.password,\n\t}\n\tresponse := new(logonResponse)\n\tif err := vb.send(request, response); err != nil {\n\t\treturn err\n\t}\n\tvb.mobref = response.Returnval\n\treturn nil\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
>>> _changes([2, 3, 0, 5]) [2, 1, -3, 5] >>> _changes([2]) [2]
[ "def _changes(path):\n \n res = [path[0]]\n res += [p - p_prev for p, p_prev in zip(path[1:], path)]\n return res" ]
[ "def prevention():\n \n tpm = np.array([\n [0.5, 0.5, 1],\n [0.5, 0.5, 0],\n [0.5, 0.5, 1],\n [0.5, 0.5, 1],\n [0.5, 0.5, 1],\n [0.5, 0.5, 0],\n [0.5, 0.5, 1],\n [0.5, 0.5, 1]\n ])\n cm = np.array([\n [0, 0, 1],\n [0, 0, 1],\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Calls the callback with the current progress and total .
[ "def _handle_progress(self, total, progress_callback): # pylint: disable=no-self-use\n \"\"\"\"\"\"\n current = 0\n while True:\n current += yield\n try:\n progress_callback(current, total)\n except Exception: # pylint: disable=broad-except\n _LOG.exception('Progress callback...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
If not overriden, will execute the command specified as the first argument Commands must be defined as methods named after the command, prefixed with execute (eg. create -> executeCreate) @param array $args @param array $options
[ "public function execute(array $args, array $options = array())\n {\n if (!count($args)) {\n throw new ConsoleException(\"Missing subcommand name\");\n }\n \n $command = ucfirst(Utils::camelize(array_shift($args)));\n $methodName = \"execute$command\";\n if (!...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Perform @return {promise<result>}
[ "async function () {\n logger.step('** Getting UUID of ST prime contract from openSTUtility Contract');\n const stPrimeUUIDResponse = await openStUtility.getSimpleTokenPrimeUUID()\n , simpleTokenPrimeUUID = stPrimeUUIDResponse.data.simpleTokenPrimeUUID\n ;\n\n if (simpleTokenPrimeUUID.length <= 2) ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github description about NLP:", "pos": "Represent the Github code about NLP:", "neg": "Represent the Github code about programming:" }
// GetProviderInterfaceInfo gets the provider details for all of the // interfaces for one machine.
[ "func (api *API) GetProviderInterfaceInfo(machine names.MachineTag) ([]network.ProviderInterfaceInfo, error) {\n\tvar result params.ProviderInterfaceInfoResults\n\targs := wrapEntities(machine)\n\terr := api.facade.FacadeCall(\"GetMachineProviderInterfaceInfo\", &args, &result)\n\tif err != nil {\n\t\treturn nil, e...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// stateBeginValue is the state at the beginning of the input.
[ "func stateBeginValue(s *scanner, c int) int {\n\tif c <= ' ' && isSpace(rune(c)) {\n\t\treturn scanSkipSpace\n\t}\n\tswitch c {\n\tcase '{':\n\t\ts.step = stateBeginStringOrEmpty\n\t\ts.pushParseState(parseObjectKey)\n\t\treturn scanBeginObject\n\tcase '[':\n\t\ts.step = stateBeginValueOrEmpty\n\t\ts.pushParseStat...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code:" }
Returns the corners of the empty cells
[ "def empty_positions(&block)\n positions = []\n each_position do |row, column|\n next if get_cell(row, column)\n yield(row, column) if block_given?\n positions << [row, column]\n end\n positions\n end" ]
[ "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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Set default values for annotations. Initial annotation take precedence over the default annotation when both annotation types are present @param defaultAnnotations default value for annotations
[ "public void setDefaults(Annotation[] defaultAnnotations) {\n if (defaultAnnotations == null) {\n return;\n }\n for (Annotation each : defaultAnnotations) {\n Class<? extends Annotation> key = each.annotationType();\n if (Title.class.equals(key) || Description.c...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Generates the url building function for a map.
[ "def generate_adapter(adapter, name='url_for', map_name='url_map'):\n \"\"\"\"\"\"\n values = {\n u'server_name': dumps(adapter.server_name),\n u'script_name': dumps(adapter.script_name),\n u'subdomain': dumps(adapter.subdomain),\n u'url_scheme': dumps(adapter.ur...
[ "@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:" }
// MarshalBinary interface implementation
[ "func (m *StatusResponseClusterNodesItems0PrimaryAddress) MarshalBinary() ([]byte, error) {\n\tif m == nil {\n\t\treturn nil, nil\n\t}\n\treturn swag.WriteJSON(m)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Println wraps underlying logger with mutex
[ "func (l Logger) Println(args ...interface{}) {\n\tl.fileMu.RLock()\n\tl.Logger.Println(args...)\n\tl.fileMu.RUnlock()\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
Returns the PID for the associated app (or -1, if no app is associated or the app is not running)
[ "def getPID(self):\n \n if self._pid is not None:\n if not PlatformManager.isPIDValid(self._pid):\n self._pid = -1\n return self._pid\n return -1" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets the decorated function as signal handler of given *signals*. *signals* can be either a single signal or a list/tuple of multiple ones.
[ "def sighandler(signals):\n \n def wrap(function):\n set_signal_handlers(signals, function)\n\n @wraps(function)\n def wrapper(*args, **kwargs):\n return function(*args, **kwargs)\n\n return wrapper\n\n return wrap" ]
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
<editor-fold defaultstate="collapsed" desc="Getters and Setters">
[ "@Override\n public void setValue(final double VALUE) {\n if (isEnabled()) {\n super.setValue((VALUE % 360));\n\n if ((VALUE % 360) == 0) {\n this.visibleValue = 90;\n }\n\n if ((VALUE % 360) > 0 && (VALUE % 360) <= 180) {\n this.vi...
[ "public function description()\n {\n //====================================================================//\n // Stack Trace\n Splash::log()->trace();\n\n //====================================================================//\n // Build & Return Widget Description Array\n ...
codesearchnet
{ "query": "Represent the Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software Development:" }
Returns an array of all roles reachable by the given ones. @param string[] $roles An array of roles @param string $suffix The role name suffix @return string[] An array of role instances
[ "protected function doGetReachableRoles(array $roles, $suffix = '')\n {\n if (0 === \\count($roles)) {\n return $roles;\n }\n\n $item = null;\n $roles = $this->formatRoles($roles);\n $id = $this->getUniqueId($roles);\n\n if (null !== ($reachableRoles = $this->...
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Find anchor variable with highest sum of dependence with the rest.
[ "def get_anchor(self):\n \"\"\"\"\"\"\n temp = np.empty([self.n_nodes, 2])\n temp[:, 0] = np.arange(self.n_nodes, dtype=int)\n temp[:, 1] = np.sum(abs(self.tau_matrix), 1)\n anchor = int(temp[0, 0])\n return anchor" ]
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create a new TimeExpression @param expr the time Expression @return new TimeExpression
[ "public static <T extends Comparable<?>> TimeExpression<T> asTime(Expression<T> expr) {\n Expression<T> underlyingMixin = ExpressionUtils.extract(expr);\n if (underlyingMixin instanceof PathImpl) {\n return new TimePath<T>((PathImpl<T>) underlyingMixin);\n } else if (underlyingMixin ...
[ "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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return the full date and time at which this portlet shoudl be automatically published. This value is built from the individual date/time fields. @return
[ "public Date getPublishDateTime() {\n if (getPublishDate() == null) {\n return null;\n }\n\n Calendar cal = Calendar.getInstance();\n cal.setTime(getPublishDate());\n cal.set(Calendar.HOUR, getPublishHour());\n cal.set(Calendar.MINUTE, getPublishMinute());\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:" }
marshals the instance of this uri. @param array $parts
[ "protected function marshalInstance(array $parts)\n {\n $this->scheme = array_key_exists('scheme', $parts)\n ? $this->marshalScheme($parts['scheme'])\n : ''\n ;\n\n $this->userInfo = $parts['user'] ?? null;\n\n if ( array_key_exists('pass', $parts) ) {\n ...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the text about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
create hardlink for the directory (includes childs).
[ "def create_hardlink(self, dest_path: str):\n ''' '''\n\n # self\n dirinfo = DirectoryInfo(dest_path)\n dirinfo.ensure_created()\n\n # child\n for item in self.list_items():\n item.create_hardlink(os.path.join(dest_path, item.path.name))" ]
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Swap implements the Swap() method of the Sort interface.
[ "func (a AcceptSlice) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\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 post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Run custom tasks before making a request. @see RestApiClient@raw
[ "protected function runAuthorizesWithOAuth2Tasks($method, &$path, &$options, &$withAuthorization)\n {\n // By default, we append the authorization header to every request.\n if ($withAuthorization) {\n $authorizationHeader = $this->getAuthorizationHeader();\n if (empty($option...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
For e.g., Russian, Ukrainian, Bosnian, Croatian, Serbian.
[ "private function int3Type4($Int)\n {\n $Tail = $Int % 10;\n $Tail2 = $Int % 100;\n if ($Tail === 1 && $Tail2 !== 11) {\n return 0;\n }\n return ($Tail >= 2 && $Tail <= 4 && ($Tail2 < 10 || $Tail2 >= 20)) ? 1 : 2;\n }" ]
[ "def home_language=(home_language)\n validator = EnumAttributeValidator.new('String', [\"English\", \"Albanian\", \"Amharic\", \"Arabic\", \"Bengali\", \"Bosnian\", \"Burmese\", \"Cantonese\", \"Chinese\", \"Dutch\", \"Farsi\", \"French\", \"German\", \"Hebrew\", \"Hindi\", \"Hmong\", \"Ilocano\", \"Japanese\"...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Used internally to retrieve a single string to used to retrieve all of the required assets. @param string $type @return string @throws Exception
[ "private function retrieve($type, $group)\n {\n // The string which will be emitted with all of the information\n $output = '';\n\n // The groups we will be loading\n $groups = [];\n\n // Check if the group is provided\n if($group === NULL)\n {\n // No ...
[ "@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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
prepareGlobals @param \Windwalker\Data\Data $data @return void
[ "protected function prepareGlobals($data)\n {\n $data->view = $this;\n $data->helper = $this->getHelperSet();\n\n foreach ($this->getRendererManager()->getHelpers() as $name => $helper) {\n $data->helper->addHelper($name, $helper);\n }\n\n $globals = $th...
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
********************************* WorkspaceTeamParameters methods * *********************************
[ "public function createWorkspaceTeamParameters(Workspace $workspace)\n {\n $params = new WorkspaceTeamParameters();\n $params->setWorkspace($workspace);\n $params->setIsPublic(true);\n $params->setSelfRegistration(false);\n $params->setSelfUnregistration(false);\n $this-...
[ "func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Use this API to update rnat resources.
[ "public static base_responses update(nitro_service client, rnat resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\trnat updateresources[] = new rnat[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tupdateresources[i...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the Github summarization about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code about Natural Language Processing:" }
Open file in given mode. @param string $filePath @param string $mode @throws FileException @return resource
[ "public function open(string $filePath, string $mode)\n {\n $this->exists($filePath, $mode);\n\n $ptr = @fopen($filePath, $mode);\n\n if (false === $ptr) {\n throw new FileException(\"Unable to open $filePath.\");\n }\n\n return $ptr;\n }" ]
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Auto Generated Code
[ "def BGPNeighborPrefixExceeded_originator_switch_info_switchIdentifier(self, **kwargs):\n \n config = ET.Element(\"config\")\n BGPNeighborPrefixExceeded = ET.SubElement(config, \"BGPNeighborPrefixExceeded\", xmlns=\"http://brocade.com/ns/brocade-notification-stream\")\n originator_switch...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the sentence about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about File management:" }
return True if the name or path is endswith {jpg|png|gif|jpeg}
[ "def is_image(name, exts=None):\n \"\"\"\"\"\"\n\n default = ['jpg', 'png', 'gif', 'jpeg']\n if exts:\n default += exts\n\n flag = False\n for ext in default:\n if name.lower().endswith(ext):\n flag = True\n break\n return flag" ]
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Send the response (headers, status code and content)
[ "public function send()\n {\n if ( ! headers_sent()) {\n $this->sendHeaders();\n }\n http_response_code($this->status);\n echo $this->prepareContent($this->content);\n }" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set fields to be key-value represented. :rtype: DataFrame :Example: >>> new_ds = df.key_value('f1 f2', kv=':', item=',')
[ "def key_value(self, *args, **kwargs):\n \n new_df = copy_df(self)\n fields = _render_field_set(args)\n self._assert_ml_fields_valid(*fields)\n new_df._perform_operation(\n op.FieldKVConfigOperation(dict((_get_field_name(f), KVConfig(**kwargs)) for f in fields)))\n ...
[ "def table_from_cwb(source, *args, **kwargs):\n \n return EventTable.read(source, 'waveburst', *args, format='root', **kwargs)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Migrates the services from the old basket to the current one. @param MShop_Order_Item_Base_Interface $basket Basket object @param array $errors Associative list of previous errors @return array Associative list of errors occured
[ "private function _copyServices( MShop_Order_Item_Base_Interface $basket, array $errors )\n\t{\n\t\tforeach( $basket->getServices() as $type => $item )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$attributes = array();\n\n\t\t\t\tforeach( $item->getAttributes() as $attrItem ) {\n\t\t\t\t\t$attributes[ $attrItem->getCode() ...
[ "public function run()\n\t{\n\t\t$total = $errors = 0;\n\t\t$context = $this->getContext();\n\t\t$config = $context->getConfig();\n\t\t$logger = $context->getLogger();\n\t\t$domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' );\n\t\t$mappings = $this->getDefaultMapping();\n\n\n\t\...
codesearchnet
{ "query": "Represent the instruction about Aimeos:", "pos": "Represent the code about Aimeos:", "neg": "Represent the code:" }
returns the result if value is not empty, or the result of applied other @param callable $other @return \stubbles\values\Result @since 6.2.0
[ "public function applyWhenEmpty(callable $other): self\n {\n if (!$this->isEmpty($this->value)) {\n return $this;\n }\n\n return self::of($other());\n }" ]
[ "final static function s($m, C $c) {return dfcf(function($m, C $c) {\n\t\t/**\n\t\t * 2017-07-19\n\t\t * Unable to reduce the implementation to:\n\t\t * \t\tdf_new(df_con_hier($m, self::class), $c);\n\t\t * because @uses __construct() is protected.\n\t\t * It is similar to @see \\Df\\Payment\\Facade::s()\n\t\t * ht...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
list_type : LIST '<' field_type '>' annotations
[ "def p_list_type(self, p):\n ''''''\n p[0] = ast.ListType(value_type=p[3], annotations=p[5])" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@return ?array @psalm-suppress MixedAssignment @psalm-suppress MixedTypeCoercion
[ "public function getCachedMixedMemberNameReferences()\n {\n $cache_directory = $this->config->getCacheDirectory();\n\n if (!$cache_directory) {\n return null;\n }\n\n $cache_location = $cache_directory . DIRECTORY_SEPARATOR . self::UNKNOWN_MEMBER_CACHE_NAME;\n\n if (...
[ "private function getEndCall(Expr $arg = null)\n {\n if ($arg === null) {\n $arg = NoReturnValue::create();\n }\n\n return new StaticCall(new FullyQualifiedName('Psy\\Command\\TimeitCommand'), 'markEnd', [new Arg($arg)]);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Is service exists. @param string $serviceFile @param string $serviceClass @return bool
[ "private static final function isServiceExists(string $serviceFile, string $serviceClass): bool\n {\n if (!file_exists($serviceFile)) {\n return false;\n }\n\n return class_exists($serviceClass, true);\n }" ]
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns a builder for an {@code InstanceInfo} object given the instance identity and the machine type.
[ "public static Builder newBuilder(InstanceId instanceId, MachineTypeId machineType) {\n return new BuilderImpl(instanceId).setMachineType(machineType);\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Write writes sitemap and index files that used from Adapter interface.
[ "func (loc *Location) Write(data []byte, linkCount int) {\n\n\tloc.opts.adp.Write(loc, data)\n\tif !loc.IsVerbose() {\n\t\treturn\n\t}\n\n\toutput := loc.Summary(linkCount)\n\tif output != \"\" {\n\t\tprintln(output)\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Process all *.php files in given path. @return string[] An array with all files that have codestyle problems.
[ "public function run()\n {\n $filesWithProblems = [];\n foreach ($this->_inspectFolders as $inspectFolder) {\n $directoryIterator = new RecursiveDirectoryIterator($this->_baseDir.'/'.$inspectFolder);\n $recursiveIterator = new RecursiveIteratorIterator($directoryIterator);\n ...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Asserts that the element exists in the DOM and is clickable by the user. @return $this @throws \Facebook\WebDriver\Exception\NoSuchElementException @throws \Facebook\WebDriver\Exception\TimeOutException
[ "public function toBeClickable()\n {\n $this->wait()->until(WebDriverExpectedCondition::elementToBeClickable($this->elementFinder->getSearchCriteria()));\n\n return $this;\n }" ]
[ "public function selectOptionByValueOfElementById($value, $elementId, $timeout = 0)\n {\n $element = $this->clickDisplayedElementByID($elementId, $timeout);\n\n \\PHPUnit_Extensions_Selenium2TestCase_Element_Select::fromElement($element)->selectOptionByValue($value);\n\n return $element;\n ...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Component autoloader @param string $className claass name
[ "public static function autoload($className) {\n if (array_key_exists($className, self::$classes)) {\n $fileName = realpath(dirname(__FILE__)) . '/' . self::$classes[$className];\n if (file_exists($fileName)) {\n include $fileName;\n }\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 post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Creates a cgroup if it doesn't exist under the specified subsystem and the given name :param subsystem: the cgroup subsystem (currently support 'memory', and 'cpuset') :param name: name of the cgroup to delete
[ "def ensure(self, subsystem, name):\n \n args = {\n 'subsystem': subsystem,\n 'name': name,\n }\n\n self._cgroup_chk.check(args)\n return self._client.json('cgroup.ensure', args)" ]
[ "func (n *Mounter) makeNsenterArgs(source, target, fstype string, options []string) (string, []string) {\n\tmountCmd := n.ne.AbsHostPath(\"mount\")\n\tmountArgs := mount.MakeMountArgs(source, target, fstype, options)\n\n\tif systemdRunPath, hasSystemd := n.ne.SupportsSystemd(); hasSystemd {\n\t\t// Complete command...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Displays the "success" page after a password change.
[ "def password_change_done(self, request, extra_context=None):\n \n from django.contrib.auth.views import password_change_done\n defaults = {\n 'extra_context': extra_context or {},\n 'template_name': 'cms/password_change_done.html',\n }\n if self.password_cha...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about Data synchronization:" }
Sets verbosity of the monitor. @param verbose true for monitor to be verbose, otherwise false. @return this instance.
[ "public final ZMonitor verbose(boolean verbose)\n {\n if (started) {\n System.out.println(\"ZMonitor: Unable to change verbosity while already started.\");\n return this;\n }\n agent.send(VERBOSE, true);\n agent.send(Boolean.toString(verbose));\n agent.rec...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param InputInterface $input @param OutputInterface $output @throws Exception
[ "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $bugId = $input->getArgument('bug-id');\n $bug = $this->entityManager->getRepository(Bug::class)->find($bugId);\n\n if (!$bug || !$bug instanceof Bug) {\n $output->writeln(sprintf('No bug found for i...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Return a list of all the fields that should be lowercased This is done on fields with `lower=True`.
[ "def to_lower(cls): # NOQA\n \n\n email = cls.get_fields_by_class(EmailType)\n lower = cls.get_fields_by_prop('lower', True) + email\n\n return list(set(email + lower))" ]
[ "def _extract_lookup(self, key):\n \"\"\"\"\"\"\n parts = key.split('__')\n # 'exact' is the default lookup if there was no explicit comparison op in `key`\n # Assume there is only one `__` in the key.\n # FIXME Change for child attribute query support\n op = 'exact' if...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// MergeCMSketch merges two CM Sketch. // Call with CMSketch with Top-N initialized may downgrade the result
[ "func (c *CMSketch) MergeCMSketch(rc *CMSketch) error {\n\tif c.depth != rc.depth || c.width != rc.width {\n\t\treturn errors.New(\"Dimensions of Count-Min Sketch should be the same\")\n\t}\n\tif c.topN != nil || rc.topN != nil {\n\t\treturn errors.New(\"CMSketch with Top-N does not support merge\")\n\t}\n\tc.count...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets the 3d dimensions of the variants after they're stacked
[ "def boxes(rigid_variants)\n stackable = {}\n nonstackable = [] \n rigid_variants.each do |v|\n sgid = v.product.stackable_group_id \n if sgid \n stackable[sgid] = [] if stackable[sgid].nil?\n stackable[sgid] << v\n else\n nonstacka...
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
解绑物理刚体 @param {View} view 要解绑的view @param {Boolean} isDelView 是否删除view,默认不删除
[ "function(view, isDelView){\n var body = view.body;\n if(body){\n //延迟删除\n if (body.isStaticBody){\n var shape = view.shape;\n if(shape && this._deleteShapes.indexOf(shape) < 0){\n this._deleteShapes.pus...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Collects data for the given Response. @param Request $request A Request instance @param Response $response A Response instance @param \Exception $exception An exception instance if the request threw one @return bool
[ "public function collect(Request $request, Response $response, \\Exception $exception = null)\n {\n if (null === $exception) {\n return true;\n }\n\n $key = \\sprintf('%s.%s', $this->getStatsDataKey(), $exception->getCode());\n $statData = $this->getStatsdDataFactory()->inc...
[ "public static function createNotMerged(Envelope $envelope, \\Exception $e = null)\n {\n $message = 'The given DigiDoc envelope must be merged with Api (using Api::merge) before calling this method.';\n\n return new static($message, null, $e);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about API documentation:" }
--------------------------------------------
[ "@Override\n public void dissect(final Parsable<?> parsable, final String inputname) throws DissectionFailure {\n final ParsedField field = parsable.getParsableField(INPUT_TYPE, inputname);\n\n String fieldValue = field.getValue().getString();\n if (fieldValue == null || fieldValue.isEmpty()...
[ "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 language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code:" }
Applies events to clazz and its prototype @param {clazz} clazz Clazz @param {object} metaData Meta data with 'clazz_event' and 'event' properties @this {metaProcessor}
[ "function(clazz, metaData) {\n this.applyEvents(clazz, metaData.clazz_events || {});\n this.applyEvents(clazz.prototype, metaData.events || {});\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// RemoveSub removes the subscription from the client identified by clientID // and returns true only if the client has not been unregistered and that // the subscription was found, otherwise returns false.
[ "func (cs *clientStore) removeSub(ID string, sub *subState) bool {\n\tcs.RLock()\n\tdefer cs.RUnlock()\n\tc := cs.clients[ID]\n\tif c == nil {\n\t\treturn false\n\t}\n\tc.Lock()\n\tremoved := false\n\tc.subs, removed = sub.deleteFromList(c.subs)\n\tc.Unlock()\n\treturn removed\n}" ]
[ "boolean detectAndHandleBackupTimeout(long timeoutMillis) {\n // if the backups have completed, we are done; this also filters out all non backup-aware operations\n // since the backupsAcksExpected will always be equal to the backupsAcksReceived\n boolean backupsCompleted = backupsAcksExpected ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetUserName sets the UserName field's value.
[ "func (s *JoinDomainInput) SetUserName(v string) *JoinDomainInput {\n\ts.UserName = &v\n\treturn s\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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Closes the connection for the given messaging engine if there is one open. @param meUuid the UUID for the messaging engine to close the connection for @param alreadyClosed if the connection has already been closed
[ "protected void closeConnection(final String meUuid, boolean alreadyClosed) {\n\n final String methodName = \"closeConnection\";\n if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {\n SibTr.entry(this, TRACE, methodName, new Object [] { meUuid, alreadyClosed });\n ...
[ "def connectTo(self, remoteRouteName):\n \n self.remoteRouteName = remoteRouteName\n # This route must not be started before its router is started. If\n # sender is None, then the router is not started. When the router is\n # started, it will start this route.\n if self.r...
codesearchnet
{ "query": "Represent the description about Computer Networking:", "pos": "Represent the code about Computer Networking:", "neg": "Represent the code:" }
Plots the convergence graph: iterations vs number of columns. Each curve shows the convergence for a given number of unique features.
[ "def plotConvergenceByDistantConnectionChance(results, featureRange, columnRange, longDistanceConnectionsRange, numTrials):\n \n ########################################################################\n #\n # Accumulate all the results per column in a convergence array.\n #\n # Convergence[f, c, t] = how lon...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get depth data @param currencyPair @throws IOException
[ "public BitZOrders getDepth(CurrencyPair currencyPair) throws IOException {\n BitZOrdersResult result = bitz.getDepth(BitZUtils.toPairString(currencyPair));\n return result.getData();\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about API documentation:", "pos": "Represent the Github code about API documentation:", "neg": "Represent the Github code:" }
Get thumb filename for a specified size @param string $filename @param string $mimeType @param array $size Contains width and height @return string
[ "static public function getThumbFilename($filename, $mimeType, $size)\n {\n if (substr($mimeType, 0, 5) == 'image')\n {\n $pos = mb_strrpos($filename, '.');\n if ($pos === FALSE)\n {\n return $filename . '_' . $size['width'] . 'x' . $size['height'];\n...
[ "public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
try to find the logged user with sid
[ "private function getUserFromSession($sid) {\n $session = $this->entityManager->getRepository(\"Emeric0101\\PHPAngular\\Entity\\Session\")->findBySid($sid);\n if (empty($session)) {\n return null;\n }\n // fix some bug with entity conflit\n $userLogged = $this->entityMa...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
Entry point for the program. @param args arguments from the command line @throws IOException
[ "@SuppressWarnings(\"static-access\")\n\tpublic static void main(String[] args) throws IOException {\t\t\n\t\tOption configDirOpt = OptionBuilder.withArgName(\"config directory\").hasArg().withDescription(\n\t\t\t\"Specify configuration directory.\").create(\"configDir\");\n\t\t// tempDir option is used by the YARN...
[ "def _type_description(self):\n \"\"\"\"\"\"\n #This is a little tricker because the docstring is housed\n #inside of the module that contains the actual executable.\n #These TypeExecutables are just pointers.\n iexec = self._element.target\n if iexec is not None:\n ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Recycle recycles/scrubs clean a HostPath volume. // Recycle blocks until the pod has completed or any error occurs. // HostPath recycling only works in single node clusters and is meant for testing purposes only.
[ "func (plugin *hostPathPlugin) Recycle(pvName string, spec *volume.Spec, eventRecorder recyclerclient.RecycleEventRecorder) error {\n\tif spec.PersistentVolume == nil || spec.PersistentVolume.Spec.HostPath == nil {\n\t\treturn fmt.Errorf(\"spec.PersistentVolume.Spec.HostPath is nil\")\n\t}\n\n\tpod := plugin.config...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Return an integer in the range of 0-11, determining the half note steps between note1 and note2. Examples: >>> measure('C', 'D') 2 >>> measure('D', 'C') 10
[ "def measure(note1, note2):\n \n res = notes.note_to_int(note2) - notes.note_to_int(note1)\n if res < 0:\n return 12 - res * -1\n else:\n return res" ]
[ "def lilypond(point):\n \n #If lilypond already computed, leave as is\n if \"lilypond\" in point:\n return point\n\n #Defaults:\n pitch_string = \"\"\n octave_string = \"\"\n duration_string = \"\"\n preamble = \"\"\n dynamic_string = \"\"\n if \"pitch\" in point:\n octav...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// ExecDmiDecode will attempt to execute a given binary, capture its output and // return it (or an any errors it encounters)
[ "func (d *DMI) ExecDmidecode(binary string) (string, error) {\n\tcmd := exec.Command(binary)\n\n\toutput, err := cmd.Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(output), nil\n}" ]
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetDBInstanceClass sets the DBInstanceClass field's value.
[ "func (s *ReservedDBInstance) SetDBInstanceClass(v string) *ReservedDBInstance {\n\ts.DBInstanceClass = &v\n\treturn s\n}" ]
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Implementation of next method from Iterator. :return: Result :raises: StopIteration if IndexError occurs.
[ "def next(self):\n \n try:\n result = self.data[self.index]\n except IndexError:\n self.index = 0\n raise StopIteration\n self.index += 1\n return result" ]
[ "def Validate(self, value, **_):\n \"\"\"\"\"\"\n # Assigning from same kind can allow us to skip verification since all\n # elements in a RepeatedFieldHelper already are coerced to the delegate\n # type. In that case we just make a copy. This only works when the value\n # wraps the same type as us.\...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// MarshalXML implements xml.Marshaler
[ "func (c *Conditions) MarshalXML(e *xml.Encoder, start xml.StartElement) error {\n\ttype Alias Conditions\n\taux := &struct {\n\t\tNotBefore RelaxedTime `xml:\",attr\"`\n\t\tNotOnOrAfter RelaxedTime `xml:\",attr\"`\n\t\t*Alias\n\t}{\n\t\tNotBefore: RelaxedTime(c.NotBefore),\n\t\tNotOnOrAfter: RelaxedTime(c.No...
[ "func (jsonFramer) NewFrameReader(r io.ReadCloser) io.ReadCloser {\n\t// we need to extract the JSON chunks of data to pass to Decode()\n\treturn framer.NewJSONFramedReader(r)\n}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Chop Line from DX-Cluster into pieces and return a dict with the spot data
[ "def decode_char_spot(raw_string):\n \"\"\"\"\"\"\n\n data = {}\n\n # Spotter callsign\n if re.match('[A-Za-z0-9\\/]+[:$]', raw_string[6:15]):\n data[const.SPOTTER] = re.sub(':', '', re.match('[A-Za-z0-9\\/]+[:$]', raw_string[6:15]).group(0))\n else:\n raise ValueError\n\n if re.sear...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Starts autoplaying in configured interval. @param {Boolean|Number} force Run autoplaying with passed interval regardless of `autoplay` settings @return {Void}
[ "function start() {\n var _this = this;\n\n if (Glide.settings.autoplay) {\n if (isUndefined(this._i)) {\n this._i = setInterval(function () {\n _this.stop();\n\n Components.Run.make('>');\n\n _this.start();\n }, this.time);\n }\n }\n ...
[ "function completedPage(instance, error)\n{\n\tmaybeCallback(instance.handlers.page)(error, instance.currentPageUrl, instance.currentCustomData);\n\t\n\t// Auto-starts next queue item, if any\n\t// If not, fires \"end\"\n\tinstance.currentDone();\n}" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Moves one pixel upstream following the supplied network. TODO Daniele doc @param colRow @param flowIterator @param netnumIterator @param param
[ "public static void goUpStreamOnNetFixed( int[] colRow, RandomIter flowIterator, RandomIter netnumIterator, int[] param ) {\n\n int kk = 0, count = 0;\n int[] point = new int[2];\n\n for( int k = 1; k <= 8; k++ ) {\n if (flowIterator.getSampleDouble(colRow[0] + dirIn[k][1], colRow[1]...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Search a configuration value in a package's config or the global config if so @param \Composer\Package\PackageInterface $package @param string $config_entry @return string
[ "public static function guessConfigurationEntry(PackageInterface $package, $config_entry)\n {\n if (empty($config_entry)) {\n return array();\n }\n $extra = $package->getExtra();\n return isset($extra[$config_entry]) ? $extra[$config_entry] : Config::get($config_entry);\n ...
[ "protected function getVcsRepositoryUrl(array $data, $registryName = null)\n {\n if (!isset($data['repository']['url'])) {\n $msg = sprintf('The \"repository.url\" parameter of \"%s\" %s asset package must be present for create a VCS Repository', $registryName, $this->assetType->getName());\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:" }
Inject the internal WsMessageRouter.
[ "@Override\n public void setTraceRouter(WsTraceRouter traceRouter) {\n\n internalTraceRouter.set(traceRouter);\n\n // Pass the earlierMessages queue to the router.\n // Now that the internalMessageRouter is non-null, this class will\n // NOT add any more messages to the earlierMessage...
[ "@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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Load the helper @param string $id @return HelperInterface @throws NoLoaders @throws NoHelper
[ "public function loadHelper($id) {\n\t\tif (empty($this->_loaders)) {\n\t\t\tthrow new NoLoaders('Wasn\\'t a loaders registered');\n\t\t}\n\t\t\n\t\tforeach ($this->_loaders as $loader) {\n\t\t\t$helper = $loader->load($id);\n\t\t\t\n\t\t\tif ($helper !== null) {\n\t\t\t\treturn $helper;\n\t\t\t}\n\t\t}\n\t\t\n\t\t...
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Remove the signature from encrypted content @private @param {String} content The encrypted text @returns {String} The unsigned encrypted key @throws {Error} Throws if no SIGNING_KEY is detected @see SIGNING_KEY
[ "function unsignEncryptedContent(content) {\n const newIndex = content.indexOf(SIGNING_KEY);\n const oldIndex = content.indexOf(SIGNING_KEY_OLD);\n if (newIndex === -1 && oldIndex === -1) {\n throw new Error(\"Invalid credentials content (unknown signature)\");\n }\n return newIndex >= 0\n ...
[ "function ConfigValue(key, value) {\n this.name = ConfigValue.name;\n StoreError.apply(\n this, [null, 'invalid argument \\'%s\\' for CONFIG SET \\'%s\\'', value, key]);\n}" ]
codesearchnet
{ "query": "Represent the comment about Encryption:", "pos": "Represent the code about Encryption:", "neg": "Represent the code about Software Development:" }
To compare color, which look alike @param [String or Color] color_to_check color to compare @param [Integer] delta max delta for each of specters
[ "def looks_like?(color_to_check = nil, delta = 8)\n color_to_check = color_to_check.converted_color if color_to_check.is_a?(SchemeColor)\n color_to_check = color_to_check.pattern_fill.foreground_folor if color_to_check.is_a?(Fill)\n color_to_check = color_to_check.color.converted_color if color_to_ch...
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Natural Language Processing:" }
Add a question message @param string $s the message to display @return void
[ "public function writeQuestion( $s )\n\t{\n\t\t$message = $this->cleanMessage( $s );\n\n\t\tif ( ! empty( $message ) )\n\t\t{\n\t\t\t$this->bag[] = array( self::QUESTION , $message );\n\t\t}\n\t}" ]
[ "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 description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
Deletes an existing collection. The collection being updated *is* expected to include the id.
[ "def delete_collection(self, collection):\n \n uri = str.join('/', [self.uri, collection])\n return self.service._delete(uri)" ]
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
APP控件支付 @param reqData 请求参数 @return {String}
[ "public static String AppConsume(Map<String, String> reqData) {\n\t\treturn HttpUtils.post(SDKConfig.getConfig().getAppRequestUrl(), reqData);\n\t}" ]
[ "function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
add an acceptable to the list @param string $acceptable @param float $priority defaults to 1.0 @return \stubbles\peer\http\AcceptHeader @throws \InvalidArgumentException
[ "public function addAcceptable(string $acceptable, float $priority = 1.0): self\n {\n if (0 > $priority || 1.0 < $priority) {\n throw new \\InvalidArgumentException(\n 'Invalid priority, must be between 0 and 1.0'\n );\n }\n\n $this->acceptables[$acce...
[ "static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std...
codesearchnet
{ "query": "Represent the Github post about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Software development:" }
// DefaultRPCConfig returns a default configuration for the RPC server
[ "func DefaultRPCConfig() *RPCConfig {\n\treturn &RPCConfig{\n\t\tListenAddress: \"tcp://0.0.0.0:26657\",\n\t\tCORSAllowedOrigins: []string{},\n\t\tCORSAllowedMethods: []string{\"HEAD\", \"GET\", \"POST\"},\n\t\tCORSAllowedHeaders: []string{\"Origin\", \"Accept\", \"Content-Type\", \"X-Requested...
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Declares that the method throws a given type. @param jsType The type that can be thrown by the method.
[ "boolean declareThrows(JSTypeExpression jsType) {\n lazyInitInfo();\n\n if (info.thrownTypes == null) {\n info.thrownTypes = new ArrayList<>();\n }\n\n info.thrownTypes.add(jsType);\n return true;\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Always initialize with the "QueryBuilder" and "QueryCompiler" objects, which extend the base 'lib/query/builder' and 'lib/query/compiler', respectively.
[ "function Client_MSSQL(config = {}) {\n // #1235 mssql module wants 'server', not 'host'. This is to enforce the same\n // options object across all dialects.\n if (config && config.connection && config.connection.host) {\n config.connection.server = config.connection.host;\n }\n\n // mssql always creates p...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
/*------------------------------------------------------------------------- Utilities: -------------------------------------------------------------------------
[ "protected function __applyFormatting($data, $validate = false, &$errors = null)\n {\n $result = '';\n\n if ($this->get('formatter')) {\n $formatter = TextformatterManager::create($this->get('formatter'));\n $result = $formatter->run($data);\n }\n\n if ($validate...
[ "function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Write data to socket and read @param string $buffer @return bool|string
[ "protected function writeAndReadSocket($buffer)\n {\n $this->writeSocket($buffer . self::SOCKET_MSG_ENDL);\n\n $read = $this->readSocket();\n\n return $read;\n }" ]
[ "def cancel_link_unlink_mode(self):\n \"\"\"\"\"\"\n self.logger.info(\"cancel_link_unlink_mode\")\n self.scene_command('08')\n # should send http://0.0.0.0/0?08=I=0\n\n ## TODO check return status\n status = self.hub.get_buffer_status()\n return status" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Create a single poll choice. Create a new poll choice for this poll
[ "def create_single_poll_choice(self, poll_id, poll_choices_text, poll_choices_is_correct=None, poll_choices_position=None):\r\n \r\n path = {}\r\n data = {}\r\n params = {}\r\n\r\n # REQUIRED - PATH - poll_id\r\n \"\"\"ID\"\"\"\r\n path[\"poll_id\"] = poll_id\r\n\r\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
doDecrypt @param string $data The encrypted string to decrypt. @param string $key The private key. @param string $iv The public key. @return string
[ "protected function doDecrypt($data, $key, $iv)\n {\n return openssl_decrypt($data, $this->getMethod(), $key, OPENSSL_RAW_DATA, $iv);\n }" ]
[ "function(algo) {\n switch (algo) {\n // Algorithm-Specific Fields for RSA encrypted session keys:\n // - MPI of RSA encrypted value m**e mod n.\n case enums.publicKey.rsa_encrypt:\n case enums.publicKey.rsa_encrypt_sign:\n return [type_mpi];\n\n // Algorithm-Specific Fi...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Encryption:" }
// NewSingleEmail ...
[ "func NewSingleEmail(from *Email, subject string, to *Email, plainTextContent string, htmlContent string) *SGMailV3 {\n\tplainText := NewContent(\"text/plain\", plainTextContent)\n\thtml := NewContent(\"text/html\", htmlContent)\n\treturn NewV3MailInit(from, subject, to, plainText, html)\n}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return a function which call _call_command for the given name. Used to bind redis commands to our own calls
[ "def _make_command_method(cls, command_name):\n \n def func(self, *args, **kwargs):\n return self._call_command(command_name, *args, **kwargs)\n return func" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
normalize variant if requested, and ignore HGVSUnsupportedOperationError This is better than checking whether the variant is intronic because future UTAs will support LRG, which will enable checking intronic variants.
[ "def _maybe_normalize(self, var):\n \n if self.normalize:\n try:\n return self._norm.normalize(var)\n except HGVSUnsupportedOperationError as e:\n _logger.warning(str(e) + \"; returning unnormalized variant\")\n # fall through to retur...
[ "def set_identifiers(self, data):\n \n for id_info in self._details.identifiers:\n var_name = id_info['var_name']\n self._data[var_name] = data.get(var_name)\n\n # FIXME: This needs to likely kick off invalidating/rebuilding\n # relations.\n # F...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Calculates the number of H bond donors. @param atomContainer AtomContainer @return number of H bond donors
[ "@Override\n public DescriptorValue calculate(IAtomContainer atomContainer) {\n int hBondDonors = 0;\n\n IAtomContainer ac;\n try {\n ac = (IAtomContainer) atomContainer.clone();\n } catch (CloneNotSupportedException e) {\n return getDummyDescriptorValue(e);\n ...
[ "private int element(IAtom atom) {\n Integer element = atom.getAtomicNumber();\n if (element != null) return element;\n if (atom instanceof IPseudoAtom) return 0;\n throw new IllegalArgumentException(\"Aromaiticty model requires atomic numbers to be set\");\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
<p>newInstance</p> @param deserializer {@link JsonDeserializer} used to deserialize the objects inside the {@link SortedSet}. @param <T> Type of the elements inside the {@link SortedSet} @return a new instance of {@link SortedSetJsonDeserializer}
[ "public static <T> SortedSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {\n return new SortedSetJsonDeserializer<T>( deserializer );\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
fromWindow := WINDOW ID @param pattern @throws org.antlr.runtime.RecognitionException
[ "private void fromWindow(PatternDescrBuilder<?> pattern) throws RecognitionException {\n String window = \"\";\n\n match(input,\n DRL6Lexer.ID,\n DroolsSoftKeywords.WINDOW,\n null,\n DroolsEditorType.KEYWORD);\n if (state.failed)\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Строит WHAT часть запроса (SELECT WHAT) @internal @param ISelectBuilder $query @return string
[ "private function buildSelectWhatPart(ISelectBuilder $query)\n {\n $columns = $query->getSelectColumns();\n if (!count($columns)) {\n return '*';\n }\n\n $result = [];\n foreach ($columns as $column) {\n if (is_array($column)) {\n list($name...
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
{@inheritdoc} @deprecated @param string|array $pathOrContext @param string $mode (default: 'rb') @throws ResourceNotFoundException @return resource
[ "public function handle($pathOrContext, $mode = 'rb')\n {\n if (is_array($pathOrContext)) {\n return stream_context_create($pathOrContext);\n }\n if (!$handle = @fopen($pathOrContext, $mode)) {\n throw new ResourceNotFoundException(\"Path '$pathOrContext' cannot be open...
[ "protected function createFlysystemAdapter()\n {\n $this->flysystemAdapter = new $this->options->flysystemAdapter($this->basePath);\n if ($this->flysystemAdapter instanceof $this->options->flysystemAdapter != true) {\n throw new ConfiguratorException('Error: Unable to Initialize the Flys...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Is preferred host? @return bool
[ "public function isPreferred()\n {\n if (($host = $this->export()) === null) {\n return $this->base === $this->effective;\n }\n $parsed = parse_url($host);\n $new = [\n 'scheme' => isset($parsed['scheme']) ? $parsed['scheme'] : parse_url($this->base, PHP_URL_SCHE...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
Validate the configured mapping metadata @return Schema @throws DoctrineStaticMetaException
[ "public function validate(): Schema\n {\n $errors = $this->schemaValidator->validateMapping();\n if (!empty($errors)) {\n $allMetaData = $this->getAllMetaData();\n $mappingPath = __DIR__ . '/../../var/doctrineMapping.ser';\n file_put_contents($mappingPath, print_r($...
[ "BaseConfiguration addDefaultConfiguration(InputStream defaultConfig) throws ConfigValidationException, ConfigUpdateException {\n return defaultConfiguration.add(defaultConfig, serverXMLConfig, variableRegistry);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }