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
e2d00029e63b41088ad5b6660a2bdd3a49c43fcb
65
module ActiveStorage Service::ImgurService = Imgur::Service end
21.666667
40
0.815385
b93309cf833f940ef5df694f24b6071ee8fd3abc
2,886
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::CDN::Mgmt::V2020_09_01 module Models # # Result of the request to list endpoints. It contains a list of endpoint # objects and a...
28.294118
80
0.524602
2642fbd1fdcccd2801c288bca074a3be8cc2f5e9
2,428
require 'helper' describe "watch expression" do # Custom eval that will: # 1) Create an instance of pry that can use for multiple calls # 2) Exercise the after_eval hook # 3) Return the output def eval(expr) output = @tester.eval expr @tester.pry.hooks.exec_hook :after_eval, nil, @tester.pry out...
20.233333
81
0.574135
91ee2772700264a089400ec1df4de4954b23499a
5,662
require_relative '../../models/game' require_relative '../../models/player' require_relative '../../models/board' RSpec.describe Board do let(:x_marker) { "X" } let(:o_marker) { "O" } let(:three_in_a_row_board) { [nil,nil,nil,nil,o_marker,o_marker,x_marker,x_marker,x_marker] } let(:three_vertical_board) { [n...
31.631285
111
0.665666
d5d0a288755e472415c449fedea67825c57c578b
5,678
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper") describe MetricFu::Grapher do describe "require_graphing_gem" do it "should give a warning if trying to use gchart but gem is not installed" do MetricFu::Configuration.run {|config| config.graph_engine = :gchart} MetricFu::Grapher...
36.165605
86
0.644241
d5c96278f1b4ec295db66b30ef1ddd1d70fa7994
1,029
module Arcade # Arcade::Init.connect environment # -------------------------------- # initializes the database connection # and returns the active database handle # # The database cannot switched later # # # Arcade::Init.db # -------------- # returns an instance of the database handle # cl...
20.176471
47
0.558795
017b7a0a5fb960b5f2ac6bb681ff4c7766f32797
2,549
class Music::DjEventsController < ApplicationController include ErrorHelper before_action :authenticate_user!, except: [:index, :show] before_action :authenticate_admin!, except: [:index, :show] # GET /music/dj # GET /music/dj.json # GET /music/dj.xml def index Project.hit 19 @dj_events = DjEven...
24.27619
96
0.641428
1a48b62b89996c8406da79b99c32b5c139fa06c9
3,054
class Shape < ActiveRecord::Base extend IsDateable include KmapsEngine::IsNotable include KmapsEngine::IsCitable belongs_to :feature, foreign_key: 'fid', primary_key: 'fid', touch: true # after_save { |record| record.feature.touch if !record.feature.nil? } # after_destroy { |record| record.feature.tou...
26.789474
124
0.666667
7aea89cb8d7da75f68a0d348d3ff3b20fca06715
1,175
require 'spec_helper_acceptance' # Ensure Password expiration is 365 days or less - Section 5.4.1.1 # Ensure minimum days between password changes is 7 or more - Section 5.4.1.2 # Ensure Pasword Expiration warning days is 7 or more - Section 5.4.1.3 describe file('/etc/login.defs') do it { is_expected.to b...
34.558824
79
0.680851
1cf074e9f3e5bd641047274027d643f7bfef1fd2
96
class TrustedMachineSerializer < ActiveModel::Serializer attributes :id, :checksum, :info end
24
56
0.802083
aca7bb7bffd3a15d54ca5bfd62e61524f5d5ef7f
974
=begin #Xero Projects API #This is the Xero Projects API The version of the OpenAPI document: 2.3.2 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'time' require 'date' module XeroRuby::Projects class ChargeType TIME = "TIME".freeze FIXED ...
24.974359
92
0.700205
1a12b4dffd73f2b40d50fa06ff009983ac25782e
3,076
# frozen_string_literal: true module Reporting class Kpi def student_funnel_goal @student_funnel_goal ||= { total: Users::Student.count, confirmed: Users::Student.where.not(confirmed_at: nil).count } end def school_manager_funnel_goal @school_manager_funnel_goal ||= { ...
36.619048
125
0.606632
3929bf9e92ada15e7487d67cf587923e4417edca
2,724
# frozen_string_literal: true describe "POST /v1/me/reviews" do describe do let(:user) { create(:user, :with_profile, :with_setting) } let(:application) { create(:oauth_application, owner: user) } let(:access_token) { create(:oauth_access_token, application: application) } let(:work) { create(:work, ...
32.047059
80
0.64464
390085afdf6335b8ff2075633b4093b3ab8eb6ad
4,552
class Khal < Formula include Language::Python::Virtualenv desc "CLI calendar application" homepage "https://lostpackets.de/khal/" url "https://files.pythonhosted.org/packages/f2/7d/c7d88bf11e6e62c5671d7b89fbc6dd7ce67d09a79ab8951ed6726791cc48/khal-0.10.3.tar.gz" sha256 "2fdd8fc14fe597e5a7d6e9c63c7868d960b4ed0...
41.009009
145
0.78471
283bb77d745b9f7c717b5c331fa8d0cca54951ce
12,439
Given(/^the admin user is logged in$/) do LoginPage.new.visit_page(new_user_session_path).and.login_with_credentials User.all.third.username, UserTestHelper::DEFAULT_PASSWORD end Given(/^the user is a player of the first game$/) do user = UserTestHelper.create_or_find_user character = CharacterTestHelper.create_...
38.273846
137
0.780609
032c2e7861391d8c481b63c4f55fb6051ef1beab
204
require "spec_helper" RSpec.describe Unleash do it "has a version number" do expect(Unleash::VERSION).not_to be nil end it "does something useful" do expect(false).to eq(false) end end
15.692308
42
0.705882
bf19cdb748de054a5a968dbffc2f0143f2809580
882
module Releasecop class Checker attr_accessor :name, :envs def initialize(name, envs) self.name = name self.envs = envs end def check Dir.chdir(CONFIG_DIR) do `git clone #{envs.first['git']} --bare #{name} > /dev/null 2>&1` Dir.chdir(name) do envs.each do...
22.05
74
0.547619
bf699ce347c1a4bbae946b02ab60deb974e74cea
1,864
# # Be sure to run `pod lib lint OnebyteSwiftNetworkCycle.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 http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name ...
45.463415
225
0.694206
6155c2b9ee6744ed86bbd658cda9cc920321ecfd
13,458
require_relative "analyzer" class CellSeg include MongoMapper::Document include DataUtilities safe timestamps! after_create :hpf_id_create, :case_id_create belongs_to :case_data key :hpf_id, String key :case_id, String #matches in table key :category_region_id, Integer key :cell_density_per_megap...
56.546218
84
0.881855
0330442b91774d108e0a4441f8729ea9fe34df78
780
module FbApi::AccountLink def account_link @message.merge!( message: { attachment: { type: 'template', payload: { template_type: 'generic', elements: [{ title: 'Привіт, мене звати Драйдер, а вас як ?', imag...
30
143
0.433333
016761620c018aad000f4403d7dbf8bb790137b6
479
class MavenShell < Formula desc "Shell for Maven" homepage "http://shell.sonatype.org/" url "https://search.maven.org/remotecontent?filepath=org/sonatype/maven/shell/dist/mvnsh-assembly/1.1.0/mvnsh-assembly-1.1.0-bin.tar.gz" sha256 "584008d726bf6f90271f4ccd03b549773cbbe62ba7e92bf131e67df3ac5a41ac" bottle :un...
29.9375
138
0.743215
6a46e1dc05e03026ea7a505ee6772dc0ae894606
101
require "amaretti/version" require "amaretti/engine" module Amaretti # Your code goes here... end
14.428571
26
0.752475
289caa753a5743d7e3e1b82228660c6f75eb7906
2,528
module Fog module Parsers module Storage module Google class GetBucketObjectVersions < Fog::Parsers::Base def reset @delete_marker = { 'Owner' => {} } @version = { 'Owner' => {} } @in_delete_marke = false @in_version = false @re...
29.741176
74
0.438291
03e7eef7d8623582473d31f3d975bc0ff96de874
47
class ReportedUserList < ApplicationRecord end
15.666667
42
0.87234
e2b1e9b12eb78f32d921329ca1727d9ef08094bf
3,135
# frozen_string_literal: true require "rails_helper" module Renalware module Feeds module Files module PracticeMemberships describe ImportCSV do let(:uk) { create(:united_kingdom) } def with_tmpfile(content) tmpfile = Tempfile.new("test_csv", Rails.root.join("tmp")...
32.65625
84
0.519936
f7a6943d0f2bc01cf2f6a7aa37fabcc7f7007e8c
1,823
require "spec_helper" RSpec.describe "Person" do describe %q( Object-Oriented Programming =========================== Object-Oriented Programming, or OOP for short, allows us to model the world around us in terms of objects. Everything is an object. Pizza, statue, cup, window, person, dog,...
28.936508
63
0.671421
bb6b9a013b1421740ea62d9543c352e7016931f2
849
require 'test_helper' class MicropostsControllerTest < ActionDispatch::IntegrationTest # test "the truth" do # assert true # end def setup @micropost = microposts(:orange) end test "should redirect create when not logged in" do assert_no_difference 'Micropost.count' do post microposts_path, pa...
25.727273
72
0.746761
f8dc5775463c320b12c23d13c70d5a5b8eb81bd6
1,941
module LolSoap # Represents a HTTP request containing a SOAP Envelope class Request attr_reader :envelope attr_accessor :xml_options def initialize(envelope) @envelope = envelope @xml_options = default_xml_options end # @see Envelope#body def body(&block) envelope.bo...
21.566667
72
0.63627
0123a754f0f039e8a56e0ea4e3bea63c0926b3df
679
module PostSetPresenters class PoolGallery < Base attr_accessor :post_set delegate :pools, :to => :post_set def initialize(post_set) @post_set = post_set end def post_previews_html(template, options = {}) html = "" if pools.empty? return template.render("post_sets/blan...
23.413793
152
0.606775
ac678541eb10ef422565a87a1c6616bbc74a13a0
1,671
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v7/errors/operation_access_denied_error.proto require 'google/protobuf' require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/ads/googleads/v7/errors/operation_access_den...
41.775
230
0.780969
acb199214b0ae86defafdf61850471919a95f107
5,148
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ServiceFabric::V6_2_0_9 module Models # # Describes an update for a stateless service. # class StatelessServiceUpdateDescrip...
32.377358
86
0.443473
ab34124db61178df75af904ea9afc3e524980493
1,786
require_relative '../fixtures/user_provisioning_fixtures' require_relative 'support/user_provisioning_helper' require_relative '../integration/support/configuration_helper' require_relative '../integration/support/s3_helper' require_relative '../../../lib/gooddata/models/user_filters/user_filter_builder' require_relati...
48.27027
101
0.590705
181a3a00b358ab8153a02cc4822022a79a0266c0
3,351
# -*- encoding: utf-8 -*- # stub: jekyll-algolia 1.7.0 ruby lib Gem::Specification.new do |s| s.name = "jekyll-algolia".freeze s.version = "1.7.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Tim...
49.279412
112
0.656819
e27a301c4137abfedb8b93b0eefe885f538862ae
1,316
require_relative 'boot' require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "active_storage/engine" require "action_controller/railtie" require "action_mailer/railtie" require "action_mailbox/engine" require "action_text/en...
34.631579
82
0.778875
1a6eaa51d63d7e629800bedd0a4388440b8350e0
1,274
class Texinfo < Formula desc "Official documentation format of the GNU project" homepage "https://www.gnu.org/software/texinfo/" url "http://ftpmirror.gnu.org/texinfo/texinfo-5.2.tar.gz" mirror "https://ftp.gnu.org/gnu/texinfo/texinfo-5.2.tar.gz" sha256 "6b8ca30e9b6f093b54fe04439e5545e564c63698a806a48065c0bba...
32.666667
95
0.697017
e8f1730b264f8ed843f65ee3759ffda3ef9019cd
5,456
# # Cookbook Name:: apache2 # Recipe:: default # # Copyright 2008-2013, Opscode, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
26.357488
253
0.686034
62b3e17029d6ee9fed337a50954fbc08cb7c7277
2,508
require 'sexp_processor' require 'i18nliner/errors' require 'i18nliner/extractors/translate_call' require 'i18nliner/extractors/sexp_helper' module I18nliner module Extractors class RubyExtractor < ::SexpProcessor include SexpHelper TRANSLATE_CALLS = [:t, :translate] attr_reader :current_line ...
24.588235
106
0.600877
f8dbe057cb784c9d4a4647c4b0602a7be9e1b9b6
4,815
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require ...
49.132653
92
0.741641
1a45d3e553e078ca48e306729c4dfb311a7edc30
1,974
$:.unshift File.dirname(__FILE__) require 'remote_ip_proxy_scrubber/version' module RemoteIpProxyScrubber # Add the following to config/application.rb or conifg/environments/* # # config.middleware.insert_before(Rails::Rack::Logger, RemoteIpProxyScrubber.filter_middleware, [ # "216.73.93.70/31", # w...
35.890909
110
0.723404
b984251e73e8851e5fa6a9dd501085e767d82ca0
2,782
# frozen_string_literal: true require 'omniauth-oauth2' module OmniAuth module Strategies class Oktaoauth < OmniAuth::Strategies::OAuth2 DEFAULT_SCOPE = %[openid profile email].freeze option :name, 'oktaoauth' option :skip_jwt, false option :jwt_leeway, 60 option :client_optio...
27.27451
107
0.543494
03c1a7a6c5c5cc57fb5229552f4f471a881404e8
161
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application ExperimentTracker::Application.initialize!
26.833333
52
0.813665
e870a8c7b8f4e115b7867e4f6ee58794d7957019
447
require 'rails_helper' RSpec.describe RevokeServiceProviderConsent do let(:now) { Time.zone.now } subject(:service) { RevokeServiceProviderConsent.new(identity, now: now) } describe '#call' do let!(:identity) { create(:service_provider_identity, deleted_at: nil) } it 'sets the deleted_at' do exp...
24.833333
76
0.684564
3907544afa4012ca551a5d664baca95475376e06
421
require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' include RspecPuppetFacts def fixture_path File.expand_path(File.join(__FILE__, '..', 'fixtures')) end $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../')) RSpec.configure do |c| c.add_setting :fixture_path, :default...
26.3125
69
0.760095
3981d55a5f2fd05b3966fe8040a4ee50f4b54352
1,148
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'resque-serial-queues/version' Gem::Specification.new do |spec| spec.name = "resque-serial-queues" spec.version = Resque::Plugins::SerialQueues::VERSION spec.authors = [...
39.586207
105
0.68554
6a79598578e0c191bc166a3748eb28b37c69fa6b
6,605
class StudySubjectsController < ApplicationController before_filter :may_create_study_subjects_required, :only => [:new,:create] before_filter :may_read_study_subjects_required, :only => [:show,:index,:dashboard,:followup,:reports,:by] before_filter :may_update_study_subjects_required, :only => [:edit,:updat...
33.358586
171
0.734746
28f2315370963d6bff1a92afd696e9e2f34e727e
601
require 'spec_helper' describe 'taxons', type: :feature, caching: true do let!(:taxonomy) { create(:taxonomy) } let!(:taxon) { create(:taxon, taxonomy: taxonomy) } before do # warm up the cache visit spree.root_path assert_written_to_cache("views/en/spree/taxonomies/#{taxonomy.id}") clear_cache...
27.318182
71
0.720466
088a4b29620d344f1e2b23bb850d54e37b72dfc3
233
class CreateGroupsUsers < ActiveRecord::Migration[5.2] def change create_table :groups_users do |t| t.integer :group_id, null: false t.integer :user_id, null: false t.timestamps null: false end end end
21.181818
54
0.682403
1d973eeb1cb4f2584936433ec029ddb1adbbf470
798
class PersonSerializer < ActiveModel::Serializer attributes :id, :lock_version, :name, :name_sort_by, :name_sort_by_confirmed, :pseudonym, :pseudonym_sort_by, :pseudonym_sort_by_confirmed, :published_name, :published_name_sort_by, :job_title, :organization, ...
33.25
74
0.676692
acf47caad691c510c45f8f3d304950066bc523a1
3,179
# square # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). module Square # All configuration including auth info and base URI for the API access # are configured in this class. class Configuration # The attribute readers for properties. attr_reader :http_client att...
32.111111
78
0.656181
7933686f8b06a6bc8d3208209cd2d6395a4d428c
70
require 'backports/tools' Backports.alias_method Proc, :yield, :call
17.5
42
0.785714
aca081c3768a857384b1f24587827924e5ebc275
1,029
class Users::OmniauthCallbacksController < DeviseTokenAuth::OmniauthCallbacksController before_filter :set_user_session after_filter :handle_user_sessions def handle_user_sessions # puts "Session After: #{session[:previously_not_logged_in]} , #{session.id}" # User just signed in if session[:previou...
30.264706
121
0.724976
62b55a50fbceac27f63e482a4dc29ebac986745d
238
module Ckeditor module Rails class Railtie < ::Rails::Railtie initializer 'ckeditor.assets.precompile', group: :all do |app| app.config.assets.precompile += Ckeditor::Rails::Asset.new.files end end end end
23.8
72
0.672269
ed245539f1bf55839933464c289ce07f803d8200
2,744
# frozen_string_literal: true # Handles HTTP interaction that allows management of bulk jobs for an APO class BulkJobsController < ApplicationController include Blacklight::Searchable # Generates the index page for a given DRUID's past bulk metadata upload jobs. def index params[:apo_id] = 'druid:' + params[...
32.282353
148
0.688047
ac17467d82af77fca1d858b99239f6c6c22235cc
1,024
class Codespell < Formula include Language::Python::Virtualenv desc "Fix common misspellings in source code and text files" homepage "https://github.com/codespell-project/codespell" url "https://files.pythonhosted.org/packages/7e/37/b15b4133e90bbef5acecfd2f3f3871c1352ee281c042fd64a22a72735fb8/codespell-1.17.1....
37.925926
138
0.802734
bb851cf2218c9635d1c3ced8abef9de812af8c1c
118
def stub_auth stub_request(:get, 'http://oauth.ccci.us/users/' + user.access_token) .to_return(status: 200) end
23.6
71
0.711864
91f6d5f70a7eeed0d43fe72d09db520bdb635161
347
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'main/home.html.erb', type: :view do # NEEDS TO BE REFACTORED # it 'renders correctly' do # user = FactoryBot.create(:user) # allow(view).to receive(:user_signed_in?).and_return(user) # render # expect(rendered).to match('Herzlic...
23.133333
63
0.697406
1c522af18e954add78c0a55d844f500305871640
561
require 'rails_helper' RSpec.describe Content, type: :model do let(:page) { FactoryGirl.create(:page) } before { @content = Content.new(kind: "h1", value: "Test header", page_id: page.id) } subject { @content } it { should respond_to(:kind) } it { should respond_to(:value) } it { should respond_to(:page...
20.035714
87
0.643494
62f2aa2ece459b6e9eef85f1b6fa5d827fb1187d
1,584
module HealthSeven::V2_3_1 class Obx < ::HealthSeven::Segment # Set ID - OBX attribute :set_id_obx, Si, position: "OBX.1" # Value Type attribute :value_type, Id, position: "OBX.2", require: true # Observation Identifier attribute :observation_identifier, Ce, position: "OBX.3", require: true # Observation ...
41.684211
82
0.738636
ed47072f6b422df2045e403041efeed8649134c3
2,469
# Encoding: UTF-8 {fileTypes: [], foldingStartMarker: /(?<_1><(?i:(?<_2>head|table|tr|div|style|script|ul|ol|form|dl))\b.*?>|\{\{?(?<_3>if|foreach|capture|literal|foreach|php|section|strip)|\{\s*$)/, foldingStopMarker: /(?<_1><\/(?i:(?<_2>head|table|tr|div|style|script|ul|ol|form|dl))>|\{\{?\/(?<_3>if|foreach|...
51.4375
224
0.646821
e8b3012e70179dc0ae564ad3004210efb8ebf528
464
module LogMinimal module Methods [:fatal, :error, :warn, :info, :debug].each do |method| define_method "#{method}f" do |message| caller = "%s#%s:%s" % [self.class, caller(1)[0].scan(/in `(.*)'/)[0][0], caller(1)[0].scan(/:(\d+):/)[0][0]] logger.send(method, "%s\t%s" % [caller, message]) ...
27.294118
116
0.551724
62166b6bf0c34ac17b19f9b1d413306c1e5cd685
4,309
require File.expand_path('../../spec_helper', __FILE__) module Pod describe Specification::Set do describe 'In general' do before do @source = Source.new(fixture('spec-repos/master')) @set = Spec::Set.new('CocoaLumberjack', @source) end it 'returns the name of the pod' do ...
34.472
115
0.570202
624eb075f81231ab8f7beddd416b99693869f09b
1,679
class Blockhash < Formula desc "Perceptual image hash calculation tool" homepage "https://github.com/commonsmachinery/blockhash" url "https://github.com/commonsmachinery/blockhash/archive/v0.3.1.tar.gz" sha256 "56e8d2fecf2c7658c9f8b32bfb2d29fdd0d0535ddb3082e44b45a5da705aca86" license "MIT" revision 2 head...
39.046512
137
0.773675
eda0e4bbb394c9368be080b6891e6f93ff533bbd
940
# encoding: UTF-8 # frozen_string_literal: true # # Copyright 2016, Ole Claussen <claussen.ole@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license...
28.484848
74
0.735106
4a3e98055ba9cf551f6feeb985ebde61bbc6ef60
67
# frozen_string_literal: true class Staff < ApplicationRecord end
13.4
31
0.820896
1ac537be8311e41de64eeb9fe76a056b1be65c70
2,438
# # Copyright (c) 2012 RightScale Inc # # 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, copy, modify, merge, publish, # ...
31.25641
79
0.68991
aca968d9174a029dc5ded06f1e66764165297254
2,445
require "rubygems" require File.join(File.dirname(__FILE__), "..", "minitest") require "logstash/loadlibs" require "logstash/testcase" require "logstash/agent" require "logstash/logging" require "logstash/outputs/elasticsearch" require "logstash/search/elasticsearch" require "logstash/search/query" require "tmpdir" ...
31.753247
167
0.604499
1db2720c76bf0709d8be521ec15ab8bbfd231077
1,642
# # Be sure to run `pod lib lint SHPAnalytic.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 http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'SHPAnaly...
38.186047
117
0.6419
3972fd3badecc6c9814634973606befc91b7ed5e
861
module NavigationHelpers # Maps a name to a path. Used by the # # When /^I go to (.+)$/ do |page_name| # # step definition in web_steps.rb # def path_to(page_name) case page_name when /^the home\s?page$/ '/' # Add more mappings here. # Here is an example that pulls values out of ...
24.6
71
0.60511
e963cf336330f7b3098456b5c285bffd1fa340de
1,801
# # Copyright:: Copyright (c) 2018 GitLab Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
26.101449
106
0.679067
1caa3ec2a99d6be61ab12e1cae6e201cfe713a76
3,696
require 'rails_helper' RSpec.describe Hesa::Grade do describe '.all' do it 'returns a list of HESA grade structs' do grades = described_class.all expect(grades.size).to eq 15 pass = grades.find { |s| s.hesa_code == '14' } expect(pass.hesa_code).to eq '14' expect(pass.description).t...
32.707965
95
0.682089
7a82901786bd751a0cdbcd32d2801c21a23b8b9e
7,824
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
49.834395
90
0.63318
115bcea8d9649727e2af541301c614f66da55063
896
# Convert a hash containing supplied and expected contents # into either supplied or expected # # args = { placeholder: { provided: 'Seymour Skinner', output: 'Seymour Skinner' } } # extract_args(args, :output) # # => { placeholder: 'Seymour Skinner' } # def extract_args(args, subkey) args.each.with_object({}) { |(k,...
24.888889
101
0.6875
03790485163a22bce4e0443f2cc60bd3a373dfc5
1,794
class Proctools < Formula desc "pgrep, pkill, and pfind for OpenBSD and Darwin (OS X)" homepage "http://proctools.sourceforge.net/" url "https://downloads.sourceforge.net/project/proctools/proctools/0.4pre1/proctools-0.4pre1.tar.gz" version "0.4pre1" sha256 "4553b9c6eda959b12913bc39b6e048a8a66dad18f888f983697...
42.714286
108
0.75864
91236063af4954903cc445c535c3e35dfbf522fa
3,418
require 'spec_helper' describe 'simpmod' do shared_examples_for "a structured module" do it { is_expected.to compile.with_all_deps } it { is_expected.to create_class('simpmod') } it { is_expected.to contain_class('simpmod') } it { is_expected.to contain_class('simpmod::install').that_comes_before('Cl...
38.840909
120
0.626975
62583580558def73fd1f89c7851b60d498035f90
1,146
cask 'unity-facebook-games-support-for-editor@2018.3.7f1' do version '2018.3.7f1,9e14d22a41bb' sha256 :no_check url "https://download.unity3d.com/download_unity/9e14d22a41bb/MacEditorTargetInstaller/UnitySetup-Facebook-Games-Support-for-Editor-2018.3.7f1.pkg" name 'Facebook Gameroom Build Support' homepage '...
31.833333
149
0.719895
ac69cc7e11c2ece2e2cbc3413db34e073360ce1d
11,252
require File.expand_path("../../../base", __FILE__) require "vagrant/util/downloader" describe Vagrant::Util::Downloader do let(:source) { "foo" } let(:destination) { "bar" } let(:exit_code) { 0 } let(:options) { {} } let(:subprocess_result) do double("subprocess_result").tap do |result| allow(re...
35.272727
123
0.635531
e8550f36c2c6d2c3e20b77f1b77be26ab73ae9cb
6,791
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2015 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork of ...
42.710692
163
0.706818
e905c1f13b8f9fa619245fcc5d1664837462b5c5
1,166
module Tokamak module Representation module Atom class Link < XML def initialize(options_or_obj) if options_or_obj.kind_of?(Hash) @doc = Nokogiri::XML::Document.new() options_or_obj = create_element("link", options_or_obj) end super(options_or_obj) end...
17.666667
65
0.473413
f756818334956935f08d84ab62fc4228413e4726
606
module TokyoMetro::Factory::Seed::Reference::BarrierFreeFacility::ServiceDetailPattern private def pattern_in_db( operation_day_id , whole = nil , search_by: @info ) h = { operation_day_id: operation_day_id }.merge( search_by.time_to_h ) if whole.present? whole.find_or_create_by(h) el...
26.347826
94
0.731023
38989ec871ffedfe13629111604ac50cc349a35c
352
def bitwise(a, b) form = "%1$7s:%2$6d %2$016b" puts form % ["a", a] puts form % ["b", b] puts form % ["a and b", a & b] puts form % ["a or b ", a | b] puts form % ["a xor b", a ^ b] puts form % ["not a ", ~a] puts form % ["a << b ", a << b] # left shift puts form % ["a >> b ", a >> b] # arithmetic...
25.142857
59
0.482955
0166433539fbc256418d12fe7983bd3bb1db1e9f
2,312
require 'common' test_check "eval" test_ok(eval("") == nil) $bad=false eval 'while false; $bad = true; print "foo\n" end' test_ok(!$bad) test_ok(eval('TRUE')) test_ok(eval('true')) test_ok(!eval('NIL')) test_ok(!eval('nil')) test_ok(!eval('FALSE')) test_ok(!eval('false')) $foo = 'test_ok(true)' begin eval $foo res...
19.266667
58
0.610727
f769a5955c2c80e684484dd5876f59bd26f5578e
227
require 'rails_helper' RSpec.describe MonitController, type: :controller do describe "GET #index" do it "returns http success" do get :index expect(response).to have_http_status(:success) end end end
17.461538
52
0.700441
0862e170874fabbcc4c6eb556c0417cb599ebe55
353
module EPUB class OCF class PhysicalContainer class UnpackedDirectory < self def open yield self end def read(path_name) ::File.read(::File.join(@container_path, path_name)) rescue ::Errno::ENOENT => error raise NoEntry.from_error(error) ...
19.611111
62
0.577904
03aa396ead7e949c522235cdfd53b9757b025ccf
421
Streakist::Container.finalize(:bugsnag) do |container| require "bugsnag" Bugsnag.configure do |config| config.project_root = Pathname(__FILE__).join("../..").realpath.dirname.freeze config.release_stage = ENV.fetch("RACK_ENV", "development") config.notify_release_stages = ["production"] config.api_...
35.083333
82
0.738717
87209a7ab78920802e79bd8f93c340ad1e6732d7
115,676
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
62.561385
195
0.676329
ab9817f6ae188e8a9739ed2369f5d4b7ca1fb1f5
135
class RemoveEmailFromSubmissions < ActiveRecord::Migration[6.1] def change remove_column :submissions, :email, :string end end
22.5
63
0.77037
f880edc264fbc7ec0f0b97dd1f13f82bcdc2b540
6,500
require 'pathname' Puppet::Type.newtype(:dsc_xvhd) 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 xVHD resource type. Automatically generated from 'xHyper-V/DSCRes...
29.279279
114
0.637538
79da3550f28c9b87b60c1e057ff4ca10bba9c7b3
1,640
# TODO: clean these requires up so they're consistent require_relative "ruby_cover_band/amplifier" require_relative "ruby_cover_band/band" require_relative "ruby_cover_band/concert" require_relative "ruby_cover_band/instruments/guitar" require_relative "ruby_cover_band/instruments/guitar/chords/chord" require_relative ...
40
115
0.846951
799cda63e8dd46b743c371c0f68b669ecd8481a0
155
class AddRoleToUsersGroup < ActiveRecord::Migration def change add_column :users_groups, :role, :string add_index :users_groups, :role end end
22.142857
51
0.754839
87510670d8d10472a327fec96e9d670b30e5b818
2,166
class Frotz < Formula desc "Infocom-style interactive fiction player" homepage "https://661.org/proj/if/frotz/" url "https://gitlab.com/DavidGriffith/frotz/-/archive/2.53/frotz-2.53.tar.bz2" sha256 "8da558828dd74d6d6ee30483bb32276ef918b8b72b7f6e89b4f7cb27e7abf58b" license "GPL-2.0-or-later" head "https://gi...
36.711864
93
0.750231
6237566c7f6035c9700908b26c3cb571920a8a99
399
node = S($input, "application/json") currencies = node.prop("orderDetails").prop("currencies") $oldSize = currencies.elements().size() $oldValue = currencies.elements().get(1).stringValue() currencies.insertBefore($oldValue, "Test") $newSize = currencies.elements().size() $newValue = currencies.elements().get(1).str...
33.25
67
0.744361
ff8cbad68fd823202ddb415fe8877ffda3090b1e
6,073
require 'spec_helper' require 'pinpoint_supported_countries' RSpec.describe PinpointSupportedCountries do before do stub_request(:get, PinpointSupportedCountries::PINPOINT_SMS_URL). to_return(body: sms_table) stub_request(:get, PinpointSupportedCountries::PINPOINT_VOICE_URL). to_return(body: voic...
29.62439
157
0.55014
5dba222bba7cefff84398d6c6d4cce3b04e7f8e4
486
# frozen_string_literal: true require 'spec_helper' describe RubyHelm::Commands::Reset do before do RubyHelm.configure do |config| config.binary = 'path/to/binary' end end after do RubyHelm.reset! end it 'calls the helm reset command' do command = described_class.new(binary: 'helm') ...
16.758621
49
0.656379
3394c1ec294734745d8b3c9f7f7abb6b4d97f5eb
992
# 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...
41.333333
86
0.760081
e8c2fe879f33fef30ffd424712b0499f7c058c87
2,802
require 'date' require 'yaml' require 'fileutils' require 'sys/proctable' module MCLimit # The default number of minutes of game play to allow per day when env not set DEFAULT_MINUTES = 30 # The minimum number of remaining minutes needed to start the game MINIMUM_MINUTES = 1 REMAINING_FILE = 'remaining.yml...
26.186916
191
0.668808
18bc99e76e49456f0626a0b5fd45689d7cb89206
676
RSpec::Matchers.define :contain_parsed_output do |expected| match do |actual| actual_output = pluck_keys expected.keys, actual expect(actual_output).to eq(expected) end def pluck_keys key_names, obj res = {} Class.new(Parslet::Transform) do key_names.each do |key_name| rule(key_name...
27.04
59
0.606509
d582229fcf69bde355d6e77f04a83f67a26b8b7d
143
class AddAttributesToRequests < ActiveRecord::Migration[5.1] def change add_column :requests, :approved, :string, default: nil end end
23.833333
60
0.755245
03cc44cf507ad81f6273f9be7df1211d5c69fd6a
1,590
require 'test_helper' class FollowingTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) @other = users(:archer) log_in_as(@user) end test "following page" do get following_user_path(@user) assert_not @user.following.empty? assert_match @user.following.count.to_s, re...
27.894737
77
0.704403
61f546be36423d6ccd36a6a61f8a6767bf653c65
1,455
module StashEngine describe Lock, '.acquire' do before :each do @reader, @writer = IO.pipe end def fork_with_new_connection config = ActiveRecord::Base.remove_connection fork do ActiveRecord::Base.establish_connection(config) yield ensure ActiveRecord::Ba...
27.980769
100
0.613746
e2d2e99dda3711c9cfefd7ea2e28819d9350aca4
1,572
require "rayyan-formats/version" require "rayyan-formats-core" require "rayyan-formats-plugins" require "rayyan-scrapers" require 'logger' module RayyanFormats class Command def initialize(args) # check arguments raise "Must provide input file name(s) as the first arguments followed by the output fil...
32.081633
109
0.61514