hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
cbbaa43094218a7aa9131c81f89aa10e41dac35b
diff --git a/nion/instrumentation/stem_controller.py b/nion/instrumentation/stem_controller.py index <HASH>..<HASH> 100644 --- a/nion/instrumentation/stem_controller.py +++ b/nion/instrumentation/stem_controller.py @@ -882,8 +882,11 @@ class DriftView(EventLoopMonitor): self.__remove_graphic() # it already exists on the correct display item, update it. if self.__graphic: - self.__graphic.bounds = tuple(self.__stem_controller.drift_region) - self.__graphic.rotation = self.__stem_controller.drift_rotation + # only fire messages when something changes to avoid flickering, difficulty editing. + if self.__graphic.bounds != tuple(self.__stem_controller.drift_region): + self.__graphic.bounds = tuple(self.__stem_controller.drift_region) + if self.__graphic.rotation != self.__stem_controller.drift_rotation: + self.__graphic.rotation = self.__stem_controller.drift_rotation # otherwise create it if there is a display item for it elif drift_display_item: drift_graphic = Graphics.RectangleGraphic()
Only update drift region if something changes. Improves flickering.
nion-software_nionswift-instrumentation-kit
train
py
081c06ac76f5a93315f2d9728f295856f227b03a
diff --git a/keen/client.py b/keen/client.py index <HASH>..<HASH> 100644 --- a/keen/client.py +++ b/keen/client.py @@ -407,7 +407,8 @@ class KeenClient(object): return self.api.query("multi_analysis", params) def get_params(self, event_collection=None, timeframe=None, timezone=None, interval=None, filters=None, - group_by=None, target_property=None, latest=None, email=None, analyses=None, steps=None): + group_by=None, target_property=None, latest=None, email=None, analyses=None, steps=None, + property_names=None): params = {} if event_collection: params["event_collection"] = event_collection @@ -437,5 +438,7 @@ class KeenClient(object): params["analyses"] = json.dumps(analyses) if steps: params["steps"] = json.dumps(steps) + if property_names: + params["property_names"] = json.dumps(property_names) return params
Update get_params to accommodate for property_names
keenlabs_KeenClient-Python
train
py
9feb328d2e8b7c9871613e4cf3c7104cc5b1fc63
diff --git a/lib/event_sourcery/event_processing/esp_process.rb b/lib/event_sourcery/event_processing/esp_process.rb index <HASH>..<HASH> 100644 --- a/lib/event_sourcery/event_processing/esp_process.rb +++ b/lib/event_sourcery/event_processing/esp_process.rb @@ -21,7 +21,7 @@ module EventSourcery error_handler.with_error_handling do EventSourcery.logger.info("Starting #{processor_name}") subscribe_to_event_stream - EventSourcery.logger.info("Stopping #{@event_processor.processor_name}") + EventSourcery.logger.info("Stopping #{processor_name}") end rescue Exception => e EventSourcery.logger.fatal("An unhandled exception occurred in #{processor_name}")
Use processor_name method to be consistent in ESPProcess
envato_event_sourcery
train
rb
64b3c003a9a975a3b6512458bd66b1ab2201bd00
diff --git a/lib/backburner/worker.rb b/lib/backburner/worker.rb index <HASH>..<HASH> 100644 --- a/lib/backburner/worker.rb +++ b/lib/backburner/worker.rb @@ -58,22 +58,6 @@ module Backburner @connection ||= Connection.new(Backburner.configuration.beanstalk_url) end - # Retries the given command specified in the block several times if there is a connection error - # Used to execute beanstalkd commands in a retryable way - # - # @example - # retryable_command { ... } - # @raise [Beaneater::NotConnected] If beanstalk fails to connect multiple times. - # - def self.retryable_command(max_tries=8, &block) - begin - yield - rescue Beaneater::NotConnected => e - retry_connection!(max_tries) - yield - end - end - # List of tube names to be watched and processed attr_accessor :tube_names @@ -112,7 +96,9 @@ module Backburner # Triggers this worker to shutdown def shutdown - log_info 'Worker exiting...' + Thread.new do + log_info 'Worker exiting...' + end Kernel.exit end
Use Thread to log message at exit Clean up duplicate code (cherry picked from commit <I>ec8ac)
nesquena_backburner
train
rb
f7103289a885616ff418d71b0a33bb60ffd2a418
diff --git a/src/pusher.js b/src/pusher.js index <HASH>..<HASH> 100644 --- a/src/pusher.js +++ b/src/pusher.js @@ -250,7 +250,10 @@ Pusher.Util = { } }; +// To receive log output provide a Pusher.log function, for example +// Pusher.log = function(m){console.log(m)} Pusher.debug = function() { + if (!Pusher.log) { return } var m = ["Pusher"] for (var i = 0; i < arguments.length; i++){ if (typeof arguments[i] === "string") { @@ -272,7 +275,6 @@ Pusher.channel_auth_endpoint = '/pusher/auth'; Pusher.connection_timeout = 5000; Pusher.cdn_http = '<CDN_HTTP>' Pusher.cdn_https = '<CDN_HTTPS>' -Pusher.log = function(msg){}; // e.g. function(m){console.log(m)} Pusher.data_decorator = function(event_name, event_data){ return event_data }; // wrap event_data before dispatching Pusher.allow_reconnect = true; Pusher.channel_auth_transport = 'ajax';
Optimization: don't construct log msg unless log function defined
pusher_pusher-js
train
js
27bc47973f7cd3d40074d1cc331d7a9ea71d0ea3
diff --git a/shoebot/data/__init__.py b/shoebot/data/__init__.py index <HASH>..<HASH> 100644 --- a/shoebot/data/__init__.py +++ b/shoebot/data/__init__.py @@ -82,3 +82,9 @@ CLOSE = "close" CENTER = 'center' CORNER = 'corner' CORNERS = "corners" + +LEFT = 'left' +RIGHT = 'right' + +RGB = "rgb" +HSB = "hsb" \ No newline at end of file
LEFT/RIGHT/HSB added to __init__
shoebot_shoebot
train
py
e480bbd0d70eba7f43802c0df9c68afeda507396
diff --git a/fastlane/spec/action_metadata_spec.rb b/fastlane/spec/action_metadata_spec.rb index <HASH>..<HASH> 100644 --- a/fastlane/spec/action_metadata_spec.rb +++ b/fastlane/spec/action_metadata_spec.rb @@ -3,6 +3,24 @@ require 'fastlane/documentation/actions_list' describe Fastlane::Action do Fastlane::ActionsList.all_actions do |action, name| describe name do + it "`fastlane_class` and `action` are matching" do + # `to_s.gsub(/::.*/, '')` to convert + # "Fastlane::Actions::AdbDevicesAction" + # to + # "AdbDevicesAction" + # + expect(name.fastlane_class + "Action").to eq(action.to_s.gsub(/^.*::/, '')) + end + + it "file name follows our convention and matches the class name" do + exceptions = %w(plugin_scores xcarchive xcbuild xcclean xcexport xctest) + + action_path = File.join(Dir.pwd, "fastlane/lib/fastlane/actions/#{name}.rb") + unless exceptions.include?(name) + expect(File.exist?(action_path)).to eq(true) + end + end + it "contains a valid category" do expect(action.category).to_not be_nil expect(action.category).to be_kind_of(Symbol)
Add tests to verify the built-in actions follow the conventions (#<I>)
fastlane_fastlane
train
rb
3a1698bca906ddb7808be19427ed96c761641cb2
diff --git a/util/src/main/java/org/vesalainen/code/PropertySetter.java b/util/src/main/java/org/vesalainen/code/PropertySetter.java index <HASH>..<HASH> 100644 --- a/util/src/main/java/org/vesalainen/code/PropertySetter.java +++ b/util/src/main/java/org/vesalainen/code/PropertySetter.java @@ -28,13 +28,13 @@ public interface PropertySetter * @return */ String[] getPrefixes(); - void set(String property, boolean arg); - void set(String property, byte arg); - void set(String property, char arg); - void set(String property, short arg); - void set(String property, int arg); - void set(String property, long arg); - void set(String property, float arg); - void set(String property, double arg); - void set(String property, Object arg); + default void set(String property, boolean arg){} + default void set(String property, byte arg){} + default void set(String property, char arg){} + default void set(String property, short arg){} + default void set(String property, int arg){} + default void set(String property, long arg){} + default void set(String property, float arg){} + default void set(String property, double arg){} + default void set(String property, Object arg){} }
Changed set methods to have no-op defaults
tvesalainen_util
train
java
f91a77351443aeb1990b188b77f96a0128f7cddb
diff --git a/pyinstrument/middleware.py b/pyinstrument/middleware.py index <HASH>..<HASH> 100644 --- a/pyinstrument/middleware.py +++ b/pyinstrument/middleware.py @@ -1,7 +1,7 @@ from django.http import HttpResponse from django.conf import settings from pyinstrument import Profiler -import platform +import sys import time import os try: @@ -34,7 +34,7 @@ class ProfilerMiddleware(MiddlewareMixin): path = request.get_full_path().replace('/', '_')[:100] # Swap ? for _qs_ on Windows, as it does not support ? in filenames. - if platform.platform().startswith('Windows'): + if sys.platform in ['win32', 'cygwin']: path = path.replace('?', '_qs_') if profile_dir:
Use sys.platform rather than platform.platform(), as joerick RTFM for me :)
joerick_pyinstrument
train
py
13aaac0d1575fb4805d71bc7f2ee390741eaec41
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ setup( zip_safe=False, include_package_data=True, package_data={'': ['README.rst']}, - install_requires=['django>=2.2', 'jsonfield>=3.0', 'bleach', 'pytz'], + install_requires=['django>=2.2', 'jsonfield>=3.0', 'bleach<=4.1.0', 'pytz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment',
Pin `bleach to` version <I> in setup.py (#<I>) Dependency `bleach` was updated to <I> and django-post_office tests are failing with this version of bleach. Pinning the version to `bleach<=<I>` makes tests run again for now.
ui_django-post_office
train
py
537c16561318df78f1a512101d0eca1b0593616e
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index <HASH>..<HASH> 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -200,8 +200,11 @@ class easy_install(Command): ) def delete_blockers(self, blockers): - for filename in blockers: - if os.path.exists(filename) or os.path.islink(filename): + extant_blockers = ( + filename for filename in blockers + if os.path.exists(filename) or os.path.islink(filename) + ) + for filename in extant_blockers: log.info("Deleting %s", filename) if not self.dry_run: if (os.path.isdir(filename) and
Filter blockers in the iterable
pypa_setuptools
train
py
2d7aa0a7896437c9dac3726a9545dab3776c5b72
diff --git a/pkg/apis/kops/versions.go b/pkg/apis/kops/versions.go index <HASH>..<HASH> 100644 --- a/pkg/apis/kops/versions.go +++ b/pkg/apis/kops/versions.go @@ -27,8 +27,6 @@ import ( func ParseKubernetesVersion(version string) (*semver.Version, error) { sv, err := semver.ParseTolerant(version) if err != nil { - glog.Warningf("error parsing kubernetes semver %q, falling back to string matching", version) - v := strings.Trim(version, "v") if strings.HasPrefix(v, "1.3.") { sv = semver.Version{Major: 1, Minor: 3} @@ -51,8 +49,10 @@ func ParseKubernetesVersion(version string) (*semver.Version, error) { } else if strings.Contains(v, "/v1.7.") { sv = semver.Version{Major: 1, Minor: 7} } else { + glog.Errorf("unable to parse Kubernetes version %q", version) return nil, fmt.Errorf("unable to parse kubernetes version %q", version) } + glog.V(1).Infof("Kubernetes version %q string matched to %v", version, sv) } return &sv, nil
Quiet version string match (it's really spammy in logs)
kubernetes_kops
train
go
7a9a51c5f3ef626e409a062514bb6a3c0d1bd490
diff --git a/src/PHPHtmlParser/Dom.php b/src/PHPHtmlParser/Dom.php index <HASH>..<HASH> 100644 --- a/src/PHPHtmlParser/Dom.php +++ b/src/PHPHtmlParser/Dom.php @@ -527,6 +527,11 @@ class Dom } } + //sometime need predicate an encode is from encoding + if ($this->options->get('useFromEncoding') != NULL) { + $str = mb_convert_encoding( $str, "UTF-8", $this->options->get('useFromEncoding')); + } + // remove white space before closing tags $str = mb_eregi_replace("'\s+>", "'>", $str); if ($str === false) {
Need from encoding Add options param is useFromEncoding therefore predicate an encode is from encoding
paquettg_php-html-parser
train
php
a12e7a9e6087cf456797ee7eda8304dbf70634d3
diff --git a/learning.py b/learning.py index <HASH>..<HASH> 100644 --- a/learning.py +++ b/learning.py @@ -410,7 +410,7 @@ class Linearlearner(Learner): class EnsembleLearner(Learner): """Given a list of learning algorithms, have them vote.""" - def __init__(self, learners=[]): + def __init__(self, learners): self.learners = learners def train(self, dataset):
EnsembleLearner: Removed unused and somewhat dangerous default learners=[].
hobson_aima
train
py
97bebceaa3dd87cbf8db36d1a4c30e6895f3b2ed
diff --git a/lib/goodbye_chatwork.rb b/lib/goodbye_chatwork.rb index <HASH>..<HASH> 100644 --- a/lib/goodbye_chatwork.rb +++ b/lib/goodbye_chatwork.rb @@ -27,8 +27,13 @@ module GoodbyeChatwork end def login - @client.post '/login.php', email: @id, password: @pw, autologin: 'on' - r = @client.get '/' + login_r = @client.post '/login.php', email: @id, password: @pw, autologin: 'on' + if login_r.env.status == 302 + @client.url_prefix = URI.parse(login_r.env.response_headers[:location].match(/^https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\:\@&=+\$,%#]+)/).to_s) + @client.get login_r.env.response_headers[:location] + end + + r = @client.get "/" self.wait self.info "login as #{@id} ..." @token = r.body.match(/var ACCESS_TOKEN = '(.+)'/).to_a[1]
Complying with kddi chatwork
swdyh_goodbye_chatwork
train
rb
7a8db93945ce7eb1f1cd2a029d1039ad4e21f828
diff --git a/interp/interp.go b/interp/interp.go index <HASH>..<HASH> 100644 --- a/interp/interp.go +++ b/interp/interp.go @@ -435,10 +435,15 @@ type Runner struct { noErrExit bool err error // current shell exit code or fatal error - exit int // current exit status code - lastExit int // last exit status code exitShell bool // whether the shell needs to exit + // The current and last exit status code. They can only be different if + // the interpreter is in the middle of running a statement. In that + // scenario, 'exit' is the status code for the statement being run, and + // 'lastExit' corresponds to the previous statement that was run. + exit int + lastExit int + bgShells errgroup.Group opts runnerOpts
interp: expand a bit on exit vs lastExit The difference is a bit subtle.
mvdan_sh
train
go
091eacef15d5f40366ca5a4d7de5c91931a706eb
diff --git a/woocommerce/product-searchform.php b/woocommerce/product-searchform.php index <HASH>..<HASH> 100644 --- a/woocommerce/product-searchform.php +++ b/woocommerce/product-searchform.php @@ -23,6 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) { ?> <form role="search" method="get" class="woocommerce-product-search" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <div class="input-group"> + <label class="screen-reader-text" for="woocommerce-product-search-field-<?php echo isset( $index ) ? absint( $index ) : 0; ?>"><?php esc_html_e( 'Search for:', 'woocommerce' ); ?></label> <input type="search" id="woocommerce-product-search-field-<?php echo isset( $index ) ? absint( $index ) : 0; ?>" class="search-field field form-control" placeholder="<?php echo esc_attr__( 'Search products&hellip;', 'understrap' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> <input type="hidden" name="post_type" value="product" /> <span class="input-group-append">
Add screen reader text label This can be changed to "sr-only" class for Bootstrap later. For now this adds it as it is in the Woo files, using the WordPress "screen-reader-text" class.
understrap_understrap
train
php
b6bf1cf091b88d104dca6ff0b219426ac34d98fc
diff --git a/src/RecordsChanges.php b/src/RecordsChanges.php index <HASH>..<HASH> 100644 --- a/src/RecordsChanges.php +++ b/src/RecordsChanges.php @@ -75,6 +75,12 @@ trait RecordsChanges { } public function __call($method, $parameters){ + $m = $this->_magic($method, $parameters); + + return $m ?: parent::__call($method, $parameters); + } + + protected function _magic($method, $parameters){ //check for history $matches = []; if(preg_match('/(.+)(?=History)/', $method, $matches)){ @@ -82,6 +88,6 @@ trait RecordsChanges { return $this->getHistory($attr); } - return parent::__call($method, $parameters); + return null; } } \ No newline at end of file
moved magic login to seperate method
RMoorePHP_change-recorder
train
php
a178b6c4926cbe1efe456f7610941f59a1050f05
diff --git a/lib/chef/provider/remote_directory.rb b/lib/chef/provider/remote_directory.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/remote_directory.rb +++ b/lib/chef/provider/remote_directory.rb @@ -169,11 +169,10 @@ class Chef dir end - end + def whyrun_supported? + true + end - def whyrun_supported? - true end - end end diff --git a/spec/unit/provider_spec.rb b/spec/unit/provider_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/provider_spec.rb +++ b/spec/unit/provider_spec.rb @@ -73,6 +73,10 @@ describe Chef::Provider do @provider.current_resource.should eql(nil) end + it "should not support whyrun by default" do + @provider.send(:whyrun_supported?).should eql(false) + end + it "should return true for action_nothing" do @provider.action_nothing.should eql(true) end
[CHEF-<I>] All providers have whyrun enabled by default due to RemoteDirectory
chef_chef
train
rb,rb
842fda306894d81956f9beca9e4ef0297910b105
diff --git a/tests/TestCase/View/Helper/TimeHelperTest.php b/tests/TestCase/View/Helper/TimeHelperTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/View/Helper/TimeHelperTest.php +++ b/tests/TestCase/View/Helper/TimeHelperTest.php @@ -537,8 +537,8 @@ class TimeHelperTest extends TestCase Time::setDefaultLocale('fr_FR'); $time = new \Cake\I18n\FrozenTime('Thu Jan 14 13:59:28 2010'); $result = $this->Time->format($time, \IntlDateFormatter::FULL); - $expected = 'jeudi 14 janvier 2010 13:59:28'; - $this->assertStringStartsWith($expected, $result); + $this->assertContains('jeudi 14 janvier 2010', $result); + $this->assertContains('13:59:28', $result); } /**
Fix test that fails on new libicu.
cakephp_cakephp
train
php
5eb6c27693fd72f85b705aa4c4aa50ebd3e619ef
diff --git a/src/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java b/src/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java index <HASH>..<HASH> 100644 --- a/src/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java +++ b/src/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java @@ -139,6 +139,8 @@ public class JdbcCpoAdapter implements CpoAdapter{ private boolean batchUpdatesSupported_=false; + protected JdbcCpoAdapter(){} + /** * Creates a JdbcCpoAdapter. * @@ -190,7 +192,7 @@ public class JdbcCpoAdapter implements CpoAdapter{ processDatabaseMetaData(); } - public JdbcCpoAdapter(DataSource metaSource, String metaSourceName, Connection c, boolean batchSupported) + protected JdbcCpoAdapter(DataSource metaSource, String metaSourceName, Connection c, boolean batchSupported) throws CpoException { setMetaDataSource(metaSource); setStaticConnection(c);
made the constructor that takes a connection protected. Made a protected default constructor.
synchronoss_cpo-api
train
java
fad3619e96c1ceea98b1c394e32bf11a43e1e360
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -362,9 +362,8 @@ module Sinatra last_modified opts[:last_modified] if opts[:last_modified] - file = Rack::File.new nil - file.path = path - result = file.serving env + file = Rack::File.new(settings.public_folder) + result = file.call(env) result[1].each { |k,v| headers[k] ||= v } headers['Content-Length'] = result[1]['Content-Length'] opts[:status] &&= Integer(opts[:status]) diff --git a/test/settings_test.rb b/test/settings_test.rb index <HASH>..<HASH> 100644 --- a/test/settings_test.rb +++ b/test/settings_test.rb @@ -244,7 +244,7 @@ class SettingsTest < Minitest::Test get '/' assert_equal 500, status assert body.include?("StandardError") - assert body.include?("<code>show_exceptions</code> setting") + assert body.include?("<code>Rack::ShowExceptions</code>") end it 'does not override app-specified error handling when set to :after_handler' do
Updated ShowExceptions notification, Rack::File usage
sinatra_sinatra
train
rb,rb
147ab6243c2b89a7d5c8aa67c1ed3b9abf272caf
diff --git a/definitions/npm/chai_v4.x.x/flow_v0.15.0-/chai_v4.x.x.js b/definitions/npm/chai_v4.x.x/flow_v0.15.0-/chai_v4.x.x.js index <HASH>..<HASH> 100644 --- a/definitions/npm/chai_v4.x.x/flow_v0.15.0-/chai_v4.x.x.js +++ b/definitions/npm/chai_v4.x.x/flow_v0.15.0-/chai_v4.x.x.js @@ -107,6 +107,7 @@ declare module "chai" { rejectedWith: (value: mixed) => Promise<mixed> & ExpectChain<T>, rejected: () => Promise<mixed> & ExpectChain<T>, notify: (callback: () => mixed) => ExpectChain<T>, + fulfilled: () => Promise<mixed> & ExpectChain<T>, // chai-subset containSubset: (obj: Object | Object[]) => ExpectChain<T>
Add fullfilled support for chai_v4.x.x (#<I>)
flow-typed_flow-typed
train
js
3c8e62a04dfe9cb6726b9738dfb00ec8441e8b4d
diff --git a/src/Helmet.js b/src/Helmet.js index <HASH>..<HASH> 100644 --- a/src/Helmet.js +++ b/src/Helmet.js @@ -373,7 +373,7 @@ const Helmet = (Component) => { shouldComponentUpdate(nextProps) { return !deepEqual(this.props, nextProps); } - + // Component.peak comes from react-side-effect: // For testing, you may use a static peek() method available on the returned component. // It lets you get the current state without resetting the mounted instance stack.
Lint error from trailing spaces.
nfl_react-helmet
train
js
dd75a3929a1dbdb0b541432ab2517820a09d6d8c
diff --git a/lib/event_bus/redis/queue.js b/lib/event_bus/redis/queue.js index <HASH>..<HASH> 100644 --- a/lib/event_bus/redis/queue.js +++ b/lib/event_bus/redis/queue.js @@ -7,8 +7,8 @@ var RedisEventBus; var BSON = require("bson").pure().BSON; inherit(RedisEventBusQueue, CommonEventBusQueue); - -var QUEUE_KEY_PREFIX = "event-bus:queues"; +var NODE_ENV = process.env.NODE_ENV; +var QUEUE_KEY_PREFIX = "event-bus:queues:" + NODE_ENV; var QUEUE_SET_KEY = QUEUE_KEY_PREFIX; var IN_QUEUE_LIST_KEY_PREFIX = QUEUE_KEY_PREFIX + ":in:"; var OUT_QUEUE_LIST_KEY_PREFIX = QUEUE_KEY_PREFIX + ":out:";
Avoid mixing up events from different environments in Redis event queue (close #<I>) The NODE_ENV value is appended to the Redis queue key name so that instances of a single app can run simultaneously on a single Redis server given they don't share the same environment value.
jbpros_plutonium
train
js
71e3b3833477b95aaf89686bb048a80f148e4787
diff --git a/src/routes.php b/src/routes.php index <HASH>..<HASH> 100644 --- a/src/routes.php +++ b/src/routes.php @@ -220,7 +220,7 @@ if( ( $conf = config( 'shop.routes.default', ['prefix' => 'shop', 'middleware' = Route::match( array( 'GET', 'POST' ), '{f_name}~{f_catid}', array( 'as' => 'aimeos_shop_tree', 'uses' => 'Aimeos\Shop\Controller\CatalogController@treeAction' - ) )->where( ['site' => '[a-z0-9\.\-]+', 'f_name' => '[^~]+'] ); + ) )->where( ['site' => '[a-z0-9\.\-]+', 'f_name' => '[^~]*'] ); Route::match( array( 'GET', 'POST' ), '{d_name}/{d_pos?}/{d_prodid?}', array( 'as' => 'aimeos_shop_detail',
Allow empty category names for catalog tree route
aimeos_aimeos-laravel
train
php
88aba05d002aa0d65cbacf37aaa34e4370a390d6
diff --git a/rest_framework_swagger/docgenerator.py b/rest_framework_swagger/docgenerator.py index <HASH>..<HASH> 100644 --- a/rest_framework_swagger/docgenerator.py +++ b/rest_framework_swagger/docgenerator.py @@ -81,7 +81,7 @@ class DocumentationGenerator(object): def __get_nickname__(self, callback): """ Returns the APIView's nickname """ - return self.__get_name__(callback) + return self.__get_name__(callback).replace(' ', '_') def __get_notes__(self, callback, method=None): """
Removed space in 'nickname' param which broke the click expand/collapse functionality for the HTTP method items
marcgibbons_django-rest-swagger
train
py
5efb010355447e51f32ab4966f1937727d7b34ab
diff --git a/src/Result/Refund/Refund.php b/src/Result/Refund/Refund.php index <HASH>..<HASH> 100644 --- a/src/Result/Refund/Refund.php +++ b/src/Result/Refund/Refund.php @@ -22,23 +22,17 @@ use Paynl\Error\Error; use Paynl\Result\Result; /** - * Description of Transaction + * Description of Refund * * @author Andy Pieters <andy@pay.nl> */ class Refund extends Result { /** - * @return string The transaction id + * @return string The Refund id */ public function getId() { return $this->data['refundId']; } - - public function info() - { - return $this->data; - } - }
getData function already exists and change some text
paynl_sdk
train
php
6be52100bf32c032a6ca932d1c9fad1b21c4226f
diff --git a/faq-bundle/src/ContaoManager/Plugin.php b/faq-bundle/src/ContaoManager/Plugin.php index <HASH>..<HASH> 100644 --- a/faq-bundle/src/ContaoManager/Plugin.php +++ b/faq-bundle/src/ContaoManager/Plugin.php @@ -22,14 +22,14 @@ use Contao\ManagerBundle\ContaoManager\Bundle\ParserInterface; class Plugin implements BundlePluginInterface { /** - * @inheritdoc + * @{inheritdoc} */ public function getBundles(ParserInterface $parser) { return [ BundleConfig::create('Contao\FaqBundle\ContaoFaqBundle') ->setLoadAfter(['Contao\CoreBundle\ContaoCoreBundle']) - ->setReplace(['faq']) + ->setReplace(['faq']), ]; } }
[Faq] Fix the coding style.
contao_contao
train
php
44934c7ccbdc1550c31774480fac6f367f5fe6d4
diff --git a/src/frontend/org/voltdb/planner/WriterSubPlanAssembler.java b/src/frontend/org/voltdb/planner/WriterSubPlanAssembler.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/planner/WriterSubPlanAssembler.java +++ b/src/frontend/org/voltdb/planner/WriterSubPlanAssembler.java @@ -66,13 +66,13 @@ public class WriterSubPlanAssembler extends SubPlanAssembler { AbstractPlanNode nextPlan() { if (!m_generatedPlans) { // Analyze join conditions - m_parsedStmt.m_joinTree.analyzeJoinExpressions(m_parsedStmt.m_noTableSelectionList); + assert (m_parsedStmt.m_joinTree != null); + JoinNode tableNode = (JoinNode) m_parsedStmt.m_joinTree.clone(); + tableNode.analyzeJoinExpressions(m_parsedStmt.m_noTableSelectionList); // these just shouldn't happen right? assert(m_parsedStmt.m_noTableSelectionList.size() == 0); m_generatedPlans = true; - assert (m_parsedStmt.m_joinTree != null); - JoinNode tableNode = m_parsedStmt.m_joinTree; // This is either UPDATE or DELETE statement. Consolidate all expressions // into the WHERE list. tableNode.m_whereInnerList.addAll(tableNode.m_joinInnerList);
Clone the join node tree to avoid the duplicate predicates ENG-<I>
VoltDB_voltdb
train
java
d7586dee38a700db938783e4665cde83bea2d27a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -82,10 +82,10 @@ CarteroNodeHook.prototype.getAssetsForEntryPoint = function( entryPointPath, cb } }; -CarteroNodeHook.prototype.getAssetUrl = function( assetSrcPath, cb ) { +CarteroNodeHook.prototype.getAssetUrl = function( assetSrcAbsPath) { var _this = this; - var assetPath = _this.metaData.assetMap && _this.metaData.assetMap[ assetSrcPath ]; + var assetPath = _this.metaData.assetMap && _this.metaData.assetMap[ assetSrcAbsPath ]; return _this.outputDirUrl && assetPath ? path.join( _this.outputDirUrl, assetPath ) : assetPath; };
Fix fn signature, not async
rotundasoftware_cartero-node-hook
train
js
6c4e1c8ce7ba859600b6e82aab2c363c26aba197
diff --git a/armet/resources/managed/base.py b/armet/resources/managed/base.py index <HASH>..<HASH> 100644 --- a/armet/resources/managed/base.py +++ b/armet/resources/managed/base.py @@ -229,7 +229,7 @@ class ManagedResource(base.Resource): if name not in item and attribute.required: raise ValidationError('Must be provided.') - except (AssertionError, ValueError) as ex: + except AssertionError as ex: self._errors[attribute.name] = [str(ex)] value = None
Decided to remove this because a test was failing
armet_python-armet
train
py
b39ad49b7b39834e23d3745323399c4c4cd364c2
diff --git a/packages/create-razzle-app/lib/index.js b/packages/create-razzle-app/lib/index.js index <HASH>..<HASH> 100644 --- a/packages/create-razzle-app/lib/index.js +++ b/packages/create-razzle-app/lib/index.js @@ -20,7 +20,7 @@ const officialExamplesApiUrl = 'https://api.github.com/repos/jaredpalmer/razzle/contents/examples'; const branch = 'next-awesome'; // this line auto updates when yarn update-examples is run -const razzlePkg = `razzle${branch == 'master' ? '' : '@' + branch}`; +const razzlePkg = `razzle${branch == 'canary' ? '@' + branch : '' }`; const getOfficialExamples = () => { if (typeof process.env.CI === 'undefined') {
fix(create-razzle-app): reverse the logic for razzle version tag
jaredpalmer_razzle
train
js
35eae0ab99fdc22e322207d590271199c19e5725
diff --git a/brother_ql/raster.py b/brother_ql/raster.py index <HASH>..<HASH> 100644 --- a/brother_ql/raster.py +++ b/brother_ql/raster.py @@ -189,7 +189,7 @@ class BrotherQLRaster(object): self.data += b'\x67\x00' # g 0x00 if self._compression: row = packbits.encode(row) - self.data += bytes([row_len]) + self.data += bytes([len(row)]) self.data += row def add_print(self, last_page=True):
fix regression from <I>e6 concerning compression
pklaus_brother_ql
train
py
2e5fee182ce93043a7c3e7544a343a741987bbcb
diff --git a/lib/fog/opennebula/models/compute/group.rb b/lib/fog/opennebula/models/compute/group.rb index <HASH>..<HASH> 100644 --- a/lib/fog/opennebula/models/compute/group.rb +++ b/lib/fog/opennebula/models/compute/group.rb @@ -8,10 +8,6 @@ module Fog identity :id attribute :name - def gid - id - end - def save raise Fog::Errors::Error.new('Creating a new group is not yet implemented. Contributions welcome!') end
[opennebula] use id instead of uid for groups
fog_fog
train
rb
0490e21b6d7a616b5c6152f3be4ec57cc97af270
diff --git a/src/main/java/org/lastaflute/core/time/SimpleTimeManager.java b/src/main/java/org/lastaflute/core/time/SimpleTimeManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/lastaflute/core/time/SimpleTimeManager.java +++ b/src/main/java/org/lastaflute/core/time/SimpleTimeManager.java @@ -25,6 +25,7 @@ import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.dbflute.helper.HandyDate; +import org.dbflute.system.DBFluteSystem; import org.dbflute.util.DfTypeUtil; import org.lastaflute.core.direction.FwAssistantDirector; import org.lastaflute.core.direction.FwCoreDirection; @@ -189,7 +190,7 @@ public class SimpleTimeManager implements TimeManager { if (realCurrentTimeProvider != null) { return realCurrentTimeProvider.currentTimeMillis(); } else { - return System.currentTimeMillis(); + return DBFluteSystem.currentTimeMillis(); } }
LastaFlute TimeManager uses DBFluteSystem current time
lastaflute_lastaflute
train
java
2aafc5a7e1f87df9d6af48565fd58be4fbf2c043
diff --git a/smokes/protractor-headless.conf.js b/smokes/protractor-headless.conf.js index <HASH>..<HASH> 100644 --- a/smokes/protractor-headless.conf.js +++ b/smokes/protractor-headless.conf.js @@ -45,9 +45,6 @@ exports.config = { onPrepare() { jasmine.getEnv().addReporter(new SpecReporter({ - suite: { - displayNumber: true - }, spec: { displayFailed: true, displayDuration: true, diff --git a/smokes/protractor.conf.js b/smokes/protractor.conf.js index <HASH>..<HASH> 100644 --- a/smokes/protractor.conf.js +++ b/smokes/protractor.conf.js @@ -46,9 +46,6 @@ exports.config = { onPrepare() { jasmine.getEnv().addReporter(new SpecReporter({ - suite: { - displayNumber: true - }, spec: { displayFailed: true, displayDuration: true,
smokes: Remove suite number from jasmine logs
buildbot_buildbot
train
js,js
6198978fa23e7acc22bc0196db9315a60bea52d0
diff --git a/test/models/person.rb b/test/models/person.rb index <HASH>..<HASH> 100644 --- a/test/models/person.rb +++ b/test/models/person.rb @@ -2,18 +2,18 @@ require 'active_model/global_identification' class Person include ActiveModel::GlobalIdentification - + attr_reader :id - + def self.find(id) new(id) end - + def initialize(id) @id = id end - + def ==(other_person) - other_person.is_a?(Person) && id == other_person.id + other_person.is_a?(Person) && id.to_s == other_person.id.to_s end end
Make tests for `Person` pass.
rails_rails
train
rb
d21f8019c4455effe35de12441b6638eaaf51515
diff --git a/src/Sql.php b/src/Sql.php index <HASH>..<HASH> 100755 --- a/src/Sql.php +++ b/src/Sql.php @@ -892,6 +892,11 @@ class Sql extends Common { public function bulkInsert($table,$params,$extra=false) { + if($output = $this->output) { + $this->output = false; + echo "BULK INSERT INTO " . $table . " (" . count($params) . " rows)...\n"; + } + switch($this->mode) { case "mysql": @@ -994,6 +999,10 @@ class Sql extends Common { $this->error(); } + if($output) { + $this->output = true; + } + return $result; }
Don't output bulk inserts They normally output way too much data to be useful, so if output is on, we switch it off, and just output a mock query with the number of rows to insert
duncan3dc_sql-class
train
php
6509d11ca307b3a50489be2676ab9e243fa2e89f
diff --git a/src/Factory.php b/src/Factory.php index <HASH>..<HASH> 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -181,12 +181,14 @@ class Factory */ private function make($model, array $attr, $save) { - if (! class_exists($model)) { - throw new ClassNotFoundException($model); - } + $group = $this->getGroup($model); + $modelWithoutGroup = $this->getModelWithoutGroup($model); + if (! class_exists($modelWithoutGroup)) { + throw new ClassNotFoundException($modelWithoutGroup); + } - $obj = new $model(); + $obj = new $modelWithoutGroup(); if ($save) { $this->saved[] = $obj; @@ -194,6 +196,9 @@ class Factory // Get the factory attributes for that model $attributes = $this->attributesFor($obj, $attr); + if ($group) { + $attributes = array_merge($attributes, $this->getFactoryAttrs($model)); + } foreach ($attributes as $attr => $value) { $obj->$attr = $value;
Combine group attributes and none group when creating factory When we create a factory with a group name passed in, we combine any attributes set on the group factory definition with the base factory (not a group one). This means we can use the group factories to overwrite the base factory
thephpleague_factory-muffin
train
php
a7baeabc325c25f9ae9c94173af516fcf89f35e4
diff --git a/framework/web/filters/CHttpCacheFilter.php b/framework/web/filters/CHttpCacheFilter.php index <HASH>..<HASH> 100644 --- a/framework/web/filters/CHttpCacheFilter.php +++ b/framework/web/filters/CHttpCacheFilter.php @@ -32,6 +32,10 @@ class CHttpCacheFilter extends CFilter public function preFilter($filterChain) { + // Only cache GET and HEAD requests + if(!in_array(Yii::app()->getRequest()->getRequestType(), array('GET', 'HEAD'))) + return true; + if($this->lastModified || $this->lastModifiedExpression) { if($this->lastModifiedExpression)
Only cache requests issued via GET and HEAD (as per RFC)
yiisoft_yii
train
php
7862bfbe3b1bab7feedfd1f4344fda358a75ed09
diff --git a/src/dropbox-api.js b/src/dropbox-api.js index <HASH>..<HASH> 100644 --- a/src/dropbox-api.js +++ b/src/dropbox-api.js @@ -8,8 +8,12 @@ DropboxApi.prototype.setAccessToken = function (accessToken) { this.accessToken = accessToken; }; +DropboxApi.prototype.getAccessToken = function () { + return this.accessToken; +}; + DropboxApi.prototype.listFolder = function (path) { - return rpcRequest('files/list_folder', { path: path }, this.accessToken); + return rpcRequest('files/list_folder', { path: path }, this.getAccessToken()); }; module.exports = DropboxApi;
Add get method for accessToken on class
dropbox_dropbox-sdk-js
train
js
ca23e8801f3266037a072a9567035fb231d3b2d8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -319,7 +319,7 @@ Protocol.prototype._onopen = function (id, data, start, end) { } this._remoteFeeds[id] = this._feed(feed.discoveryKey) - feed.remoteId = id + this._remoteFeeds[id].remoteId = id this.emit('feed', feed.discoveryKey) }
fix remoteId assignment (#<I>)
mafintosh_hypercore-protocol
train
js
6204a5ab469638c66961f1aaef4c3e6a33f4ebb5
diff --git a/lib/termnote/pane/code.rb b/lib/termnote/pane/code.rb index <HASH>..<HASH> 100644 --- a/lib/termnote/pane/code.rb +++ b/lib/termnote/pane/code.rb @@ -19,6 +19,15 @@ module TermNote def highlighted Pygments.highlight source, formatter: 'terminal256', lexer: language end + + def gutter + " " * (width / 2) + end + + def space + newlines = height > rows.size ? (height - rows.size) / 2 : 0 + "\n" * newlines + end end end end
Override #gutter, #space in Pane::Code The code should be centered, as chapters are, and long snippets should not be hidden if there is room in the terminal window.
krainboltgreene_termnote
train
rb
e99d3adff6c20dfba18a06836e8126fd60e836b9
diff --git a/abilian/services/security/service.py b/abilian/services/security/service.py index <HASH>..<HASH> 100644 --- a/abilian/services/security/service.py +++ b/abilian/services/security/service.py @@ -55,10 +55,11 @@ def require_flush(fun): @wraps(fun) def ensure_flushed(service, *args, **kwargs): if service.app_state.needs_db_flush: - session = current_app.db.session - if any(isinstance(m, (RoleAssignment, SecurityAudit)) - for models in (session.new, session.dirty, session.deleted) - for m in models): + session = current_app.db.session() + if (not session._flushing + and any(isinstance(m, (RoleAssignment, SecurityAudit)) + for models in (session.new, session.dirty, session.deleted) + for m in models)): session.flush() service.app_state.needs_db_flush = False
security service/ensure_flushed() decorator: check if session is currently flushing
abilian_abilian-core
train
py
a77615a8061cfae42562c88bd716b5959b12cf80
diff --git a/lib/lanes/db.rb b/lib/lanes/db.rb index <HASH>..<HASH> 100644 --- a/lib/lanes/db.rb +++ b/lib/lanes/db.rb @@ -6,14 +6,12 @@ module Lanes attr_accessor(:config_file) def establish_connection( env = ENV['RAILS_ENV'] || 'development') - file = config_file || 'config/database.yml' - config = YAML::load( IO.read( file ) ) - ::ActiveRecord::Base.configurations = config - self.connect( ::ActiveRecord::Base.configurations[ env ] ) - end - - def connect( configuration ) - ::ActiveRecord::Base.establish_connection( configuration ) + if ENV['DATABASE_URL'] + ::ActiveRecord::Base.establish_connection( ENV['DATABASE_URL'] ) + else + config = YAML::load( IO.read( config_file || "config/database.yml" ) ) + ::ActiveRecord::Base.establish_connection( config[env] ) + end end def load_seed
Support connecting via DATABASE_URL environment var
argosity_hippo
train
rb
b0a47649195735d3dc51756d26bea0ba7843467a
diff --git a/bcbio/pipeline/cleanbam.py b/bcbio/pipeline/cleanbam.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/cleanbam.py +++ b/bcbio/pipeline/cleanbam.py @@ -17,7 +17,7 @@ def fixrg(in_bam, names, ref_file, dirs, data): """Fix read group in a file, using samtools addreplacerg. """ work_dir = utils.safe_makedir(os.path.join(dirs["work"], "bamclean", dd.get_sample_name(data))) - out_file = os.path.join(work_dir, "%s-fix_rgs.bam" % utils.splitext_plus(os.path.basename(in_bam))[0]) + out_file = os.path.join(work_dir, "%s-fixrg.bam" % utils.splitext_plus(os.path.basename(in_bam))[0]) if not utils.file_uptodate(out_file, in_bam): with file_transaction(data, out_file) as tx_out_file: rg_info = novoalign.get_rg_info(names)
bam_clean: cleaner file extension for fixrg
bcbio_bcbio-nextgen
train
py
df9a2caf7bbc6221c9d1735fbae622a3efcef55d
diff --git a/tests/test_ncbi.py b/tests/test_ncbi.py index <HASH>..<HASH> 100644 --- a/tests/test_ncbi.py +++ b/tests/test_ncbi.py @@ -15,6 +15,7 @@ class NCBITestCase(SourceTestCase): def setUp(self): self.source = NCBIGene('rdf_graph', True) self.source.settestonly(True) + self.source.settestmode(True) self._setDirToSource() return diff --git a/tests/test_omim.py b/tests/test_omim.py index <HASH>..<HASH> 100644 --- a/tests/test_omim.py +++ b/tests/test_omim.py @@ -18,6 +18,7 @@ class OMIMTestCase(SourceTestCase): def setUp(self): self.source = OMIM('rdf_graph', True) self.source.settestonly(True) + self.source.settestmode(True) self._setDirToSource() return
hoping to dissentwine test better
monarch-initiative_dipper
train
py,py
78464e99736369c9d9a7ed88bacb9f604d74f403
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,8 +17,8 @@ setup( long_description=long_description, # The project's main homepage. - url='https://github.com/pypa/sampleproject', - + url='https://github.com/not-inept/suggest_imports', + download_url='https://github.com/not-inept/suggest_imports/archive/0.2.tar.gz', # Author details author='not-inept', author_email='notinept@gmail.com', @@ -53,7 +53,7 @@ setup( # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's - # requirements files see: + # requirements files seePython, Rust, and Node projects: # https://packaging.python.org/en/latest/requirements.html install_requires=['peppercorn', 'toml', 'tabulate'],
Updated setup.py to fix release error
not-inept_suggest_imports
train
py
1f1131b2baf048057a6d477e9ef22dc33db1dda4
diff --git a/tests/lib/toolkit/XMLElementTest.php b/tests/lib/toolkit/XMLElementTest.php index <HASH>..<HASH> 100644 --- a/tests/lib/toolkit/XMLElementTest.php +++ b/tests/lib/toolkit/XMLElementTest.php @@ -163,6 +163,18 @@ final class XMLElementTest extends TestCase $this->assertEquals('value', $x->getValue()); } + public function testReplaceValue() + { + $x = (new \XMLElement('xml')) + ->setValue('value') + ->appendChild('string') + ->appendChild(new \XMLElement('child')) + ->replaceValue('new value'); + $this->assertNotEmpty($x->getChildren()); + $this->assertEquals(2, $x->getNumberOfChildren()); + $this->assertEquals('new value', $x->getValue()); + } + public function testSetAttribute() { $x = (new \XMLElement('xml'))->setAttribute('value', 'yes');
Add replaceValue() test Picked from <I>dbc8e1 Picked from f2bf<I>
symphonycms_symphony-2
train
php
d9d3d65716dfe8f5a8d83e5fa83286185bcf0657
diff --git a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java index <HASH>..<HASH> 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java +++ b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java @@ -287,6 +287,9 @@ public class ReferenceCountedOpenSslEngine extends SSLEngine implements Referenc PlatformDependent.throwException(cause); } } + + // Only create the leak after everything else was executed and so ensure we don't produce a false-positive for + // the ResourceLeakDetector. leak = leakDetection ? leakDetector.track(this) : null; }
Add comment why the ResourceLeak creation is happening as last in the constructor. Followup of c5b5d<I>a0d9ae<I>c1e<I>a6de<I>a<I>f
netty_netty
train
java
2f38b5d4d56ac7a959184d60ab64c69784e143ae
diff --git a/lib/aprs/aprs_kiss.rb b/lib/aprs/aprs_kiss.rb index <HASH>..<HASH> 100644 --- a/lib/aprs/aprs_kiss.rb +++ b/lib/aprs/aprs_kiss.rb @@ -63,7 +63,7 @@ module Aprs (2...start).each do |i| path = identity_as_string(extract_callsign(raw_frame[i * 7..-1])) - if path&.length + if path and path.length > 0 if raw_frame[i * 7 + 6] & 0x80 != 0 full_path << [path, '*'].join else
Corrected an improper use of &.
Syncleus_apex-aprs
train
rb
2431fe73b8e88e8a5333211acf768157df338e00
diff --git a/plugins/kernel_v1/config/ssh.rb b/plugins/kernel_v1/config/ssh.rb index <HASH>..<HASH> 100644 --- a/plugins/kernel_v1/config/ssh.rb +++ b/plugins/kernel_v1/config/ssh.rb @@ -31,7 +31,6 @@ module VagrantPlugins def upgrade(new) new.ssh.username = @username if @username != UNSET_VALUE - new.ssh.password = @password if @password != UNSET_VALUE new.ssh.host = @host if @host != UNSET_VALUE new.ssh.port = @port if @port != UNSET_VALUE new.ssh.guest_port = @guest_port if @guest_port != UNSET_VALUE diff --git a/plugins/kernel_v2/config/ssh.rb b/plugins/kernel_v2/config/ssh.rb index <HASH>..<HASH> 100644 --- a/plugins/kernel_v2/config/ssh.rb +++ b/plugins/kernel_v2/config/ssh.rb @@ -4,7 +4,6 @@ module VagrantPlugins module Kernel_V2 class SSHConfig < Vagrant.plugin("2", :config) attr_accessor :username - attr_accessor :password attr_accessor :host attr_accessor :port attr_accessor :guest_port
config.ssh.password is not used
hashicorp_vagrant
train
rb,rb
5050420ae95cd2240987a00f79c3858a46887e4d
diff --git a/nashvegas/models.py b/nashvegas/models.py index <HASH>..<HASH> 100644 --- a/nashvegas/models.py +++ b/nashvegas/models.py @@ -4,7 +4,8 @@ try: from django.utils.timezone import now now; # poor-man's pyflakes ignore except ImportError: - from datetime.datetime import now + import datetime + now = datetime.datetime.now class Migration(models.Model):
Properly set now from datetime
paltman-archive_nashvegas
train
py
43cb65e7776a77fa6af88b31a61d00c5b653b5dd
diff --git a/slim/Slim.php b/slim/Slim.php index <HASH>..<HASH> 100644 --- a/slim/Slim.php +++ b/slim/Slim.php @@ -42,6 +42,9 @@ set_exception_handler(array('Slim', 'handleExceptions')); //Slim will auto-load class files in the same directory as Slim.php spl_autoload_register(array('Slim', 'autoload')); +//Ensure timezone is set (defaults to 'UTC') +date_default_timezone_set(@date_default_timezone_get()); + class Slim { //Constants helpful when triggering errors or calling Slim::log()
Ensuring Slim will always have a default TimeZone. This resolves issues in PHP <I> if timezone not set. Default timezone used if none specified is UTC.
slimphp_Slim
train
php
2b684d9240a61f49af1cbf2d0d425b539cdd1695
diff --git a/lib/lita/robot.rb b/lib/lita/robot.rb index <HASH>..<HASH> 100644 --- a/lib/lita/robot.rb +++ b/lib/lita/robot.rb @@ -162,6 +162,11 @@ module Lita end end + # A list of room IDs the robot should join. + def persisted_rooms + Lita.redis.smembers("persisted_rooms").sort + end + private # Loads and caches the adapter on first access. @@ -182,11 +187,6 @@ module Lita adapter_class.new(self) end - # A list of room IDs the robot should join. - def persisted_rooms - Lita.redis.smembers("persisted_rooms").sort - end - # Starts the web server. def run_app http_config = config.http
Move persisted_rooms to not be private. We need to move the persisted rooms command on the robot to not be private. Otherwise the adapters can't access the list of persisted rooms and therefore can't recconect to them on start up.
litaio_lita
train
rb
e555cd916ef4e29013ac79dc0859f0727767229e
diff --git a/lib/bigquery-client/version.rb b/lib/bigquery-client/version.rb index <HASH>..<HASH> 100644 --- a/lib/bigquery-client/version.rb +++ b/lib/bigquery-client/version.rb @@ -1,5 +1,5 @@ module BigQuery class Client - VERSION = '0.2.0' + VERSION = '0.2.1' end end
Bump up version to <I>
ttanimichi_bigquery-client
train
rb
f72517358fcdad9799d44de7c44520bbdcd1df6a
diff --git a/tests/Statistics/EffectSizeTest.php b/tests/Statistics/EffectSizeTest.php index <HASH>..<HASH> 100644 --- a/tests/Statistics/EffectSizeTest.php +++ b/tests/Statistics/EffectSizeTest.php @@ -153,4 +153,23 @@ class EffectSizeTest extends \PHPUnit_Framework_TestCase [9, 3.5, 1.2, 1.5, 13, 15, 4.0153968], ]; } + + /** + * @dataProvider dataProviderForGlassDelta + */ + public function testGlassDelta($μ₁, $μ₂, $s₂, $expected) + { + $Δ = EffectSize::glassDelta($μ₁, $μ₂, $s₂); + + $this->assertEquals($expected, $Δ, '', 0.00001); + } + + public function dataProviderForGlassDelta() + { + return [ + [40, 57.727272727273, 30.763910379179, -0.57623600], + [3, 4, 1.5811388300842, -0.63245553], + [3, 3, 1.5, 0], + ]; + } }
Add unit tests for effect size glass' delta.
markrogoyski_math-php
train
php
1ea84b56173f71454660d53d258292b6a6a365b9
diff --git a/djangocms_blog/admin.py b/djangocms_blog/admin.py index <HASH>..<HASH> 100755 --- a/djangocms_blog/admin.py +++ b/djangocms_blog/admin.py @@ -42,7 +42,7 @@ class PostAdmin(EnhancedModelAdminMixin, FrontendEditableAdmin, 'classes': ('collapse',) }), ('SEO', { - 'fields': [('meta_description', 'meta_keywords')], + 'fields': [('meta_description', 'meta_keywords', 'meta_title')], 'classes': ('collapse',) }), ]
Oops, forgot to add it to the admin
nephila_djangocms-blog
train
py
8f5874081cc2aad490fc6cdd067ec80c97f594f3
diff --git a/lib/superstring/index.js b/lib/superstring/index.js index <HASH>..<HASH> 100644 --- a/lib/superstring/index.js +++ b/lib/superstring/index.js @@ -178,8 +178,7 @@ _.assign(Substitutor, /** @lends Substitutor */ { * * @type {Object} */ - DEFAULT_VARS: { - }, + DEFAULT_VARS: {}, /** * Create an instance of a substitutor or reuse one @@ -222,7 +221,7 @@ _.assign(Substitutor, /** @lends Substitutor */ { // @todo make the default variales of SuperString extensible and do this anywhere else but here _.forOwn(dynamicVariables, function (variable, name) { - if (_.isFunction(variable.generator)) { + if (variable && _.isFunction(variable.generator)) { Substitutor.DEFAULT_VARS[name] = variable.generator; } });
Add check for variable before accessing attributes
postmanlabs_postman-collection
train
js
c48e8c1e7ad0f652942886fe12db4064cf66ffe7
diff --git a/lib/link.js b/lib/link.js index <HASH>..<HASH> 100644 --- a/lib/link.js +++ b/lib/link.js @@ -537,7 +537,7 @@ exports.error = function(socket, err, safe) { // {{{2 // console.log('LINK ERROR', socket._lid, err.code, err.message); if (! (err instanceof Error)) { - return error(O.error(socket, '`err` must be instance of `Error`', err)); + err = O.error.apply(O, arguments.slice(1)); } switch (typeof (socket || undefined)) {
Improvement: `O.link.error` calls O.error internally when no error is supplied.
OpenSmartEnvironment_ose
train
js
f77ec2d170d0b024fdedacdeaf0fb3950ee080f9
diff --git a/workshift/utils.py b/workshift/utils.py index <HASH>..<HASH> 100644 --- a/workshift/utils.py +++ b/workshift/utils.py @@ -10,11 +10,9 @@ def can_manage(request, semester=None): current workshift managers, that semester's workshift managers, and site superusers. """ - if semester: - semester_managers = semeter.workshift_managers.all() - if Manager: - workshift_managers = Manager.objects.filter(incumbent__user=request.user) \ - .filter(workshift_manager=True) - return request.user in semester_managers or \ - workshift_managers.count() or \ - request.user.is_superuser + if semester and request.user in semester.workshift_managers.all(): + return True + if Manager and Manager.objects.filter(incumbent__user=request.user) \ + .filter(workshift_manager=True).count() > 0: + return True + return request.user.is_superuser
Fixed a bug when semester=None
knagra_farnsworth
train
py
eb58e743d87270ae1e45957a7798287014af856e
diff --git a/mopidy_musicbox_webclient/static/js/controls.js b/mopidy_musicbox_webclient/static/js/controls.js index <HASH>..<HASH> 100644 --- a/mopidy_musicbox_webclient/static/js/controls.js +++ b/mopidy_musicbox_webclient/static/js/controls.js @@ -12,10 +12,10 @@ function playBrowsedTracks(addtoqueue, trackIndex) { // For radio streams we just add the selected URI. // TODO: Why? - if (isStreamUri(trackUri)) { - mopidy.tracklist.add(null, null, trackUri); - return false; - } + //if (isStreamUri(trackUri)) { + //mopidy.tracklist.add(null, null, trackUri); + //return false; + //} switch (addtoqueue) { case PLAY_NOW:
Treat streams same as everything else in playBrowsedTracks Fixes #<I>
pimusicbox_mopidy-musicbox-webclient
train
js
8a5da4419e90b49261d2bad646898b1053466832
diff --git a/Grid/Action/RowAction.php b/Grid/Action/RowAction.php index <HASH>..<HASH> 100644 --- a/Grid/Action/RowAction.php +++ b/Grid/Action/RowAction.php @@ -324,6 +324,7 @@ class RowAction implements RowActionInterface if (is_callable($this->callback)) { return call_user_func($this->callback, $this, $row); } + return $this; } } diff --git a/Grid/Column/ActionsColumn.php b/Grid/Column/ActionsColumn.php index <HASH>..<HASH> 100644 --- a/Grid/Column/ActionsColumn.php +++ b/Grid/Column/ActionsColumn.php @@ -109,12 +109,13 @@ class ActionsColumn extends Column public function getActionsToRender($row) { $list = $this->rowActions; - foreach($list AS $i=>$action) { + foreach($list as $i=>$action) { $list[$i] = $action->render($row); if(false === $list[$i]) { unset($list[$i]); } } + return $list; }
Fix CS for pull request #<I> Fix CS in RowAction and ActionsColumn for pull request #<I>
APY_APYDataGridBundle
train
php,php
01bf8137ff00bab2e62b4edba11b21787b982e1f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,9 @@ 'use strict'; -var request = require('request') - , util = require('util') - , validFormats = ['csv', 'json', 'jsonp', 'xml', 'yaml'] - , apiUrl = 'http://hotell.difi.no/api' - ; +var request = require('request'); +var util = require('util'); +var validFormats = ['csv', 'json', 'jsonp', 'xml', 'yaml']; +var apiUrl = 'http://hotell.difi.no/api'; module.exports = function(opts, callback){
Reformats code to please jshint
zrrrzzt_difi
train
js
634696235a5f9dc5060a891a01a45719674493b7
diff --git a/lib/opal_node.rb b/lib/opal_node.rb index <HASH>..<HASH> 100644 --- a/lib/opal_node.rb +++ b/lib/opal_node.rb @@ -1,5 +1,29 @@ +module IO::Writable + def puts(*args) + write args.map { |arg| String(arg) }.join($/)+$/ + end +end + +$stdout = IO.new +$stderr = IO.new +STDOUT = $stdout +STDERR = $stderr + +def $stdout.write(string) + `process.stdout.write(#{string})` + nil +end + +def $stderr.write(string) + `process.stderr.write(string)` + nil +end + +$stdout.extend(IO::Writable) +$stderr.extend(IO::Writable) + module Kernel - def print *args - `process.stdout.write(#{args.join})` + def require name + `require(#{name})` end end
Fix some stdout stuff (should be backported to opal)
opal_opal-node
train
rb
0e34fd35109562b16ff6b77b5297ed3f2a9983cb
diff --git a/src/main/java/org/aesh/command/impl/parser/AeshCommandLineCompletionParser.java b/src/main/java/org/aesh/command/impl/parser/AeshCommandLineCompletionParser.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/aesh/command/impl/parser/AeshCommandLineCompletionParser.java +++ b/src/main/java/org/aesh/command/impl/parser/AeshCommandLineCompletionParser.java @@ -44,11 +44,9 @@ import java.util.List; public class AeshCommandLineCompletionParser<C extends Command> implements CommandLineCompletionParser { private final AeshCommandLineParser<C> parser; - private final LineParser lineParser; public AeshCommandLineCompletionParser(AeshCommandLineParser<C> parser) { this.parser = parser; - lineParser = new LineParser(); } @Override
LineParser not needed atm
aeshell_aesh
train
java
1cb0b755e8bbbd5f720d9264168898f1f43369b0
diff --git a/src/Task/Queue.php b/src/Task/Queue.php index <HASH>..<HASH> 100644 --- a/src/Task/Queue.php +++ b/src/Task/Queue.php @@ -54,11 +54,11 @@ namespace Plinker\Tasks\Task { // name 'tasks.auto_update', // source - "#!/bin/bash\ncomposer update", + "#!/bin/bash\ncomposer update plinker/tasks", // type 'bash', // description - 'Plinker auto update', + 'Plinker tasks auto update', // default params [] ); diff --git a/src/Tasks.php b/src/Tasks.php index <HASH>..<HASH> 100644 --- a/src/Tasks.php +++ b/src/Tasks.php @@ -330,7 +330,7 @@ namespace Plinker\Tasks { 'completed' => 0 ]); - $task->sleep = round((empty($sleep) ? 1: $sleep)); + $task->sleep = round((empty($sleep) ? 1 : $sleep)); // get task source id $task->tasksource = $this->model->findOne('tasksource', 'name = ?', [$name]);
[since: <I>] <I>-May-<I> - change task update
plinker-rpc_tasks
train
php,php
767270c64fee9d7fbf48e9ee332256d9d6e74d65
diff --git a/src/Collection.php b/src/Collection.php index <HASH>..<HASH> 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -247,7 +247,7 @@ class Collection * @param array $content Optional document content * @return Document the newly created Kuzzle\Document object */ - public function documentFactory($id = '', array $content = []) + public function document($id = '', array $content = []) { return new Document($this, $id, $content); } diff --git a/tests/DocumentTest.php b/tests/DocumentTest.php index <HASH>..<HASH> 100644 --- a/tests/DocumentTest.php +++ b/tests/DocumentTest.php @@ -246,7 +246,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase $kuzzle = new \Kuzzle\Kuzzle($url); $dataCollection = new Collection($kuzzle, $collection, $index); - $document = $dataCollection->documentFactory($documentId, array_merge($documentContent, ['_version' => 1])); + $document = $dataCollection->document($documentId, array_merge($documentContent, ['_version' => 1])); $result = $document->serialize();
documentFactory renamed to document
kuzzleio_sdk-php
train
php,php
2e686adf57df886b848e2c75f2ab45d977264e78
diff --git a/django_afip/models.py b/django_afip/models.py index <HASH>..<HASH> 100644 --- a/django_afip/models.py +++ b/django_afip/models.py @@ -49,7 +49,16 @@ def check_response(response): def first_currency(): - return CurrencyType.objects.filter(code='PES').first() + """ + Returns the id for the first currency + + The `default` parameter of a foreign key *MUST* be a primary key (and not + an instance), else migrations break. This helper method exists solely for + that purpose. + """ + ct = CurrencyType.objects.filter(code='PES').first() + if ct: + return ct.pk class GenericAfipTypeManager(models.Manager):
Fix migration failure on postgres Migrations were failing on postgres when the DB was non-empty (actually, when at least one currency existed) due to how defaults were referenced. Fixes #<I>
WhyNotHugo_django-afip
train
py
544777d81eb7689f12f0e40bdc8d369882807bc0
diff --git a/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php b/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php index <HASH>..<HASH> 100644 --- a/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php +++ b/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php @@ -460,7 +460,7 @@ return new Stash\\Pool($compositeDriver);');$whoopsConditionMiddleware = Install if (!$this->moufManager->instanceExists('rootController')) { $splashGenerateService = new SplashCreateControllerService(); $splashGenerateService->generate($this->moufManager, 'RootController', 'rootController', - $controllernamespace, false, true, false, + $controllernamespace, true, false, array( array( 'url' => '/',
fix call to SplashCreateControllerService::generate, last commit removes , but generate function was still called with the parameter in this function
thecodingmachine_mvc.splash
train
php
dc2b823eccae5318f27f1fea92f875d5c2b78bc7
diff --git a/lib/command-line.js b/lib/command-line.js index <HASH>..<HASH> 100644 --- a/lib/command-line.js +++ b/lib/command-line.js @@ -40,4 +40,4 @@ CommandLineInterface.prototype = { }; exports.CommandLineInterface = CommandLineInterface; -exports.Domain = Domain; +exports.Domain = CommandLineInterface.Domain = Domain;
Make "Domain" accessable from CommandLineInterface
groonga_gcs
train
js
ff8aa4fc323e3f412da35363cb8f1a26d317187f
diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index <HASH>..<HASH> 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -492,7 +492,8 @@ def parse_aggregate_report_xml(xml, nameservers=None, timeout=6.0): timeout=timeout)) else: - records.append(_parse_report_record(report["record"])) + records.append(_parse_report_record(report["record"]), + nameservers=nameservers) new_report["records"] = records diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index <HASH>..<HASH> 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -163,12 +163,14 @@ def _main(): rf = args.reports_folder af = args.archive_folder + ns = args.nameservers reports = get_dmarc_reports_from_inbox(args.host, args.user, args.password, reports_folder=rf, archive_folder=af, delete=args.delete, + nameservers=ns, test=args.test) aggregate_reports += reports["aggregate_reports"]
Updated to pass nameserver arguments to all occurances of parse_report_record(). This significantly speeds up processing long reports from the inbox in my testing.
domainaware_parsedmarc
train
py,py
7f747e671f65750d9ec0c317a4d4bf1446949c40
diff --git a/lib/dissemination.js b/lib/dissemination.js index <HASH>..<HASH> 100644 --- a/lib/dissemination.js +++ b/lib/dissemination.js @@ -51,7 +51,7 @@ Dissemination.prototype.adjustMaxPiggybackCount = function adjustMaxPiggybackCou Dissemination.prototype.fullSync = function fullSync() { var changes = []; - for (var i = 0; i < this.ringpop.membership.members; i++) { + for (var i = 0; i < this.ringpop.membership.members.length; i++) { var member = this.ringpop.membership.members[i]; changes.push({
Bug fix in recent fullSync refactor
esatterwhite_skyring
train
js
0eb16370a4c8aecc32c34e2e08ebfcf861a87540
diff --git a/src/app/Http/Controllers/PermissionController.php b/src/app/Http/Controllers/PermissionController.php index <HASH>..<HASH> 100644 --- a/src/app/Http/Controllers/PermissionController.php +++ b/src/app/Http/Controllers/PermissionController.php @@ -16,10 +16,7 @@ class PermissionController extends Controller public function store(ValidatePermissionRequest $request, Permission $permission) { - $permission = $permission->storeWithRoles( - $request->all(), - $request->get('roleList') - ); + $permission = $permission->storeWithRoles($request->validated()); return [ 'message' => __('The permission was created!'), @@ -35,10 +32,7 @@ class PermissionController extends Controller public function update(ValidatePermissionRequest $request, Permission $permission) { - $permission->updateWithRoles( - $request->all(), - $request->get('roleList') - ); + $permission->updateWithRoles($request->validated()); return [ 'message' => __('The permission was successfully updated'),
refactors for the new HasRoles trait
laravel-enso_PermissionManager
train
php
4574647639409bf9f51bc47577b42632118eff2a
diff --git a/app/src/js/modules/fields/relationship.js b/app/src/js/modules/fields/relationship.js index <HASH>..<HASH> 100644 --- a/app/src/js/modules/fields/relationship.js +++ b/app/src/js/modules/fields/relationship.js @@ -33,7 +33,9 @@ if (fconf.groupBy) { templateSelection = function (item) { - return $(item.element).parent().attr('label') + ': ' + item.text; + var label = $(item.element).parent().attr('label'); + + return (label ? label + ': ' : '') + item.text; }; }
Change how templateSelection is build
bolt_bolt
train
js
7c67a5604c05fd513f1827b89f80471b9e7477d4
diff --git a/lib/serf/agent.js b/lib/serf/agent.js index <HASH>..<HASH> 100644 --- a/lib/serf/agent.js +++ b/lib/serf/agent.js @@ -87,15 +87,12 @@ Agent.prototype.start = function() { }; Agent.prototype.tryStart = function() { - var eventHandlerPath = path.join(__dirname, '..', '..', 'bin', - 'express-droonga-serf-event-handler'); var agentArgs = [ 'agent', '-node', this._nodeName, '-bind', this._hostName + ':' + BIND_PORT, '-rpc-addr', this._hostName + ':' + RPC_PORT, - // '-event-handler', eventHandlerPath, - // '-log-level', this._logLevel, + '-log-level', 'INFO', '-tag', 'role=protocol-adapter' ]; this._otherMembers.forEach(function(address) {
Fix Serf agent's log level to INFO. Because the agent wrapper detects events based on INFO-level logs.
droonga_express-droonga
train
js
d1f6c4911aa90d15cd349b8f975f0f0e99d83179
diff --git a/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java b/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java +++ b/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java @@ -242,8 +242,9 @@ public class DataTableRenderer extends CoreRenderer { "var that = this;" + "$( 'input', this.footer() ).on( 'keyup change', function () {" + " if ( that.search() !== this.value ) {" + - " that.search( this.value ).draw('page')}" + - " } );" + + " that.search( this.value ).draw('page');" + + " }" + + "} );" + "} );", null ); //# End JS rw.writeText("} );",null );
#<I> - since the javascript is nested more than a couple of levels, make it clearer what's happening.
TheCoder4eu_BootsFaces-OSP
train
java
1d47d970d119706c2b5bb1e473897ec139f37b10
diff --git a/lib/github-status/support/git.rb b/lib/github-status/support/git.rb index <HASH>..<HASH> 100644 --- a/lib/github-status/support/git.rb +++ b/lib/github-status/support/git.rb @@ -17,9 +17,11 @@ module GitHubStatus Contract None => String def sha - @sha ||= (File.read "#{workdir}/#{path}").chomp - rescue Errno::EISDIR - @sha ||= git.revparse 'HEAD' + @sha ||= if File.file? "#{workdir}/#{path}" + File.read("#{workdir}/#{path}").chomp + else + git.revparse 'HEAD' + end end end end
git: don't use exceptions to determine if we have plain sha file
colstrom_concourse-github-status
train
rb
2b77bfd8536dca8ffc3086b2386c56f21926ebe8
diff --git a/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js b/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js index <HASH>..<HASH> 100644 --- a/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js +++ b/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js @@ -84,15 +84,19 @@ export default class ReactNativeStyleResolver { // otherwise fallback to resolving const flatArray = flattenArray(style); let isArrayOfNumbers = true; + let cacheKey = ''; for (let i = 0; i < flatArray.length; i++) { const id = flatArray[i]; if (typeof id !== 'number') { isArrayOfNumbers = false; } else { + if (isArrayOfNumbers) { + cacheKey += (id + '-'); + } this._injectRegisteredStyle(id); } } - const key = isArrayOfNumbers ? createCacheKey(flatArray.join('-')) : null; + const key = isArrayOfNumbers ? createCacheKey(cacheKey) : null; return this._resolveStyleIfNeeded(flatArray, key); }
[fix] improve style resolver performance Script time in the benchmark was profiled by adding `console.profile` around the timings for script time. The call to Array.join in the resolve function stood out. Since the code already iterates over the array it can run slightly faster by building the cache key in that loop instead. Close #<I>
necolas_react-native-web
train
js
af818f9072185c59626852e4613ad34ce5249e06
diff --git a/src/Validate.php b/src/Validate.php index <HASH>..<HASH> 100644 --- a/src/Validate.php +++ b/src/Validate.php @@ -6,7 +6,7 @@ namespace ReallySimpleJWT; use ReallySimpleJWT\Interfaces\Validator; use ReallySimpleJWT\Exception\ValidateException; -use ReallySimpleJWT\Exception\ParseException; +use ReallySimpleJWT\Exception\ParsedException; use ReallySimpleJWT\Interfaces\Encode; /** @@ -34,7 +34,7 @@ class Validate * token can be used for. * * @throws ValidateException - * @throws ParseException + * @throws ParsedException */ public function expiration(): Validate { @@ -50,7 +50,7 @@ class Validate * token can be used from. * * @throws ValidateException - * @throws ParseException + * @throws ParsedException */ public function notBefore(): Validate {
Fixed references to ParseException with ParsedException in Validate class.
RobDWaller_ReallySimpleJWT
train
php
9b6747713ee747c6c76092dd0d87e1da3a9023c2
diff --git a/lib/vagrant/action/box/download.rb b/lib/vagrant/action/box/download.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/action/box/download.rb +++ b/lib/vagrant/action/box/download.rb @@ -5,7 +5,6 @@ module Vagrant BASENAME = "box" include Util - include ExceptionCatcher attr_reader :temp_path
Remove ExceptionCatcher include from downloader action
hashicorp_vagrant
train
rb
0fdbd8c74984025098fa8c07d1dfbcd57a4dff6b
diff --git a/spec/rmagick/image/clone_spec.rb b/spec/rmagick/image/clone_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rmagick/image/clone_spec.rb +++ b/spec/rmagick/image/clone_spec.rb @@ -1,15 +1,28 @@ RSpec.describe Magick::Image, "#clone" do - it "works" do - image = described_class.new(20, 20) + it "returns a new copy of the image" do + image = build_image - result = image.clone - expect(result).to be_instance_of(described_class) - expect(image).to eq(result) + new_image = image.clone + + expect(new_image).to eq(image) + expect(new_image).not_to be(image) + expect(new_image.export_pixels).to eq(image.export_pixels) + end + + it "returns a non-frozen copy of the image when it is not frozen" do + image = build_image + + new_image = image.clone + + expect(new_image.frozen?).to be(false) + end + + it "returns a frozen copy of the image when it is frozen" do + image = build_image - result = image.clone - expect(image.frozen?).to eq(result.frozen?) image.freeze - result = image.clone - expect(image.frozen?).to eq(result.frozen?) + new_image = image.clone + + expect(new_image.frozen?).to be(true) end end
Flesh out Image#clone (#<I>)
rmagick_rmagick
train
rb
d8fa6c43872f117828fc7ff4bf29b5f28014d918
diff --git a/lib/mobility/backend.rb b/lib/mobility/backend.rb index <HASH>..<HASH> 100644 --- a/lib/mobility/backend.rb +++ b/lib/mobility/backend.rb @@ -65,10 +65,12 @@ On top of this, a backend will normally: end # @!macro [new] backend_reader + # Gets the translated value for provided locale from configured backend # @param [Symbol] locale Locale to read # @return [Object] Value of translation # # @!macro [new] backend_writer + # Updates translation for provided locale without calling backend's methods to persist the changes. # @param [Symbol] locale Locale to write # @param [Object] value Value to write # @return [Object] Updated value
Explain backend read & write behaviour in yard docs
shioyama_mobility
train
rb
82e1ad1443b1fe7dd71ecda52bc1e342b64951a7
diff --git a/.gitignore b/.gitignore index <HASH>..<HASH> 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,7 @@ venv.bak/ # mypy .mypy_cache/ + +# Printer outputs +*.emf +*.prn diff --git a/fluxions/__init__.py b/fluxions/__init__.py index <HASH>..<HASH> 100644 --- a/fluxions/__init__.py +++ b/fluxions/__init__.py @@ -1 +1 @@ -__all__ = ["fluxions"] \ No newline at end of file +__all__ = ['fluxions'] diff --git a/fluxions/fluxions.py b/fluxions/fluxions.py index <HASH>..<HASH> 100644 --- a/fluxions/fluxions.py +++ b/fluxions/fluxions.py @@ -1,6 +1,6 @@ import numpy as np -class Fluxion(object): +class Fluxion: def is_node(self): return True diff --git a/fluxions/test/test_basics.py b/fluxions/test/test_basics.py index <HASH>..<HASH> 100644 --- a/fluxions/test/test_basics.py +++ b/fluxions/test/test_basics.py @@ -1,5 +1,5 @@ import pytest -import fluxions as fl +from . import fluxions as fl def test_basic_usage(): # f(x) = 5x
Fixed import eror in test_basics.py; removed redundant inherit from object in Fluxion class
CS207-Final-Project-Group-10_cs207-FinalProject
train
gitignore,py,py,py
8bc477ee2aa12959081ad0e1b56052cac4c167cb
diff --git a/svtyper/singlesample.py b/svtyper/singlesample.py index <HASH>..<HASH> 100644 --- a/svtyper/singlesample.py +++ b/svtyper/singlesample.py @@ -94,7 +94,7 @@ def dump_library_metrics(lib_info_path, sample): def setup_src_vcf_file(fobj, invcf, rootdir): src_vcf = invcf - if invcf == '<stdin>': + if os.path.basename(invcf) == '<stdin>': src_vcf = dump_piped_vcf_to_file(fobj, rootdir) return src_vcf @@ -776,7 +776,7 @@ def sso_genotype(bam_string, logit("Temporary scratch directory: {}".format(scratchdir)) # dump the vcf file into the tmp directory, if we're reading from stdin - src_vcf_file = setup_src_vcf_file(vcf_in, os.path.basename(invcf), scratchdir) + src_vcf_file = setup_src_vcf_file(vcf_in, invcf, scratchdir) # create the vcf object src_vcf = init_vcf(src_vcf_file, sample, scratchdir)
+ improve handling of vcf's passed through stdin - check the basename inside setup_src_vcf_file not outside of it
hall-lab_svtyper
train
py
d8ece997f9ccd38a61d5cf9c2868a33234dee0e5
diff --git a/lib/rudy/utils.rb b/lib/rudy/utils.rb index <HASH>..<HASH> 100644 --- a/lib/rudy/utils.rb +++ b/lib/rudy/utils.rb @@ -55,14 +55,14 @@ module Rudy # Wait for something to happen. # * +duration+ seconds to wait between tries (default: 2). - # * +max+ maximum time to wait (default: 120). Throws an exception when exceeded. + # * +max+ maximum time to wait (default: 3600). Throws an exception when exceeded. # * +logger+ IO object to print +dot+ to. # * +msg+ the message to print before executing the block. # * +bells+ number of terminal bells to ring. Set to nil or false to keep the waiter silent # # The +check+ block must return false while waiting. Once it returns true # the waiter will return true too. - def waiter(duration=2, max=120, logger=STDOUT, msg=nil, bells=0, &check) + def waiter(duration=2, max=3600, logger=STDOUT, msg=nil, bells=0, &check) # TODO: Move to Drydock. [ed-why?] raise "The waiter needs a block!" unless check duration = 1 if duration < 1
Increased default CLI interface timeout from <I> seconds to <I>
solutious_rudy
train
rb
321925ea5c7be44e9f556f1cf57adadf89455a50
diff --git a/client/tts.py b/client/tts.py index <HASH>..<HASH> 100644 --- a/client/tts.py +++ b/client/tts.py @@ -21,7 +21,6 @@ from distutils.spawn import find_executable import yaml import argparse -import pyaudio import wave try: import mad @@ -73,7 +72,7 @@ class AbstractMp3TTSEngine(AbstractTTSEngine): wav = wave.open(f, mode='wb') wav.setframerate(mf.samplerate()) wav.setnchannels(1 if mf.mode() == mad.MODE_SINGLE_CHANNEL else 2) - wav.setsampwidth(pyaudio.get_sample_size(pyaudio.paInt32)) + wav.setsampwidth(4L) # width of 32 bit audio frame = mf.read() while frame is not None: wav.writeframes(frame)
Get rid of pyaudio in `tts.py`
benhoff_vexbot
train
py
03626402ca10961981834919cef38e01c2651d83
diff --git a/lib/gems-status/scm_check_messages.rb b/lib/gems-status/scm_check_messages.rb index <HASH>..<HASH> 100644 --- a/lib/gems-status/scm_check_messages.rb +++ b/lib/gems-status/scm_check_messages.rb @@ -23,7 +23,7 @@ private commits.each do |commit| if message_checker.check_message?(message(commit)) Utils::log_debug "#{message(commit)}" - key = commit_key(commit) + key = "#{name}_#{commit_key(commit)}" if !key Utils::log_error "no key for #{name}" next
prepend the gem name to the security key to avoid collision between different gems
jordimassaguerpla_gems-status
train
rb
fa4e2ffa9ffbd2f4782402531f2c83afe1aaf8d3
diff --git a/allure-pytest/src/plugin.py b/allure-pytest/src/plugin.py index <HASH>..<HASH> 100644 --- a/allure-pytest/src/plugin.py +++ b/allure-pytest/src/plugin.py @@ -83,6 +83,15 @@ def pytest_addoption(parser): help="""Comma-separated list of story names. Run tests that have at least one of the specified story labels.""") + parser.getgroup("general").addoption('--allure-ids', + action="store", + dest="allure_ids", + metavar="IDS_SET", + default={}, + type=label_type(LabelType.ID), + help="""Comma-separated list of IDs. + Run tests that have at least one of the specified id labels.""") + def link_pattern(string): pattern = string.split(':', 1) if not pattern[0]: @@ -145,6 +154,7 @@ def select_by_labels(items, config): arg_labels = set().union(config.option.allure_epics, config.option.allure_features, config.option.allure_stories, + config.option.allure_ids, config.option.allure_severities) return filter(lambda item: arg_labels & set(allure_labels(item)) if arg_labels else True, items)
support for searching test by ID (via #<I>)
allure-framework_allure-python
train
py
0e11487cb171abf7c3d12b932533a419a3cd0f22
diff --git a/tracext/github.py b/tracext/github.py index <HASH>..<HASH> 100644 --- a/tracext/github.py +++ b/tracext/github.py @@ -221,7 +221,7 @@ class GitHubMixin(Component): hmac_hash = hmac.new( webhook_secret.encode('utf-8'), - reqdata.encode('utf-8'), + reqdata, supported_algorithms[algorithm]) computed = hmac_hash.hexdigest()
Treat webhook payload as byte string The previous code would raise an exception if the payload contained non-ascii characters.
trac-hacks_trac-github
train
py
8b47e051baaed073c09fa36f2a0a68846b9910ea
diff --git a/src/Unirest/Request.php b/src/Unirest/Request.php index <HASH>..<HASH> 100644 --- a/src/Unirest/Request.php +++ b/src/Unirest/Request.php @@ -98,7 +98,7 @@ class Request */ public static function setMashapeKey($key) { - return self::$defaultHeaders['X-Mashape-Key'] = $key; + return self::defaultHeader('X-Mashape-Key', $key); } /**
Set Mashape Key by calling setDefaultHeader
Kong_unirest-php
train
php
412deb8b0582106625a2d012acc29f444bf8bb95
diff --git a/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/metrics/mancenter/ReadMetricsOperation.java b/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/metrics/mancenter/ReadMetricsOperation.java index <HASH>..<HASH> 100644 --- a/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/metrics/mancenter/ReadMetricsOperation.java +++ b/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/metrics/mancenter/ReadMetricsOperation.java @@ -35,7 +35,7 @@ public class ReadMetricsOperation extends Operation implements BlockingOperation public ReadMetricsOperation(long offset, int collectionIntervalSeconds) { this.offset = offset; - int timeoutSeconds = Math.min(MIN_TIMEOUT_SECONDS, collectionIntervalSeconds * 2); + int timeoutSeconds = Math.max(MIN_TIMEOUT_SECONDS, collectionIntervalSeconds * 2); setWaitTimeout(TimeUnit.SECONDS.toMillis(timeoutSeconds)); }
Fix minimum timeout issue (#<I>)
hazelcast_hazelcast
train
java
60e92b0e0b9f03ad6cde8f0c8fd2ede99bb98c59
diff --git a/ieml/AST/terms.py b/ieml/AST/terms.py index <HASH>..<HASH> 100644 --- a/ieml/AST/terms.py +++ b/ieml/AST/terms.py @@ -3,7 +3,6 @@ from .tree_metadata import TermMetadata from ieml.exceptions import TermComparisonFailed, CannotRetrieveMetadata, IEMLTermNotFoundInDictionnary from ieml.parsing.script import ScriptParser from ieml.script import Script -from models.terms.terms import TermsConnector class Term(AbstractProposition): @@ -47,6 +46,7 @@ class Term(AbstractProposition): from models.base_queries import DictionaryQueries TermMetadata.set_connector(DictionaryQueries()) + from models.terms.terms import TermsConnector term = TermsConnector().get_term(self.script) if term is None: raise IEMLTermNotFoundInDictionnary(str(self.script))
Fix a circular import with the model.
IEMLdev_ieml
train
py
db9d7e7bcd57c01beae03625f50d914b4cce5e59
diff --git a/pkts-streams/src/main/java/io/pkts/streams/SipStream.java b/pkts-streams/src/main/java/io/pkts/streams/SipStream.java index <HASH>..<HASH> 100644 --- a/pkts-streams/src/main/java/io/pkts/streams/SipStream.java +++ b/pkts-streams/src/main/java/io/pkts/streams/SipStream.java @@ -26,6 +26,19 @@ public interface SipStream extends Stream<SipPacket> { List<SipPacket> getPackets(); /** + * Check whether this {@link SipStream} is in the terminated state, which it is if any of the following is true: + * For INVITE streams: + * <ul> + * <li>If the initial handshake failed with an error + * response (which will include CANCEL scenarios)</li> + * <li>If the call was successfully established and a BYE + * request and the corresponding final response has been processed</li> + * </ul> + * @return + */ + boolean isTerminated(); + + /** * Post Dial Delay (PDD) is defined as the time it takes between the INVITE * and until some sort of ringing signal is received (18x responses). *
Small addition to expose isTerminated method on the SipStream interface
aboutsip_pkts
train
java
fda4dbe82b3a9792bb9dcbab441f94f86fad1de1
diff --git a/src/astral/geocoder.py b/src/astral/geocoder.py index <HASH>..<HASH> 100644 --- a/src/astral/geocoder.py +++ b/src/astral/geocoder.py @@ -18,7 +18,7 @@ from typing import Dict, Generator, List, Tuple, Union from astral import LocationInfo, latlng_to_float -__all__ = ["all_locations", "database", "lookup"] +__all__ = ["lookup", "database", "add_locations", "all_locations"] # region Location Info
Added add_locations to __all__ and re-ordered
sffjunkie_astral
train
py
72cf646a4d79dc3b59fdd88b245bac78989e2909
diff --git a/lib/fuguta.rb b/lib/fuguta.rb index <HASH>..<HASH> 100644 --- a/lib/fuguta.rb +++ b/lib/fuguta.rb @@ -69,6 +69,8 @@ module Fuguta def load(path = nil) buf = case path when NilClass + raise "No path given and usual_paths not set" unless @conf.usual_paths + path = @conf.usual_paths.find { |path| File.exists?(path) } || raise("None of the usual paths existed: #{@conf.usual_paths.join(", ")}") @@ -130,7 +132,7 @@ module Fuguta l.load(File.expand_path(path, base_conf_dir)) end } - + self end end @@ -262,7 +264,7 @@ module Fuguta end } end - + def alias_param (alias_name, ref_name) # getter self.class_eval %Q{ @@ -333,9 +335,12 @@ module Fuguta l = Loader.new(c) - paths.each { |path| - l.load(path) - } + if paths.empty? + l.load + else + paths.each { |path| l.load(path) } + end + l.validate c
Make sure usual_paths is used when loading a config and raise an error if it's not set
axsh_fuguta
train
rb
3c3ae5d331ed98f6bc68621d5c327cca527ce901
diff --git a/examples/MpxCreate.java b/examples/MpxCreate.java index <HASH>..<HASH> 100644 --- a/examples/MpxCreate.java +++ b/examples/MpxCreate.java @@ -266,6 +266,7 @@ public class MpxCreate // be the same as the task start dates. // assignment1.setRemainingWork(new MPXDuration (40, TimeUnit.HOURS)); + assignment2.setRemainingWork(new MPXDuration (80, TimeUnit.HOURS)); assignment1.setStart(df.parse("01/01/2003")); assignment2.setStart(df.parse("11/01/2003"));
Updated to work correctly with new MSPDI attributes.
joniles_mpxj
train
java
812e009e578598d13f3f734ec21b3c2be2a2b6dd
diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index <HASH>..<HASH> 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -804,7 +804,10 @@ func scpUploadFile(dst string, src io.Reader, w io.Writer, r *bufio.Reader, fi * log.Println("[DEBUG] Copying input data into temporary file so we can read the length") if _, err := io.Copy(tf, src); err != nil { - return err + return fmt.Errorf("Error copying input data into local temporary "+ + "file. Check that TEMPDIR has enough space. Please see "+ + "https://www.packer.io/docs/other/environment-variables.html#tmpdir"+ + "for more info. Error: %s", err) } // Sync the file so that the contents are definitely on disk, then
Add more detail for errors where the problem is that TEMPDIR is filled up
hashicorp_packer
train
go
7ad11e9124d33d67abc6648ac88798f81279847e
diff --git a/riak/client/transport.py b/riak/client/transport.py index <HASH>..<HASH> 100644 --- a/riak/client/transport.py +++ b/riak/client/transport.py @@ -58,18 +58,20 @@ class RiakClientTransport(object): def _skip_bad_nodes(transport): return transport._node not in skip_nodes - for retry in range(self.RETRY_COUNT): + retry_count = self.RETRY_COUNT + + for retry in range(retry_count): try: with pool.take(_filter=_skip_bad_nodes) as transport: try: return fn(transport) except (IOError, httplib.HTTPException) as e: - if _is_retryable(e): - transport._node.error_rate.incr(1) + transport._node.error_rate.incr(1) + if retry < (retry_count - 1) and _is_retryable(e): skip_nodes.append(transport._node) raise BadResource(e) else: - raise e + raise except BadResource: continue
Raise the final exception when the retry limit has been reached. This prevents masking of errors when the loop falls through to its completion, all tries raising BadResource. The previous behavior was that the function doesn't return any value, essentially returning None.
basho_riak-python-client
train
py