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
afe70bf8e7c9764355113d65d2e6b4e5ca7d95b6
diff --git a/spec/models/resource_export_file_spec.rb b/spec/models/resource_export_file_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/resource_export_file_spec.rb +++ b/spec/models/resource_export_file_spec.rb @@ -23,6 +23,7 @@ describe ResourceExportFile do manifestation.save! export_file = ResourceExportFile.new export_file.user = users(:admin) + export_file.save! export_file.export! file = export_file.resource_export expect(file).to be_truthy
explicitly save resource_export_file record.
next-l_enju_biblio
train
rb
f41e8d1c38587a02808164f5f14968eeabde8783
diff --git a/src/AdamWathan/Form/Elements/FormOpen.php b/src/AdamWathan/Form/Elements/FormOpen.php index <HASH>..<HASH> 100644 --- a/src/AdamWathan/Form/Elements/FormOpen.php +++ b/src/AdamWathan/Form/Elements/FormOpen.php @@ -54,6 +54,11 @@ class FormOpen extends Element return $this->setHiddenMethod('PUT'); } + public function patch() + { + return $this->setHiddenMethod('PATCH'); + } + public function delete() { return $this->setHiddenMethod('DELETE');
added PATCH method to FormOpen.php
adamwathan_form
train
php
c8e6f1f231a7fdbf7fdcfd7ce00859b6a8062aab
diff --git a/src/video/texture_cache.js b/src/video/texture_cache.js index <HASH>..<HASH> 100644 --- a/src/video/texture_cache.js +++ b/src/video/texture_cache.js @@ -60,11 +60,9 @@ class TextureCache { /** * @ignore */ - remove(image) { + delete(image) { if (!this.cache.has(image)) { - if (this.cache.remove(image) === true) { - this.length--; - } + this.cache.delete(image); } }
fix & rename internal cache delete function only decrease length when removing a texture unit cache, and not image.
melonjs_melonJS
train
js
303a620732d7870cb24b32be2071ba91f53c9f0c
diff --git a/saspy/sasiohttp.py b/saspy/sasiohttp.py index <HASH>..<HASH> 100644 --- a/saspy/sasiohttp.py +++ b/saspy/sasiohttp.py @@ -948,8 +948,8 @@ class SASsessionHTTP(): headers = {"Accept":"text/plain", "Authorization":"Bearer "+self.sascfg._token} done = False - delay = kwargs.get('GETstatusDelay' , 0.5) - excpcnt = kwargs.get('GETstatusFailcnt', 5) + delay = kwargs.get('GETstatusDelay' , 0) + excpcnt = kwargs.get('GETstatusFailcnt', 5) while not done: try:
change default delay in http poll in submit
sassoftware_saspy
train
py
e0488b26f04e931b17b104fd7f69f6527436e81d
diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/rails.rb +++ b/lib/puppet/rails.rb @@ -29,7 +29,9 @@ module Puppet::Rails ActiveRecord::Base.verify_active_connections! begin - ActiveRecord::Base.establish_connection(database_arguments()) + args = database_arguments + Puppet.info "Connecting to #{args[:adapter]} database: #{args[:database]}" + ActiveRecord::Base.establish_connection(args) rescue => detail if Puppet[:trace] puts detail.backtrace @@ -46,7 +48,7 @@ module Puppet::Rails case adapter when "sqlite3" - args[:dbfile] = Puppet[:dblocation] + args[:database] = Puppet[:dblocation] when "mysql", "postgresql" args[:host] = Puppet[:dbserver] unless Puppet[:dbserver].empty? args[:username] = Puppet[:dbuser] unless Puppet[:dbuser].empty?
Fix #<I> puppetqd doesn't give an error when no config is given Added an info message about what database we're connecting to. In the case of the default database, it looks like: info: Connecting to sqlite3 database: /var/lib/puppet/state/clientconfigs.sqlite3 Also squashes the deprecation warning #<I>, since fixing that makes this patch smaller.
puppetlabs_puppet
train
rb
8e6b89159c2688e3bc41b9100305217940477cc9
diff --git a/malcolm/parts/ADCore/hdfwriterpart.py b/malcolm/parts/ADCore/hdfwriterpart.py index <HASH>..<HASH> 100644 --- a/malcolm/parts/ADCore/hdfwriterpart.py +++ b/malcolm/parts/ADCore/hdfwriterpart.py @@ -137,6 +137,8 @@ class HDFWriterPart(ChildPart): # write between each flush. Thus we need to know the exposure time. Get # it from the last FDM. (There's probably only one, and we don't care # about other cases.) + # Choose a default exposure time in case there is no FDM. + exposure_time = 0.1 # seconds for mutator in params.generator.mutators: if isinstance(mutator, FixedDurationMutator): exposure_time = mutator.duration
Add default exposure time for HDF flushing maths
dls-controls_pymalcolm
train
py
43db2857ccf9a5985f1a3edab48c942e8d61c703
diff --git a/example/src/dragular.js b/example/src/dragular.js index <HASH>..<HASH> 100644 --- a/example/src/dragular.js +++ b/example/src/dragular.js @@ -3,7 +3,7 @@ require("./dragular.css"); var Angular = require("angular"); Angular.module("dragular", [ - require("angular-drag-drop").name, + require("../../src/angular-drag-drop").name, require("controllers/game").name, ])
Refer to the local instance of the lib
ggoodman_angular-drag-drop
train
js
959e70c5036c0777b41aafe10087c9a6dd7754d1
diff --git a/trunk/JLanguageTool/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java b/trunk/JLanguageTool/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java index <HASH>..<HASH> 100644 --- a/trunk/JLanguageTool/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java +++ b/trunk/JLanguageTool/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java @@ -337,7 +337,7 @@ public class PatternRuleTest extends TestCase { if (s.indexOf('|') >= 0) { System.err.println("The " + lang.toString() + " rule: " + ruleId + ", token [" + tokenIndex + "], contains | (pipe) in " - + " regexp part [" + matcher.group(2) + + " regexp bracket expression [" + matcher.group(2) + "] which is unlikely to be correct."); }
Minor change in warning given by "ant test".
languagetool-org_languagetool
train
java
5f225f91030d2fc8b2bf06efc71749ba55723fe7
diff --git a/lib/endpoint/find-routes.js b/lib/endpoint/find-routes.js index <HASH>..<HASH> 100644 --- a/lib/endpoint/find-routes.js +++ b/lib/endpoint/find-routes.js @@ -34,6 +34,10 @@ function findRoutes (state) { const hasExampleRoutes = !!routeBlocks.slice(1).find(block => { const prevBlock = state.blocks[state.blocks.indexOf(block) - 1] + if (prevBlock.type === 'exampleTitle') { + return true + } + if (prevBlock.type !== 'description') { return false }
build: better endpoint parsing, stop mistaking examples as valid endpoint routes
octokit_routes
train
js
c3ebb47d0fa3109ee2b7b33e167f750010b69164
diff --git a/test/test_form_builder.rb b/test/test_form_builder.rb index <HASH>..<HASH> 100644 --- a/test/test_form_builder.rb +++ b/test/test_form_builder.rb @@ -51,7 +51,7 @@ class JudgeFormBuilderTest < ActionView::TestCase end def test_time_zone_select - assert_dom_equal expected_time_zone_select, builder.time_zone_select(:time_zone, ActiveSupport::TimeZone.us_zones, :include_blank => true, :validate => true) + assert builder.time_zone_select(:time_zone, ActiveSupport::TimeZone.us_zones, :include_blank => true, :validate => true), "time zone select not present" end def builder
Make time_zone_select test a general assertion instead of asserting DOM equal (time zones are variable)
joecorcoran_judge
train
rb
333d8d3e5ffd05aeb4e99602c5512b5e17cd627e
diff --git a/GPy/models/GP_regression.py b/GPy/models/GP_regression.py index <HASH>..<HASH> 100644 --- a/GPy/models/GP_regression.py +++ b/GPy/models/GP_regression.py @@ -79,7 +79,7 @@ class GP_regression(model): return self.kern._get_params_transformed() def _get_param_names(self): - return self.kern._get_params_names_transformed() + return self.kern._get_param_names_transformed() def _model_fit_term(self): """
Fix error introduced into GP_regression when doing name changes.
SheffieldML_GPy
train
py
7fca266635be2ea408a16dc90bed6b53343f4f0a
diff --git a/signaturit_sdk/signaturit_client.py b/signaturit_sdk/signaturit_client.py index <HASH>..<HASH> 100644 --- a/signaturit_sdk/signaturit_client.py +++ b/signaturit_sdk/signaturit_client.py @@ -15,7 +15,7 @@ class SignaturitClient: 'mandatory_photo', 'mandatory_voice', 'branding_id', 'templates', 'method', 'sms_auth', 'data'] - STORAGE_S3 = ['bucket, key, secret'] + STORAGE_S3 = ['bucket', 'key', 'secret'] STORAGE_SFTP_PASSWORD = ['password'] STORAGE_SFTP_KEY = ['passphrase', 'public', 'private']
Fixed a typo on a storage constant
signaturit_python-sdk
train
py
03d342a91f31208f5da52861d007c786bf359787
diff --git a/test/actions/showDocumentation.js b/test/actions/showDocumentation.js index <HASH>..<HASH> 100644 --- a/test/actions/showDocumentation.js +++ b/test/actions/showDocumentation.js @@ -16,7 +16,7 @@ describe('Action: Show Documentation', () => { it('returns the correct parts', async () => { let {documentation, serverInformation} = await api.specHelper.runAction('showDocumentation') - expect(Object.keys(documentation).length).to.equal(6) // 6 actions + expect(Object.keys(documentation).length).to.equal(7) // 7 actions expect(serverInformation.serverName).to.equal('actionhero') }) })
Updating action count for showDocumentation test.
actionhero_actionhero
train
js
6f556da3a76d8012be25cffeb6163ef189763dca
diff --git a/lib/server/console.js b/lib/server/console.js index <HASH>..<HASH> 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -72,14 +72,14 @@ cwd : CWD }, - onMessage = function(command) { - log(ConNum, command); + onMessage = function(conNum, command) { + log(conNum, command); if (onMsg) onMsg(command, callback); else - spawnify(command, Clients[ConNum], callback); - }, + spawnify(command, Clients[conNum], callback); + }.bind(null, ConNum), onDisconnect = function(conNum) { Clients[conNum] = null;
fix(console) one directory for all consoles
cloudcmd_console-io
train
js
11497125f24a929c1cea00208ecc44c1d21d6ab7
diff --git a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java +++ b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java @@ -127,7 +127,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener HikariMBeanElf.registerMBeans(configuration, this); } - houseKeepingTimer = new Timer("Hikari Housekeeping Timer", true); + houseKeepingTimer = new Timer("Hikari Housekeeping Timer (pool " + configuration.getPoolName() + ")", true); addConnectionExecutor = PoolUtilities.createThreadPoolExecutor(configuration.getMaximumPoolSize(), "HikariCP connection filler");
Fix #<I> add pool name to housekeeping timer thread
brettwooldridge_HikariCP
train
java
12976bf4194338d1b079e7ea6cb6f62c967a8d3d
diff --git a/gulpfile.js/lib/webpack-multi-config.js b/gulpfile.js/lib/webpack-multi-config.js index <HASH>..<HASH> 100644 --- a/gulpfile.js/lib/webpack-multi-config.js +++ b/gulpfile.js/lib/webpack-multi-config.js @@ -18,6 +18,7 @@ module.exports = function(env) { context: jsSrc, plugins: [], resolve: { + root: jsSrc, extensions: [''].concat(extensions) }, module: {
Added resolve-root jsSrc Taking advantage of the configuration property resolve-root. <URL>
vigetlabs_blendid
train
js
5a5447525a460a9d6372d40dde7e45e39769690d
diff --git a/Integration/TrustedFormIntegration.php b/Integration/TrustedFormIntegration.php index <HASH>..<HASH> 100644 --- a/Integration/TrustedFormIntegration.php +++ b/Integration/TrustedFormIntegration.php @@ -131,6 +131,7 @@ class TrustedFormIntegration extends AbstractEnhancerIntegration $this->logger->error( 'TrustedForm: Certificate already expired ('.$trustedFormClaim.') with contact '.$identifier.': '.(!empty($data->expired_at) ? $data->expired_at : '') ); + break 2; // no break case 200: @@ -212,7 +213,7 @@ class TrustedFormIntegration extends AbstractEnhancerIntegration 'TrustedForm: Unrecognized response code '.(!empty($response->code) ? '('.$response->code.')' : '').' (try '.$try.'/'.$tryLimit.') with contact '.$identifier.': '.(!empty($response->body) ? $response->body : '') ); usleep(250000); - break; + break 2; } } }
[ENG-<I>] Do not retry if cert is already expired.
TheDMSGroup_mautic-enhancer
train
php
2db538b86bc8f93b28b645411ef78830bd675c76
diff --git a/support/Config.php b/support/Config.php index <HASH>..<HASH> 100644 --- a/support/Config.php +++ b/support/Config.php @@ -21,7 +21,7 @@ interface Config extends collections\Dictionary { * @return self * @throws \LogicException if $config is not defined or not an array */ - public function load( $file ); + public function load( $file, $key = '' ); /** * Merge an array into the current configuration.
Support for loading a config file into a specific key
gamernetwork_yolk-contracts
train
php
03a5fc1547cb314acd91b301d6a9dd749ec028d8
diff --git a/lib/tool.js b/lib/tool.js index <HASH>..<HASH> 100644 --- a/lib/tool.js +++ b/lib/tool.js @@ -204,14 +204,20 @@ class WebpackTool { return compiler; } - createDevServerOptions(webpackConfig, devServer) { + createDevServerOptions(webpackConfig, devServer = {}) { const { output } = webpackConfig; + const { headers = {}, index, methods, mimeTypes, publicPath, writeToDisk } = devServer; return { + index, + writeToDisk, + mimeTypes, + methods, + publicPath: publicPath || output.publicPath, headers: { 'x-webpack': 'easywebpack', 'cache-control': 'max-age=0', + ...headers, }, - publicPath: output.publicPath }; }
fix: add webpack-dev-middleware missing options
easy-team_webpack-tool
train
js
b92d606c9dffbc6d7bf9fa7604af6ab7e949e54e
diff --git a/js/binance.js b/js/binance.js index <HASH>..<HASH> 100644 --- a/js/binance.js +++ b/js/binance.js @@ -3746,7 +3746,7 @@ module.exports = class binance extends Exchange { return this.parseFundingRate (response); } - async fetchFundingRateHistory (symbol, since = undefined, limit = undefined, params = {}) { + async fetchFundingRateHistory (symbol, limit = undefined, since = undefined, params = {}) { await this.loadMarkets (); const market = this.market (symbol); const request = {
Switched argument limit for binance.fetchFundingRateHistory because this argument is not taken by gate.io
ccxt_ccxt
train
js
2d08835f4cf4a2b3b75d5937399a42ac38ef38ea
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ required = [ setup( name='unwrapper', - version='0.0.8', + version='1.0.0', url='https://github.com/shaunvxc/unwrap', license='MIT', author='Shaun Viguerie',
bump to <I> :balloon:
shaunvxc_unwrapper
train
py
3054dbcb9d9936600a761e7da8a25bddee6b8b8b
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 @@ -1177,6 +1177,14 @@ module Sinatra set(:public_folder, value) end + def public_dir=(value) + self.public_folder = value + end + + def public_dir + public_folder + end + private # Condition for matching host name. Parameter might be String or Regexp. def host_name(pattern) 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 @@ -484,6 +484,18 @@ class SettingsTest < Test::Unit::TestCase end end + describe 'public_dir' do + it 'is an alias for public_folder' do + @base.public_dir = File.dirname(__FILE__) + assert_equal File.dirname(__FILE__), @base.public_dir + assert_equal @base.public_folder, @base.public_dir + + @application.public_dir = File.dirname(__FILE__) + assert_equal File.dirname(__FILE__), @application.public_dir + assert_equal @application.public_folder, @application.public_dir + end + end + describe 'lock' do it 'is disabled by default' do assert ! @base.lock?
alias public_folder as public_dir
sinatra_sinatra
train
rb,rb
cba82a92e2d44b49d140694c8d7e9dded34d0a52
diff --git a/hack/build-local-images.py b/hack/build-local-images.py index <HASH>..<HASH> 100755 --- a/hack/build-local-images.py +++ b/hack/build-local-images.py @@ -257,6 +257,9 @@ for image in image_config: ) debug("Initiating Docker build with Dockerfile:\n{}".format(open(join(context_dir, "Dockerfile")).read())) + # re-pull the original image before building it so we're not accumulating layers each time we + # rebuild the image. + call(["docker", "pull", full_name(image) + ":" + image_config[image]["tag"]]) call(["docker", "build", "-t", full_name(image), "."], cwd=context_dir) remove(join(context_dir, "Dockerfile"))
always pull image before rebuilding local images
openshift_origin
train
py
2641b5185e483ab6ca477799f8bf3749111cd2e4
diff --git a/xclim/core/locales.py b/xclim/core/locales.py index <HASH>..<HASH> 100644 --- a/xclim/core/locales.py +++ b/xclim/core/locales.py @@ -141,7 +141,7 @@ def get_local_dict(locale: Union[str, Sequence[str], Tuple[str, dict]]): ) if isinstance(locale[1], dict): return locale - with open(locale[1]) as locf: + with open(locale[1], encoding="utf-8") as locf: return locale[0], json.load(locf)
Clearly set utf-8 in `get_local_dict` file handler to prevent opening files using Windows default charsets
Ouranosinc_xclim
train
py
f83be101b5718e085fdc437789fa8cf3e27f4967
diff --git a/src/ChrisKonnertz/DeepLy/DeepLy.php b/src/ChrisKonnertz/DeepLy/DeepLy.php index <HASH>..<HASH> 100644 --- a/src/ChrisKonnertz/DeepLy/DeepLy.php +++ b/src/ChrisKonnertz/DeepLy/DeepLy.php @@ -17,11 +17,6 @@ class DeepLy { /** - * The length of the text for translations is limited by the API - */ - const MAX_TRANSLATION_TEXT_LEN = 5000; - - /** * All supported language code constants */ const LANG_AUTO = 'auto'; // Let DeepL decide which language it is (only works for the source language) @@ -48,6 +43,11 @@ class DeepLy ]; /** + * The length of the text for translations is limited by the API + */ + const MAX_TRANSLATION_TEXT_LEN = 5000; + + /** * Constants that are names of methods that can be called via the API */ const METHOD_TRANSLATE = 'LMT_handle_jobs'; // Translates a text
Moved the constant to a better palce
chriskonnertz_DeepLy
train
php
cd5e16d516edce11b0405a1393dccbc168ac6b74
diff --git a/lib/nightcrawler_swift/connection.rb b/lib/nightcrawler_swift/connection.rb index <HASH>..<HASH> 100644 --- a/lib/nightcrawler_swift/connection.rb +++ b/lib/nightcrawler_swift/connection.rb @@ -16,6 +16,7 @@ module NightcrawlerSwift connected_attr_reader :catalog, :admin_url, :upload_url, :public_url, :internal_url def auth_response + @auth_response ||= nil authenticate! if @auth_response.nil? @auth_response end
Initialize the variable before use it to avoid warnings
tulios_nightcrawler_swift
train
rb
31dcb4a539de6f8dc6904a0aa0a5e570c2836188
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,6 @@ import re import io -import textwrap -import sys -import shutil from setuptools import setup @@ -60,12 +57,3 @@ setup( 'Programming Language :: Python' ], ) - -# Check that the pandoc-xnos script is on the PATH -if not shutil.which('pandoc-xnos'): - msg = """ - ERROR: `pandoc-xnos` script not found. This will need to - be corrected. If you need help, please file an Issue at - https://github.com/tomduck/pandoc-xnos/issues.\n""" - print(textwrap.dedent(msg)) - sys.exit(-1)
Removed script check that was causing a developer pip error.
tomduck_pandoc-xnos
train
py
bba04e08ccf631291a042cca5985591899eca869
diff --git a/lib/puppet/provider/service/freebsd.rb b/lib/puppet/provider/service/freebsd.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/provider/service/freebsd.rb +++ b/lib/puppet/provider/service/freebsd.rb @@ -78,7 +78,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do # Add a new setting to the rc files def rc_add(service, rcvar, yesno) - append = "\n\# Added by Puppet\n#{rcvar}_enable=\"#{yesno}\"" + append = "\# Added by Puppet\n#{rcvar}_enable=\"#{yesno}\"\n" # First, try the one-file-per-service style if File.exists?(@@rcconf_dir) File.open(@@rcconf_dir + "/#{service}", File::WRONLY | File::APPEND | File::CREAT, 0644) {
Fix for #<I> -- Newline goes at the _end_ of the line Fredrik Eriksson's suggested change, from the ticket.
puppetlabs_puppet
train
rb
cda65b49d06b2e0a8ece8dfd04c39376f77f05b0
diff --git a/webapps/client/scripts/repository/controllers/cam-cockpit-repository-view-ctrl.js b/webapps/client/scripts/repository/controllers/cam-cockpit-repository-view-ctrl.js index <HASH>..<HASH> 100644 --- a/webapps/client/scripts/repository/controllers/cam-cockpit-repository-view-ctrl.js +++ b/webapps/client/scripts/repository/controllers/cam-cockpit-repository-view-ctrl.js @@ -157,7 +157,6 @@ define([ updateSilently({ deployment: focused.id, resource: null, - resourceName: null, viewbox: null, editMode: null }); @@ -169,7 +168,6 @@ define([ updateSilently({ deployment: null, resource: null, - resourceName: null, viewbox: null, editMode: null }); @@ -208,7 +206,7 @@ define([ }; } else if (resourceName) { - + resources = resources || []; for(var i=0, resource; !!(resource = resources[i]); i++) { if (resource.name === resourceName) { return {
chore(repository): keep resource name related to CAM-<I>
camunda_camunda-bpm-platform
train
js
71f46594cabd1a22bda5909b0c19237ae5646600
diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py index <HASH>..<HASH> 100644 --- a/pycm/pycm_obj.py +++ b/pycm/pycm_obj.py @@ -542,6 +542,7 @@ def __overall_stat_init__(cm): cm.TPR_Micro = cm.overall_stat["TPR Micro"] cm.PPV_Micro = cm.overall_stat["PPV Micro"] cm.F1_Macro = cm.overall_stat["F1 Macro"] + cm.F1_Micro = cm.overall_stat["F1 Micro"] cm.Overall_RACC = cm.overall_stat["Overall RACC"] cm.Overall_RACCU = cm.overall_stat["Overall RACCU"] cm.PI = cm.overall_stat["Scott PI"]
fix : F1 Micro added to object
sepandhaghighi_pycm
train
py
9c9cb989fefc26f658e3b28a05f7d79872520ad4
diff --git a/lib/clever-ruby/clever_object.rb b/lib/clever-ruby/clever_object.rb index <HASH>..<HASH> 100644 --- a/lib/clever-ruby/clever_object.rb +++ b/lib/clever-ruby/clever_object.rb @@ -198,9 +198,13 @@ module Clever # @api private # @return [Object] def add_accessors(keys) + obj = self metaclass.instance_eval do keys.each do |k| next if @@permanent_attributes.include? k + unless obj.class.linked_resources.nil? + next if obj.class.linked_resources.include? k + end k_eq = :"#{k}=" define_method(k) { @values[k] } define_method(k_eq) { |v| @values[k] = v }
only add accessor for attributes if they dont refer to nested resources
Clever_clever-ruby
train
rb
a1a208228f5e4c355f2d6b2af7a9efc5679c7092
diff --git a/asv/commands/publish.py b/asv/commands/publish.py index <HASH>..<HASH> 100644 --- a/asv/commands/publish.py +++ b/asv/commands/publish.py @@ -103,14 +103,24 @@ class Publish(Command): repo = get_repo(conf) benchmarks = Benchmarks.load(conf) + def copy_ignore(src, names): + # Copy only *.js and *.css in vendor dir + ignore = [fn for fn in names + if (os.path.basename(src).lower() == 'vendor' and + not fn.lower().endswith('.js') and + not fn.lower().endswith('.css'))] + return ignore + template_dir = os.path.join( os.path.dirname(os.path.abspath(__file__)), '..', 'www') - shutil.copytree(template_dir, conf.html_dir) + shutil.copytree(template_dir, conf.html_dir, ignore=copy_ignore) # Ensure html_dir is writable even if template_dir is on a read-only FS os.chmod(conf.html_dir, 0o755) for (pre, ds, fs) in os.walk(conf.html_dir): - for x in fs + ds: + for x in fs: + os.chmod(os.path.join(pre, x), 0o644) + for x in ds: os.chmod(os.path.join(pre, x), 0o755) log.step()
publish: only copy vendor/*.{js,css}, and don't set +x on copied files
airspeed-velocity_asv
train
py
b631a77439a8e828a7b67018928b4500cc84e269
diff --git a/packages/interaction/src/InteractionManager.js b/packages/interaction/src/InteractionManager.js index <HASH>..<HASH> 100644 --- a/packages/interaction/src/InteractionManager.js +++ b/packages/interaction/src/InteractionManager.js @@ -1431,7 +1431,7 @@ export default class InteractionManager extends EventEmitter const events = this.normalizeToPointerData(originalEvent); - if (events[0].pointerType === 'mouse') + if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen') { this.didMove = true;
Update the mouse position in onPointerMove when using a pen tablet (#<I>)
pixijs_pixi.js
train
js
dd74f9a8fe7a698d5623fc5ee4ce3551246fbba5
diff --git a/stream.js b/stream.js index <HASH>..<HASH> 100644 --- a/stream.js +++ b/stream.js @@ -48,7 +48,7 @@ DuplexStream.prototype._end = function (end) { if(isError(end)) this.sink.end(end) //otherwise, respect pause - else if(!this.sink.paused) { + else if(this.buffer.length === 0) { this.sink.end(end) this.paused = this.sink.paused } @@ -63,10 +63,12 @@ DuplexStream.prototype.resume = function () { while(this.buffer.length && !this.sink.paused) { var data = this.buffer.shift() this._preread(data) - this.sink.write(data) + //check if it's paused again, uncase a credit allocation in _preread + //has changed the pause state. + if(!this.sink.paused) this.sink.write(data) } - if(this.ended && this.buffer.length == 0 && !this.sink.paused) + if(this.ended && this.buffer.length == 0) this.sink.end(this.ended) }
breaking change: pause doesn't prevent end
push-stream_push-mux
train
js
827848b851319fbaa85ac22fd468e33c04782939
diff --git a/src/FinalHandler.php b/src/FinalHandler.php index <HASH>..<HASH> 100644 --- a/src/FinalHandler.php +++ b/src/FinalHandler.php @@ -113,7 +113,7 @@ class FinalHandler if ($this->request instanceof Http\Request && $this->request->originalUrl) { $url = $this->request->originalUrl; } else { - $this->request->getUrl(); + $url = $this->request->getUrl(); } $escaper = new Escaper();
Fixed missing variable declaration in FinalHandler
phly_conduit
train
php
80aa23b56c1cb2dd8ae0c24788bb1af79b84c975
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -31,7 +31,8 @@ var input = [ // HTTP/S Transport Protocol , ["http://host.xz/path/to/repo.git/", false] , ["https://host.xz/path/to/repo.git/", false] - + , ["http://host.xz:8000/path/to/repo.git/", false] + , ["https://host.xz:8000/path/to/repo.git/", false] // Local (Filesystem) Transport Protocol , ["/path/to/repo.git/", false] , ["path/to/repo.git/", false]
add tests for urls with ports
IonicaBizau_is-ssh
train
js
34bce5f066031574f9dffabfb0c933d000a29a7d
diff --git a/lib/mongo_mapper/document.rb b/lib/mongo_mapper/document.rb index <HASH>..<HASH> 100644 --- a/lib/mongo_mapper/document.rb +++ b/lib/mongo_mapper/document.rb @@ -341,10 +341,6 @@ module MongoMapper end def save(options={}) - if options === false - ActiveSupport::Deprecation.warn "save with true/false is deprecated. You should now use :validate => true/false." - options = {:validate => false} - end options.reverse_merge!(:validate => true) perform_validations = options.delete(:validate) !perform_validations || valid? ? create_or_update(options) : false diff --git a/test/functional/test_document.rb b/test/functional/test_document.rb index <HASH>..<HASH> 100644 --- a/test/functional/test_document.rb +++ b/test/functional/test_document.rb @@ -721,17 +721,12 @@ class DocumentTest < Test::Unit::TestCase end end - should "insert document" do + should "insert invalid document" do doc = @document.new + doc.expects(:valid?).never doc.save(:validate => false) @document.count.should == 1 end - - should "work with false passed to save" do - doc = @document.new - doc.save(false) - @document.count.should == 1 - end end context "#save (with options)" do
Deprecations are for projects that are past <I>. ;) Enjoy life on the edge!
mongomapper_mongomapper
train
rb,rb
dff479758a7edcf9d007e12f7d6f1c47b8ecea42
diff --git a/src/wyone/core/SolverState.java b/src/wyone/core/SolverState.java index <HASH>..<HASH> 100644 --- a/src/wyone/core/SolverState.java +++ b/src/wyone/core/SolverState.java @@ -137,7 +137,7 @@ public final class SolverState implements Iterable<WFormula> { WFormula f = rassignments.get(x); //System.out.println("STATE BEFORE: " + this + " (" + System.identityHashCode(this) + "), i=" + i + "/" + worklist.size() + " : " + f); for(InferenceRule ir : solver.theories()) { - if(assignments.size() >= limit) { + if(worklist.size() >= limit || assignments.size() >= limit) { return; } else if(assertions.get(x)) { ir.infer(f, this, solver);
Ok, hmmm, that didn't work very well.
Whiley_WhileyCompiler
train
java
0832c07a872ac6865047e89ffb3f1c217f7eadd7
diff --git a/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php b/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php +++ b/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php @@ -209,9 +209,9 @@ class ConfigurationTest extends MigrationTestCase public function testGetVersionNotFound() { - $this->setExpectedException(MigrationException::class); - $config = $this->getSqliteConfiguration(); + + $this->setExpectedException(MigrationException::class); $config->getVersion('foo'); }
Move expected exception after getSqliteConfiguration call in test
doctrine_migrations
train
php
1b96e1bf6d624c59fc1cb68400011f88be37396f
diff --git a/transformers/websockets/server.js b/transformers/websockets/server.js index <HASH>..<HASH> 100644 --- a/transformers/websockets/server.js +++ b/transformers/websockets/server.js @@ -27,7 +27,7 @@ module.exports = function server() { * @api private */ function noop(err) { - if (err) logger.error(err.message, err); + if (err) logger.error(err); } //
[fix] When logging errors, use the error as the first argument of the logger
primus_primus
train
js
d50589cb46565a3f359872c32dfe02a6b61b864d
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1,4 @@ -module.exports = require('./dav'); +module.exports = { + dav: require('./dav'), + web3: require('./web3wrapper') +}; \ No newline at end of file
fix: expose web3 from dav-js
DAVFoundation_dav-js
train
js
50b3a161df3a3965fa766300f11da27e04766d49
diff --git a/src/Service/Plugin/SettingsGetter.php b/src/Service/Plugin/SettingsGetter.php index <HASH>..<HASH> 100644 --- a/src/Service/Plugin/SettingsGetter.php +++ b/src/Service/Plugin/SettingsGetter.php @@ -157,7 +157,7 @@ class SettingsGetter extends Registration * @return array * List of these files */ - public static function getAdditionelHelpFiles() + public static function getAdditionalHelpFiles() { return static::$additionalHelpFiles; } diff --git a/src/View/Messages.php b/src/View/Messages.php index <HASH>..<HASH> 100644 --- a/src/View/Messages.php +++ b/src/View/Messages.php @@ -198,7 +198,7 @@ class Messages $this->readHelpFile(KREXX_DIR . 'resources/language/Help.ini'); - foreach (SettingsGetter::getAdditionelHelpFiles() as $filename) { + foreach (SettingsGetter::getAdditionalHelpFiles() as $filename) { $this->readHelpFile($filename); } }
Fixed a typo in the method name.
brainworxx_kreXX
train
php,php
f50b7dbe11c82e2af19d84227d4a964d239f25c3
diff --git a/cli/Valet/Site.php b/cli/Valet/Site.php index <HASH>..<HASH> 100644 --- a/cli/Valet/Site.php +++ b/cli/Valet/Site.php @@ -304,11 +304,19 @@ class Site $caSrlParam = ' -CAserial ' . $caSrlPath; } - $this->cli->run(sprintf( + $result = $this->cli->runAsUser(sprintf( 'openssl x509 -req -sha256 -days 730 -CA "%s" -CAkey "%s"%s -in "%s" -out "%s" -extensions v3_req -extfile "%s"', $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath )); + // If cert could not be created using runAsUser(), use run(). + if (strpos($result, 'Permission denied')) { + $this->cli->run(sprintf( + 'openssl x509 -req -sha256 -days 730 -CA "%s" -CAkey "%s"%s -in "%s" -out "%s" -extensions v3_req -extfile "%s"', + $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath + )); + } + $this->trustCertificate($crtPath); }
handle SSL .crt creation "Permission denied" failure
laravel_valet
train
php
69e74e635ef514c5481fa0b538d88e4b145de0d7
diff --git a/lib/dm-validations.rb b/lib/dm-validations.rb index <HASH>..<HASH> 100644 --- a/lib/dm-validations.rb +++ b/lib/dm-validations.rb @@ -41,13 +41,13 @@ module DataMapper def create(attributes = {}, context = :default) resource = new(attributes) return resource unless resource.valid?(context) - resource.save + resource.save!(context) resource end - def create!(attributes = {}) + def create!(attributes = {}, context = :default) resource = new(attributes) - resource.save! + resource.save!(context) resource end end @@ -59,7 +59,7 @@ module DataMapper # def save_with_validations(context = :default) return false unless valid?(context) - save! + save!(context) end # Return the ValidationErrors
Ensure that context gets passed to Resource#save! Because of the way hooks are implemented, you cannot hook save_with_validations (save), but instead you always hook Resource#save (save!). Since dm-core's save method takes an optional context (but does nothing with it), I've updated dm-validations to call save!(context), which allows you do hook :save, and get the context it was saved in.
emmanuel_aequitas
train
rb
6cd9ebb84790bfabf0561b8922644ccddbc20d83
diff --git a/daftlistings/daft.py b/daftlistings/daft.py index <HASH>..<HASH> 100644 --- a/daftlistings/daft.py +++ b/daftlistings/daft.py @@ -155,7 +155,7 @@ class Daft: if self._filters: payload["filters"] = self._filters if self._ranges: - payload["range"] = self._ranges + payload["ranges"] = self._ranges if self._geoFilter: payload["geoFilter"] = self._geoFilter payload["paging"] = self._paging
(#<I>) range -> ranges
AnthonyBloomer_daftlistings
train
py
4021ae2f6e466d6cdd69c6fa84b5f7484986aaea
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -2434,8 +2434,8 @@ func newServer(listenAddrs []string, db database.DB, chainParams *chaincfg.Param } // allow nondefault ports after 50 failed tries. - if fmt.Sprintf("%d", addr.NetAddress().Port) != - activeNetParams.DefaultPort && tries < 50 { + if tries < 50 && fmt.Sprintf("%d", addr.NetAddress().Port) != + activeNetParams.DefaultPort { continue }
server.go: Optimize newAddressFunc Change the order of conditions to avoid calling fmt.Sprintf unnecessarily.
btcsuite_btcd
train
go
291006e7cc98a94f98cf74ccbd039f40df8721d4
diff --git a/src/Strava/API/Service/REST.php b/src/Strava/API/Service/REST.php index <HASH>..<HASH> 100644 --- a/src/Strava/API/Service/REST.php +++ b/src/Strava/API/Service/REST.php @@ -482,7 +482,7 @@ class REST implements ServiceInterface public function getStreamsRoute($id) { - $path = '/routes/' . $id . '/streams/'; + $path = '/routes/' . $id . '/streams'; $result = $this->adapter->get($path, array(), $this->getHeaders()); return $this->format($result); diff --git a/tests/Strava/API/Service/RESTTest.php b/tests/Strava/API/Service/RESTTest.php index <HASH>..<HASH> 100644 --- a/tests/Strava/API/Service/RESTTest.php +++ b/tests/Strava/API/Service/RESTTest.php @@ -545,7 +545,7 @@ class RESTTest extends PHPUnit_Framework_TestCase { $pestMock = $this->getPestMock(); $pestMock->expects($this->once())->method('get') - ->with($this->equalTo('/routes/1234/streams/')) + ->with($this->equalTo('/routes/1234/streams')) ->will($this->returnValue('{"response": 1}')); $service = new Strava\API\Service\REST('TOKEN', $pestMock);
Remove trailing slash from streams URL (#<I>)
basvandorst_StravaPHP
train
php,php
59fc72961cb29086d7e2195912f2516f4349b8f6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ HERE = os.path.dirname(__file__) setup( name=NAME, - version='0.0.7', + version='0.0.8', packages=find_packages(), install_requires=['requests', 'werkzeug'], package_data={'': ['*.txt', '*.rst']},
Make new release (<I>)
authomatic_liveandletdie
train
py
c066e62a19f2583e77614f121f1f34faaeef41b3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def is_requirement(line): setup( name='edx-ecommerce-worker', - version='0.8.1', + version='0.8.2', description='Celery tasks supporting the operations of edX\'s ecommerce service', long_description=long_description, classifiers=[
Bumping version after latest commit (#<I>) Added new Email template for Enterprise Portal Emails ENT-<I>
edx_ecommerce-worker
train
py
d460b0d09a0aecd7506e1cebf9539fccce815353
diff --git a/resources/lang/de-DE/dashboard.php b/resources/lang/de-DE/dashboard.php index <HASH>..<HASH> 100644 --- a/resources/lang/de-DE/dashboard.php +++ b/resources/lang/de-DE/dashboard.php @@ -23,16 +23,16 @@ return [ 'incident-templates' => 'Ereignis Vorlagen', 'updates' => [ 'title' => 'Vorfall Updates für :incident', - 'count' => '{0} Zero Updates|[1] One Update|[2] Two Updates|[3,*] Several Updates', + 'count' => '{0} 0 Updates|[1] Ein Update|[2] Zwei Updates|[3,*] Mehrere Updates', 'add' => [ 'title' => 'Vorfall-Update erstellen', - 'success' => 'Your new incident update has been created.', - 'failure' => 'Something went wrong with the incident update.', + 'success' => 'Dein Vorfall Update wurde erstellt.', + 'failure' => 'Etwas ist mit dem Vorfall Update schief gelaufen.', ], 'edit' => [ 'title' => 'Vorfall Update bearbeiten', 'success' => 'Vorfall Update wurde aktualisiert.', - 'failure' => 'Aktualisierung des Vorfall Updates fehlgeschlagen', + 'failure' => 'Etwas ist mit dem Aktualisieren des Vorfall Updates schief gelaufen', ], ], 'add' => [
New translations dashboard.php (German)
CachetHQ_Cachet
train
php
cc1c1096b0d72e16ac0d21b5f36e9754eb6e0bb5
diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index <HASH>..<HASH> 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -1411,7 +1411,6 @@ class Controller * @param bool $addToLayout Add to layout, instead of page * * @return ComponentBase|null Component object. Will return `null` if a soft component is used but not found. - * * @throws CmsException if the (hard) component is not found. * @throws SystemException if the (hard) component class is not found or is not registered. */
Remove newline between "throws" and "return"
octobercms_october
train
php
0e7f2efdb161db0b907ea0cdfc547ca8f348271e
diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index <HASH>..<HASH> 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -321,8 +321,10 @@ class I18n extends Object { $this->__domains[$domain][$this->__lang][$this->category] = array(); return $domain; } - - if ($head = $this->__domains[$domain][$this->__lang][$this->category][""]) { + + if (isset($this->__domains[$domain][$this->__lang][$this->category][""])) { + $head = $this->__domains[$domain][$this->__lang][$this->category][""]; + foreach (explode("\n", $head) as $line) { $header = strtok($line,":"); $line = trim(strtok("\n"));
Fixing notice errors caused by accessing headers in po files that don't exist. Fixes #<I>
cakephp_cakephp
train
php
765f4237cac37c869ea251f4eb370a01a47f5bb0
diff --git a/mongo_orchestration/__init__.py b/mongo_orchestration/__init__.py index <HASH>..<HASH> 100644 --- a/mongo_orchestration/__init__.py +++ b/mongo_orchestration/__init__.py @@ -20,7 +20,7 @@ from mongo_orchestration.servers import Servers from mongo_orchestration.replica_sets import ReplicaSets from mongo_orchestration.sharded_clusters import ShardedClusters -__version__ = '0.6.8' +__version__ = '0.6.9.dev0' def set_releases(releases=None, default_release=None): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -81,7 +81,7 @@ class test(Command): setup( name='mongo-orchestration', - version='0.6.8', + version='0.6.9.dev0', author='MongoDB, Inc.', author_email='mongodb-user@googlegroups.com', description='Restful service for managing MongoDB servers',
Begin work on <I>
10gen_mongo-orchestration
train
py,py
ba56a0c0cf5ff784e9096ac1ff1e3caaa52ba396
diff --git a/factory.py b/factory.py index <HASH>..<HASH> 100644 --- a/factory.py +++ b/factory.py @@ -20,6 +20,7 @@ import os import sys +import urllib import warnings from flask import Blueprint @@ -72,7 +73,9 @@ class WSGIScriptAliasFix(object): def __call__(self, environ, start_response): """Parse path from ``REQUEST_URI`` to fix ``PATH_INFO``.""" if environ.get('WSGI_SCRIPT_ALIAS') == environ['SCRIPT_NAME']: - path_info = urlparse(environ.get('REQUEST_URI')).path + path_info = urllib.unquote_plus( + urlparse(environ.get('REQUEST_URI')).path + ) # addresses issue with url encoded arguments in Flask routes environ['SCRIPT_NAME'] = '' environ['PATH_INFO'] = path_info return self.app(environ, start_response)
base: fix for wsgi PATH_INFO handling * Addresses issue with url encoded arguments in Flask routes. E.g. for route `/collection/<name>` the view argument `name` was not unescaped when accessed by `/collection/Books%<I>%<I>%<I>Reports` on Apache and this led to error during lookup in database. (closes #<I>)
inveniosoftware_invenio-base
train
py
67d0d01a2bac0c3cf1b3ea6aead2f44451420d03
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -64,10 +64,13 @@ quiet: False timing: False """.format(expect_colors) - +if expect_colors: + color_str = 'True ' +else: + color_str = 'False' SHOW_LONG = """abbrev: True # Accept abbreviated commands case_insensitive: True # upper- and lower-case both OK -colors: True # Colorized output (*nix only) +colors: {} # Colorized output (*nix only) continuation_prompt: > # On 2nd+ line of input debug: False # Show full error stack on error default_file_name: command.txt # for ``save``, ``load``, etc. @@ -77,7 +80,7 @@ feedback_to_output: False # include nonessentials in `|`, `>` results prompt: (Cmd) # quiet: False # Don't print nonessential feedback timing: False # Report execution times -""" +""".format(color_str) class StdOut(object):
Fixed long-form show unit test to deal with Windows not having colors.
python-cmd2_cmd2
train
py
fa7e43f8de94e86210f9c5ed1e3f784c85728b17
diff --git a/test/merge_patch_test.rb b/test/merge_patch_test.rb index <HASH>..<HASH> 100644 --- a/test/merge_patch_test.rb +++ b/test/merge_patch_test.rb @@ -207,19 +207,9 @@ describe "README example" do } JSON - expected = <<-JSON.strip_heredoc.gsub(/\s/, "") - { - "title": "Goodbye!", - "author" : { - "phoneNumber": "+01-123-456-7890", - "givenName" : "John", - }, - "tags":["example"], - "content": "This will be unchanged" - } - JSON + expected = %q'{"title":"Hello!","author":{"givenName":"John"},"tags":["example"],"content":"This will be unchanged"},"phoneNumber":"+01-123-456-7890"' - pending do + pending do assert_equal expected, JSON.merge(document, merge_patch) end end
fix up README test. Now it's in line with the new README.
steveklabnik_json-merge_patch
train
rb
5ebeb91c78f2decf2e8d7a8c6c5696cd6f283465
diff --git a/docs/app/Components/ComponentDoc/ComponentExample.js b/docs/app/Components/ComponentDoc/ComponentExample.js index <HASH>..<HASH> 100644 --- a/docs/app/Components/ComponentDoc/ComponentExample.js +++ b/docs/app/Components/ComponentDoc/ComponentExample.js @@ -138,7 +138,7 @@ class ComponentExample extends Component { resetJSX = () => { const { sourceCode } = this.state const original = this.getOriginalSourceCode() - if (sourceCode !== original && confirm('Loose your changes?')) { // eslint-disable-line no-alert + if (sourceCode !== original && confirm('Lose your changes?')) { // eslint-disable-line no-alert this.setState({ sourceCode: original }) this.renderSourceCode() }
fix(ComponentExample): typo "loose" to "lose" (#<I>) fix(ComponentExample): typo "loose" to "lose"
Semantic-Org_Semantic-UI-React
train
js
de8efdb9f95b5d62e9d09819d739da7dedf03c9c
diff --git a/src/wormhole/cli/cmd_send.py b/src/wormhole/cli/cmd_send.py index <HASH>..<HASH> 100644 --- a/src/wormhole/cli/cmd_send.py +++ b/src/wormhole/cli/cmd_send.py @@ -48,10 +48,9 @@ class Sender: w = wormhole(APPID, self._args.relay_url, self._reactor, self._tor_manager, timing=self._timing) - try: - yield self._go(w) - finally: - w.close() + d = self._go(w) + d.addBoth(w.close) # must wait for ack from close() + yield d def _send_data(self, data, w): data_bytes = dict_to_bytes(data)
cmd_send: wait for ack from close() Without this, the sender drops the connection before the "close" message has made it to the server, which leaves the mailbox hanging until it expires. It still lives in a 'd.addBoth()' slot, so it gets closed even if some error occurrs, but we wait for it's Deferred to fire in both success and failure cases.
warner_magic-wormhole
train
py
6dc6092753b4fb786eec93362d5eca1f4c47c504
diff --git a/fabfile.py b/fabfile.py index <HASH>..<HASH> 100644 --- a/fabfile.py +++ b/fabfile.py @@ -9,6 +9,7 @@ from prettyprint import pp import re VERSION_PATTERN = r'^v\d+(\.\d+)+?$' +env.releases_directory = "release" env.root_dir = os.path.abspath(os.path.dirname(__file__)) env.release = "HEAD" @@ -27,7 +28,6 @@ def latest_git_tag(): latest_tag = None return latest_tag - def compare_versions(x, y): """ Expects 2 strings in the format of 'X.Y.Z' where X, Y and Z are @@ -81,7 +81,13 @@ def release(): test() tag = make_tag() local("mvn package -pl enabler -am") - local("scripts/updatedocs.sh") + # Must have keystore info configured in ~/.m2/settings + local("mvn install -Prelease -pl enabler") + local("mkdir -p %(releases_directory)s" % env) + local("cp enabler/target/openxc-enabler.apk enabler/target/openxc-enabler-%s.apk" % tag) + local("cp enabler/target/openxc-enabler-signed-aligned.apk enabler/target/openxc-enabler-release-%s.apk" % tag) + + # local("scripts/updatedocs.sh") @task def snapshot():
Build production release APK in release fab task.
openxc_openxc-android
train
py
58fd04ce909883441877e11a4de4d3b7e2380b5f
diff --git a/cobra/core/Object.py b/cobra/core/Object.py index <HASH>..<HASH> 100644 --- a/cobra/core/Object.py +++ b/cobra/core/Object.py @@ -66,9 +66,6 @@ class Object(object): def __contains__(self, x): return self.id.__contains__(x) - def __iter__(self): - return list(self.id).__iter__() - def __getitem__(self, index): return self.id[index] @@ -76,7 +73,7 @@ class Object(object): return self.id[i:j] def __repr__(self): - return repr(self.id) + return "<%s %s at 0x%x>" % (self.__class__.__name__, self.id, id(self)) def __str__(self): return str(self.id)
core.Object has __repr__ and not __iter__ The __repr__ now returns <CLASS ID 0xMEMORY_LOCATION> so it is clear if an entity is a string id for a reaction or a reaction itself from the __repr__. This fixes gh#<I> The lack of __iter__ makes it easy to check for lists of core.Object using duck-typing instead of explicitly using isinstance
opencobra_cobrapy
train
py
8b64f3d05bda56411816d13aaa8008edde7a5277
diff --git a/pnc_cli/utils.py b/pnc_cli/utils.py index <HASH>..<HASH> 100644 --- a/pnc_cli/utils.py +++ b/pnc_cli/utils.py @@ -44,10 +44,8 @@ def checked_api_call(api, func, **kwargs): else: return response - epoch = datetime.datetime.utcfromtimestamp(0) - def unix_time_millis(dt): millis = int((dt - epoch).total_seconds() * 1000.0) return millis @@ -96,3 +94,10 @@ def get_config(): "New config file written to ~/.config/pnc-cli/pnc-cli.conf. Configure pncUrl and keycloakUrl values.") exit(1) return config + + +def get_internal_repo_start(environment): + if "stage" in environment: + return 'git+ssh://pnc-gerrit-stage@code-stage.eng.nay.redhat.com:29418/' + elif "devel" in environment: + return 'git+ssh://user-pnc-gerrit@pnc-gerrit.pnc.dev.eng.bos.redhat.com:29418/'
update utils added function to retrieve the appropriate internal_scm beginning based upon the configured PNC url
project-ncl_pnc-cli
train
py
c2c907e3224238e63e2e77736ee8ff4af80c7a71
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ from setuptools import setup from rejected import __version__ +import os import sys classifiers = ['Development Status :: 5 - Production/Stable', @@ -22,6 +23,9 @@ extras_require = {'html': ['beautifulsoup4']} if sys.version_info < (2, 7, 0): install_requires.append('importlib') +if os.environ.get('READTHEDOCS', None) == 'True': + install_requires.append('pyev==0.8.1') + setup(name='rejected', version=__version__, description='Rejected is a Python RabbitMQ Consumer Framework and '
Install a pinned version of pyev due to build errors on rtd
gmr_rejected
train
py
689a6501473cca6ac9e31017b6192814b4c9cf5b
diff --git a/local_settings/loader.py b/local_settings/loader.py index <HASH>..<HASH> 100644 --- a/local_settings/loader.py +++ b/local_settings/loader.py @@ -93,8 +93,7 @@ class Loader(Base): for k in v: v[k] = self._do_interpolation(v[k], settings) elif isinstance(v, Sequence): - for i, item in enumerate(v): - v[i] = self._do_interpolation(item, settings) + v = v.__class__(self._do_interpolation(item, settings) for item in v) return v def _convert_name(self, name):
Handle tuples in Loader._do_interpolation() Reported by @yorkedork
PSU-OIT-ARC_django-local-settings
train
py
ac900d1a42e5379e192b57cef67845db202e82c3
diff --git a/tests/test_signed_div.py b/tests/test_signed_div.py index <HASH>..<HASH> 100644 --- a/tests/test_signed_div.py +++ b/tests/test_signed_div.py @@ -9,7 +9,7 @@ import os test_location = str(os.path.dirname(os.path.realpath(__file__))) -def run_strtol(threads): +def run_signed_div(): test_bin = os.path.join(test_location, "../../binaries-private/tests/i386/test_signed_div") b = angr.Project(test_bin) @@ -21,9 +21,8 @@ def run_strtol(threads): nose.tools.assert_equal(out_angr, stdout_real) -def test_strtol(): - yield run_strtol, None - yield run_strtol, 8 +def test_signed_div(): + yield run_signed_div if __name__ == "__main__": - run_strtol(4) + run_signed_div()
Rename the signed_div test case, and ... disable the multithreaded test case.
angr_angr
train
py
87daec16437bf9c4c477f0c911ec0a6b3d2382a9
diff --git a/lib/elastic_apm/sql_summarizer.rb b/lib/elastic_apm/sql_summarizer.rb index <HASH>..<HASH> 100644 --- a/lib/elastic_apm/sql_summarizer.rb +++ b/lib/elastic_apm/sql_summarizer.rb @@ -25,7 +25,7 @@ module ElasticAPM end def summarize(sql) - sql = sql.encode(UTF8, invalid: :replace, replace: nil) + sql = sql.encode(UTF8, invalid: :replace, undef: :replace) self.class.cache[sql] ||= REGEXES.find do |regex, sig| if (match = sql[0...1000].match(regex))
Handle undefined characters as well (#<I>)
elastic_apm-agent-ruby
train
rb
1c011d61c7c67308aa12ddfc629ec406b40f76a2
diff --git a/jams/tests/jams_test.py b/jams/tests/jams_test.py index <HASH>..<HASH> 100644 --- a/jams/tests/jams_test.py +++ b/jams/tests/jams_test.py @@ -186,6 +186,10 @@ def test_jamsframe_add_observation_fail(): yield __test, ann, 0.0, None, 'foo', 1 yield __test, ann, None, 1.0, 'foo', 1 + yield __test, ann, -1, -1, 'foo', 1 + yield __test, ann, 0.0, -1, 'foo', 1 + yield __test, ann, -1, 1.0, 'foo', 1 + def test_jamsframe_interval_values():
Added negative value test cases to add_observation
marl_jams
train
py
bfc2b54d5a0bc8ba8a3b115aa8abaf3911cfc9c9
diff --git a/command/__init__.py b/command/__init__.py index <HASH>..<HASH> 100644 --- a/command/__init__.py +++ b/command/__init__.py @@ -1,17 +1,7 @@ """distutils.command Package containing implementation of all the standard Distutils -commands. Currently this means: - - build - build_py - build_ext - install - install_py - install_ext - dist - -but this list will undoubtedly grow with time.""" +commands.""" __revision__ = "$Id$" @@ -21,5 +11,6 @@ __all__ = ['build', 'install', 'install_py', 'install_ext', + 'clean', 'sdist', ]
Simplified doc string. Added 'clean' to list of commands.
pypa_setuptools
train
py
4a91845d97afba0d84c72ffd130fb903c77ec64c
diff --git a/src/Saft/Sparql/Query.php b/src/Saft/Sparql/Query.php index <HASH>..<HASH> 100644 --- a/src/Saft/Sparql/Query.php +++ b/src/Saft/Sparql/Query.php @@ -550,6 +550,16 @@ class Query return $result; } + + /** + * Returns raw query, if available. + * + * @return string + */ + public function getQuery() + { + return $this->query; + } /** * Parsing the given queryand extract its parts. @@ -672,6 +682,36 @@ class Query $this->setOffset($parts['offset'][1][0]); } } + + /** + * Checks if query is a DELETE query. + * + * @return boolean + */ + public function isDeleteQuery() + { + return false !== strpos($this->getProloguePart(), 'DELETE'); + } + + /** + * Checks if query is an INSERT query. + * + * @return boolean + */ + public function isInsertQuery() + { + return false !== strpos($this->getProloguePart(), 'INSERT'); + } + + /** + * Checks if query is SPARQL UPDATE by checking if its either an insert- or delete query. + * + * @return boolean + */ + public function isUpdateQuery() + { + return $this->isInsertQuery() || $this->isDeleteQuery(); + } public function getProloguePart() {
Add isDeleteQuery, isInsertQuery, isUpdateQuery, getQuery These helper functions check which type the query is. A delete query contains DELETE in the prologue part, same for INSERT. An update query is either a delete- or insert query.
SaftIng_Saft
train
php
a4930284cf9212dd464ff7112ed0b1c1f9bb0ae9
diff --git a/src/OkulBilisim/OjsImportBundle/Helper/ImportCommand.php b/src/OkulBilisim/OjsImportBundle/Helper/ImportCommand.php index <HASH>..<HASH> 100644 --- a/src/OkulBilisim/OjsImportBundle/Helper/ImportCommand.php +++ b/src/OkulBilisim/OjsImportBundle/Helper/ImportCommand.php @@ -4,6 +4,8 @@ namespace OkulBilisim\OjsImportBundle\Helper; use Doctrine\DBAL\Connection; use Doctrine\ORM\EntityManager; +use Monolog\Handler\StreamHandler; +use Monolog\Logger; use Psr\Log\LoggerInterface; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; @@ -54,6 +56,9 @@ class ImportCommand extends ContainerAwareCommand ->createConnection($parameters); $this->em = $this->getContainer()->get('doctrine.orm.entity_manager'); + + $path = $this->getContainer()->getParameter('kernel.root_dir') . '/logs/import.log'; $this->logger = $this->getContainer()->get('logger'); + $this->logger->pushHandler(new StreamHandler($path, Logger::INFO)); } } \ No newline at end of file
Save import logs to its own file
academic_VipaImportBundle
train
php
39b99ff32fc97c711963e100e9c99b035960aaea
diff --git a/lib/resque.rb b/lib/resque.rb index <HASH>..<HASH> 100644 --- a/lib/resque.rb +++ b/lib/resque.rb @@ -163,7 +163,7 @@ module Resque # A shortcut to unregister_worker # useful for command line tool def remove_worker(worker_id) - worker = Resque::Worker.find(worker_id) + worker = Worker.find(worker_id) worker.unregister_worker end
Adding missing remove_worker for resque command line tool
resque_resque
train
rb
eb68b384ff43a94f6dd0468b2bc4c67de6c23350
diff --git a/h2o-py/h2o/connection.py b/h2o-py/h2o/connection.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/connection.py +++ b/h2o-py/h2o/connection.py @@ -491,6 +491,7 @@ class H2OConnection(object): files = {file_upload_info["file"] : open(file_upload_info["file"], "rb")} return requests.post(url, files=files, headers=headers) elif method == "POST": + headers["Content-Type"] = "application/x-www-form-urlencoded" return requests.post(url, data=post_body, headers=headers) elif method == "DELETE": return requests.delete(url, headers=headers)
Set Content-Type: application/x-www-form-urlencoded for regular POST requests.
h2oai_h2o-3
train
py
e5c3cc834925daf29718a8ce2b64cddff854b1c3
diff --git a/src/GeneaLabs/Bones/Macros/BonesMacrosFormBuilder.php b/src/GeneaLabs/Bones/Macros/BonesMacrosFormBuilder.php index <HASH>..<HASH> 100644 --- a/src/GeneaLabs/Bones/Macros/BonesMacrosFormBuilder.php +++ b/src/GeneaLabs/Bones/Macros/BonesMacrosFormBuilder.php @@ -206,7 +206,13 @@ class BonesMacrosFormBuilder extends \Illuminate\Html\FormBuilder public function bs_switch($label, $name, $value = 1, $checked = null, array $options = [], $extraElement = null, $extraWidth = 0) { - $options['class'] .= [' switch']; + if ((array_key_exists('class', $options)) + && (strpos($options['class'], 'switch') >= 0)) { + $options['class'] .= [' switch']; + } else { + $options[] = ['class' => 'switch']; + } + return $this->wrapOutput( $this->checkbox($name, $value, ($checked ? 'checked' : ''), $options), $label,
fixing some bs_switch bugs
GeneaLabs_laravel-casts
train
php
dcc939f02f3e95492928893258bae2c15914e14d
diff --git a/rewind/logbook.py b/rewind/logbook.py index <HASH>..<HASH> 100644 --- a/rewind/logbook.py +++ b/rewind/logbook.py @@ -774,7 +774,9 @@ class LogBookRunner(object): assert not newid.startswith("ERROR"), \ "Generated ID must not be part of req/rep vocabulary." + # Important this is done before forwarding to the streaming socket self.eventstore.add_event(newid, eventstr) + self.streaming_socket.send(newid, zmq.SNDMORE) self.streaming_socket.send(eventstr)
Minor edit Commenting the importance of call order when putting something an event in event store and then proxying the event further to listeners.
JensRantil_rewind
train
py
1cbbab0f69f6a0d10723b8e365f5a3f40c5cef5e
diff --git a/openquake/commands/plot_memory.py b/openquake/commands/plot_memory.py index <HASH>..<HASH> 100644 --- a/openquake/commands/plot_memory.py +++ b/openquake/commands/plot_memory.py @@ -25,14 +25,14 @@ def make_figure(plots): # NB: matplotlib is imported inside since it is a costly import import matplotlib.pyplot as plt - fig = plt.figure() - nplots = len(plots) - for i, (task_name, mem) in enumerate(plots): - ax = fig.add_subplot(nplots, 1, i + 1) - ax.grid(True) - ax.set_title(task_name) - ax.set_ylabel('GB') - ax.plot(range(len(mem)), mem) + fig, ax = plt.subplots() + ax.grid(True) + ax.set_ylabel('GB') + start = 0 + for task_name, mem in plots: + ax.plot(range(start, start + len(mem)), mem, label=task_name) + start += len(mem) + ax.legend() return plt
Plotting a single graph [skip CI] Former-commit-id: 7d<I>d6c<I>e9db9f6b<I>b4b8c<I>b
gem_oq-engine
train
py
a8fae2ee925ecd67e102854d57640c67b51efa72
diff --git a/fost_authn/middleware.py b/fost_authn/middleware.py index <HASH>..<HASH> 100644 --- a/fost_authn/middleware.py +++ b/fost_authn/middleware.py @@ -18,12 +18,18 @@ class Middleware: return credentials return [None, None] - def process_request(self, request): + def key_hmac(self, request): [mechanism, authorization] = self.get_mechanism(request) if mechanism == "FOST": [key, hmac] = self.get_userpass(authorization) if key and hmac: - user = django.contrib.auth.authenticate( - request = request, key = key, hmac = hmac) - if user: - request.user = user + return key, hmac + return None, None + + def process_request(self, request): + key, hmac = self.key_hmac(request) + if key and hmac: + user = django.contrib.auth.authenticate( + request = request, key = key, hmac = hmac) + if user: + request.user = user
Split apart the parsing step from the processing so that we can make use of the functionality in other tests etc.
Felspar_django-fost-authn
train
py
33009d44bf4115661dc9261fb9b21372fedbd768
diff --git a/www/src/python_tokenizer.js b/www/src/python_tokenizer.js index <HASH>..<HASH> 100644 --- a/www/src/python_tokenizer.js +++ b/www/src/python_tokenizer.js @@ -71,8 +71,9 @@ function TokenError(message, position){ function get_line_at(src, pos){ // Get the line in source code src starting at position pos - var end = src.substr(pos).search(/[\r\n]/) - return end == -1 ? src.substr(pos) : src.substr(pos, end + 1) + var end = src.substr(pos).search(/[\r\n]/), + line = end == -1 ? src.substr(pos) : src.substr(pos, end + 1) + return line + '\n' } function get_comment(src, pos, line_num, line_start, token_name, line){
Attribute .line of tokens generated by python_tokenizer.js ends with "\n"
brython-dev_brython
train
js
50337f8628dee2f8abe92ec97cbff39f25660b3e
diff --git a/tests/test.py b/tests/test.py index <HASH>..<HASH> 100644 --- a/tests/test.py +++ b/tests/test.py @@ -740,6 +740,27 @@ class DockerClientTest(unittest.TestCase): buf.close() os.remove(buf.name) + def test_import_image_from_image(self): + try: + self.client.import_image( + image=fake_api.FAKE_IMAGE_NAME, + repository=fake_api.FAKE_REPO_NAME, + tag=fake_api.FAKE_TAG_NAME + ) + except Exception as e: + self.fail('Command should not raise exception: {0}'.format(e)) + + fake_request.assert_called_with( + 'unix://var/run/docker.sock/v1.6/images/create', + params={ + 'repo': fake_api.FAKE_REPO_NAME, + 'tag': fake_api.FAKE_TAG_NAME, + 'fromImage': fake_api.FAKE_IMAGE_NAME + }, + data=None, + timeout=docker.client.DEFAULT_TIMEOUT_SECONDS + ) + def test_inspect_image(self): try: self.client.inspect_image(fake_api.FAKE_IMAGE_NAME)
Added failing test for importing an image via name instead of src
docker_docker-py
train
py
2f4d20ed0f766211cd2fba06f82cb130581fe5bd
diff --git a/code/administrator/components/com_files/views/files/tmpl/default.php b/code/administrator/components/com_files/views/files/tmpl/default.php index <HASH>..<HASH> 100644 --- a/code/administrator/components/com_files/views/files/tmpl/default.php +++ b/code/administrator/components/com_files/views/files/tmpl/default.php @@ -87,8 +87,8 @@ window.addEvent('domready', function() { Files.createModal = function(container, button){ var modal = $(container); - document.body.grab(modal); modal.setStyle('display', 'none'); + document.body.grab(modal); $(button).addEvent('click', function(e) { e.stop();
New file and folder boxes are visible before the modals open
joomlatools_joomlatools-framework
train
php
6a3332d9817b141afb4aaec2752d026079eaa33e
diff --git a/src/graph.js b/src/graph.js index <HASH>..<HASH> 100644 --- a/src/graph.js +++ b/src/graph.js @@ -245,15 +245,24 @@ Graph.__prototype__ = function() { op.apply(this.objectAdapter); this.updated_at = new Date(); + this._internalUpdates(op); + Operator.Helpers.each(op, function(_op) { _.each(this.indexes, function(index) { - // Treating indexes as first class listeners for graph changes index.onGraphChange(_op); + }, this); - // And all regular listeners in second line - this.trigger('operation:applied', _op, this); + // And all regular listeners in second line + this.trigger('operation:applied', _op, this); + }, this); + }; + this._internalUpdates = function(op) { + // Treating indexes as first class listeners for graph changes + Operator.Helpers.each(op, function(_op) { + _.each(this.indexes, function(index) { + index.onGraphChange(_op); }, this); }, this); };
Pack all internal co-transformations into a dedicated method.
substance_data
train
js
b2a7855e21526e076cbdf356d2e19104d4a4cc05
diff --git a/src/styles/getPlatformElevation.ios.js b/src/styles/getPlatformElevation.ios.js index <HASH>..<HASH> 100644 --- a/src/styles/getPlatformElevation.ios.js +++ b/src/styles/getPlatformElevation.ios.js @@ -1,23 +1,20 @@ /* eslint-enable import/no-unresolved, import/extensions */ -import { black } from './colors'; +import { black, transparent } from './colors'; import { ELEVATION_ZINDEX } from './constants'; const getPlatformElevation = (elevation) => { - if (elevation !== 0) { - return { - shadowColor: black, - shadowOpacity: 0.3, - shadowRadius: elevation, - shadowOffset: { - height: 2, - width: 0, - }, - // we need to have zIndex on iOS, otherwise the shadow is under components that - // are rendered later - zIndex: ELEVATION_ZINDEX, - }; - } - return { }; + return { + shadowColor: elevation > 0 ? black : transparent, + shadowOpacity: 0.3, + shadowRadius: elevation / 2, + shadowOffset: { + height: 1, + width: 0, + }, + // we need to have zIndex on iOS, otherwise the shadow is under components that + // are rendered later + zIndex: ELEVATION_ZINDEX, + }; }; export default getPlatformElevation;
Fix shadow props on iOS (#<I>)
xotahal_react-native-material-ui
train
js
f5bff24fa4112e43d6a6ee664b93a3d0c02add12
diff --git a/src/Cursor.js b/src/Cursor.js index <HASH>..<HASH> 100644 --- a/src/Cursor.js +++ b/src/Cursor.js @@ -11,6 +11,8 @@ export * from './eraseRegions'; * * @see http://www.termsys.demon.co.uk/vtansi.htm * @see http://misc.flogisoft.com/bash/tip_colors_and_formatting + * @see http://man7.org/linux/man-pages/man4/console_codes.4.html + * @see http://www.x.org/docs/xterm/ctlseqs.pdf * @since 1.0.0 */ export class Cursor {
docs(cursor): Add few useful links to comments
kittikjs_cursor
train
js
a3b6a6d18f7ec681a3238458b80897055bee606b
diff --git a/lib/markety/version.rb b/lib/markety/version.rb index <HASH>..<HASH> 100644 --- a/lib/markety/version.rb +++ b/lib/markety/version.rb @@ -1,5 +1,5 @@ module Markety - VERSION = "grantfork" + VERSION = "1-grantfork" end
bundle does not like strings as version numbers
davidsantoso_markety
train
rb
b00eacec707f7dceb6621b8c483bd97f4d0db7c9
diff --git a/src/nls/no-nb/strings.js b/src/nls/no-nb/strings.js index <HASH>..<HASH> 100644 --- a/src/nls/no-nb/strings.js +++ b/src/nls/no-nb/strings.js @@ -158,7 +158,7 @@ define({ "CMD_DUPLICATE" : "Dupliker", "CMD_COMMENT" : "Kommenter/utkommenter linjer", "CMD_LINE_UP" : "Flytt linje(r) opp", - "CMD_LINE_DOWN" : "Move linje(r) ned", + "CMD_LINE_DOWN" : "Flytt linje(r) ned", // View menu commands "VIEW_MENU" : "Vis",
missing translation in CMD_LINE_DOWN
adobe_brackets
train
js
9f99419189d2109ed18d174076a87a38c13f033e
diff --git a/ELiDE/ELiDE/timestream.py b/ELiDE/ELiDE/timestream.py index <HASH>..<HASH> 100644 --- a/ELiDE/ELiDE/timestream.py +++ b/ELiDE/ELiDE/timestream.py @@ -242,7 +242,7 @@ class TimestreamScreen(Screen): 'draw_left': turn > branch_lineage[branch][1], 'draw_up': row > 0, 'draw_down': bool(start_turn_branches[turn]), - 'draw_right': bool(branch_split_turns_todo[branch]) + 'draw_right': turn < col2turn[-1] }) else: data.append({'widget': 'Widget'})
Correct the rightward facing Cross in Timestream
LogicalDash_LiSE
train
py
a29582daad2432889cc15da35c3eca1a78affa6e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -224,6 +224,9 @@ module.exports = { baseDir() { return __dirname; }, + cacheKey() { + return name; + }, parallelBabel: { requireFile: __filename, buildUsing: '_canvasBuildPlugin',
Return a cache key for canvas enforcer Not really necessary according to the documentation, but let’s set it just in case.
sandydoo_ember-google-maps
train
js
ee64a7716478e5bdea020bef99f0650d480815fa
diff --git a/lib/pusher/webhook.rb b/lib/pusher/webhook.rb index <HASH>..<HASH> 100644 --- a/lib/pusher/webhook.rb +++ b/lib/pusher/webhook.rb @@ -30,7 +30,8 @@ module Pusher # def initialize(request, client = Pusher) @client = client - if request.kind_of?(Rack::Request) + # Should work without Rack + if defined?(Rack::Request) && request.kind_of?(Rack::Request) @key = request.env['HTTP_X_PUSHER_KEY'] @signature = request.env["HTTP_X_PUSHER_SIGNATURE"] @content_type = request.content_type
Should work without Rack, closes #<I>
pusher_pusher-http-ruby
train
rb
4d1a93d10bc885f45626b8162ea6f7d11ce86331
diff --git a/lang/it.js b/lang/it.js index <HASH>..<HASH> 100644 --- a/lang/it.js +++ b/lang/it.js @@ -48,6 +48,7 @@ else { 'KickAssets.DONE': 'Fatto', 'KickAssets.TOOMANYSELECTED': 'Hai selezionato troppi elementi. Per piacere selezionane non più di %s.', 'KickAssets.INVALIDTYPESSELECTED': 'Alcuni elementi selezionati non sono validi. Per piacere seleziona solo %s', - 'KickAssets.INVALIDEXTENSIONSSELECTED': 'Alcuni files selezionati hanno estensioni non valide. Per piacere seleziona solo %s' + 'KickAssets.INVALIDEXTENSIONSSELECTED': 'Alcuni files selezionati hanno estensioni non valide. Per piacere seleziona solo %s', + 'KickAssets.MOREOPTIONS': 'Altre opzioni' }); }
Add missing row MOREOPTIONS in italian translation
unclecheese_silverstripe-kickassets
train
js
b43a802d5aada357a41f76d0ae9a67373cbdebc7
diff --git a/fabfile.py b/fabfile.py index <HASH>..<HASH> 100644 --- a/fabfile.py +++ b/fabfile.py @@ -457,6 +457,7 @@ def offline(): @task def completions(type='fish'): output.status = False + configuration.offline = True if type == 'fish': fish_completions()
Get shell completions in offline-mode for better performane
factorial-io_fabalicious
train
py
75cc56843a5066c2a357082ff85b3dc51ff44748
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,8 +21,11 @@ from pathlib import Path on_rtd = os.environ.get('READTHEDOCS') == 'True' if on_rtd: - subprocess.run('pip install -U "pip>=18.0" "setuptools>=40.1"', shell=True) - subprocess.run('pip install -e "..[docs]"', shell=True) + try: + from ai.backend.client import request # noqa + except ImportError: + subprocess.run('pip install -U "pip>=18.0" "setuptools>=40.1"', shell=True) + subprocess.run('pip install -e "..[docs]"', shell=True) # -- Project information -----------------------------------------------------
docs: Install dependencies only when not installed
lablup_backend.ai-client-py
train
py
7978ed7a9a8ade47c3cbf794d1609ad8b04c878b
diff --git a/web/static/js/controllers/SubServiceControl.js b/web/static/js/controllers/SubServiceControl.js index <HASH>..<HASH> 100644 --- a/web/static/js/controllers/SubServiceControl.js +++ b/web/static/js/controllers/SubServiceControl.js @@ -97,8 +97,14 @@ function SubServiceControl($scope, $q, $routeParams, $location, $interval, resou } ], validate: function(){ + var name = $scope.vhosts.add.name; + for (var i in $scope.vhosts.data) { + if (name == $scope.vhosts.data[i].Name) { + return false; + } + } var re = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/; - return re.test($scope.vhosts.add.name); + return re.test(name); } }); };
prevent duplication of vhost names
control-center_serviced
train
js
6a74818d662cbbd9255f24b58ff639d164aa4003
diff --git a/lib/jcr/find_roots.rb b/lib/jcr/find_roots.rb index <HASH>..<HASH> 100644 --- a/lib/jcr/find_roots.rb +++ b/lib/jcr/find_roots.rb @@ -88,6 +88,7 @@ module JCR def self.get_rule_by_type rule retval = nil + return retval unless rule.is_a? Hash case when rule[:array_rule] retval = rule[:array_rule] diff --git a/spec/find_roots_spec.rb b/spec/find_roots_spec.rb index <HASH>..<HASH> 100644 --- a/spec/find_roots_spec.rb +++ b/spec/find_roots_spec.rb @@ -37,6 +37,18 @@ describe 'find_roots' do expect( roots.length ).to eq( 0 ) end + it 'should find one root with an empty object rule' do + tree = JCR.parse( '{}' ) + roots = JCR.find_roots( tree ) + expect( roots.length ).to eq( 1 ) + end + + it 'should find one root with an empty array rule' do + tree = JCR.parse( '[]' ) + roots = JCR.find_roots( tree ) + expect( roots.length ).to eq( 1 ) + end + it 'should find an annotated rule' do tree = JCR.parse( '$vrule=: @{root} [ integer* ]' ) roots = JCR.find_roots( tree )
fixed issue with finding roots with empty objects and arrays
arineng_jcrvalidator
train
rb,rb
c859e50f1ad4ed6b2955a70aad9d3ba659ea22ee
diff --git a/treeherder/model/error_summary.py b/treeherder/model/error_summary.py index <HASH>..<HASH> 100644 --- a/treeherder/model/error_summary.py +++ b/treeherder/model/error_summary.py @@ -188,18 +188,11 @@ def is_helpful_search_term(search_term): 'Return code: 0', 'Return code: 1', 'Return code: 2', - 'Return code: 9', 'Return code: 10', 'mozalloc_abort(char const*)', 'mozalloc_abort', - 'Exiting 1', - 'Exiting 9', 'CrashingThread(void *)', - 'libSystem.B.dylib + 0xd7a', - 'linux-gate.so + 0x424', - 'TypeError: content is null', 'leakcheck', - 'ImportError: No module named pygtk', '# TBPL FAILURE #', ]
Bug <I> - drop unused items from list of terms to ignore in searches for bug suggestions (#<I>)
mozilla_treeherder
train
py
bf40bb583e9cbb0bbbe9874df1471a4dfd2736a5
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -109,7 +109,7 @@ def test_market (market): for id in ccxt.markets: market = getattr (ccxt, id) markets[id] = market ({ - 'verbose': True, + 'verbose': False, # 'proxy': 'https://crossorigin.me/', 'proxy': 'https://cors-anywhere.herokuapp.com/', # 'proxy': 'http://cors-proxy.htmldriven.com/?url=',
switched verbosity off in test.py
ccxt_ccxt
train
py
562cb74486ad8a5f8a1a215ac010cd04873c1bfb
diff --git a/lib/loghose.js b/lib/loghose.js index <HASH>..<HASH> 100755 --- a/lib/loghose.js +++ b/lib/loghose.js @@ -61,7 +61,7 @@ function loghose (opts) { return } opts.tty = info.Config.Tty - streams[data.id.substring(0,12)] = stream + streams[data.id] = stream pump( stream, parser(data, opts)
revert using substring(0,<I>) for streams dictionary
mcollina_docker-loghose
train
js
feafc34f8e6bc9ac5d27ba2b959a02b34bafba9a
diff --git a/site/rollup.config.js b/site/rollup.config.js index <HASH>..<HASH> 100644 --- a/site/rollup.config.js +++ b/site/rollup.config.js @@ -13,6 +13,9 @@ const mode = process.env.NODE_ENV; const dev = mode === 'development'; const legacy = !!process.env.SAPPER_LEGACY_BUILD; +const onwarn = (warning, onwarn) => (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) || onwarn(warning); +const dedupe = importee => importee === 'svelte' || importee.startsWith('svelte/'); + export default { client: { input: config.client.input(), @@ -28,7 +31,10 @@ export default { hydratable: true, emitCss: true }), - resolve(), + resolve({ + browser: true, + dedupe + }), commonjs(), json(), @@ -53,6 +59,7 @@ export default { module: true }) ], + onwarn }, server: { @@ -67,7 +74,9 @@ export default { generate: 'ssr', dev }), - resolve(), + resolve({ + dedupe + }), commonjs(), json() ], @@ -78,6 +87,7 @@ export default { require('module').builtinModules || Object.keys(process.binding('natives')) ) ], + onwarn }, serviceworker: {
site: rollup resolve and onwarn improvements from sapper-template
sveltejs_svelte
train
js
3c228d9edc036ef2752bf3c5535b2a6de47e49f1
diff --git a/src/Interfaces/ParserInterface.php b/src/Interfaces/ParserInterface.php index <HASH>..<HASH> 100644 --- a/src/Interfaces/ParserInterface.php +++ b/src/Interfaces/ParserInterface.php @@ -18,19 +18,19 @@ interface ParserInterface * Load the deltas string, checks the json is valid and can be decoded * and then saves the decoded array to the the $quill_json property * - * @param string $quill_json Quill json string + * @param array|string $quill_json Quill json string * * @return Parse * @throws \InvalidArgumentException Throws an exception if there was an error decoding the json */ - public function load(string $quill_json): Parse; + public function load($quill_json): Parse; /** * Load multiple delta strings, checks the json is valid for each index, * ensures they can be decoded and the saves each decoded array to the * $quill_json_stack property indexed by the given key * - * @param array An array of $quill json strings, returnable via array index + * @param array An array of $quill json array|strings, returnable via array index * * @return Parse * @throws \InvalidArgumentException Throws an exception if there was an error decoding the json
fixing the interface which only seems to complain on php<I>?
deanblackborough_php-quill-renderer
train
php
c98a8daa6bf23711e5e6feca07ddd8974c879110
diff --git a/lib/alchemy/upgrader/four_point_one.rb b/lib/alchemy/upgrader/four_point_one.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/upgrader/four_point_one.rb +++ b/lib/alchemy/upgrader/four_point_one.rb @@ -21,6 +21,19 @@ module Alchemy All your existing tags have been migrated to `Gutentag::Tag`s. + Removed Rails and non-English translations + ------------------------------------------ + + Removed the Rails translations from our translation files and moved all non-english translation + files into the newly introduced `alchemy_i18n` gem. + + If you need more translations than the default English one you can either put `alchemy_i18n` + in to your apps `Gemfile` or - recommended - copy only the translation files you need into your + apps `config/locales` folder. + + For the Rails translations either put the rails-i18n gem into your apps Gemfile or - recommended - + copy only the translation files you need into your apps config/locales folder. + NOTE todo notice, 'Alchemy v4.1 changes' end
Add note about translation removals to upgrader
AlchemyCMS_alchemy_cms
train
rb
26261791918ec6e442f5ac64ce19577e20705dcb
diff --git a/Classes/TYPO3/Surf/Task/FLOW3/SymlinkConfigurationTask.php b/Classes/TYPO3/Surf/Task/FLOW3/SymlinkConfigurationTask.php index <HASH>..<HASH> 100644 --- a/Classes/TYPO3/Surf/Task/FLOW3/SymlinkConfigurationTask.php +++ b/Classes/TYPO3/Surf/Task/FLOW3/SymlinkConfigurationTask.php @@ -41,7 +41,7 @@ class SymlinkConfigurationTask extends \TYPO3\Surf\Domain\Model\Task { $commands = array( "cd {$targetReleasePath}/Configuration", "rm -f Production/*", - "rmdir Production", + "if [ -d Production ]; then rmdir Production; fi", "mkdir -p ../../../shared/Configuration/Production", "ln -snf ../../../shared/Configuration/Production Production" );
[BUGFIX] Safeguard rmdir of directory If the Production directory was not created the SymlinkConfigurationTask outputs errors from rmdir. Change-Id: I<I>db<I>c7df<I>ef8abd<I>f9d<I>d<I>e3
TYPO3_Surf
train
php
0c75c14ac4af360b06ed7c4735b17709caef2449
diff --git a/metpy/calc/cross_sections.py b/metpy/calc/cross_sections.py index <HASH>..<HASH> 100644 --- a/metpy/calc/cross_sections.py +++ b/metpy/calc/cross_sections.py @@ -208,8 +208,10 @@ def normal_component(data_x, data_y, index='index'): # Take the dot products component_norm = data_x * unit_norm[0] + data_y * unit_norm[1] - # Reattach units (only reliable attribute after operation) - component_norm.attrs = {'units': data_x.attrs['units']} + # Reattach only reliable attributes after operation + for attr in ('units', 'grid_mapping'): + if attr in data_x.attrs: + component_norm.attrs[attr] = data_x.attrs[attr] return component_norm @@ -248,8 +250,10 @@ def tangential_component(data_x, data_y, index='index'): # Take the dot products component_tang = data_x * unit_tang[0] + data_y * unit_tang[1] - # Reattach units (only reliable attribute after operation) - component_tang.attrs = {'units': data_x.attrs['units']} + # Reattach only reliable attributes after operation + for attr in ('units', 'grid_mapping'): + if attr in data_x.attrs: + component_tang.attrs[attr] = data_x.attrs[attr] return component_tang
Reattach grid_mapping after cross-section calculations.
Unidata_MetPy
train
py
35bdf9c62bf71e276d2c1a40b08066eea4430e22
diff --git a/main/boofcv-reconstruction/src/test/java/boofcv/alg/structure/score3d/TestScoreFundamentalVsRotation.java b/main/boofcv-reconstruction/src/test/java/boofcv/alg/structure/score3d/TestScoreFundamentalVsRotation.java index <HASH>..<HASH> 100644 --- a/main/boofcv-reconstruction/src/test/java/boofcv/alg/structure/score3d/TestScoreFundamentalVsRotation.java +++ b/main/boofcv-reconstruction/src/test/java/boofcv/alg/structure/score3d/TestScoreFundamentalVsRotation.java @@ -43,6 +43,8 @@ class TestScoreFundamentalVsRotation extends CommonEpipolarScore3DChecks { ModelMatcher<DMatrixRMaj, AssociatedPair> ransac3D = FactoryMultiViewRobust.fundamentalRansac(new ConfigFundamental(), configRansac); - return new ScoreFundamentalVsRotation(ransac3D); + var alg = new ScoreFundamentalVsRotation(ransac3D); + alg.inlierErrorTol = configRansac.inlierThreshold; + return alg; } } \ No newline at end of file
TestScoreFundamentalVsRotation - Fixed parameters. RANSAC and internal tolerances were not the same.
lessthanoptimal_BoofCV
train
java