Load all available endpoints as an array of full class names with namespace strings.
The endpoints are contained within a folder structure that is only 1 level deep.
770554
private function loadAllEndpoints()
    {
        self::$endpointClasses = array_map(function ($classPath) {
            // For ./Api/Endpoints/MatchById -> ('MatchById.php')
            list($endpointClass) = array_slice(explode('/', $classPath), -1, 1);
            
            // Build the full class name with namespace
            $fullClassName = join('\\', [__NAMESPACE__, 'Endpoints', str_replace('.php', '', $endpointClass)]);
            
            /** @var Endpoint $endpoint */
            $endpoint = new $fullClassName($this->region);
            
            self::$endpointDefinitions[$endpoint->getName()] = [
                'class' => $fullClassName,
                'instance' => $endpoint,
            ];
            
            return $fullClassName;
        }, glob(__DIR__.'/Endpoints/*.php'));
    }
1318244
def load_from(dir)
      Dir.foreach(dir) do |name|
        next if name =~ /^\./

        # convert from external to internal form, and
        # extract the instance/class flag

        if name =~ /^(.*?)-(c|i).yaml$/
          external_name = $1
          is_class_method = $2 == "c"
          internal_name = RiWriter.external_to_internal(external_name)
          list = is_class_method ? @class_methods : @instance_methods
          path = File.join(dir, name)
          list << MethodEntry.new(path, internal_name, is_class_method, self)
        else
          full_name = File.join(dir, name)
          if File.directory?(full_name)
            inf_class = @inferior_classes.find {|c| c.name == name }
            if inf_class
              inf_class.add_path(full_name)
            else
              inf_class = ClassEntry.new(full_name, name, self)
              @inferior_classes << inf_class
            end
            inf_class.load_from(full_name)
          end
        end
      end
    end
1298428
function eachEndpoint(iterator) {
	for (var namespace in endpoints) {
		var methods = endpoints[namespace];

		for (var name in methods) {
			var method = methods[name];

			iterator(namespace, name, method);
		}
	}

	return endpoints;
}
1356368
def load_dict(self, source, namespace='', make_namespaces=False):
        ''' 
        '''
        stack = [(namespace, source)]
        while stack:
            prefix, source = stack.pop()
            if not isinstance(source, dict):
                raise TypeError('Source is not a dict (r)' % type(key))
            for key, value in source.items():
                if not isinstance(key, str):
                    raise TypeError('Key is not a string (%r)' % type(key))
                full_key = prefix + '.' + key if prefix else key
                if isinstance(value, dict):
                    stack.append((full_key, value))
                    if make_namespaces:
                        self[full_key] = self.Namespace(self, full_key)
                else:
                    self[full_key] = value
        return self
220181
private ImmutableList<EndPoint> getEndPointsFromHostDiscovery() {
        Iterable<ServiceEndPoint> hosts = _hostDiscovery.getHosts();

        ImmutableList.Builder<EndPoint> endPoints = ImmutableList.builder();
        for (final ServiceEndPoint host : hosts) {
            if (host.equals(_self)) {
                continue;
            }
            endPoints.add(new EndPoint() {
                @Override
                public String getAddress() {
                    return _endPointAdapter.toEndPointAddress(host);
                }

                @Override
                public boolean isValid() {
                    return Iterables.contains(_hostDiscovery.getHosts(), host);
                }
            });
        }

        return endPoints.build();
    }
948552
private URL[] findResourcesInUrls(String classRelativePath, URL[] urls)
    {
        List<URL> list = new ArrayList<URL>();
        for (URL url : urls)
        {
            if (AllowedProtocol.isValidProtocol(url.getProtocol().toUpperCase()) && url.getPath().endsWith(".jar"))
            {
                try
                {
                    JarFile jarFile = new JarFile(URLDecoder.decode(url.getFile(), Constants.CHARSET_UTF8));

                    // Checking the dependencies of this jar file
                    Manifest manifest = jarFile.getManifest();
                    if (manifest != null)
                    {
                        String classPath = manifest.getMainAttributes().getValue("Class-Path");
                        // Scan all entries in the classpath if they are
                        // specified in the jar
                        if (!StringUtils.isEmpty(classPath))
                        {
                            List<URL> subList = new ArrayList<URL>();
                            for (String cpEntry : classPath.split(" "))
                            {
                                try
                                {
                                    subList.add(new URL(cpEntry));
                                }
                                catch (MalformedURLException e)
                                {
                                    URL subResources = ClasspathReader.class.getClassLoader().getResource(cpEntry);
                                    if (subResources != null)
                                    {
                                        subList.add(subResources);
                                    }
                                    // logger.warn("Incorrect URL in the classpath of a jar file ["
                                    // + url.toString()
                                    // + "]: " + cpEntry);
                                }
                            }
                            list.addAll(Arrays.asList(findResourcesInUrls(classRelativePath,
                                    subList.toArray(new URL[subList.size()]))));
                        }
                    }
                    JarEntry present = jarFile.getJarEntry(classRelativePath + ".class");
                    if (present != null)
                    {
                        list.add(url);
                    }
                }
                catch (IOException e)
                {
                    logger.warn("Error during loading from context , Caused by:" + e.getMessage());
                }

            }
            else if (url.getPath().endsWith("/"))
            {
                File file = new File(url.getPath() + classRelativePath + ".class");
                if (file.exists())
                {
                    try
                    {
                        list.add(file.toURL());
                    }
                    catch (MalformedURLException e)
                    {
                        throw new ResourceReadingException(e);
                    }
                }
            }

        }
        return list.toArray(new URL[list.size()]);
    }
758460
public static List<String> getAllNameSpaces() throws ApiException {
    V1NamespaceList listNamespace =
        COREV1_API.listNamespace(
            null, "true", null, null, null, 0, null, Integer.MAX_VALUE, Boolean.FALSE);
    List<String> list =
        listNamespace
            .getItems()
            .stream()
            .map(v1Namespace -> v1Namespace.getMetadata().getName())
            .collect(Collectors.toList());
    return list;
  }
485099
def _extract_all_python_namespaces(self, thrift_file_sources_by_target):
    """"""
    py_namespaces_by_target = OrderedDict()
    failing_py_thrift_by_target = defaultdict(list)
    for t, all_content in thrift_file_sources_by_target.items():
      py_namespaces_by_target[t] = []
      for (path, content) in all_content:
        try:
          py_namespaces_by_target[t].append(
            # File content is provided as a binary string, so we have to decode it.
            (path, self._extract_py_namespace_from_content(t, path, content.decode('utf-8'))))
        except self.NamespaceParseFailure:
          failing_py_thrift_by_target[t].append(path)

    if failing_py_thrift_by_target:
      # We dump the output to a file here because the output can be very long in some repos.
      no_py_namespace_output_file = os.path.join(self.workdir, 'no-python-namespace-output.txt')

      pretty_printed_failures = '\n'.join(
        '{}: [{}]'.format(t.address.spec, ', '.join(paths))
        for t, paths in failing_py_thrift_by_target.items())
      error = self.NamespaceExtractionError(no_py_namespace_output_file, """\
Python namespaces could not be extracted from some thrift sources. Declaring a `namespace py` in
thrift sources for python thrift library targets will soon become required.

{} python library target(s) contained thrift sources not declaring a python namespace. The targets
and/or files which need to be edited will be dumped to: {}
""".format(len(failing_py_thrift_by_target), no_py_namespace_output_file))

      safe_file_dump(no_py_namespace_output_file, '{}\n'.format(pretty_printed_failures))

      if self.get_options().strict:
        raise error
      else:
        self.context.log.warn(error)
    return py_namespaces_by_target
1253429
@RequestMapping(value = "/endpointdoc", method = RequestMethod.GET)
    public @ResponseBody
    Set<RequestMappingInfo> getEndpoints() {

        return this.service.getEndpoints(requestMappingHandlerMapping);
    }
777855
public Object[] loadContextClasses(ClassLoader loader,
                                       ContextClassEntry[] contextClasses) 
    throws Exception {

        if (loader == null) {
            throw new IllegalArgumentException("ClassLoader is null");
        }

        if (contextClasses == null || contextClasses.length == 0) {
            throw new IllegalArgumentException("No Context Classes");
        }
                        
        Vector<Class<?>> classVector = 
            new Vector<Class<?>>(contextClasses.length);
        String[] prefixNames = new String[contextClasses.length];
        
        String className = null;
        for (int i = 0; i < contextClasses.length; i++) {
            className = contextClasses[i].getContextClassName();    
            Class<?> contextClass = loader.loadClass(className);
            
            classVector.addElement(contextClass);
            String prefixName = contextClasses[i].getPrefixName();
            if (prefixName != null) { 
                prefixNames[i] = prefixName + "$";
            }
            else {
                prefixNames[i] = null;
            }                                
        }
        
        Class<?>[] classes = new Class<?>[classVector.size()];
        classVector.copyInto(classes);
        
        return new Object[] {classes, prefixNames};
    }
59537
def __add_endpoints(self):
        
        for mapping in endpoint_mappings:
            if all(map(self.config.get, mapping.keys)):
                self.__add_single_endpoint(
                    mapping.cls, mapping.endpoint, mapping.is_protected
                )

        self.bp.exception(exceptions.SanicJWTException)(
            self.responses.exception_response
        )

        if not self.instance_is_blueprint:
            url_prefix = self._get_url_prefix()
            self.instance.blueprint(self.bp, url_prefix=url_prefix)
586979
private void loadEndpointParserProperties() {
        try {
            endpointParserProperties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("com/consol/citrus/endpoint/endpoint.parser"));
        } catch (IOException e) {
            log.warn("Unable to laod default endpoint annotation parsers from resource '%s'", e);
        }
    }
141364
@Override
	public void addEndpoint(T endpoint) {
		if (endpoints.length == 0) {
			endpoints = new Endpoint[1];
			endpoints[0] = endpoint;
		} else {
			for (int i = 0; i < endpoints.length; i++) {
				if (endpoints[i].equals(endpoints)) {

					// Already registered
					return;
				}
			}

			// Add to array
			Endpoint[] copy = new Endpoint[endpoints.length + 1];
			System.arraycopy(endpoints, 0, copy, 0, endpoints.length);
			copy[endpoints.length] = endpoint;
			endpoints = copy;
		}

		// Remove from cache
		endpointCache.remove(endpoint.getNodeID());
	}
1277731
def _attach_endpoints(self):
        """"""
        for name, endpoint in inspect.getmembers(self):
            if inspect.isclass(endpoint) and issubclass(endpoint, self._Endpoint) and (endpoint is not self._Endpoint):
                endpoint_instance = endpoint(self.base_requester)
                setattr(self, endpoint_instance.endpoint, endpoint_instance)
1339492
def __load(self):
        
        parts = self.__class_name.split('.')
        module_name = ".".join(parts[:-1])
        module = __import__(module_name)
        modules = []
        for comp in parts[1:]:
            module = getattr(module, comp)
            modules.append(module)

        self.__module = modules[-2]
596829
def list(cls, params=None):
        
        return fields.ListField(name=cls.ENDPOINT, init_class=cls).decode(
            cls.element_from_string(cls._get_request(params=params).text)
        )
1341114
private void loadEndpointComponentProperties() {
        try {
            endpointComponentProperties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("com/consol/citrus/endpoint/endpoint.components"));
        } catch (IOException e) {
            log.warn("Unable to laod default endpoint components from resource '%s'", e);
        }
    }