hexsha stringlengths 40 40 | size int64 2 1.01M | content stringlengths 2 1.01M | avg_line_length float64 1.5 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
ac2505f59db85ea9d797282ded4fceba3b7fca05 | 410 | # encoding: utf-8
require_relative 'checker_transformer_base'
module Epuber
class Transformer < CheckerTransformerBase
require_relative 'transformer/text_transformer'
# @return [Hash<Symbol, Class>]
#
def self.map_source_type__class
{
:result_text_xhtml_string => TextTransformer,
... | 20.5 | 53 | 0.692683 |
ac820ecbb94e24df7d6aafac0c8bfb0ac4edbcdc | 173 | describe file('/etc/syslog.sumologic.pem') do
it { is_expected.not_to exist }
end
describe file('/etc/rsyslog.d/sumologic.conf') do
it { is_expected.not_to exist }
end
| 21.625 | 49 | 0.734104 |
91ccb32de234a33f7b91aabf6e29cb71fc2c8dc8 | 5,208 | require 'pathname'
Puppet::Type.newtype(:dsc_spuserprofileserviceapppermissions) do
require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'
@doc = %q{
The DSC SPUserProfileServiceAppPermissions resource... | 33.384615 | 144 | 0.690092 |
18e015cf2fcec18660a515dc4485251b79bbde60 | 49 | module NvdFeedApi
VERSION = '0.3.1'.freeze
end
| 12.25 | 26 | 0.714286 |
f8a056b5122fd62276d25fdc7c6c5987454adf2a | 1,761 | require 'spec_helper'
describe Runaround::MethodCall do
context 'struct members' do
subject { described_class.new }
it { is_expected.to respond_to :method }
it { is_expected.to respond_to :args }
it { is_expected.to respond_to :opts }
it { is_expected.to respond_to :block }
it { is_expected... | 24.458333 | 59 | 0.574106 |
b9a1e559d46e2e3244fdcb3a5081aa890d97a28d | 1,669 | require 'rbconfig'
require 'timeout'
allowed_failures = ENV['TEST_BUNDLED_GEMS_ALLOW_FAILURES'] || ''
allowed_failures = allowed_failures.split(',').reject(&:empty?)
rake = File.realpath("../../.bundle/bin/rake", __FILE__)
gem_dir = File.realpath('../../gems', __FILE__)
exit_code = 0
ruby = ENV['RUBY'] || RbConfig.ru... | 29.803571 | 114 | 0.641102 |
ed8af70b9206c243deafc0aa4c60cbd60237e031 | 678 | require 'yaml'
require 'sidekiq'
config_file = File.dirname(__FILE__) + '/../config.yml'
fail "Configuration file " + config_file + " missing!" unless File.exist?(config_file)
CONFIG = YAML.load_file(config_file)
redis_conn = proc {
Redis.new(
:driver => :hiredis,
:host => CONFIG['redis']['host'],
:port... | 24.214286 | 86 | 0.676991 |
91bdcec55a4d5f1268eac28bc05de38ee82cdf4b | 1,459 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-mediaco... | 26.527273 | 84 | 0.755312 |
0304c5612493dab74dd58c242de4f2b716e998ad | 9,468 | # frozen_string_literal: true
require "helper"
require "jobs/retry_job"
require "models/person"
require "minitest/mock"
class ExceptionsTest < ActiveSupport::TestCase
setup do
JobBuffer.clear
skip if adapter_skips_scheduling?(ActiveJob::Base.queue_adapter)
end
test "successfully retry job throwing exce... | 37.571429 | 147 | 0.721694 |
21e406100b5bfb4c6e507c7d3e5cb0127b5f7aa5 | 453 | # frozen_string_literal: true
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------... | 32.357143 | 79 | 0.604857 |
33b7ad205683fea785adbbd710dc102ef43b4936 | 59 | class Issue < ActiveRecord::Base
belongs_to :project
end
| 14.75 | 32 | 0.779661 |
e9fc6006c5fe137a42c55f6786d8dffb9e5df410 | 3,464 | require 'spec_helper_acceptance'
require 'yaml'
RUN_IN_PARALLEL = ENV.fetch('BEAKER_RUN_IN_PARALLEL', '')
.split(',').include?('tests')
test_name 'tpm2 class'
describe 'tpm2 class' do
let(:tpm2_abrmd2_hieradata) do
{
# Required to use the IBM simulator
'tpm2::tabrm_options' => ... | 30.121739 | 109 | 0.630774 |
260ab1aa54dcf27da5017e33b099b2b1624168a8 | 3,683 | class TestimonialsController < ApplicationController
before_filter :except => :index do |controller|
controller.ensure_logged_in t("layouts.notifications.you_must_log_in_to_give_feedback")
end
before_filter :ensure_authorized_to_give_feedback, :except => :index
before_filter :ensure_feedback_not_given, :e... | 35.757282 | 221 | 0.725224 |
21ced22c0458e4cd3a25345d1b8887619a172bdf | 582 | module Oauth
module Controller
module Helper
extend ActiveSupport::Concern
included do
helper_method :require_access_token
end
def require_access_token
if token && token.valid?
true
else
respond_to do |format|
format.html { he... | 20.785714 | 88 | 0.579038 |
f776421d4fd40ce124b0031fe488c19ab33d60dc | 202 | #
# Cookbook Name:: mchx_dk
# Recipe:: zero
#
# Copyright (c) 2016 The Authors, All Rights Reserved.
include_recipe 'mchx_dk::chef_dk'
include_recipe 'mchx_dk::installs'
include_recipe 'mchx_dk::user'
| 20.2 | 54 | 0.752475 |
6a3860210960548d7a1f4251156a682ddb5018a5 | 2,904 | # typed: false
# frozen_string_literal: true
require "test/support/fixtures/testball"
require "formula"
describe Formula do
describe "#uses_from_macos" do
before do
allow(OS).to receive(:mac?).and_return(false)
end
it "acts like #depends_on" do
f = formula "foo" do
url "foo-1.0"
... | 24.403361 | 69 | 0.580234 |
1159f04cd3ab683a6f4e7dbea8ecbe1c77da84b7 | 46,434 | require 'spec_helper'
require 'msf/core/payload_generator'
RSpec.describe Msf::PayloadGenerator do
include_context 'Msf::Simple::Framework#modules loading'
# let(:lhost) { "192.168.172.1"}
# let(:lport) { "8443" }
# let(:datastore) { { "LHOST" => lhost, "LPORT" => lport } }
# let(:add_code) { false }
# le... | 33.45389 | 183 | 0.554292 |
bf8cb08b59227519d9c79d273e0ce11bb66c2750 | 3,767 | require 'spec_helper_acceptance'
test_name 'install tpm simulators'
describe 'install tpm_simulators' do
# Implement any workarounds that are needed to run as service
def implement_workarounds(hirs_host)
# workaround for dbus config file mismatch error:
# "dbus[562]: [system] Unable to reload configurati... | 38.050505 | 102 | 0.701088 |
5d5db8917a00a345ca4cee0d465960becf101630 | 1,802 | class ViewCell
class << self
# load cell based on a name, pass context and optional vars
# ViewCell.get(:user, self) -> UserCell.new(self)
def get parent, name, vars={}
('%sCell' % name.to_s.classify)
.constantize
.new parent, vars
end
# delegate current scope methods to par... | 26.115942 | 76 | 0.577691 |
e86efd6d2654fb4a19477a2516f37cb3f3886c94 | 3,551 | # frozen_string_literal: true
module RuboCop
module Cop
module Rails
# This cop checks dynamic `find_by_*` methods.
# Use `find_by` instead of dynamic method.
# See. https://rails.rubystyle.guide#find_by
#
# @example
# # bad
# User.find_by_name(name)
# User.f... | 30.09322 | 80 | 0.595044 |
ff900b1c2fbad94eeb3ba722499b6e246015ae76 | 667 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = "hyperspace_jekyll_theme"
spec.version = "0.1.1"
spec.authors = ["Andrew Banchich"]
spec.email = ["andrewbanchich@gmail.com"]
spec.summary = %q{A Jekyll version of the "Hyperspace" theme by HTML5 UP.}
spec.home... | 37.055556 | 132 | 0.643178 |
87af10cd05091697430f1202118fa3224a466536 | 1,473 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Myapp
class Application < Rails::Application
# Settings in config/environments/* take p... | 52.607143 | 244 | 0.704005 |
08124fc729521b041741ea1864eb51f04196ca63 | 776 | workers = Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
require "active_record"
ActiveRecord... | 29.846154 | 105 | 0.731959 |
f8a6a4dcbaf9d50ef2b88f229e77d09e93d0fd67 | 1,965 | # frozen_string_literal: true
class ThinkingSphinx::IndexSet
include Enumerable
def self.reference_name(klass)
@cached_results ||= {}
@cached_results[klass.name] ||= klass.name.underscore.to_sym
end
delegate :each, :empty?, :to => :indices
def initialize(options = {}, configuration = nil)
@opt... | 21.129032 | 76 | 0.68855 |
b9c9208eb9a4e7593f424b1273b6079e57505dff | 260 | class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :provider
t.string :uid
t.string :name
t.string :oauth_token
t.datetime :oauth_expires_at
t.timestamps
end
end
end
| 18.571429 | 48 | 0.642308 |
2641ce8a52c54aa19c03fd44803e7b484860561f | 1,083 | module PurchaseRequestsHelper
def i18n_pr_state(state)
case state
when 'pending'
t('purchase_request.pending')
when 'accepted'
t('purchase_request.not_ordered')
when 'rejected'
t('purchase_request.reject')
when 'ordered'
t('purchase_request.ordered')
end
end
def ca... | 30.083333 | 105 | 0.663897 |
08b6d66ef8fd1e79eab447101cdf3a614b1c64d4 | 134 | require 'spec_helper'
describe SlackGoogleBot do
it 'has a version' do
expect(SlackGoogleBot::VERSION).to_not be nil
end
end
| 16.75 | 49 | 0.753731 |
87d1b085055190cf982ce66bc103e495b19239f6 | 749 | name "poppler"
default_version "0.24.5"
version "0.24.5" do
source md5: "334f2ac95cc8039f2a57fe63e4a81c69"
end
dependency "fontconfig"
dependency "zlib"
dependency "libxml2"
dependency "curl"
dependency "libtiff"
dependency "libjpeg"
dependency "libpng"
dependency "lcms2"
dependency "poppler-data"
source :url => "... | 20.243243 | 73 | 0.70227 |
e990896c872bbabfa8ed37758b22a18b00d99d17 | 545 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, '../../package.json')))
Pod::Spec.new do |s|
s.name = package['name']
s.version = package['version']
s.summary = package['description']
s.authors = { "yiyi" => "1710797241@qq.com" }
s.homepage = package['repository'... | 24.772727 | 73 | 0.572477 |
7978d07256e018fdab8e021a5b2445521c4f5865 | 67,674 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::S3
class Object
extend Aws::Deprecations
# @overload ... | 42.007449 | 169 | 0.658702 |
d5dfd0f253a6b29d0a115b12fe345ae0958eb38b | 728 | # frozen_string_literal: true
module Inferno
module USCore311ProfileDefinitions
class USCore311GoalSequenceDefinitions
MUST_SUPPORTS = {
extensions: [],
slices: [
{
name: 'Goal.target.due[x]:dueDate',
path: 'target.due',
discriminator: {
... | 19.157895 | 47 | 0.42033 |
bb47c26306b6039d779fc4f802016001575d129d | 2,644 | #
# The MIT License (MIT)
#
# Copyright (c) 2014 Wynand Pieterse
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, co... | 50.846154 | 158 | 0.760212 |
1133d5672235d5921904b998d5b0517f4d7c37ef | 1,664 | #
# Be sure to run `pod lib lint FZHExtension.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'FZHExt... | 37.818182 | 110 | 0.643029 |
7aa2120918f17b13c39bc132412cb0f9bd1c1552 | 266 | require 'bundler/setup'
require 'aasm-diagram'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
| 22.166667 | 63 | 0.744361 |
1c4baeca1c76a1addff5da925cb06dc443b94a8b | 171 | class DropContactDetails < ActiveRecord::Migration[5.2]
def up
drop_table :contact_details
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| 17.1 | 55 | 0.760234 |
ed161200ede0ac43743abcc00754b6a7ea283a4a | 2,622 | class Acme::Client::Error < StandardError
class Timeout < Acme::Client::Error; end
class ClientError < Acme::Client::Error; end
class InvalidDirectory < ClientError; end
class UnsupportedOperation < ClientError; end
class UnsupportedChallengeType < ClientError; end
class NotFound < ClientError; end
class... | 46 | 84 | 0.757437 |
28962a9c8eef9122f2fd27ed2834df1286547b7b | 659 | module Ranker::Strategies
##
# Ranks rankables according to: http://en.wikipedia.org/wiki/Ranking#Modified_competition_ranking_.28.221334.22_ranking.29
#
class ModifiedCompetition < Strategy
# Methods:
def execute
rank = 0
scores_unique_sorted.each_with_index { |score, index|
rank... | 24.407407 | 124 | 0.664643 |
f792f3b3bdb4e041345d9f89cdea1798ff4e731e | 2,004 | module Keycloak
class Middleware
def initialize(app)
@app = app
end
def call(env)
if Keycloak.config.server_url.present?
authenticate(env)
else
@app.call(env)
end
end
def authenticate(env)
method = env["REQUEST_METHOD"]
path = env["PATH_INFO... | 28.628571 | 96 | 0.671657 |
280ea0ef98a90e9557f0e1d4defdc961003cc16f | 298 | class YoutubeVideo < Video
self.table_name = "asset_host_core_youtube_videos"
def attrs
{
"data-assethost" => "YoutubeVideo",
"data-ah-videoid" => self.videoid
}
end
def as_json
{
:class => "YoutubeVideo",
:videoid => self.videoid
}
end
end
| 16.555556 | 52 | 0.59396 |
e261739e64ce158b885c4689aae440fc78849881 | 652 | asset_directory = File.expand_path('../../../../assets', __FILE__)
asset_file_paths = Dir.glob(File.join(asset_directory, 'message-bus.js'))
asset_file_names = asset_file_paths.map{|e| File.basename(e) }
describe asset_file_names do
it 'should contain .js files' do
expect(asset_file_names).to include('message-bu... | 34.315789 | 73 | 0.708589 |
d5395cb80c0e07c50206db561aeab44a95c08e44 | 293 | Binda::Api::Types::SelectionType = GraphQL::ObjectType.define do
name 'Binda_Selection'
field :value, types.String do
resolve ->(obj, args, ctx) do
obj[:value]
end
end
field :label, types.String do
resolve ->(obj, args, ctx) do
obj[:label]
end
end
end
| 17.235294 | 64 | 0.631399 |
e83883217c3e377ac63d9502f5b7f7b6a790f02d | 1,347 | module Brakeman
ASTFile = Struct.new(:path, :ast)
# This class handles reading and parsing files.
class FileParser
attr_reader :file_list
def initialize tracker
@tracker = tracker
@timeout = @tracker.options[:parser_timeout]
@app_tree = @tracker.app_tree
@file_list = {}
end
... | 25.415094 | 149 | 0.599852 |
9169b811e0282bbbbe058a52d09a40aa30b3f6af | 1,019 | namespace :import do
require 'net/http'
desc "Runs a full import of companies, engines, genres, platforms, series, games, and optionally covers."
task :full, [:include_covers] => :environment do |_task, args|
args.with_defaults(include_covers: false)
puts 'Running a full import...'
import_tasks = [
... | 30.878788 | 145 | 0.657507 |
1106d99013b2fe3d0b2c9d8c065458c452e7f516 | 174 | class ChangeApplicationsDocumentToApplicationDocuments < ActiveRecord::Migration[5.1]
def change
rename_table :applications_documents, :application_documents
end
end
| 29 | 85 | 0.83908 |
87f3d73765ea70e9d771b300396ebcb459e09b1f | 231 | class CreateSubmissions < ActiveRecord::Migration
def change
create_table :submissions do |t|
t.integer :student_number
t.string :site_url
t.integer :points
t.timestamps null: false
end
end
end
| 19.25 | 49 | 0.683983 |
4a5c6352ba4bf99b5623d45b2f1dafb1fd0dbcda | 372 | =begin
An example of generating swagger via gRPC ecosystem.
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0
Contact: none@example.com
Generated by: https://github.com/openapitools/openapi-generator.git
=end
class V1... | 23.25 | 106 | 0.817204 |
1a537e7e4e87e67b6579ab590da9c2c01f3afbbd | 1,767 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | 47.756757 | 104 | 0.703452 |
28992797bb2017d69361784368b67f809ce7a458 | 15,931 | require 'pathname'
Puppet::Type.newtype(:dsc_securitysetting) do
require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'
@doc = %q{
The DSC SecuritySetting resource type.
Automatically generated fro... | 34.408207 | 871 | 0.661038 |
38369046bcd0d244478a055c7efba6a867b1dd9c | 442 | class ApplicationController < ActionController::Base
helper_method :current_user
helper_method :logged_in?
before_action :authenticated_user
require 'little-recipe-parser'
def current_user
@current_user ||= User.find_by(id: session[:user_id]) if session[:user_id]
end
def logged_in... | 21.047619 | 82 | 0.70362 |
33c57795471aa2b5dc0177a4b8beb26b2faa3367 | 715 | Pod::Spec.new do |s|
s.name = 'AWSTranscribe'
s.version = '2.9.4'
s.summary = 'Amazon Web Services SDK for iOS.'
s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
s.homepage = 'htt... | 39.722222 | 157 | 0.613986 |
61516d7f5410bddd89808c520fda145d108347ba | 3,668 | class MergeCriteriaTables < ActiveRecord::Migration[6.0]
def change
# Create new criteria table
create_table :criteria do |t|
t.string 'name', null: false
t.string 'type', null: false
t.text 'description', null: false, default: ''
t.integer 'position', null: false
t.decimal 'max_... | 44.192771 | 112 | 0.708561 |
f8bfd5c9e26c8475aac69acfd9e323288bbb62e7 | 2,011 | # Extending QualityReport so that updating a single patient can deal with
# OID dictionaries
module QME
class QualityReport
field :aggregate_result, type: Integer
# Removes the cached results for the patient with the supplied id and
# recalculates as necessary
def self.update_patient_results(id)
... | 44.688889 | 112 | 0.685728 |
f8c6b9fa07d68efbd02d33e8913be3ebf3cd4883 | 960 | # encoding: utf-8
module Epuber
class Compiler
module FileTypes
require_relative 'generated_file'
class NavFile < GeneratedFile
# @return [Epuber::Version]
#
attr_reader :epub_version
# @param [Epuber::Version] epub_version
#
def initialize(epub_ver... | 22.325581 | 67 | 0.517708 |
ff4788b52c26bf56f3b7e58abac1cd3acb0a79a1 | 515 | #!/usr/bin/env ruby
require "pathname"
$:.unshift File.expand_path("./lib")
require "basekit"
client = BaseKit::Client.new({
:api_base_url => "http://rest.basekit.almost",
:consumer_key => "",
:consumer_secret => "",
:access_token => "",
:access_secret => "",
})
client.post("/users", {
:brandR... | 20.6 | 51 | 0.551456 |
b983e4d0b8056cb67f0f8af56480c4709f42649d | 8,342 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product... | 29.792857 | 210 | 0.61508 |
39a51aeab4c07820f7675fdd1b0fd19071b4be6e | 1,307 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 36.305556 | 86 | 0.729916 |
bb0104012ed56c234726c4eadc81d409e73d58ae | 452 | # frozen_string_literal: true
require_relative '../../test_helper'
require_relative '../../support/utils/api_controller_test_utils'
describe API::V1::CitiesController do
include API::ControllerTestUtils
before { sign_in users(:researcher) }
it { api_get_works_for :index }
it { has_no_route_for :get, :show }... | 26.588235 | 64 | 0.736726 |
288123f4e170b4ace437bce745097e3b1b6ece67 | 2,124 | require 'rails_helper'
RSpec.describe PlacesController, :type => :controller do
def valid_attributes
place = FactoryGirl.build(:place)
{name: place.name}
end
describe "GET 'index'" do
before(:each) do
get :index
end
it "returns http success" do
expect(response).to be_success
e... | 22.83871 | 80 | 0.577213 |
4a79dc3b8e3ef2434c8a18e6aa3757cba4d62312 | 2,406 | class Dafny < Formula
desc "Verification-aware programming language"
homepage "https://github.com/dafny-lang/dafny/blob/master/README.md"
url "https://github.com/dafny-lang/dafny/archive/v3.4.1.tar.gz"
sha256 "75c86d22ed9b9b7b88b078e2f27cca6b408070dd95e865e3e57f2dc3c3cd0bbe"
license "MIT"
livecheck do
... | 34.869565 | 122 | 0.691189 |
62b9d201c18e13b8b4e615db842152fb980ef947 | 128 | class AllowImagesPostIdToBeNull < ActiveRecord::Migration
def change
change_column_null :images, :post_id, true
end
end
| 21.333333 | 57 | 0.789063 |
1a61341f52327f1ba14ea5905b3a7e200548896f | 1,735 | class Miller < Formula
desc "Like sed, awk, cut, join & sort for name-indexed data such as CSV"
homepage "https://github.com/johnkerl/miller"
url "https://github.com/johnkerl/miller/releases/download/v5.9.1/mlr-5.9.1.tar.gz"
sha256 "fb531efe5759b99935ce420c8ad763099cf11c2db8d32e8524753f4271454b57"
license "BS... | 36.914894 | 99 | 0.712392 |
33db91fee94e394a564647ee2677f9b61bd5f087 | 1,456 | {
matrix_id: '2094',
name: 'n3c5-b6',
group: 'JGD_Homology',
description: 'Simplicial complexes from Homology from Volkmar Welker.',
author: 'V. Welker',
editor: 'J.-G. Dumas',
date: '2008',
kind: 'combinatorial problem',
problem_2D_or_3D: '0',
num_rows: '120',
num_cols: '210... | 33.860465 | 75 | 0.611264 |
26dfe68cd010cf76f572ae9ad30f0bae93fd1357 | 1,306 | module Groonga
class Command
@@classes = {}
class << self
def register_class(name, klass)
@@classes[name] = klass
end
def find_class(name)
@@classes[name]
end
end
private
def context
@context ||= Context.instance
end
def writer
@writer... | 20.092308 | 74 | 0.557427 |
f8a851a7b70b5cb3a1f6b3e0bc264c98ff66cc8e | 119 | class AddTimeToLessons < ActiveRecord::Migration[5.1]
def change
add_column :lessons, :time, :datetime
end
end
| 19.833333 | 53 | 0.739496 |
f8306555a2aeae37110959ff4c5b5a40249f0fc8 | 356 | module Findable
extend ActiveSupport::Concern
module ClassMethods
def find_by_id(id)
query = ::IdQuery.new id
search_options = {
index: index_names,
body: query.generate_search_body,
}
results = ES.client.search search_options
hits = results['hits']
hits.de... | 19.777778 | 47 | 0.648876 |
9116d711b36c2b2b4adc1bbe90b61302d3c516ad | 1,426 | class Tomcat < Formula
homepage "https://tomcat.apache.org/"
url "https://www.apache.org/dyn/closer.cgi?path=tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz"
mirror "https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz"
sha256 "c98b19a1edaaef2859991f304d0ec8f29c5ccacc6... | 40.742857 | 118 | 0.753156 |
5d9386b257b6546efc087dc9347167bfa3b7a289 | 1,051 | class Sshuttle < Formula
include Language::Python::Virtualenv
desc "Proxy server that works as a poor man's VPN"
homepage "https://github.com/sshuttle/sshuttle"
url "https://github.com/sshuttle/sshuttle.git",
tag: "v1.0.4",
revision: "abb48f199656f776be0f05601ff5746f36df3370"
license "LGPL-2... | 31.848485 | 94 | 0.758325 |
e86d3ea198cfef6e7516b5558093fe7432ae568e | 1,129 | local_cache [@posts.map(&:id), params[:verbose]], expires: 1.hour do
atom_feed :root_url => url_for(:controller => :post, :action => :index, :tags => params[:tags], :only_path => false) do |feed|
feed.title CONFIG['app_name']
feed.updated @posts[0].created_at if @posts.length > 0
@posts.each do |post|
... | 53.761905 | 142 | 0.621789 |
6a969c9e751d2854e5b714bf678423e99e474f85 | 191 | RSpec.describe JbaezViewTool do
it "has a version number" do
expect(JbaezViewTool::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 19.1 | 48 | 0.717277 |
abc086afb2b9de4fda74d7567f043672bb314a4b | 500 | require 'spec_helper'
describe 'swift::proxy::healthcheck' do
let :facts do
{}
end
let :pre_condition do
'class { "concat::setup": }
concat { "/etc/swift/proxy-server.conf": }'
end
let :fragment_file do
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/25_swift_healthcheck"
... | 22.727273 | 88 | 0.708 |
e2da7bd23a333a571265f67f84fa4b2d761811fb | 4,030 | describe PaynetApi::ReportRequest do
let(:test_id_from_paynet) { "59206906" }
let(:request) { PaynetApi::ReportRequest.new(paynet_id: test_id_from_paynet, payment_comprehensive: "1") }
let(:request_with_options) { PaynetApi::ReportRequest.new(
paynet_id: test_id_from_paynet,
payment_comprehensive: "1",
... | 41.979167 | 566 | 0.685112 |
33c85a5e96480d1656144d58d702ec127d19a8cd | 7,219 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Labservices::Mgmt::V2018_10_15
module Models
#
# Represents an image from the Azure Marketplace
#
class GalleryImage < Resource
include... | 31.251082 | 78 | 0.462252 |
f81ba52b7ea4660c73380e5bdaf5aa386c376c1f | 26 | module FixturesHelper
end
| 8.666667 | 21 | 0.884615 |
f891346853bb82b570daf1e8481a3a97b378d758 | 565 | Pod::Spec.new do |s|
s.name = 'NanoStore'
s.version = '2.5.3'
s.license = 'BSD'
s.summary = 'NanoStore is an open source, lightweight schema-less local key-value document store written in Objective-C for Mac OS X and iOS.'
s.homepage = 'https://github.com/tciuro/NanoStore'
s.... | 40.357143 | 150 | 0.589381 |
03eb7462ece037c95983a47d363881ec8df1e287 | 887 | # frozen_string_literal: true
class AuditEvent < ApplicationRecord
include CreatedAtFilterable
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
belongs_to :user, foreign_key: :author_id
validates :author_id, presence: true
validates :entity_id, presence: true
validates :entity_type, ... | 25.342857 | 77 | 0.739572 |
1ad14f2f569d91295031d2f4e73aef0020037bf8 | 360 | cask "font-amstelvar-alpha" do
version :latest
sha256 :no_check
# github.com/google/fonts/ was verified as official when first introduced to the cask
url "https://github.com/google/fonts/raw/master/ofl/amstelvaralpha/AmstelvarAlpha-VF.ttf"
name "Amstelvar Alpha"
homepage "https://fonts.google.com/earlyacce... | 30 | 91 | 0.763889 |
f866bc29e693f7205b85e86701194e8944e729ff | 1,340 | require 'rails_helper'
RSpec.describe User, type: :model do
describe 'Validations' do
it do
should validate_presence_of(:username)
.with_message('Username cannot be blank')
end
it do
should validate_length_of(:username)
.is_at_most(10)
.with_message('Maximum allowed us... | 31.162791 | 108 | 0.695522 |
e974dc519d69ca552fd6b2bafa223331252efb86 | 1,658 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Redis::TraceChunks do
let(:instance_specific_config_file) { "config/redis.trace_chunks.yml" }
let(:environment_config_file_name) { "GITLAB_REDIS_TRACE_CHUNKS_CONFIG_FILE" }
let(:shared_state_config_file) { nil }
before do
allow(Gi... | 29.607143 | 104 | 0.701448 |
bf5b392fa1cc8058f1d752851eac06e0539d2bf4 | 753 | # frozen_string_literal: true
require "test_helper"
class ReplyToComponentTest < ViewComponent::TestCase
setup do
@topic = create(:topic)
@reply_to = create(:reply, topic: @topic)
@reply = create(:reply, reply_to: @reply_to, topic: @topic)
end
test "normal" do
component = ReplyToComponent.new(r... | 26.892857 | 91 | 0.699867 |
33bf1372adc2bd616af6ced283051516a092af7e | 942 | module EventStore
module EntityStore
module Controls
module Entity
def self.example
Current.example
end
class Example
include Schema::DataStructure
attribute :sum
def ==(other)
other.is_a?(self.class) && other.sum == sum
... | 18.470588 | 75 | 0.488323 |
f86eeafd6b6af5ffc0fd28c0b9b157d979c81e28 | 1,117 | Gem::Specification.new do |s|
s.name = 'cached_record'
s.version = '0.0.1'
s.date = '2008-10-27'
s.summary = "memcached caching for active record"
#s.description = ""
s.authors = ['Kacper Cieśla']
s.email = 'kacper.ciesla@gmail.com'
s.homepage = ''
s.has_rdoc = true
s.rdoc_options = ['--main', 'R... | 53.190476 | 355 | 0.747538 |
f72b7716b26797db89e786bd818b2bfcf934e064 | 1,103 | # spark_restart - Restart the Spark components
#
# This recipe restarts Spark on the server. It will start the
# appropriate services, depending on whether this is a designated
# Spark master.
Chef::Log.info("Running #{node['app_name']}::spark_restart")
require File.expand_path("../spark_helper.rb", __FILE__)
# As... | 32.441176 | 123 | 0.75884 |
91ea1756c4396a854e24bfab0388b67446171485 | 4,558 |
module ActiveRecord
module Batches
# Looping through a collection of records from the database
# (using the +all+ method, for example) is very inefficient
# since it will try to instantiate all the objects at once.
#
# In that case, batch processing methods allow you to work
# with the record... | 36.464 | 122 | 0.652699 |
bb9511a33713f1fd7b545cfd79201a453e723fc4 | 248 | class ErrorMessage < ActiveRecord::Base
belongs_to :user
validates :message, :fix, :image, presence: true
has_attached_file :image, styles: { :medium => "400x400#" }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
end
| 27.555556 | 72 | 0.741935 |
3977b137f7766e0242dd7bbf8896f4c90fa3f1e9 | 6,836 | # frozen_string_literal: true
require File.expand_path(File.dirname(__FILE__) + '/../rails_helper')
require File.expand_path(File.dirname(__FILE__) + '/../arp_spec_helper')
describe AccountsController do
before(:context) do
@user = create_user!
end
describe AccountsController, 'during account creation' do
... | 30.792793 | 92 | 0.619661 |
9192890bb9e3aad937b5432728f3785d29aa59af | 3,199 | require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
class PageArticlesRoutesTest < ActionController::TestCase
tests ArticlesController
with_common :a_page, :an_article
paths = %W( /pages/1
/pages/1/comments.atom
/pages/1/articles/an-article
/pages/1/... | 43.821918 | 125 | 0.610191 |
ac1ee50e331bb76bf050e281ff20ad3f93d0aa35 | 922 | cask "hstracker" do
version "1.7.8"
sha256 "152b199825c7049435a51421d0871507cfa30507316db37aa31c2be1639e427a"
url "https://github.com/HearthSim/HSTracker/releases/download/#{version}/HSTracker.app.zip",
verified: "github.com/HearthSim/HSTracker/"
appcast "https://github.com/HearthSim/HSTracker/releases.a... | 36.88 | 94 | 0.74295 |
4ad75e8b7aa0c4f20a5bed3ed21103dc06b5033b | 1,060 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | 40.769231 | 86 | 0.757547 |
6abb75641a5edf7e21cef05e88026361d392e3b5 | 1,422 | require File.dirname(__FILE__) + '/../test_helper'
require 'document_controller'
# Re-raise errors caught by the controller.
class DocumentController; def rescue_action(e) raise e end; end
class DocumentControllerTest < ActionController::TestCase
fixtures :documents
def setup
@controller = DocumentControll... | 36.461538 | 126 | 0.71519 |
870ccfa576e19d26ecc211f39cb001b8a193926a | 1,793 | module MRuby
module LoadGems
def gembox(gemboxfile)
gembox = File.expand_path("#{gemboxfile}.gembox", "#{MRUBY_ROOT}/mrbgems")
fail "Can't find gembox '#{gembox}'" unless File.exists?(gembox)
GemBox.config = self
instance_eval File.read(gembox)
end
def gem(gemdir, &block)
ca... | 28.919355 | 90 | 0.600112 |
bb8f88398f2da01fbc9061311999c0d286ff2c9b | 4,563 | require 'opal/path_reader'
require 'opal/builder_processors'
require 'opal/paths'
require 'set'
module Opal
class Builder
include BuilderProcessors
class MissingRequire < LoadError
end
def initialize(options = nil)
(options || {}).each_pair do |k,v|
public_send("#{k}=", v)
end
... | 28.166667 | 127 | 0.633136 |
283fb834930631c95a062576a7c4de095fecf13b | 1,102 | def get_randomness(args)
args.state.upper_height ||= rand(310)
args.state.lower_height ||= 720 - args.state.upper_height
end
def jump(args)
args.state.player_accel = 10
end
def gravity(args)
args.state.player_accel = args.state.player_accel - args.state.gravity_coeff
end
def move_player(args)
args.state.pla... | 25.045455 | 78 | 0.717786 |
611dd437adc1c7d6ce0080bfa4e1a31be36d3364 | 3,735 | ##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
in... | 23.639241 | 89 | 0.635341 |
ede6c8d58d460f636df94d1ef20057c11dd150ff | 822 | require 'xcodeproj/scheme/xml_element_wrapper'
module Xcodeproj
class XCScheme
# This abstract class aims to be the base class for every XxxAction class
# that have a #build_configuration attribute
#
class AbstractSchemeAction < XMLElementWrapper
# @return [String]
# The build con... | 30.444444 | 77 | 0.663017 |
ff3edc0656ed7afa9807c9603af95c230cceeec7 | 315 | require "algebra"
P = MPolynomial(Rational)
x, y, z = P.vars "xyz"
f1 = x**2 + y**2 + z**2 -1
f2 = x**2 + z**2 - y
f3 = x - z
coeff, basis = Groebner.basis_coeff([f1, f2, f3])
basis.each_with_index do |b, i|
p [coeff[i].inner_product([f1, f2, f3]), b]
p coeff[i].inner_product([f1, f2, f3]) == b #=> true
end
| 22.5 | 54 | 0.587302 |
875b0e98a2bc5411c5d17db0dba05b8d69ce2d42 | 7,439 | require "formula"
require "compilers"
# Homebrew extends Ruby's `ENV` to make our code more readable.
# Implemented in {SharedEnvExtension} and either {Superenv} or
# {Stdenv} (depending on the build mode).
# @see Superenv
# @see Stdenv
# @see http://www.rubydoc.info/stdlib/Env Ruby's ENV API
module SharedEnvExtension... | 24.470395 | 107 | 0.655061 |
03ea441cb4450488d6c5093eeb66acd656e134b3 | 660 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module ReviewApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails... | 33 | 82 | 0.765152 |
ab92eee55eff30cbea9bea83472ac6e57b93fd92 | 5,368 | require 'etl/version'
require 'etl/helpers'
require 'logger'
require 'date'
require 'time'
class ETL
include Helpers
attr_accessor :description
attr_accessor :connection
attr_reader :logger
ORDERED_ETL_OPERATIONS = [
:ensure_destination,
:before_etl,
:etl,
:after_etl
]
ITERATOR_OPERA... | 24.289593 | 157 | 0.621461 |
621635ce3e6771479cc806e7562fbab483684544 | 379 | RSpec.describe SaferFloats do
it "raises an exception when floating point numbers are compared for equality" do
expect{
0.1 + 0.2 == 0.3
}.to raise_exception(SaferFloats::Error)
end
it "raises an exception when floating point numbers are compared for inequality" do
expect{
0.1 + 0.2 != 0... | 23.6875 | 85 | 0.688654 |
bfa7c982aa1e87f8acdfdaa4c3615bba6437be91 | 5,042 | # Copyright (c) 2010, patrickHVE@googlemail.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of ... | 33.838926 | 136 | 0.695954 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.