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 |
|---|---|---|---|---|---|
d5ea3e43a1d1989ca4043a277f536ba99d690b90 | 555 | class Approval::ApprovalFlow < ApplicationRecord
include Sys::Model::Base
include Cms::Model::Rel::Content
include Cms::Model::Auth::Content
column_attribute :sort_no, default: 10
# Content
belongs_to :content, class_name: 'Approval::Content::ApprovalFlow', required: true
belongs_to :group, class_name:... | 25.227273 | 84 | 0.722523 |
bbc122cc9ec351756dafb7dd5a8e527ee7e965ad | 7,485 | # 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, ... | 39.394737 | 229 | 0.644623 |
3999b436f667b22852f1048cd56c8dbb4c201cd8 | 1,049 | class Seqkit < Formula
# Shen_2016: "https://doi.org/10.1371/journal.pone.0163962"
desc "Ultrafast FASTA/Q file manipulation"
homepage "https://bioinf.shenwei.me/seqkit/"
# We use binaries to avoid compiling Go code
if OS.mac?
url "https://github.com/shenwei356/seqkit/releases/download/v0.10.0/seqkit_darw... | 34.966667 | 99 | 0.771211 |
bbe3c76ed58639313361136e05b5f7c87729c1a0 | 4,175 | module Spree
class BookkeepingDocument < ActiveRecord::Base
PERSISTED_ATTRS = [
:firstname,
:lastname,
:email,
:total,
:number
]
# Spree::BookkeepingDocument cares about creating PDFs. Whenever it needs to know
# anything about the document to send to the view, it asks a... | 28.020134 | 98 | 0.654132 |
33a150fd15b6cd53f1f02765b7d6897a7d12aed8 | 826 | Gem::Specification.new do |s|
s.name = 'aws-s3'
s.version = '0.6.2.20110114001'
s.summary = "Client library for Amazon's Simple Storage Service's REST API"
s.description = s.summary
s.email = 'marcel@vernix.org'
s.author = 'Marcel Molina Jr.'
s.has_rdoc = true
s.extra_rdoc_files = %w(README COPYING INST... | 35.913043 | 85 | 0.617433 |
62e80425ed5e3be1f80736230f16429ae9845b6d | 1,294 | module Kit::Auth::Endpoints::Web::Users::Settings::Oauth::Index
def self.endpoint(router_conn:)
Kit::Organizer.call(
list: [
[:alias, :web_require_session_user!],
self.method(:list),
self.method(:render),
],
ctx: { router_conn: router_conn },
)
end
Kit::Router:... | 25.88 | 88 | 0.602009 |
e9a09b69228ca43c88e711dec5541f708e7617e9 | 6,974 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end
require 'dat... | 29.179916 | 157 | 0.618727 |
1c6aba968eda9941cf1e1eef7a86429a7c045243 | 856 | #
# Be sure to run `pod lib lint GLArithmetic.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 = 'GLArith... | 29.517241 | 105 | 0.598131 |
6a91027677c75ae21a05aa48e638b240e1f1fc3b | 45 | collection @users
extends 'api/v1/users/show' | 22.5 | 27 | 0.8 |
bb15972ff99d0487f9720d19e843505ed18a2c83 | 4,697 | require_relative "../helper"
require "fluent/test/driver/output"
require "fluent/plugin/out_rabbitmq"
class RabbitMQOutputTest < Test::Unit::TestCase
def setup
Fluent::Test.setup
@time = Fluent::Engine.now
@tag = "test.test"
bunny = Bunny.new
bunny.start
@channel = bunny.create_channel
... | 22.051643 | 84 | 0.650841 |
acca5216a0e899517a351e90c88f778ab49060bf | 456 | Pod::Spec.new do |s|
s.name = 'Base32'
s.version = '1.0.2'
s.license = 'Public Domain'
s.summary = 'RFC 4648 Base32 implementation in Objective-C ARC.'
s.homepage = 'http://github.com/ekscrypto/Base32'
s.author = { 'Dave Poirier' => 'ekscrypto@gmail.com' }
s.source = { :git => 'https://github.c... | 38 | 85 | 0.638158 |
acefae4f3a04cb10785fc4e8113bcdcd63d56203 | 79 | # frozen_string_literal: true
require_relative '../asciidoctor/pdf/converter'
| 19.75 | 47 | 0.810127 |
ff7e7aee46d8b0e64c7dd514f908648022b61cf8 | 3,876 | describe AirbrakeApi::V3::NoticeParser do
let(:app) { Fabricate(:app) }
let(:notifier_params) do
{
"name" => "notifiername",
"version" => "notifierversion",
"url" => "notifierurl"
}
end
it "raises error when errors attribute is missing" do
expect do
described_class.ne... | 32.847458 | 149 | 0.653767 |
288a7e0d41a55d024c5a87d291d9b794c6661efc | 1,015 | # frozen_string_literal: true
module Gitlab
module Checks
class PushFileCountCheck < BaseChecker
attr_reader :repository, :newrev, :limit, :logger
LOG_MESSAGES = {
diff_content_check: "Validating diff contents being single file..."
}.freeze
ERROR_MESSAGES = {
upper_limit... | 26.710526 | 100 | 0.629557 |
f88ac0f91a0235d6d551b765c62bcab52617349b | 3,036 | module SynapsePayRest
class CardUsNode < BaseNode
class << self
private
def payload_for_create(nickname:, document_id:, card_type:, **options)
args = {
type: 'CARD-US',
nickname: nickname,
document_id: document_id,
card_type: card_type,
}.merge... | 32.645161 | 101 | 0.635375 |
ff1ba36eb8e98fc633eae5c2dc5fec91c3705e18 | 839 | RSpec.describe Log4r::DateDirectoryFileOutputter do
before do
Timecop.freeze(2018, 1, 23)
end
let(:params) {
{
file_path: '/tmp/%Y/%m/%d/request.log',
trunc: 'false'
}
}
it 'should be directory file path' do
outputter = described_class.new('logfile', params)
file_path = outpu... | 28.931034 | 59 | 0.681764 |
28c90c088e0d5a72bcfa78d9825eeaa2b35922d5 | 73 | class BestSellerList < ActiveRecord::Base
has_many :best_sellers
end
| 12.166667 | 41 | 0.794521 |
f8e0700e7a3c8b44821b29fe07bdd34dd6c02a7c | 552 | require 'formula'
class Capnp < Formula
homepage 'http://kentonv.github.io/capnproto/'
url 'http://capnproto.org/capnproto-c++-0.4.1.tar.gz'
sha1 '18ce1a404c2bf68e6625e44927bfe6b67186cb15'
needs :cxx11
def install
system "./configure", "--disable-debug",
"--disable-dependency-... | 24 | 58 | 0.576087 |
ac6dd3a29ca4923998e0d677115a93804b628c16 | 8,385 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Spree::OrderInventory, type: :model do
let(:order) { create :completed_order_with_totals }
let(:line_item) { order.line_items.first }
let(:shipment) { order.shipments.first }
let(:variant) { subject.variant }
let(:stock_item) { shipment.sto... | 30.053763 | 108 | 0.677281 |
e2576ccb7f4ab6f05e253722df0efadedeb9cd4c | 697 | cask "steermouse" do
version "5.5.5"
sha256 "9aa09144b17ec0199a9ea2aa4ad000abc6839aba02a227fcfcce3f04a61a1af3"
url "https://plentycom.jp/ctrl/files_sm/SteerMouse#{version}.dmg"
name "SteerMouse"
homepage "https://plentycom.jp/en/steermouse/"
livecheck do
url "https://plentycom.jp/en/steermouse/downloa... | 31.681818 | 87 | 0.705882 |
1885acea28c59706332138151b7f399fc50b18aa | 452 | module Dave
class Request
attr_reader :args
attr_reader :method
attr_reader :path
attr_reader :requestor
def initialize method, args, path, requestor = nil
@args, @method, @path, @requestor = args, method, path, requestor
end
def self.from_request request
self.new request.m... | 18.08 | 72 | 0.683628 |
e9d97d7b68cec41b4b8d3c90a7c504b2a4216103 | 23,614 | module Fleximage
# Container for Fleximage model method inclusion modules
module Model
class MasterImageNotFound < RuntimeError #:nodoc:
end
# Include acts_as_fleximage class method
def self.included(base) #:nodoc:
base.extend(ClassMethods)
end
# Provides class method... | 39.687395 | 142 | 0.607309 |
b9643e16ab34c4734cb36960e9fd1d8b68cd47ab | 1,727 | require "net/https"
require "uri"
require "json"
require "binocular/version"
module Binocular
class Bin
attr_accessor :settings, :bin_number
attr_reader :info, :errors
DEFAULT_SETTINGS = { proxy_host: nil, proxy_port: nil }
def self.info bin_number
self.new(bin_number).fetch_info
end
... | 23.657534 | 80 | 0.633468 |
5dca25a51cecadf814b61e3581e76e7761c5d4a7 | 32,575 | # -*- coding: binary -*-
module Msf
class Post
module Hardware
module Automotive
module UDS
#
# Helper method to take client.automotive response hashes and return a single array in order, This
# takes the ISO-TP Packets and assembles them in order, strips out the ISO-TP/UDS related info
# and returns just the... | 36.114191 | 126 | 0.643776 |
f74fe133bdd63509c31a202b7657a82c3cc8a5d9 | 210 | # frozen_string_literal: true
class Settings::ProfilePolicy < ApplicationPolicy
def update?
!!account
end
def permitted_attributes_for_update
%i[nickname public_name biography avatar]
end
end
| 17.5 | 49 | 0.771429 |
5d1d83b90773a11b488980d6e34ef3a051077202 | 1,527 | class Okteto < Formula
desc "Build better apps by developing and testing code directly in Kubernetes"
homepage "https://okteto.com"
url "https://github.com/okteto/okteto/archive/1.13.10.tar.gz"
sha256 "b50bfebb8d1cad07411624c3c4946a140f32c5f64db0b2e5b393c1f5d82a860e"
license "Apache-2.0"
head "https://githu... | 46.272727 | 139 | 0.764898 |
18b0d6480baf561ed458476623649bd82cf099d6 | 4,187 | class NodeAT14 < Formula
desc "Platform built on V8 to build network applications"
homepage "https://nodejs.org/"
url "https://nodejs.org/dist/v14.18.3/node-v14.18.3.tar.xz"
sha256 "783ac443cd343dd6c68d2abcf7e59e7b978a6a428f6a6025f9b84918b769d608"
license "MIT"
livecheck do
url "https://nodejs.org/dist... | 38.768519 | 123 | 0.678529 |
01d36142b77be6b837584b4f83d7b49c5f0cc328 | 681 | require 'rails_helper'
RSpec.describe User, type: :model do
context 'associations' do
it { should have_many(:posts) }
it { should have_many(:comments) }
it { should have_many(:likes) }
it { should have_many(:friendships) }
it { should have_many(:inverse_friendships).class_name(:Friendship) }
... | 37.833333 | 75 | 0.713656 |
033a8ef9aef1257e72174314915e702339d0be3d | 1,661 | class Juliaup < Formula
desc "Julia installer and version multiplexer"
homepage "https://github.com/JuliaLang/juliaup"
url "https://github.com/JuliaLang/juliaup/archive/v1.5.29.tar.gz"
sha256 "4dc02d9e7ecddf7364b1862d8b478c2a6f01e0eea9dd755e40e171c42d0b3511"
license "MIT"
head "https://github.com/JuliaLang/... | 41.525 | 123 | 0.775436 |
1da2015f7b2893a827957eb3148a62a54983e6ba | 266 | class FontBayon < Formula
head "https://github.com/google/fonts/raw/master/ofl/bayon/Bayon-Regular.ttf"
desc "Bayon"
homepage "https://www.google.com/fonts/specimen/Bayon"
def install
(share/"fonts").install "Bayon-Regular.ttf"
end
test do
end
end
| 24.181818 | 79 | 0.718045 |
ff2a55ba6c63a19d47f13626ef8a7b4bb74d2074 | 291 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,:confirmable, :lockable
end
| 41.571429 | 86 | 0.766323 |
e832452377599fcdbaee83f3d68b2f982b1fedb4 | 1,280 | # frozen_string_literal: true
class ActionMessage < MessageComponent
self.ignored_columns = %w[completing_message_type] # TODO: was polymorphic, need to remove
belongs_to :completing_message, class_name: "Message"
validates :description, presence: true
def completed?
completing_message.try(:message).try... | 31.219512 | 92 | 0.659375 |
799d977868fece689e64f300da60e32dfb900787 | 1,018 | lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rspec/any_of/version'
Gem::Specification.new do |spec|
spec.name = 'rspec-any_of'
spec.version = RSpec::AnyOf::VERSION
spec.authors = ['Arkadiy Zabazhanov']
spec.email = ['open-s... | 37.703704 | 69 | 0.682711 |
87140e13b7242ed76bf2e6873564a7c3d947e515 | 517 | require "graphql/api/unauthorized_exception"
module GraphQL::Api
class Policy
attr_reader :ctx, :model
def initialize(ctx, model)
@model = model
@ctx = ctx
end
def user
ctx[:current_user]
end
def create?
true
end
def update?
true
end
def dest... | 12.309524 | 44 | 0.588008 |
18f4f4928569b30657f16cd2f86b9c07931c6ab5 | 131 | # Chef Provisioning Azure driver
class Chef
module Provisioning
module AzureDriver
VERSION = "0.6.0"
end
end
end
| 14.555556 | 32 | 0.687023 |
e8f9e24d82847c9df8bd413965f476133116b6a6 | 642 | class CapsuleSyncMonitor
@queue = :signup
extend CapsuleHelper
# This monitors capsuleCRM for changes and queues up individual changes for update in the frontend app
def self.perform
[
:orgs,
:people
].each do |type|
self.send(type).each { |t| enqueue_sync(t, t.class.name.demodulize)... | 20.709677 | 104 | 0.676012 |
283f70b852078e109f52c0437bf132c50cc88377 | 827 | # frozen_string_literal: true
RSpec.feature "List Schedule for System Admin", :all_dbs do
let!(:current_user) { User.authenticate!(roles: ["System Admin"]) }
context "Correct buttons are displayed" do
let!(:hearing) { create(:hearing) }
let!(:hearing_day) { create(:hearing_day) }
scenario "Correct da... | 31.807692 | 96 | 0.71584 |
f83415acfbf52f3aff9207dea5d70412ac83a261 | 1,205 | # DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
Gem::Specification.new do |s|
s.name = %q{refinerycms-base}
s.version = %q{1.1.0}
s.summary = %q{Base engine for Refinery CMS}
s.description = %q{This provides a base for Refinery CMS which hand... | 34.428571 | 127 | 0.609129 |
bb4c7c1816c8abce0474ef30eaeb89fc697ab027 | 277 | FactoryBot.define do
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
#
# Example adding this to your spec_helper will load these Factories for use:
# require 'spree_cropper/factories'
end
| 39.571429 | 130 | 0.787004 |
793e9d0a65ced9ede7fa65708974532c30b28dbb | 1,615 | class MediaInfo < Formula
desc "Unified display of technical and tag data for audio/video"
homepage "https://mediaarea.net/"
url "https://mediaarea.net/download/binary/mediainfo/0.7.98/MediaInfo_CLI_0.7.98_GNU_FromSource.tar.bz2"
version "0.7.98"
sha256 "d194ff6fb32880e5f0e3c11b2d9139c65f647b8049d57258258870e... | 32.3 | 106 | 0.634056 |
38845bd42c64e686f669cedeff48db7c1d3e3c76 | 1,321 | class Dune < Formula
desc "Composable build system for OCaml"
homepage "https://dune.build/"
url "https://github.com/ocaml/dune/releases/download/2.6.1/dune-2.6.1.tbz"
sha256 "5ef959f286448ee172f1cffc86c439a6f7b662676e6015b282db071bb88899a0"
head "https://github.com/ocaml/dune.git"
bottle do
cellar :an... | 37.742857 | 94 | 0.72218 |
6a74ab916022cc006cdb762c5a09cae58adcc05a | 1,101 | require File.expand_path('../../../../spec_helper', __FILE__)
require 'set'
describe "SortedSet#classify" do
before(:each) do
@set = SortedSet["one", "two", "three", "four"]
end
it "yields each Object in self in sorted order" do
res = []
@set.classify { |x| res << x }
res.should == ["one", "two"... | 30.583333 | 108 | 0.625795 |
ab64f0df2d2957bdcf21662cc63f0fc73571b866 | 328 | # -*- encoding: utf-8 -*-
#
# Para manter compatibilidade com ActiveModel
require 'date'
require 'time'
class Date
def self.current
Time.respond_to?(:zone) && Time.zone ? Time.zone.today : Date.today
end
end
class Time
def self.current
Time.respond_to?(:zone) && Time.zone ? Time.zone.now : Time.now
... | 16.4 | 71 | 0.679878 |
f802e30dda16ab2742d96e397364f395bedffd72 | 2,813 | # frozen_string_literal: true
require_relative "../test_helper"
class ResponseTest < Minitest::Test
def setup
@redis = DB.pool.checkout
@meeting = Meeting.new(id: :test, account: :account)
@meeting.cleanup
@person = Person.new(id: :foo, name: :bar)
end
def teardown
@meeting.cleanup
DB.... | 29 | 92 | 0.707074 |
ff26cbe24ba0a9a062b221e49e09bb4ab8cee718 | 366 | cask 'maltego-ce' do
version '4.0.11.9358'
sha256 'eed48ed7d6a32cbb6d963c1af0c0fd7f9c78e89351aa746804889e521469ac3f'
url "https://www.paterva.com/malv#{version.major}/community/MaltegoCE.v#{version}.dmg"
name 'Maltego CE'
homepage 'https://www.paterva.com/web7/buy/maltego-clients/maltego-ce.php'
app "Malt... | 33.272727 | 88 | 0.76776 |
267eeee61339fca539ee7e934bbda9d92aba5e96 | 842 | # == Schema Information
#
# Table name: illustration_crops
#
# id :integer not null, primary key
# illustration_id :integer
# image_file_name :string(255)
# image_content_type :string(255)
# image_file_size :integer
# image_updated_at :datetime
# created_at :datetime
#... | 29.034483 | 124 | 0.693587 |
033f0a36013c5fc3dda3bdfe4ff0348eebf762c5 | 274 | module WordpressHelper
def wordpress_age(hit)
content_tag(:span,
t('views.otrs.age',
age: time_ago_in_words(Time.parse(hit['date']))))
end
def wordpress_excerpt(hit)
strip_tags(hit['excerpt']['rendered']).html_safe
end
end
| 22.833333 | 67 | 0.631387 |
61cf81a60128414906581dbcd0e7998c103691e3 | 1,656 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require '../azure_mgmt_signlr/lib/module_defin... | 40.390244 | 94 | 0.677536 |
e9ee40a4c2e9c1b48af068090ae48570f9d2b396 | 869 | # frozen_string_literal: true
module Stupidedi
module Versions
module ThirtyTen
module SegmentDefs
s = Schema
e = ElementDefs
r = ElementReqs
BCH = s::SegmentDef.build(:BCH, "Beginning Segment for Purchase Order Change",
"To indicate the beginning of the Purchase O... | 37.782609 | 86 | 0.637514 |
4a56506ba03f7b60ced7895810dd8945bcf74794 | 1,974 | class Packetbeat < Formula
desc "Lightweight Shipper for Network Data"
homepage "https://www.elastic.co/products/beats/packetbeat"
url "https://github.com/elastic/beats/archive/v5.4.3.tar.gz"
sha256 "a7714383de1a610c7318e8a2751a230b64c8ca243058abd59b1886aabcc3965b"
head "https://github.com/elastic/beats.git"... | 30.84375 | 111 | 0.676798 |
7a7da63429d3a046d8c1d661f6f675092d8856a4 | 508 | module Roles
roles = [
{
label: "System Admin",
description: "Super user, given only to people who can manage the entire system (Team JD8112)."
},
{
label: "Expo Admin",
description: "Expo admin, for all intents will be identical to system admin."
},
{
label: "Team Me... | 24.190476 | 102 | 0.627953 |
abe20a3f39a39bb1d4646667d2ef11aa2a75b9bb | 1,994 | class ProfilesController < ApplicationController
before_action :set_profile, only: [:show, :edit, :update, :destroy]
before_action :authenticate_user!
# GET /profiles
# GET /profiles.json
def index
@profiles = Profile.all
end
# GET /profiles/1
# GET /profiles/1.json
def show
end
... | 26.586667 | 94 | 0.636409 |
7956305a739f4c59dc2320e569f4b741cc4f41b7 | 419 | require 'test_helper'
require 'generators/landing_boi/landing_boi_generator'
module LandingBoi
class LandingBoiGeneratorTest < Rails::Generators::TestCase
tests LandingBoiGenerator
destination Rails.root.join('tmp/generators')
setup :prepare_destination
# test "generator runs without errors" do
... | 24.647059 | 61 | 0.735084 |
2624396d540b5c7089a5a78c7b5b8ce02ba4a1b7 | 948 | Spree::Product.class_eval do
def option_values
@_option_values ||= Spree::OptionValue.for_product(self)
end
def grouped_option_values
@_grouped_option_values ||= option_values.group_by(&:option_type)
@_grouped_option_values.sort_by { |option_type, option_values| option_type.position }
end
def v... | 29.625 | 89 | 0.703586 |
1c88fda8b4f708b130db93f22b09db82f736286c | 4,269 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core/post/windows/priv'
require 'msf/core/post/common'
require 'msf/core/post/windows/registry'
class MetasploitModule < Msf::Post
include Msf::Post::Windows::Priv
... | 32.587786 | 115 | 0.635278 |
f8f7a57b115f639dfce02e3068c22604f0f8bd7f | 7,819 | # encoding: utf-8
require 'spec_helper'
describe "mail encoding" do
it "should allow you to assign a mail wide charset" do
mail = Mail.new
mail.charset = 'utf-8'
mail.charset.should eq 'utf-8'
end
describe "using default encoding" do
it "should allow you to send in unencoded strings to fields a... | 39.291457 | 166 | 0.630388 |
bf5cf2a2e0197f1779278b6d1240dea92aa8dcd3 | 1,855 | # Copyright 2015 Google 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 agreed to in writing,... | 37.1 | 94 | 0.738544 |
33408bb4aefa417f2933c80620c45fd5e6c7fd50 | 1,507 |
# This file is automatically generated by puppet-swagger-generator and
# any manual changes are likely to be clobbered when the files
# are regenerated.
require_relative '../../../puppet_x/puppetlabs/kubernetes/provider'
Puppet::Type.type(:kubernetes_downward_api_projection).provide(:swagger, :parent => Puppe... | 24.704918 | 130 | 0.671533 |
f79f07b9acd351e0e2939d63e3addaf9eee43cb5 | 5,928 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.0.1-SNAPSHOT
=en... | 30.091371 | 214 | 0.627024 |
abdad802db37b74009700f2f168a2f145b4c6342 | 693 | require 'dragonfly'
Dragonfly.app.configure do
# Allow all URLs to be fetched.
fetch_url_whitelist [
/.*/
]
plugin :imagemagick
verify_urls true
secret Rails.application.secrets.dragonfly_secret
url_format "/media/:job/:name"
if Rails.env.test?
datastore :memory
else
datastore :file,
... | 20.382353 | 71 | 0.741703 |
1103e4dd0fc48e951932b79d56f9af3b67275696 | 3,953 | require 'spec_helper'
module Bmg
module Operator
describe Ungroup do
subject {
Ungroup.new(Type::ANY.with_keys(keys), operand, attrlist)
}
context 'with a candidate key that does not use the attrlist' do
let(:keys) {
[[:id], [:id, :grouped]]
}
describ... | 26.891156 | 109 | 0.374146 |
f7dc77edd54ff7f9044ac21e5ac3dbff13b11b17 | 2,328 | require 'bosh/director/core/templates'
require 'bosh/director/core/templates/job_template_renderer'
require 'bosh/director/core/templates/source_erb'
module Bosh::Director
class JobTemplateUnpackFailed < StandardError
end
module Core::Templates
class JobTemplateLoader
def initialize(logger, template_b... | 35.815385 | 93 | 0.630155 |
e834bc83cbba1bedc70c242d8492483e6fc051b6 | 3,925 | require 'rails_helper'
feature 'Event Creation', js: true do
before do
create :venue, title: 'Empire State Building'
create :venue, title: 'New Relic'
create :venue, title: 'Urban Airship'
end
scenario 'User adds an event at an existing venue' do
# visit '/'
# click_on 'Add an event'
vis... | 37.740385 | 107 | 0.690191 |
e88479cc3b16b3229d18d83530833a5b00cf15b6 | 1,794 | #
# Be sure to run `pod lib lint Libmuse.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 = 'Libmuse'
s... | 35.88 | 109 | 0.636009 |
3929aa66dcfcbd520724c682785c606f186710a7 | 814 | client = DocSpring::Client.new
template_id = 'tpl_000000000000000001'
<% if @template_type != :doc -%>
expect(client).to receive(:sleep).with(1).once
<% end -%>
response = client.generate_pdf(
template_id: template_id,
data: {
title: 'Test PDF',
description: 'This PDF is great!',
},
field_overrides: {
... | 26.258065 | 71 | 0.710074 |
5d944ec12badcc2973a4968613e550a49828da5f | 864 | #
# Copyright (c) 2016 Sam4Mobile
#
# 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 writ... | 36 | 74 | 0.769676 |
33e791de49f519e414f8792c24a27ca862e70ba0 | 2,299 | cask 'omnifocus' do
if MacOS.version <= :mavericks
version '2.0.4'
sha256 '3282eb7e41ec2638f68a92a6509eddd96a96c39b65b954dcedcc4e62289f22a9'
url "https://downloads.omnigroup.com/software/MacOSX/10.9/OmniFocus-#{version}.dmg"
elsif MacOS.version <= :yosemite
version '2.7.4'
sha256 'a273e55c15f825... | 47.895833 | 165 | 0.736407 |
79dd98ff052d95b63255d7a3c3286e8d73ac7c27 | 6,575 | module BlobHelper
def highlighter(blob_name, blob_content, nowrap: false)
Gitlab::Highlight.new(blob_name, blob_content, nowrap: nowrap)
end
def highlight(blob_name, blob_content, nowrap: false, plain: false)
Gitlab::Highlight.highlight(blob_name, blob_content, nowrap: nowrap, plain: plain)
end
def ... | 33.207071 | 143 | 0.675589 |
1d350ece3cdb81eceeeb596f5482383e18896c8f | 1,025 | class Staff::Base < ApplicationController
before_action :authorize
before_action :check_account
before_action :check_timeout
private def current_staff_member
if session[:staff_member_id]
@current_staff_member ||= StaffMember.find_by(id: session[:staff_member_id])
end
end
private def authoriz... | 23.837209 | 82 | 0.717073 |
f8488972f8fac44d79f8a2b52491bd8f7e685090 | 872 | # frozen_string_literal: true
require_relative 'lib/chinese_remainder'
input = ARGF.readlines.map(&:chomp)
class Bus
attr_accessor :id, :departure
def initialize(id)
@id = id.to_i
@departure = @id
end
end
# Part 1
start_time = input[0].to_i
buses = input[1].split(/,/).filter_map do |bus_id|
Bus.ne... | 20.27907 | 81 | 0.705275 |
0879fce69ca1a808b636546c7ee66e50e30df5e4 | 1,208 | require 'test_helper'
class Accounts::AccountCreatedEventTest < ActiveSupport::TestCase
def test_create
account = FactoryBot.build_stubbed(:simple_buyer, id: 1,
provider_account_id: 2)
event = Accounts::AccountCreatedEvent.create(account, user)
assert event
... | 28.093023 | 83 | 0.725166 |
f7308c1b416112500db62f381a983a382e2b94f6 | 1,463 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2017 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... | 32.511111 | 91 | 0.734108 |
62178e3c3b76481dbc674197734f74f44163b5d4 | 5,308 | #==
# Copyright (C) 2008 James S Urquhart
#
# 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, publ... | 30.682081 | 175 | 0.666918 |
e8c13d0d158033a7a32ef213811149d40e6d09bf | 785 | module Kuby::KubeDB::DSL::Catalog::V1alpha1
class RedisVersionSpec < ::KubeDSL::DSLObject
value_fields :deprecated, :version
object_field(:exporter) { Kuby::KubeDB::DSL::Catalog::V1alpha1::RedisVersionExporter.new }
object_field(:db) { Kuby::KubeDB::DSL::Catalog::V1alpha1::RedisVersionDatabase.new }
o... | 34.130435 | 116 | 0.696815 |
380a18818ab068d903319df2012dcd7f3bbff204 | 646 | # frozen_string_literal: true
class Projects::GrafanaApiController < Projects::ApplicationController
include RenderServiceResults
include MetricsDashboard
def proxy
result = ::Grafana::ProxyService.new(
project,
params[:datasource_id],
params[:proxy_path],
query_params.to_h
).exe... | 20.83871 | 70 | 0.724458 |
08ced4a9b946b25d6ed88238c52aa08e7fa41cd7 | 687 | # frozen_string_literal: true
# == Schema Information
#
# Table name: player_histories
#
# id :bigint not null, primary key
# kit_no :integer
# ovr :integer
# recorded_on :date
# value :integer
# created_at :datetime not null
# updated_at :datetime not nul... | 22.9 | 66 | 0.63901 |
bbf3fe32a3235e651adb80d6b7d3f6bb9240a77c | 416 | # frozen_string_literal: true
module InvisibleCollector
module Model
class Debit < AbstractModel
attr_accessor :number
attr_accessor :date
attr_accessor :gross_total
def initialize(options = {})
options = options.with_indifferent_access
@number = options[:number]
... | 21.894737 | 49 | 0.661058 |
bf42fdbda0b8ae860419e94fc90595636837feb5 | 280 | module Pageflow
class SubmitFileToZencoderJob
@queue = :default
extend StateMachineJob
def self.perform_with_result(file, options, api = ZencoderApi.instance)
file.job_id = api.create_job(file.output_definition)
file.save!
:ok
end
end
end
| 18.666667 | 75 | 0.703571 |
216fb33d2afb7fa24387ee0435673033aa28cd90 | 12,194 | require 'puppet/parameter/value_collection'
require 'pathname'
class Puppet::Type::Acl
# Ace is an Access Control Entry for use with the Access
# Control List (ACL) type. ACEs contain information about
# the trustee, the rights, and on some systems how they are
# inherited and propagated to subtypes.
class A... | 34.156863 | 315 | 0.644169 |
4aa53081f7b4b00796f13ee6cd09d1599a3e51fa | 1,116 | #--------------------------
#
# @class Memberships::BecomeFormerIndividualMemberActions
#
# @desc Responsibility: Do all the things that need to be done when an individual membership
# enters the renewal grace period
#
#
# @author Ashley Engelund (ashley.engelund@gmail.com weedySeaDragon @ github)
# @date 4/1/21
#... | 27.219512 | 99 | 0.655018 |
edfc52599e73e76439887ca33b0d7c65c1305129 | 38 | class Bucket < ActiveRecord::Base
end
| 12.666667 | 33 | 0.789474 |
1859cc89de9c5f3a4f526f6938b7610cb9b6ca71 | 781 | class FightClubApp
configure :development do
set :database, 'sqlite:///dev.db'
set :show_exceptions, true
end
configure :production do
db = URI.parse(ENV['DATABASE_URL'] || 'postgres:///localhost/mydb')
ActiveRecord::Base.establish_connection(
:adapter => db.scheme == 'postgres' ? 'postgresql' :... | 27.892857 | 96 | 0.640205 |
18d63306159f9304fa4488ed8e97d9dcbc7913df | 113 | module AthenaHealth
class AnalyteCollection < BaseCollection
attribute :analytes, Array[Analyte]
end
end
| 18.833333 | 42 | 0.787611 |
613dfd9d7f4076a8d20855a1a5f73785d77cadae | 1,330 | # Clean this up. Have it assume there's an install?
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require "panini"
grammar = Panini::Grammar.new
# ================
# = Nonterminals =
# ================
expression = grammar.add_nonterminal("EXPR")
term... | 25.576923 | 66 | 0.631579 |
267c7b65edf69ad1611619cfa58596f3865b7eda | 1,962 | #
# Be sure to run `pod lib lint FlexLib.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 = 'FlexLib'
s... | 35.035714 | 102 | 0.650866 |
11064409a858388e897b13a788f4a3cd8c0b6021 | 401 | class Api::UsersController < ApplicationController
def index
@users = User.all
end
def create
@user = User.new(user_params)
if @user.save
sign_in!(@user)
render 'api/users/show'
else
render(
json: @user.errors.full_messages,
status: 422
)
end
end
... | 16.708333 | 54 | 0.618454 |
f85eeadd90a59a39d63ededd3b90284f852175b7 | 496 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | 62 | 171 | 0.832661 |
bf855c37e36853e2b0172e7ff69555ecd5ab00a7 | 5,273 | #
# Be sure to run `pod spec lint WalrusKit.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
# To see working Podspecs in the CocoaPods repo see https://gith... | 37.935252 | 109 | 0.604969 |
6a68365b9c9253a5aefbf85af067acca43bba126 | 1,298 | # frozen_string_literal: true
ORIG_ARGV = ARGV.dup
require "active_support/core_ext/kernel/reporting"
silence_warnings do
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
end
require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"
... | 28.217391 | 75 | 0.77735 |
18dc0c05b3feb90b698a090c4a0fc68138aee3c5 | 681 | require 'spec_helper'
describe GatherContent::Api::Account, vcr: true do
let(:account_id) { 123456 }
let(:account) { GatherContent::Api::Account.new(account_id) }
describe '.new' do
subject { account }
it { is_expected.to be_a GatherContent::Api::Account }
end
describe '#fetch' do
subject { ac... | 23.482759 | 63 | 0.643172 |
39d94c9a73e4412465daa8ae6b00ab80c7ab4ddb | 2,359 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "blue_cross_pets/version"
Gem::Specification.new do |spec|
spec.name = "blue_cross_pets"
spec.version = BlueCrossPets::VERSION
spec.summary = %q{CLI that display Blue Cross UK adoptabl... | 51.282609 | 260 | 0.686732 |
919096f739369a15e65301ffd3a6cef45eecdae6 | 503 | # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License ... | 45.727273 | 90 | 0.759443 |
ac14d7e35b46a70164e534b0d43e3007a61757ac | 110 | FactoryGirl.define do
factory :subject do
sequence(:name) { |n| "#{Faker::Lorem.word} #{n}" }
end
end
| 18.333333 | 55 | 0.627273 |
e92c783ea37176d1d7de7825e9f97f1e40be40f9 | 362 | class Ruian
class Model
class Row < Struct.new(:adm_code, :city_code, :city_name, :momc_code,
:momc_name, :mop_code, :mop_name, :city_part_code,
:city_part_name, :street_name_code, :street_name, :so_type,
:e, :o, :o_code, :zip, :gis_... | 36.2 | 86 | 0.549724 |
b9e5cacb697e31b883755f0cd3e71aa7a471e64a | 135 | # frozen_string_literal: true
class VACOLS::Actcode < VACOLS::Record
self.table_name = "actcode"
self.primary_key = "actckey"
end
| 19.285714 | 38 | 0.748148 |
611226e48adc170aad7f03035b6102dfb9f0e646 | 653 | # frozen_string_literal: true
module Mutations
module Issues
class SetLocked < Base
graphql_name 'IssueSetLocked'
argument :locked,
GraphQL::BOOLEAN_TYPE,
required: true,
description: 'Whether or not to lock discussion on the issue.'
def resolve(pr... | 24.185185 | 91 | 0.614089 |
abfebcd74c32a59cdd56317d5039822c572f77eb | 867 | # デフォルト
# max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
# min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
# threads min_threads_count, max_threads_count
# worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
# port ENV.fetch("PORT") { 3000 }
# environment ENV... | 43.35 | 79 | 0.739331 |
1d55b2db52a3743bb02c4bdc5df117dfdb845a33 | 281 | require "vagrant"
module VagrantPlugins
module GuestFedora
autoload :Guest, File.expand_path("../guest", __FILE__)
class Plugin < Vagrant.plugin("1")
name "Fedora guest"
description "Fedora guest support."
guest("fedora") { Guest }
end
end
end
| 18.733333 | 59 | 0.661922 |
01862ee6b0b3b0c6e98638cebe6e7c9eafe5adb3 | 411 | # encoding: UTF-8
require "#{File.dirname(__FILE__)}/../lib/hammer"
module HammerMocks
def self.included(base)
base.let(:container_mock) { mock(:container, :drop_context => true) }
base.let(:context_mock) { mock(:context, :conteiner => container_mock) }
base.let(:component_mock) { mock(:component, :cont... | 27.4 | 76 | 0.705596 |
5ddca3b1b260821adc1d3f2b5459bf2460c43cf5 | 5,538 | require 'test_helper'
class RequestChangeTest < ActiveSupport::TestCase
# заявка на изменение - выслана на согласование
def setup
@admin = users(:admin)
@budget_owner = users(:budget_owner)
@budget_top_owner = users(:budget_top_owner)
@fo_user = users(:fo_user)
current_user = @ad... | 36.196078 | 191 | 0.747382 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.