text:
import argparse
import json
import os
import subprocess
import sys
from collections import defaultdict
from configparser import ConfigParser
from functools import total_ordering
from urllib.error import HTTPError
from urllib.request import Request, urlopen

from bs4 import BeautifulSoup

COLOR_BLUE = "\x1b[34m"
COLOR_RESET = "\x1b[0m"

def banner(message):
  print("{}[=== {} ===]{}".format(COLOR_BLUE, message, COLOR_RESET))

@total_ordering
class Package:

  def __init__(self, name, target, bdist_wheel_flags=None):
    self.name = name
    self.target = target
    self.bdist_wheel_flags = bdist_wheel_flags or ("--python-tag", "py36.py37")

  def __lt__(self, other):
    return self.name < other.name

  def __eq__(self, other):
    return self.name == other.name

  def __hash__(self):
    return super().__hash__()

  def __str__(self):
    return self.name

  def __repr__(self):
    return "Package<name={}>".format(self.name)

  def exists(self):
    req = Request("https://pypi.org/pypi/{}".format(self.name))
    req.get_method = lambda: "HEAD"
    try:
      urlopen(req)
      return True
    except HTTPError as e:
      if e.code == 404:
        return False
      raise

  def latest_version(self):
    f = urlopen("https://pypi.org/pypi/{}/json".format(self.name))
    j = json.load(f)
    return j["info"]["version"]

  def owners(self):
    url = "https://pypi.org/pypi/{}/{}".format(self.name, self.latest_version())
    url_content = urlopen(url).read()
    parser = BeautifulSoup(url_content, 'html.parser')
    owners = {span.find('a', recursive=False).get_text().strip().lower()
              for span in parser.find_all('span', class_='sidebar-section__maintainer')}
    return owners

def core_packages():
  # N.B. We constrain the ABI (Application Binary Interface) to cp36 to allow pantsbuild.pants to
  # work with any Python 3 version>= 3.6. We are able to get this future compatibility by specifying
  # `abi3`, which signifies any version >= 3.6 must work. This is possible to set because in
  # `src/rust/engine/src/cffi/native_engine.c` we set up `Py_LIMITED_API` and in `src/python/pants/BUILD` we
  # set ext_modules, which together allows us to mark the abi tag. See https://docs.python.org/3/c-api/stable.html
  # for documentation and https://bitbucket.org/pypa/wheel/commits/1f63b534d74b00e8c2e8809f07914f6da4502490?at=default#Ldocs/index.rstT121
  # for how to mark the ABI through bdist_wheel.
  bdist_wheel_flags = ("--py-limited-api", "cp36")
  return {
    Package("pantsbuild.pants", "//src/python/pants:pants-packaged", bdist_wheel_flags=bdist_wheel_flags),
    Package("pantsbuild.pants.testutil", "//src/python/pants/testutil:testutil_wheel"),
  }

def contrib_packages():
  return {
    Package(
      "pantsbuild.pants.contrib.scrooge",
      "//contrib/scrooge/src/python/pants/contrib/scrooge:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.buildgen",
      "//contrib/buildgen/src/python/pants/contrib/buildgen:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.go",
      "//contrib/go/src/python/pants/contrib/go:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.node",
      "//contrib/node/src/python/pants/contrib/node:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.scalajs",
      "//contrib/scalajs/src/python/pants/contrib/scalajs:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.python.checks",
      "//contrib/python/src/python/pants/contrib/python/checks:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.python.checks.checker",
      "//contrib/python/src/python/pants/contrib/python/checks/checker",
      bdist_wheel_flags=("--universal",),
    ),
    Package(
      "pantsbuild.pants.contrib.findbugs",
      "//contrib/findbugs/src/python/pants/contrib/findbugs:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.cpp",
      "//contrib/cpp/src/python/pants/contrib/cpp:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.confluence",
      "//contrib/confluence/src/python/pants/contrib/confluence:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.errorprone",
      "//contrib/errorprone/src/python/pants/contrib/errorprone:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.codeanalysis",
      "//contrib/codeanalysis/src/python/pants/contrib/codeanalysis:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.jax_ws",
      "//contrib/jax_ws/src/python/pants/contrib/jax_ws:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.mypy",
      "//contrib/mypy/src/python/pants/contrib/mypy:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.avro",
      "//contrib/avro/src/python/pants/contrib/avro:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.thrifty",
      "//contrib/thrifty/src/python/pants/contrib/thrifty:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.googlejavaformat",
      "//contrib/googlejavaformat/src/python/pants/contrib/googlejavaformat:plugin",
    ),
    Package(
      "pantsbuild.pants.contrib.awslambda_python",
      "//contrib/awslambda/python/src/python/pants/contrib/awslambda/python:plugin",
    ),
  }

def all_packages():
  return core_packages().union(contrib_packages())

def build_and_print_packages(version):
  packages_by_flags = defaultdict(list)
  for package in sorted(all_packages()):
    packages_by_flags[package.bdist_wheel_flags].append(package)

  for (flags, packages) in packages_by_flags.items():
    args = ("./pants", "setup-py", "--run=bdist_wheel {}".format(" ".join(flags))) + tuple(package.target for package in packages)
    try:
      # We print stdout to stderr because release.sh is expecting stdout to only be package names.
      subprocess.run(args, stdout=sys.stderr, check=True)
      for package in packages:
        print(package.name)
    except subprocess.CalledProcessError:
      print("Failed to build packages {names} for {version} with targets {targets}".format(
        names=','.join(package.name for package in packages),
        version=version,
        targets=' '.join(package.target for package in packages),
      ), file=sys.stderr)
      raise

def get_pypi_config(section, option):
  config = ConfigParser()
  config.read(os.path.expanduser('~/.pypirc'))

  if not config.has_option(section, option):
    raise ValueError('Your ~/.pypirc must define a {} option in the {} section'.format(option, section))
  return config.get(section, option)

def check_ownership(users, minimum_owner_count=3):
  minimum_owner_count = max(len(users), minimum_owner_count)
  packages = sorted(all_packages())
  banner("Checking package ownership for {} packages".format(len(packages)))
  users = {user.lower() for user in users}
  insufficient = set()
  unowned = dict()

  def check_ownership(i, package):
    banner("[{}/{}] checking ownership for {}: > {} releasers including {}".format(i, len(packages), package, minimum_owner_count, ", ".join(users)))
    if not package.exists():
      print("The {} package is new! There are no owners yet.".format(package.name))
      return

    owners = package.owners()
    if len(owners) <= minimum_owner_count:
      insufficient.add(package)

    difference = users.difference(owners)
    for d in difference:
      unowned.setdefault(d, set()).add(package)

  for i, package in enumerate(packages):
    check_ownership(i, package)

  if insufficient or unowned:
    if unowned:
      for user, packages in sorted(unowned.items()):
        print("Pypi account {} needs to be added as an owner for the following packages:\n{}".format(user, "\n".join(package.name for package in sorted(packages))), file=sys.stderr)

    if insufficient:
      print('The following packages have fewer than {} owners but should be setup for all releasers:\n{}'.format(minimum_owner_count, '\n'.join(package.name for package in insufficient)))

    sys.exit(1)

def _create_parser():
  parser = argparse.ArgumentParser()
  subparsers = parser.add_subparsers(dest="command")
  # list
  parser_list = subparsers.add_parser('list')
  parser_list.add_argument("--with-packages", action="store_true")
  # list-owners
  subparsers.add_parser("list-owners")
  # check-my-ownership
  subparsers.add_parser("check-my-ownership")
  # build_and_print
  parser_build_and_print = subparsers.add_parser("build_and_print")
  parser_build_and_print.add_argument("version")
  return parser

args = _create_parser().parse_args()

if args.command == "list":
  if args.with_packages:
    print('\n'.join(
      '{} {} {}'.format(package.name, package.target, " ".join(package.bdist_wheel_flags))
      for package in sorted(all_packages())))
  else:
    print('\n'.join(package.name for package in sorted(all_packages())))
elif args.command == "list-owners":
  for package in sorted(all_packages()):
    if not package.exists():
      print("The {} package is new!  There are no owners yet.".format(package.name), file=sys.stderr)
      continue
    print("Owners of {}:".format(package.name))
    for owner in sorted(package.owners()):
      print("{}".format(owner))
elif args.command == "check-my-ownership":
  me = get_pypi_config('server-login', 'username')
  check_ownership({me})
elif args.command == "build_and_print":
  build_and_print_packages(args.version)
else:
  raise argparse.ArgumentError("Didn't recognise arguments {}".format(args))


text:
#import <Foundation/Foundation.h>
#import "MGLTypes.h"
#import "MGLGeometry.h"
#import "MGLMapCamera.h"

NS_ASSUME_NONNULL_BEGIN

/**
 The options to use when creating images with the `MGLMapSnapshotter`.
 */
MGL_EXPORT
@interface MGLMapSnapshotOptions : NSObject

/**
 Creates a set of options with the minimum required information.

 @param styleURL URL of the map style to snapshot. The URL may be a full HTTP or
    HTTPS URL, a Mapbox URL indicating the style's map ID
    (`mapbox://styles/{user}/{style}`), or a path to a local file relative to
    the application's resource path. Specify `nil` for the default style.
 @param size The image size.
 */
- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL camera:(MGLMapCamera *)camera size:(CGSize)size;

#pragma mark - Configuring the Map

/**
 URL of the map style to snapshot.
 */
@property (nonatomic, readonly) NSURL *styleURL;

/**
 The zoom level.

 The default zoom level is 0. If this property is non-zero and the camera
 property is non-nil, the camera's altitude is ignored in favor of this
 property's value.
 */
@property (nonatomic) double zoomLevel;

/**
 A camera representing the viewport visible in the snapshot.

 If this property is non-nil and the `coordinateBounds` property is set to a
 non-empty coordinate bounds, the camera's center coordinate and altitude are
 ignored in favor of the `coordinateBounds` property.
 */
@property (nonatomic) MGLMapCamera *camera;

/**
 The coordinate rectangle that encompasses the bounds to capture.

 If this property is non-empty and the camera property is non-nil, the camera's
 center coordinate and altitude are ignored in favor of this property's value.
 */
@property (nonatomic) MGLCoordinateBounds coordinateBounds;

#pragma mark - Configuring the Image

/**
 The size of the output image, measured in points.

 */
@property (nonatomic, readonly) CGSize size;

/**
 The scale of the output image. Defaults to the main screen scale.

 The minimum scale is 1.
 */
@property (nonatomic) CGFloat scale;

@end

/**
 An image generated by a snapshotter object.
 */
MGL_EXPORT
@interface MGLMapSnapshot : NSObject

#if TARGET_OS_IPHONE
/**
 Converts the specified map coordinate to a point in the coordinate space of the
 image.
 */
- (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate;

/**
 Converts the specified image point to a map coordinate.
 */
- (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point;

/**
 The image of the map's content.
 */
@property (nonatomic, readonly) UIImage *image;
#else
/**
 Converts the specified map coordinate to a point in the coordinate space of the
 image.
 */
- (NSPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate;

/**
 Converts the specified image point to a map coordinate.
 */
- (CLLocationCoordinate2D)coordinateForPoint:(NSPoint)point;

/**
 The image of the map's content.
 */
@property (nonatomic, readonly) NSImage *image;
#endif

@end

/**
 A block to processes the result or error of a snapshot request.

 @param snapshot The `MGLMapSnapshot` that was generated or `nil` if an error
    occurred.
 @param error The error that occured or `nil` when successful.
 */
typedef void (^MGLMapSnapshotCompletionHandler)(MGLMapSnapshot* _Nullable snapshot, NSError* _Nullable error);

/**
 An `MGLMapSnapshotter` generates static raster images of the map. Each snapshot
 image depicts a portion of a map defined by an `MGLMapSnapshotOptions` object
 you provide. The snapshotter generates an `MGLMapSnapshot` object
 asynchronously, passing it into a completion handler once tiles and other
 resources needed for the snapshot are finished loading.

 You can change the snapshotter's options at any time and reuse the snapshotter
 for multiple distinct snapshots; however, the snapshotter can only generate one
 snapshot at a time. If you need to generate multiple snapshots concurrently,
 create multiple snapshotter objects.

 For an interactive map, use the `MGLMapView` class. Both `MGLMapSnapshotter`
 and `MGLMapView` are compatible with offline packs managed by the
 `MGLOfflineStorage` class.

 From a snapshot, you can obtain an image and convert geographic coordinates to
 the image's coordinate space in order to superimpose markers and overlays. If
 you do not need offline map functionality, you can use the `Snapshot` class in
 [MapboxStatic.swift](https://github.com/mapbox/MapboxStatic.swift/) to generate
 static map images with overlays.

 ### Example

 ```swift
 let camera = MGLMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), altitude: 100, pitch: 20, heading: 0)

 let options = MGLMapSnapshotOptions(styleURL: MGLStyle.satelliteStreetsStyleURL, camera: camera, size: CGSize(width: 320, height: 480))
 options.zoomLevel = 10

 let snapshotter = MGLMapSnapshotter(options: options)
 snapshotter.start { (snapshot, error) in
     if let error = error {
         fatalError(error.localizedDescription)
     }

     image = snapshot?.image
 }
 ```

 #### Related examples
 See the
 Create a static map snapshot example to learn how to use the
 `MGLMapSnapshotter` to generate a static image based on an `MGLMapView`
 object's style, camera, and view bounds.
 */
MGL_EXPORT
@interface MGLMapSnapshotter : NSObject

- (instancetype)init NS_UNAVAILABLE;

/**
 Initializes and returns a map snapshotter object that produces snapshots
 according to the given options.

 @param options The options to use when generating a map snapshot.
 @return An initialized map snapshotter.
 */
- (instancetype)initWithOptions:(MGLMapSnapshotOptions *)options NS_DESIGNATED_INITIALIZER;

/**
 Starts the snapshot creation and executes the specified block with the result.

 @param completionHandler The block to handle the result in.
 */
- (void)startWithCompletionHandler:(MGLMapSnapshotCompletionHandler)completionHandler;

/**
 Starts the snapshot creation and executes the specified block with the result
 on the specified queue.

 @param queue The queue to handle the result on.
 @param completionHandler The block to handle the result in.
 */
- (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MGLMapSnapshotCompletionHandler)completionHandler;

/**
 Cancels the snapshot creation request, if any.

 Once you call this method, you cannot resume the snapshot. In order to obtain
 the snapshot, create a new `MGLMapSnapshotter` object.
 */
- (void)cancel;

/**
 The options to use when generating a map snapshot.
 */
@property (nonatomic) MGLMapSnapshotOptions *options;

/**
 Indicates whether a snapshot is currently being generated.
 */
@property (nonatomic, readonly, getter=isLoading) BOOL loading;

@end

NS_ASSUME_NONNULL_END

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

001
017
018package org.apache.commons.codec;
019
020import java.util.Comparator;
021
022/**
023 * Compares Strings using a {@link StringEncoder}. This comparator is used to sort Strings by an encoding scheme such as
024 * Soundex, Metaphone, etc. This class can come in handy if one need to sort Strings by an encoded form of a name such
025 * as Soundex.
026 *
027 * <p>This class is immutable and thread-safe.</p>
028 *
029 * @version $Id: StringEncoderComparator.java 1468177 2013-04-15 18:35:15Z ggregory $
030 */
031@SuppressWarnings("rawtypes")
032// TODO ought to implement Comparator<String> but that's not possible whilst maintaining binary compatibility.
033public class StringEncoderComparator implements Comparator {
034
035    /**
036     * Internal encoder instance.
037     */
038    private final StringEncoder stringEncoder;
039
040    /**
041     * Constructs a new instance.
042     *
043     * @deprecated Creating an instance without a {@link StringEncoder} leads to a {@link NullPointerException}. Will be
044     *             removed in 2.0.
045     */
046    @Deprecated
047    public StringEncoderComparator() {
048        this.stringEncoder = null; // Trying to use this will cause things to break
049    }
050
051    /**
052     * Constructs a new instance with the given algorithm.
053     *
054     * @param stringEncoder
055     *            the StringEncoder used for comparisons.
056     */
057    public StringEncoderComparator(final StringEncoder stringEncoder) {
058        this.stringEncoder = stringEncoder;
059    }
060
061    /**
062     * Compares two strings based not on the strings themselves, but on an encoding of the two strings using the
063     * StringEncoder this Comparator was created with.
064     *
065     * If an {@link EncoderException} is encountered, return <code>0</code>.
066     *
067     * @param o1
068     *            the object to compare
069     * @param o2
070     *            the object to compare to
071     * @return the Comparable.compareTo() return code or 0 if an encoding error was caught.
072     * @see Comparable
073     */
074    @Override
075    public int compare(final Object o1, final Object o2) {
076
077        int compareCode = 0;
078
079        try {
080            @SuppressWarnings("unchecked") // May fail with CCE if encode returns something that is not Comparable
081            // However this was always the case.
082            final Comparable<Comparable<?>> s1 = (Comparable<Comparable<?>>) this.stringEncoder.encode(o1);
083            final Comparable<?> s2 = (Comparable<?>) this.stringEncoder.encode(o2);
084            compareCode = s1.compareTo(s2);
085        } catch (final EncoderException ee) {
086            compareCode = 0;
087        }
088        return compareCode;
089    }
090
091}


text:
package model

import com.byteslounge.slickrepo.meta.Keyed
import slick.jdbc.JdbcProfile

object ItemTable extends JdbcProfile {

  import api.{Table => SlickTable, _}

  val name = "ITEMS"

  /**
    * Defines entity fields for slick.
    */
  class ItemTable(tag: Tag) extends SlickTable[Item](tag, name) with Keyed[Int] {

    def id = column[Int]("ID", O.PrimaryKey, O.AutoInc)

    def description = column[String]("DESCRIPTION")

    override def * = (id.?, description).mapTo[Item]
  }

}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta name="robots" content="noindex">

        <title>File Steel/Database/IConnection.php | Steel 1.0</title>

        <link rel="stylesheet" href="resources/bootstrap.min.css?973e37a8502921d56bc02bb55321f45b072b6f71">
        <link rel="stylesheet" href="resources/style.css?49f43d3208c5d7e33fa16d36107a345bf11cc00d">

                    Steel 1.0

                    <form id="search" class="navbar-form navbar-left" role="search">
                        <input type="hidden" name="cx" value="">
                        <input type="hidden" name="ie" value="UTF-8">

                            <input type="text" name="q" class="search-query form-control" placeholder="Search">

                    </form>

                            Namespace

                            Class

Namespaces

                                Steel

                                        Database

                                        MVC

Classes

Steel\ArrayMethods

Steel\Database\Connection

Steel\MVC\MVCBundle

Steel\MVC\MVCIdentifier

Steel\Settings

Steel\Steel

Interfaces

Steel\Database\IConnection

Steel\IApplication

Steel\MVC\IController

Steel\MVC\IErrorController

Steel\MVC\IErrorModel

Steel\MVC\IModel

Steel\MVC\IView

 1 <?php
 2 namespace Steel\Database;
 3
 4 /**
 5  * Interface for Steel-compatible database connections.
 6  *
 7  * @since   1.0
 8  * @author  Eric Rabil <ericjrabil@gmail.com>
 9  */
10 interface IConnection {
11     public function __construct(\Steel\Steel $steel);
12     public function insert($table, $values = []);
13     public function select($table, $conditions = [], $columns = []);
14     public function update($table, $updates = [], $conditions = []);
15     public function update_all($table, $updates = []);
16     public function delete($table, $conditions = []);
17     public function truncate($table);
18     public function prepared($statement, $values);
19     public function query($query);
20     public function get_pdo();
21 }
22

                Steel 1.0 API documentation generated by ApiGen