language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException, InvalidEndpointException, InvalidPortException, InvalidBucketNameException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, InvalidArgumentException, IOException, Xml...
python
def setdefault(self: dict, other: dict): """Like .update() but values in self take priority.""" for k, v in other.items(): self.setdefault(k, v)
java
private void render(SVG.Group obj) { debug("Group render"); updateStyleForElement(state, obj); if (!display()) return; if (obj.transform != null) { canvas.concat(obj.transform); } checkForClipPath(obj); boolean compositing = pushLayer()...
java
public String generateSourceMap() throws IOException { final String sourceMethod = "generateSourceMap"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{name}); } String result = null; lineLengths =...
python
def get_service_framework_id( service_name, inactive=False, completed=False ): """ Get the framework ID for a service :param service_name: the service name :type service_name: str :param inactive: whether to include inactive services :type inactive: bool ...
java
public int readAll(CharBuffer buf, int length) throws IOException { int len = buf.length(); buf.length(len + length); int readLength = readAll(buf.buffer(), len, length); if (readLength < 0) buf.length(len); else if (readLength < length) buf.length(len + readLength); return lengt...
python
def zlist(columns, items, print_columns=None, text="", title="", width=DEFAULT_WIDTH, height=ZLIST_HEIGHT, timeout=None): """ Display a list of values :param columns: a list of columns name :type columns: list of strings :param items: a list of values :type items: list of st...
java
public void setNAME(Integer newNAME) { Integer oldNAME = name; name = newNAME; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.BEGIN_SEGMENT_COMMAND__NAME, oldNAME, name)); }
java
@Check public void checkContainerType(SarlEvent event) { final XtendTypeDeclaration declaringType = event.getDeclaringType(); if (declaringType != null) { final String name = canonicalName(declaringType); assert name != null; error(MessageFormat.format(Messages.SARLValidator_32, name), event, nu...
python
def match_concept(self,string): '''Find all matches in this :class:`Bottle` for ``string`` and return the best match''' matches = self.match_all_concepts(string) if len(matches)>0: return matches[0] return None
java
public void process(DocumentAndOp doc, Analyzer analyzer) throws IOException { if (doc.getOp() == DocumentAndOp.Op.DELETE || doc.getOp() == DocumentAndOp.Op.UPDATE) { deleteList.add(doc.getTerm()); } if (doc.getOp() == DocumentAndOp.Op.INSERT || doc.getOp() == DocumentAndOp.O...
java
public void setSortMode(final SortMode sortMode) { getOrCreateComponentModel().sortMode = sortMode == null ? SortMode.NONE : sortMode; }
python
def update_name(self, force=False, create_term=False, report_unchanged=True): """Generate the Root.Name term from DatasetName, Version, Origin, TIme and Space""" updates = [] self.ensure_identifier() name_term = self.find_first('Root.Name') if not name_term: if cr...
java
@Override public boolean fileCreated(File file) throws WatchingException { if (WatcherUtils.isInDirectory(file, internalSources)) { processDirectory(internalSources, destinationForInternals); } else if (WatcherUtils.isInDirectory(file, externalSources)) { processDirectory(ext...
java
private <T> InternalProviderImpl installInternalProvider(Class<T> clazz, String bindingName, InternalProviderImpl<? extends T> internalProvider, boolean isBound, boolean isTestProvider) { if (bindingName == null) { if (isBound) { return installUnNamedProvider(mapClassesToUnNamedBoundProviders, c...
java
public void removeConstraint(final GVRConstraint gvrConstraint) { mPhysicsContext.runOnPhysicsThread(new Runnable() { @Override public void run() { if (contains(gvrConstraint)) { NativePhysics3DWorld.removeConstraint(getNative(), gvrConstraint.getNativ...
java
public static TranslatableComponent make(final @NonNull String key, final @NonNull List<Component> args, final @NonNull Consumer<Builder> consumer) { final Builder builder = builder(key).args(args); consumer.accept(builder); return builder.build(); }
python
def get_data(self): """ reads data from current WD measurement.txt or magic_measurements.txt depending on data model and sorts it into main measurements data structures given bellow: Data - {specimen: { zijdblock:[[treatment temp-str,dec-float, inc-float, ...
python
def merge_tags(left, right, factory=Tags): """ Merge two sets of tags into a new troposphere object Args: left (Union[dict, troposphere.Tags]): dictionary or Tags object to be merged with lower priority right (Union[dict, troposphere.Tags]): dictionary or Tags object to be ...
java
public static SecretKeyFactory getSecretKeyFactory(String algorithm) { final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider(); SecretKeyFactory keyFactory; try { keyFactory = (null == provider) // ? SecretKeyFactory.getInstance(getMainAlgorithm(algorithm)) // : SecretKeyF...
java
public final void parse(final InputStream in, final ContentHandler handler) throws IOException, ParserException { parse(new InputStreamReader(in), handler); }
java
public ActionForm createActionForm(ActionServlet servlet) throws IllegalAccessException, InstantiationException { // Create a new form bean instance if (getDynamic()) { return super.createActionForm(servlet); } try { ReloadableClassHandler rch = Handler...
python
def parse_authentication_request(self, request_body, http_headers=None): # type: (str, Optional[Mapping[str, str]]) -> oic.oic.message.AuthorizationRequest """ Parses and verifies an authentication request. :param request_body: urlencoded authentication request :param http_heade...
python
def reset(self, hard=False): '''reset the card dispense, either soft or hard based on boolean 2nd arg''' if hard: self.sendcommand(Vendapin.RESET, 1, 0x01) time.sleep(2) else: self.sendcommand(Vendapin.RESET) time.sleep(2) # parse the r...
python
def save_form(self, form, request, **resources): """Save self form.""" resource = yield from super(PWAdminHandler, self).save_form(form, request, **resources) resource.save() return resource
java
protected final MemorySegment nextSegment(MemorySegment current, int posInSegment) throws IOException { if (current != null) { writeSegment(current, posInSegment, false); } final MemorySegment next = this.writer.getNextReturnedBlock(); this.blockCount++; return next; }
java
Object replaceObject(ResourceRefConfigFactory resRefConfigFactory) { DSConfig config = dsConfig.get(); String filter = config.jndiName == null || config.jndiName.startsWith("java:") ? FilterUtils.createPropertyFilter("config.displayId", config.id) : Filter...
java
protected boolean householderPivot(int j) { final double u[] = dataQR[j]; // find the largest value in this column // this is used to normalize the column and mitigate overflow/underflow final double max = QrHelperFunctions_DDRM.findMax(u, j, numRows - j); if( max <= singul...
java
public static String digest(ByteBuffer script) { try { MessageDigest md = MessageDigest.getInstance("SHA1"); md.update(script); return new String(Base16.encode(md.digest(), false)); } catch (NoSuchAlgorithmException e) { throw new RedisException("JVM does ...
python
def create_mapping(record, keys): """Create a field mapping for use in API updates and creates. Args: record (BaseModel): Record that should be mapped. keys (list[str]): Fields that should be mapped as keys. Returns: dict: Dictionary with keys: ...
java
public static Optional<Path> createTempFilePathAsOpt(Path path) { debug(log, "createTempFilePathAsOpt", path); String[] prefixSuffix = JMFiles.getPrefixSuffix(path.toFile()); try { return Optional .of(Files.createTempFile(prefixSuffix[0], prefixSuffix[1])) ...
python
def load(self, skey, sdesc, sdict=None, loaders=None, merge=False, writeback=False): ''' Loads a dictionary into current settings :param skey: Type of data to load. Is be used to reference the data \ in the files sections within settings :param sdesc...
python
def _find_start_time(hdr, s_freq): """Find the start time, usually in STC, but if that's not correct, use ERD Parameters ---------- hdr : dict header with stc (and stamps) and erd s_freq : int sampling frequency Returns ------- datetime either from stc or from e...
java
private static boolean isCollapsibleValue(Node value, boolean isLValue) { switch (value.getToken()) { case GETPROP: // Do not collapse GETPROPs on arbitrary objects, because // they may be implemented setter functions, and oftentimes // setter functions fail on native objects. This is ...
java
public static String replaceAll(final String input, final String pattern, final String replacement) { final StringBuilder result = new StringBuilder(); int startIndex = 0; int newIndex; while ((newIndex = input.indexOf(pattern, startIndex)) >= 0) { result.append(...
python
def _set_fabric_isl(self, v, load=False): """ Setter method for fabric_isl, mapped from YANG variable /interface/fortygigabitethernet/fabric/fabric_isl (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_isl is considered as a private method. Backends ...
java
public void plusNanoSeconds(long delta) { if (delta != 0) { long result = getNanoSecond() + delta; setNanoSecond((int) Math.floorMod(result, 1000000000)); plusSeconds(Math.floorDiv(result, 1000000000)); } }
java
private void buildMetaZoneNames(MethodSpec.Builder method, TimeZoneData data) { CodeBlock.Builder code = CodeBlock.builder(); code.beginControlFlow("\nthis.$L = new $T<$T, $T>() {", "metazoneNames", HASHMAP, STRING, TIMEZONE_NAMES); for (MetaZoneInfo info : data.metaZoneInfo) { if (info....
java
public ZealotKhala andNotLike(String field, Object value) { return this.doLike(ZealotConst.AND_PREFIX, field, value, true, false); }
java
public void setTextValue(String v) { if (BodyCitation_Type.featOkTst && ((BodyCitation_Type)jcasType).casFeat_textValue == null) jcasType.jcas.throwFeatMissing("textValue", "ch.epfl.bbp.uima.types.BodyCitation"); jcasType.ll_cas.ll_setStringValue(addr, ((BodyCitation_Type)jcasType).casFeatCode_textValue, ...
python
def get_package_by_key(self, package_keyname, mask=None): """Get a single package with a given key. If no packages are found, returns None :param package_keyname: string representing the package key name we are interested in. :param string mask: Mask to specify the properties we want t...
python
def get_resources(cls): """Returns Ext Resources.""" plural_mappings = resource_helper.build_plural_mappings( {}, RESOURCE_ATTRIBUTE_MAP) if NEUTRON_VERSION.version[0] <= NEUTRON_NEWTON_VERSION.version[0]: attr.PLURALS.update(plural_mappings) return resource_helpe...
python
def system_which(command, mult=False): """Emulates the system's which. Returns None if not found.""" _which = "which -a" if not os.name == "nt" else "where" os.environ = { vistir.compat.fs_str(k): vistir.compat.fs_str(val) for k, val in os.environ.items() } result = None try: ...
python
def utc2et(utcstr): """ Convert an input time from Calendar or Julian Date format, UTC, to ephemeris seconds past J2000. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/utc2et_c.html :param utcstr: Input time string, UTC. :type utcstr: str :return: Output epoch, ephemeris seconds ...
java
protected SchemaInformedGrammar getSchemaInformedElementFragmentGrammar() throws EXIException { // unique qname map Map<QName, List<XSElementDeclaration>> uniqueNamedElements = getUniqueNamedElements(); if (elementFragment0 != null) { return elementFragment0; } // 8.5.3 Schema-informed Elem...
java
public static DoubleChromosome of(final DoubleGene... genes) { checkGeneRange(Stream.of(genes).map(DoubleGene::range)); return new DoubleChromosome(ISeq.of(genes), IntRange.of(genes.length)); }
java
@Deprecated @Override public JsonParser createJsonParser(Reader r) throws IOException, JsonParseException { return createParser(r); }
python
def get_absolute(self, points): """Given a set of points geo referenced to this instance, return the points as absolute values. """ # remember if we got a list is_list = isinstance(points, list) points = ensure_numeric(points, num.float) if len(points.shape) == ...
python
def _meanprecision(D, tol=1e-7, maxiter=None): '''Mean and precision alternating method for MLE of Dirichlet distribution''' N, K = D.shape logp = log(D).mean(axis=0) a0 = _init_a(D) s0 = a0.sum() if s0 < 0: a0 = a0/s0 s0 = 1 elif s0 == 0: a0 = ones(a.shape) / len...
java
public void clearUserValues() { ArrayList<String> buckets = getBuckets(); for (String bucket : buckets) { setCreditCount(bucket, 0); } setBuckets(new ArrayList<String>()); ArrayList<String> actions = getActions(); for (String action : actions) { ...
java
public CmsUUID addForbiddenParentFolder(String parentFolder, String reason) { CmsUUID id = new CmsUUID(); m_forbiddenParentFolders.put(id, new ForbiddenFolderEntry(parentFolder, reason)); return id; }
java
public final void xmlRequestWriteRawDataOnSystemOut() throws IOException { FormattedWriter writer = new FormattedWriter(new OutputStreamWriter(System.out)); xmlWriteRawOn(writer, false); writer.flush(); }
python
def coarsen(self, windows, func, boundary='exact', side='left'): """ Apply """ windows = {k: v for k, v in windows.items() if k in self.dims} if not windows: return self.copy() reshaped, axes = self._coarsen_reshape(windows, boundary, side) if isinsta...
java
public static Label.Builder format(final Label.Builder label) { for (final MapFieldEntry.Builder entryBuilder : label.getEntryBuilderList()) { final List<String> valueList = new ArrayList<>(entryBuilder.getValueList()); entryBuilder.clearValue(); for (String value : valueList...
java
public static void deleteCommerceSubscriptionEntry( long commerceSubscriptionEntryId) throws com.liferay.portal.kernel.exception.PortalException { getService().deleteCommerceSubscriptionEntry(commerceSubscriptionEntryId); }
python
def do_GET(self): # check here request header to identify the type of req, if http or ws # if this is a ws req, instance a ws handler, add it to App's ws list, return if "Upgrade" in self.headers: if self.headers['Upgrade'] == 'websocket': #passing arguments to websoc...
python
def _read_ini_config(ini_file_contents: str) -> Dict[str, str]: """ Parses the given ini file contents and converts to a dictionary of key/value pairs. :param ini_file_contents: the contents of the ini file :return: dictionary where the variable names are key and their values are the values """ ...
python
def _prepare_wsdl_objects(self): """ Preps the WSDL data structures for the user. """ self.DeletionControlType = self.client.factory.create('DeletionControlType') self.TrackingId = self.client.factory.create('TrackingId') self.TrackingId.TrackingIdType = self.client.fact...
java
public static void main(String[] args) { String icuApiVer; if (ICU_VERSION.getMajor() <= 4) { if (ICU_VERSION.getMinor() % 2 != 0) { // Development mile stone int major = ICU_VERSION.getMajor(); int minor = ICU_VERSION.getMinor() + 1; ...
python
def build_taxonomy(self, level, namespace, predicate, value): """ :param level: info, safe, suspicious or malicious :param namespace: Name of analyzer :param predicate: Name of service :param value: value :return: dict """ return { 'level':...
python
def do_random(context, seq): """Return a random item from the sequence.""" try: return random.choice(seq) except IndexError: return context.environment.undefined('No random item, sequence was empty.')
python
def gen_gmfs(gmf_set): """ Generate GMF nodes from a gmf_set :param gmf_set: a sequence of GMF objects with attributes imt, sa_period, sa_damping, event_id and containing a list of GMF nodes with attributes gmv and location. The nodes are sorted by lon/lat. """ for gmf in gmf_set: ...
java
public void createPageControlsPostconfig() { try { getMainPageButton("projectFromArchiveRadio").setSelection(true); getMainPageButton("projectFromArchiveRadio").setEnabled(false); getMainPageButton("projectFromDirectoryRadio").setSelection(false); getMainPageButton("projectFromDirectoryRadio").setEnabled(...
python
def split_str(string): """Split string in half to return two strings""" split = string.split(' ') return ' '.join(split[:len(split) // 2]), ' '.join(split[len(split) // 2:])
python
def call_agent_side(self, method, *args, **kwargs): ''' Call the method, wrap it in Deferred and bind error handler. ''' assert not self._finalize_called, ("Attempt to call agent side code " "after finalize() method has been " ...
python
def visit_IfExp(self, node): ''' Resulting node alias to either branch >>> from pythran import passmanager >>> pm = passmanager.PassManager('demo') >>> module = ast.parse('def foo(a, b, c): return a if c else b') >>> result = pm.gather(Aliases, module) >>> Aliase...
java
public DataDescriptor parentDescriptor() { if (type == TYPE_INVALID) { return null; } else if (dataIds != null) { return new DataDescriptor(dataPath); } else { if (dataPath.length == 1) return null; String[] myPath = new String[data...
python
def add_nodes(self, nodes, attr_dict=None, **attr): """Adds multiple nodes to the graph, along with any related attributes of the nodes. :param nodes: iterable container to either references of the nodes OR tuples of (node reference, attribute dictionary); ...
python
def value_get(method_name): """ Creates a getter that will call value's method with specified name using the context's key as first argument. @param method_name: the name of a method belonging to the value. @type method_name: str """ def value_get(value, context, **_params): method ...
java
static <I, O> CipherExecutor<I, O> getInstance() { if (INSTANCE == null) { synchronized (NoOpCipherExecutor.class) { if (INSTANCE == null) { INSTANCE = new NoOpCipherExecutor<>(); } } } return INSTANCE; }
java
public static ApiOvhCore getInstance() { ApiOvhCore core = new ApiOvhCore(); // core._consumerKey = core.config.getConsumerKey(); core._consumerKey = core.getConsumerKeyOrNull();// config.getConsumerKey(); if (core._consumerKey == null) { File file = ApiOvhConfigBasic.getOvhConfig(); String location = Api...
python
def influx_query_(self, q): """ Runs an Influx db query """ if self.influx_cli is None: self.err( self.influx_query_, "No database connected. Please initialize a connection") return try: return self.influx_cli.qu...
java
@VisibleForTesting static void propagateMetadataFromProps(Map<String, String> metaData, Props inputProps, String nodeType, String nodeName, Logger logger) { // Backward compatibility: Unless user specifies, this will be absent from flows and jobs // .. if so, do a no-op like before if (!inputProps....
java
public static Optional<OffsetRange<CharOffset>> charOffsetsOfWholeString(String s) { if (s.isEmpty()) { return Optional.absent(); } return Optional.of(charOffsetRange(0, s.length() - 1)); }
java
private NodeStruct nodesWithDataTakeUnsafe() { LOG.entering("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe"); try { final NodeStruct child = nodesWithData.take(); LOG.exiting("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe", child); return child; } catch (final InterruptedE...
python
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-digitalocean-config profile=my-profile '...
java
@Override public void deleteUser(String username) throws AuthenticationException { String user = file_store.getProperty(username); if (user == null) { throw new AuthenticationException("User '" + username + "' not found."); } file_store.remove(username...
java
public static List<ConnectionParams> manyFromConfig(ConfigParams config, boolean configAsDefault) { List<ConnectionParams> result = new ArrayList<ConnectionParams>(); // Try to get multiple connections first ConfigParams connections = config.getSection("connections"); if (connections.size() > 0) { List<Str...
python
def creates_cycle(connections, test): """ Returns true if the addition of the 'test' connection would create a cycle, assuming that no cycle already exists in the graph represented by 'connections'. """ i, o = test if i == o: return True visited = {o} while True: num_add...
python
def remove_listener(self, registration_id): """ Removes the specified membership listener. :param registration_id: (str), registration id of the listener to be deleted. :return: (bool), if the registration is removed, ``false`` otherwise. """ try: self.listen...
python
def create(self, name, plan, zone, service_type='mongodb', instance_type='mongodb_sharded', version='2.4.6'): """Create an ObjectRocket instance. :param str name: The name to give to the new instance. :param int plan: The plan size of the new instance. :param str zone: Th...
java
public static RouteMeta build(RouteType type, Class<?> destination, String path, String group, int priority, int extra) { return new RouteMeta(type, null, destination, null, path, group, null, priority, extra); }
java
public static Builder from(URI swaggerUri) { Validate.notNull(swaggerUri, "swaggerUri must not be null"); String scheme = swaggerUri.getScheme(); if (scheme != null && swaggerUri.getScheme().startsWith("http")) { try { return from(swaggerUri.toURL()); } ca...
python
def tile_images(img1, img2, mask1, mask2, opts): """Combine two images into one by tiling them. ``mask1`` and ``mask2`` provide optional masks for alpha-blending; pass None to avoid. Fills unused areas with ``opts.bgcolor``. Puts a ``opts.spacing``-wide bar with a thin line of ``opts.sepcolor`` ...
java
@Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { lepManager.endThreadContext(); }
python
def server_to_dict(server): """ Returns the :class:`dict` representation of a server object. The returned :class:`dict` is meant to be consumed by :class:`~bang.deployers.cloud.ServerDeployer` objects. """ return { A.server.ID: server.id, A.server.PUBLIC_IPS: [server.pu...
python
def _remove_column(self, name): """ Removes a column from the blueprint. :param name: The column name :type name: str :rtype: Blueprint """ self._columns = filter(lambda c: c.name != name, self._columns) return self
java
public boolean bind () { // open our TCP listening ports int successes = 0; for (int port : _ports) { try { acceptConnections(port); successes++; } catch (IOException ioe) { log.warning("Failure listening to socket", "ho...
java
@Override public AuthenticationInfo beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token) throws AuthenticationException { final SimpleAuthenticationInfo authenticationInfo = (SimpleAuthenticationInfo) super.beforeAllAttempts(realms, token); authenticationInfo.setPrincipa...
java
void apMessage(AnnotationProcessingError ex) { log.printLines(PrefixKind.JAVAC, "msg.proc.annotation.uncaught.exception"); ex.getCause().printStackTrace(log.getWriter(WriterKind.NOTICE)); }
java
public Collection<ScmConfiguration> parseRepositoriesFile(String fileName, String scmType, String scmPpk, String scmUser, String scmPassword) { try (InputStream is = new FileInputStream(fileName)) { String jsonText = IOUtils.toString(is); JSONObject json = new JSONObject(jsonText); ...
python
async def reset(self): """ reset the tournament on Challonge |methcoro| Note: |from_api| Reset a tournament, clearing all of its scores and attachments. You can then add/remove/edit participants before starting the tournament again. Raises: APIException ...
python
def list_roles(): """ List existing roles """ click.echo(green('\nListing roles:')) click.echo(green('-' * 40)) with get_app().app_context(): roles = Role.query.all() if not roles: click.echo(red('No roles found')) return for index,role in enumerate(roles...
python
def save_data(self, trigger_id, **data): """ let's save the data :param trigger_id: trigger ID from which to save data :param data: the data to check to be used and save :type trigger_id: int :type data: dict :return: the status of the sav...
python
def analyze_insertions(fa, threads = 6): """ - find ORFs using Prodigal - find introns using cmscan (vs Rfam intron database) - check that ORFs and intron overlap with insertion region - plot insertion length versus model position for each insertion (based on insertion type) """ safe, sequen...
python
def lookup_asset_types(self, sids): """ Retrieve asset types for a list of sids. Parameters ---------- sids : list[int] Returns ------- types : dict[sid -> str or None] Asset types for the provided sids. """ found = {} ...
python
def remove(property_name, system=False): """ Remove a configuration property/value setting from the config file. :param property_name: The name of the property to remove. :keyword system: Set to True to modify the system configuration file. If not set, the user config file will be ...
python
def txt(self, txt, h=None, at_x=None, to_x=None, change_style=None, change_size=None): """print string to defined (at_x) position to_x can apply only if at_x is None and if used then forces align='R' """ h = h or self.height self._change_props(change_style, change_size) a...
java
@Override public Set<String> convert(String value) { //shouldn't ever get called but if it does, the best we can do is return a String set List<String> list = Arrays.asList(ConversionManager.split(value)); Set<String> set = new HashSet<>(list); return set; }
python
def grouper(iterable, n): """ Slice up `iterable` into iterables of `n` items. :param iterable: Iterable to splice. :param n: Number of items per slice. :returns: iterable of iterables """ it = iter(iterable) while True: chunk = itertools.islice(it, n) try: f...