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
a9d8ef2d6f6bb0a3723b8ca1c00e2003c46a8050
diff --git a/hamster/stats.py b/hamster/stats.py index <HASH>..<HASH> 100644 --- a/hamster/stats.py +++ b/hamster/stats.py @@ -659,7 +659,7 @@ A week of usage would be nice!""")) # date of first record when year has been selected # Using python datetime formatting syntax. See: # http://docs.python.org/library/time.html#time.strftime - first_date = facts[0]["start_time"].strftime(C_("first record", "%(b)s %(d)s")) + first_date = facts[0]["start_time"].strftime(C_("first record", "%b %d")) summary += _("First activity was recorded on %s.") % \ ("<b>%s</b>" % first_date)
bug <I> fixed substitution of string in stats when year is selected
projecthamster_hamster
train
py
e0d793c3a978e59229b7a894f3978b620498891e
diff --git a/angr/sim_procedure.py b/angr/sim_procedure.py index <HASH>..<HASH> 100644 --- a/angr/sim_procedure.py +++ b/angr/sim_procedure.py @@ -160,7 +160,7 @@ class SimProcedure(object): l.debug("Executing %s%s%s%s with %s, %s", inst.display_name, ' (syscall)' if inst.is_syscall else '', - ' (inline)' if inst.use_state_arguments else '', + ' (inline)' if not inst.use_state_arguments else '', ' (stub)' if inst.is_stub else '', sim_args, inst.kwargs)
Fix debug logging for simprocedures
angr_angr
train
py
6720906ee52a86902751abd4e6294eb4d56fc938
diff --git a/lib/ignore/ignore.go b/lib/ignore/ignore.go index <HASH>..<HASH> 100644 --- a/lib/ignore/ignore.go +++ b/lib/ignore/ignore.go @@ -23,13 +23,12 @@ import ( ) const ( - resultInclude Result = 1 << iota - resultDeletable = 1 << iota - resultFoldCase = 1 << iota + resultNotMatched Result = 0 + resultInclude Result = 1 << iota + resultDeletable = 1 << iota + resultFoldCase = 1 << iota ) -var notMatched Result = 0 - type Pattern struct { pattern string match glob.Glob @@ -125,14 +124,14 @@ func (m *Matcher) Parse(r io.Reader, file string) error { func (m *Matcher) Match(file string) (result Result) { if m == nil { - return notMatched + return resultNotMatched } m.mut.Lock() defer m.mut.Unlock() if len(m.patterns) == 0 { - return notMatched + return resultNotMatched } if m.matches != nil { @@ -166,8 +165,8 @@ func (m *Matcher) Match(file string) (result Result) { } } - // Default to false. - return notMatched + // Default to not matching. + return resultNotMatched } // Patterns return a list of the loaded patterns, as they've been parsed
lib/ignore: Refactor: notMatched should be one of the constants GitHub-Pull-Request: <URL>
syncthing_syncthing
train
go
68bbe5b14863a0bb933960c988095e0e04972b42
diff --git a/plenum/server/view_change/instance_change_provider.py b/plenum/server/view_change/instance_change_provider.py index <HASH>..<HASH> 100644 --- a/plenum/server/view_change/instance_change_provider.py +++ b/plenum/server/view_change/instance_change_provider.py @@ -108,8 +108,7 @@ class InstanceChangeProvider: logger.warning("InstanceChangeProvider: view_no='{}' " "must be of int type".format(view_no_str)) break - else: - view_no = int(view_no_str) + view_no = int(view_no_str) votes_as_dict = instance_change_db_serializer.deserialize(serialized_votes) if not votes_as_dict: break
INDY-<I>: refactoring
hyperledger_indy-plenum
train
py
f75b545cbf9e238726baee3bad1517f910a6fc92
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ if sys.argv[-1] == 'publish': settings.update( name='nameparts', - version='0.5.3', + version='0.5.4', description='Takes a full human name and splits it into individual parts', long_description=read('README.md'), author='James Polera', @@ -35,12 +35,13 @@ settings.update( classifiers=( 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', + 'Natural Language :: English', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.2', - ) + ) ) setup(**settings)
Updated setup.py to reflect proper classifiers
polera_nameparts
train
py
49ae05394da03da4dfa7a9aa7876a50da31b0f91
diff --git a/lib/haml.rb b/lib/haml.rb index <HASH>..<HASH> 100644 --- a/lib/haml.rb +++ b/lib/haml.rb @@ -569,7 +569,7 @@ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir) # </a> # <![endif]--> # -# ==== \ +# ==== \ # # The backslash character escapes the first character of a line, # allowing use of otherwise interpreted characters as plain text.
Fix a Haml documentation bug. Seriously, "\" is different than "\ " in RDoc? Significant indentation is one thing, but this is just nuts.
sass_ruby-sass
train
rb
958e08747ac12228e0eddacc1df2c24a20811bab
diff --git a/errors.go b/errors.go index <HASH>..<HASH> 100644 --- a/errors.go +++ b/errors.go @@ -39,16 +39,20 @@ func (e *httpClientError) IsRateLimit() bool { return e.code == 429 } func (e *httpClientError) IsNotFound() bool { return e.code == 404 } func (e *httpClientError) IsPermissionDenied() bool { return e.code == 401 } +// IsRateLimit takes an error and returns true exactly if the error is a rate-limit error. func IsRateLimit(err error) bool { re, ok := err.(rateLimitError) return ok && re.IsRateLimit() } +// IsNotFound takes an error and returns true exactly if the error is a not-found error. func IsNotFound(err error) bool { nf, ok := err.(notFoundError) return ok && nf.IsNotFound() } +// IsPermissionDenied takes an error and returns true exactly if the error is a +// permission-denied error. func IsPermissionDenied(err error) bool { pd, ok := err.(permissionDeniedError) return ok && pd.IsPermissionDenied()
Add comments to public members of errors (golint)
adlio_trello
train
go
8b6e963530fcce4d3f132ef61677684176c2e9d2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,4 +7,5 @@ setup(name='keggrest', author='Enrico Giampieri', author_email='enrico.giampieri@unibo.it', py_modules=['keggrest'], + download_url='https://github.com/EnricoGiampieri/keggrest.git' ) \ No newline at end of file
added the github address to the setup file
EnricoGiampieri_keggrest
train
py
9adf2d8475f802ea4fb933e6ea559a031e6353d9
diff --git a/lib/repp/handler/slack.rb b/lib/repp/handler/slack.rb index <HASH>..<HASH> 100644 --- a/lib/repp/handler/slack.rb +++ b/lib/repp/handler/slack.rb @@ -27,7 +27,7 @@ module Repp def handle client.on :message do |data| - reply_to = data.text.scan(REPLY_REGEXP).map do |node| + reply_to = (data.text || "").scan(REPLY_REGEXP).map do |node| user = users.find { |u| u.id == node.first } user ? user.name : nil end
Check nil text when Slack message received
kinoppyd_repp
train
rb
a79824eda91de72a236aa4bbc8068f1422dc7983
diff --git a/lib/transformers/compilers.js b/lib/transformers/compilers.js index <HASH>..<HASH> 100644 --- a/lib/transformers/compilers.js +++ b/lib/transformers/compilers.js @@ -11,12 +11,13 @@ var helpers = require('../helpers') exports.CompilerCollection = CompilerCollection CompilerCollection.prototype = Object.create(transformers.Transformer.prototype) -function CompilerCollection (options) { - for (var key in options) { - if (options.hasOwnProperty(key)) { - this[key] = options[key] - } - } +function CompilerCollection () { + this.compilers = [] +} + +CompilerCollection.prototype.addCompiler = function (compiler) { + this.compilers.push(compiler) + return this } CompilerCollection.prototype.transform = function (srcDir, destDir, callback) {
Use chained addCompiler method to assemble compiler collection
ember-cli_broccoli-middleware
train
js
d29223aff7898261aac6e1a446727854beb90e93
diff --git a/Notifications/ResetPassword.php b/Notifications/ResetPassword.php index <HASH>..<HASH> 100644 --- a/Notifications/ResetPassword.php +++ b/Notifications/ResetPassword.php @@ -61,7 +61,7 @@ class ResetPassword extends Notification } else { $url = url(config('app.url').route('password.reset', [ 'token' => $this->token, - 'email' => $notifiable->getEmailForPasswordReset() + 'email' => $notifiable->getEmailForPasswordReset(), ], false)); }
Apply fixes from StyleCI (#<I>)
illuminate_auth
train
php
fcf4eaae078027c3b92f1d814cb1286a86525cde
diff --git a/Functions/correlate.py b/Functions/correlate.py index <HASH>..<HASH> 100644 --- a/Functions/correlate.py +++ b/Functions/correlate.py @@ -28,6 +28,7 @@ def progress_bar(progress): sys.stdout.write(text) sys.stdout.flush() + def correlation_worker(n_pos, test_frequencies_range, vq, trajectory): correlation_function_step = 10
added init.py file to the repository
abelcarreras_DynaPhoPy
train
py
b69e5499e2b7387d544809060f67b93f68716fd8
diff --git a/src/cli.js b/src/cli.js index <HASH>..<HASH> 100644 --- a/src/cli.js +++ b/src/cli.js @@ -497,10 +497,10 @@ function create ([_, dir, id, name, cfgJson], args) { var cfg = JSON.parse(cfgJson || '{}'); // Template path - var customWww = args['copy-from'] || args['link-to'] || args.template; + var customWww = args['link-to'] || args.template; if (customWww) { - if (!args.template && !args['copy-from'] && customWww.indexOf('http') === 0) { + if (!args.template && customWww.indexOf('http') === 0) { throw new CordovaError( 'Only local paths for custom www assets are supported for linking' + customWww ); @@ -516,11 +516,6 @@ function create ([_, dir, id, name, cfgJson], args) { link: 'link-to' in args }; - if ('copy-from' in args) { - logger.warn('Warning: --copy-from option is being deprecated. Consider using --template instead.'); - wwwCfg.template = true; - } - cfg.lib = cfg.lib || {}; cfg.lib.www = wwwCfg; }
Remove support for deprecated --copy-from
apache_cordova-cli
train
js
96c08ca4ed9e2e0e599de16dfa3081a2a8fb1e5a
diff --git a/src/ServiceLocatorInterface.php b/src/ServiceLocatorInterface.php index <HASH>..<HASH> 100755 --- a/src/ServiceLocatorInterface.php +++ b/src/ServiceLocatorInterface.php @@ -13,7 +13,7 @@ interface ServiceLocatorInterface * * @param string $key * @param array $extra - * @return mixed + * @return object * @throws ServiceLocatorException */ public function getService(string $key, array $extra = null);
Changed to correct object return type.
extendsframework_extends-servicelocator
train
php
b9ca32ffdd37f8b6372dc664dd16e4e01e3c5f37
diff --git a/process/generic_worker.go b/process/generic_worker.go index <HASH>..<HASH> 100644 --- a/process/generic_worker.go +++ b/process/generic_worker.go @@ -54,11 +54,7 @@ func (g *Generic) handleErr(logger *zap.Logger, retriable bool, err error, key g g.queue.forget(key) return } - if retriable { - if g.queue.numRequeues(key) >= maxRetries { - logger.Warn("Exceeded maximum retries, dropping object out of the queue", zap.Error(err)) - return - } + if retriable && g.queue.numRequeues(key) < maxRetries { logger.Info("Error syncing object, will retry", zap.Error(err)) g.queue.addRateLimited(key) return
Remove pointless if-statement
atlassian_ctrl
train
go
d1cb7d240439993b536bee2a8065c97b4814383b
diff --git a/py8583/py8583.py b/py8583/py8583.py index <HASH>..<HASH> 100644 --- a/py8583/py8583.py +++ b/py8583/py8583.py @@ -369,7 +369,7 @@ class Iso8583: self.BuildMTI() self.BuildBitmap() - for field in self.__Bitmap: + for field in sorted(self.__Bitmap): if(field != 1 and self.Field(field) == 1): self.BuildField(field)
fixed critical error in the way iso message is built
timgabets_bpc8583
train
py
fa31545f1d38dad6df979dc784bb07b5c087240a
diff --git a/GruntTasks/GruntConfigBuilder.js b/GruntTasks/GruntConfigBuilder.js index <HASH>..<HASH> 100644 --- a/GruntTasks/GruntConfigBuilder.js +++ b/GruntTasks/GruntConfigBuilder.js @@ -1,11 +1,13 @@ module.exports = { merge: null, glob: null, + grunt: null, init: function(grunt, appConfig) { this.merge = require('merge'); this.glob = require('glob'); require('load-grunt-tasks')(grunt); + this.grunt = grunt; var config = { pkg: grunt.file.readJSON('package.json'), @@ -45,7 +47,7 @@ module.exports = { buildFromFile: function(keys, filepath) { if (keys.length == 0) { - return require(filepath); + return require(this.grunt.file.findup(filepath)); } else { var subArray = {}; var index = keys[0];
use grunt to locate the target files
open-orchestra_open-orchestra-cms-bundle
train
js
e9ea0c58019e4541ffcc9defb8a1cfdb619e519d
diff --git a/nlppln/wfgenerator.py b/nlppln/wfgenerator.py index <HASH>..<HASH> 100644 --- a/nlppln/wfgenerator.py +++ b/nlppln/wfgenerator.py @@ -12,13 +12,14 @@ class WorkflowGenerator(WFGenerator): self.load(step_file='https://raw.githubusercontent.com/nlppln/' 'pattern-docker/master/pattern.cwl') - def save(self, fname, validate=True, wd=False, inline=False, relative=True, - pack=False, encoding='utf-8'): + def save(self, fname, mode=None, validate=True, wd=False, inline=False, + relative=True, pack=False, encoding='utf-8'): """Save workflow to file For nlppln, the default is to save workflows with relative paths. """ super(WorkflowGenerator, self).save(fname, + mode=mode, validate=validate, wd=wd, inline=inline,
Update save method Because scriptcwl has a new way of saving.
nlppln_nlppln
train
py
e804001839e6a9ab420566a3abb1c3dfdb93e5bc
diff --git a/hotdoc/core/links.py b/hotdoc/core/links.py index <HASH>..<HASH> 100644 --- a/hotdoc/core/links.py +++ b/hotdoc/core/links.py @@ -63,12 +63,11 @@ class LinkResolver(object): except IOError: return - self.__external_links = links[0] - self.__local_links = links[1] + self.__local_links = links def pickle (self, output): n = datetime.now() - pickle.dump ([self.__external_links, self.__local_links], + pickle.dump (self.__local_links, open (os.path.join (output, "links.p"), 'wb')) def get_named_link (self, name, search_external=True):
links: Do not pickle external links They are always recreated anyway and pickling them might take a big long time on system having many gtk doc books.
hotdoc_hotdoc
train
py
c0680660d578b6cc2181b7eb7e7361eb8742097f
diff --git a/vendor/github.com/mitchellh/cli/cli.go b/vendor/github.com/mitchellh/cli/cli.go index <HASH>..<HASH> 100644 --- a/vendor/github.com/mitchellh/cli/cli.go +++ b/vendor/github.com/mitchellh/cli/cli.go @@ -398,12 +398,6 @@ func (c *CLI) processArgs() { break } - // Check for help flags. - if arg == "-h" || arg == "-help" || arg == "--help" { - c.isHelp = true - continue - } - if c.subcommand == "" { // Check for version flags if not in a subcommand. if arg == "-v" || arg == "-version" || arg == "--version" { @@ -411,6 +405,12 @@ func (c *CLI) processArgs() { continue } + // Check for help flags. + if arg == "-h" || arg == "-help" || arg == "--help" { + c.isHelp = true + continue + } + if arg != "" && arg[0] == '-' { // Record the arg... c.topFlags = append(c.topFlags, arg)
vendor: patch github.com/mitchellh/cli until help output is fixed We need to init the flagset that cli uses to generate the help outside of the Run method since Run isn't called anymore for printing help.
hashicorp_consul
train
go
5f4035e444ae9c4754a1a034b9ee3946fba202b1
diff --git a/packages/cozy-konnector-libs/src/libs/saveFiles.js b/packages/cozy-konnector-libs/src/libs/saveFiles.js index <HASH>..<HASH> 100644 --- a/packages/cozy-konnector-libs/src/libs/saveFiles.js +++ b/packages/cozy-konnector-libs/src/libs/saveFiles.js @@ -226,6 +226,8 @@ function checkMimeWithPath(mime, filepath) { } function logFileStream(fileStream) { + if (!fileStream) return + if (fileStream && fileStream.constructor && fileStream.constructor.name) { log( 'info',
fix(saveFiles): avoid the 'The fileStream attribute is a undefined' message in logs
konnectors_libs
train
js
11fc42d10b5b6393c539a5150693f43906bb8acb
diff --git a/lib/casio.js b/lib/casio.js index <HASH>..<HASH> 100644 --- a/lib/casio.js +++ b/lib/casio.js @@ -1430,7 +1430,7 @@ Casio.prototype.model = function(name, opts) { } if (primaryVal) { - into.push(primary); + into.push(Model.keyAlias); values.push(primaryVal); }
Missed one place keyAlias is necessary
studybreak_casio
train
js
aff7bb3becd0604b7b283d2803d48bbcd71065b7
diff --git a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/formats/raw/RawFormatSerializationSchema.java b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/formats/raw/RawFormatSerializationSchema.java index <HASH>..<HASH> 100644 --- a/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/formats/raw/RawFormatSerializationSchema.java +++ b/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/formats/raw/RawFormatSerializationSchema.java @@ -164,7 +164,7 @@ public class RawFormatSerializationSchema implements SerializationSchema<RowData default: throw new UnsupportedOperationException( - "'single-format' currently doesn't support type: " + type); + "'raw' format currently doesn't support type: " + type); } }
[hotfix][table-runtime] Fix the exception info of raw format (#<I>)
apache_flink
train
java
4c8ca15e481639651f7210f911544135044d4832
diff --git a/msk/__init__.py b/msk/__init__.py index <HASH>..<HASH> 100644 --- a/msk/__init__.py +++ b/msk/__init__.py @@ -19,4 +19,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -__version__ = '0.3.5' # Also update in setup.py +__version__ = '0.3.6' # Also update in setup.py diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ from setuptools import setup setup( name='msk', - version='0.3.5', # Also update in msk/__init__.py + version='0.3.6', # Also update in msk/__init__.py packages=['msk', 'msk.actions'], install_requires=['GitPython', 'typing', 'msm>=0.5.13', 'pygithub'], url='https://github.com/MycroftAI/mycroft-skills-kit',
Increment version to <I>
MycroftAI_mycroft-skills-kit
train
py,py
02602ebd24bc08c1212626fee30accc68eb0351e
diff --git a/features/support/env.rb b/features/support/env.rb index <HASH>..<HASH> 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,5 +1,9 @@ require 'aruba/cucumber' Before do - @aruba_timeout_seconds = 2 + slow_boot = false + slow_boot ||= RUBY_PLATFORM == "java" + slow_boot ||= defined?(::Rubinius) + + @aruba_timeout_seconds = slow_boot ? 5 : 2 end
Longer timeouts on platforms with slow boots.
applicationsonline_librarian
train
rb
31ad6ee2b768b94b5ab2f67c62a23268892e3478
diff --git a/pypsa/networkclustering.py b/pypsa/networkclustering.py index <HASH>..<HASH> 100644 --- a/pypsa/networkclustering.py +++ b/pypsa/networkclustering.py @@ -78,7 +78,8 @@ def aggregategenerators(network, busmap, with_time=True, carriers=None, custom_s columns = (set(attrs.index[attrs.static & attrs.status.str.startswith('Input')]) | {'weight'}) & set(generators.columns) grouper = [generators.bus, generators.carrier] - weighting = generators.weight.groupby(grouper, axis=0).transform(lambda x: (x/x.sum()).fillna(1.)) + generators.weight.fillna(1., inplace=True) + weighting = generators.weight.groupby(grouper, axis=0).transform(lambda x: x/x.sum() ) generators['capital_cost'] *= weighting strategies = {'p_nom_max': np.min, 'weight': np.sum, 'p_nom': np.sum, 'capital_cost': np.sum} strategies.update(custom_strategies)
networkclustering: Fix aggregategenerators to handle unweighted generators
PyPSA_PyPSA
train
py
9c0197f69a64c44f0e9ca127f87306e1a417e0dc
diff --git a/app.go b/app.go index <HASH>..<HASH> 100644 --- a/app.go +++ b/app.go @@ -146,6 +146,21 @@ func (app *Application) Delete(pattern string, handler HandlerFunc) { app.router.AddRoute("DELETE", pattern, handler) } +// Patch method is used for registering a Patch method route +func (app *Application) Patch(pattern string, handler HandlerFunc) { + app.router.AddRoute("PATCH", pattern, handler) +} + +// Options method is used for registering a Options method route +func (app *Application) Options(pattern string, handler HandlerFunc) { + app.router.AddRoute("OPTIONS", pattern, handler) +} + +// Head method is used for registering a Head method route +func (app *Application) Head(pattern string, handler HandlerFunc) { + app.router.AddRoute("HEAD", pattern, handler) +} + // Error method is used for registering an handler for a specified HTTP error code. func (app *Application) Error(statusCode int, handler ErrorHandlerFunc) { app.errorHandler[statusCode] = handler
[feat] Add Patch, Head, Options
dinever_golf
train
go
eef8ae3409db963831de320e320d735923bd5821
diff --git a/productmd/common.py b/productmd/common.py index <HASH>..<HASH> 100644 --- a/productmd/common.py +++ b/productmd/common.py @@ -82,7 +82,7 @@ def parse_nvra(nvra): """ Parse RPM N-E:V-R.A string to a dict. - :param nvra: N-E:V-R.A string, eventually a file name or a file path incl. '.rpm' suffix + :param nvra: N-E:V-R.A string. This can be a file name or a file path including the '.rpm' suffix. :type nvra: str :rtype: dict """
common: explain filename handling for parse_nvra() Explain that the nvra argument *may* be a filename, but this is not necessary.
release-engineering_productmd
train
py
3bb02ae67c83723b0123944a2bc29b49e9614f5e
diff --git a/io3d/idxformat.py b/io3d/idxformat.py index <HASH>..<HASH> 100644 --- a/io3d/idxformat.py +++ b/io3d/idxformat.py @@ -8,6 +8,7 @@ import numpy as np import os.path as op import logging logger = logging.getLogger(__name__) +import sed3 class IDXReader: def _init__(self): @@ -42,7 +43,8 @@ class IDXReader: logger.error("Unknown data type") data = np.fromfile(filename, dtype=dtype) - d3 = np.reshape(data,[1024,1024,-1]) + shape = [1024, 1024, 5] + d3 = np.reshape(data[:np.prod(shape)],shape) print "all ok"
try to read idx format
mjirik_io3d
train
py
8652ca98d5001cc91cd8c8c51da466a81a6c8d50
diff --git a/ext/extconf.rb b/ext/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -6,7 +6,7 @@ def patch_autogen File.write('autogen.sh', File.read('autogen.sh').gsub(/libtoolize/, 'glibtoolize')) end -unless have_library 'snappy' +unless pkg_config('libsnappy') || have_library('snappy') # build vendor/snappy pwd = File.dirname File.expand_path __FILE__ dir = File.join pwd, '..', 'vendor', 'snappy'
try pkg_config to locate libsnappy We have our own build of libsnappy in the /opt/ hierarchy, which we'd like to use. By trying the pkg_config call first, the snappy gem can pickup this location reliably.
miyucy_snappy
train
rb
35b9d695a4ed56ce554da7a8231bf29eec14e30a
diff --git a/packages/webpack-cli/lib/utils/package-exists.js b/packages/webpack-cli/lib/utils/package-exists.js index <HASH>..<HASH> 100644 --- a/packages/webpack-cli/lib/utils/package-exists.js +++ b/packages/webpack-cli/lib/utils/package-exists.js @@ -1,6 +1,6 @@ function packageExists(packageName) { try { - require(packageName); + require.resolve(packageName); return true; } catch (err) { return false;
fix: improve package-exists util (#<I>)
webpack_webpack-cli
train
js
1bad8612229ef40998b263ff36b6ecee9a7859e5
diff --git a/node/rpcstack.go b/node/rpcstack.go index <HASH>..<HASH> 100644 --- a/node/rpcstack.go +++ b/node/rpcstack.go @@ -1,4 +1,4 @@ -// Copyright 2015 The go-ethereum Authors +// Copyright 2020 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify
changed date of rpcstack.go since new file (#<I>)
ethereum_go-ethereum
train
go
6150a3e90c9f75d77d178403e2009c0c32d11dae
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/resource/reader/TemplateResourceReader.java b/moco-core/src/main/java/com/github/dreamhead/moco/resource/reader/TemplateResourceReader.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/resource/reader/TemplateResourceReader.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/resource/reader/TemplateResourceReader.java @@ -153,7 +153,7 @@ public class TemplateResourceReader implements ContentResourceReader { private Optional<Long> start; private Optional<Long> end; - public Range(Optional<Long> start, Optional<Long> end) { + Range(final Optional<Long> start, final Optional<Long> end) { this.start = start; this.end = end; }
added missing final to range in template resource reader
dreamhead_moco
train
java
cf59e1a91102f3cbddc8f030b1f308770b542eeb
diff --git a/src/ViewRenderer.php b/src/ViewRenderer.php index <HASH>..<HASH> 100644 --- a/src/ViewRenderer.php +++ b/src/ViewRenderer.php @@ -35,7 +35,7 @@ class ViewRenderer return $this->viewFactory->file( $path, - array_merge(['jigsaw' => $data], $data->all()) + array_merge(['jigsaw' => $data], $data->toArray()) )->render(); }
Use toArray for top-level view vars, for better backwards compatibility
tightenco_jigsaw
train
php
b07a99c45425ee75f7bcdf3c9b6e978bef7bdcac
diff --git a/src/app-cache.js b/src/app-cache.js index <HASH>..<HASH> 100644 --- a/src/app-cache.js +++ b/src/app-cache.js @@ -133,7 +133,7 @@ export default class AppCache { getPageTemplate(name, content) { return ` <!doctype html> - <html manifest="${ name }.appcache">${ content || '' }</html> + <html manifest="${ name }.appcache"><meta charset="utf-8">${ content || '' }</html> `.trim().replace(/^ */gm, ''); } @@ -153,4 +153,4 @@ export default class AppCache { disableInstall: this.disableInstall }; } -} \ No newline at end of file +}
added content-type to app-cache iframe fixes #<I>
NekR_offline-plugin
train
js
44b4c3b9ab332fceabdc98c34df65de195da484d
diff --git a/packages/okidoc-md/src/buildMarkdown/buildMarkdown.spec.js b/packages/okidoc-md/src/buildMarkdown/buildMarkdown.spec.js index <HASH>..<HASH> 100644 --- a/packages/okidoc-md/src/buildMarkdown/buildMarkdown.spec.js +++ b/packages/okidoc-md/src/buildMarkdown/buildMarkdown.spec.js @@ -134,7 +134,7 @@ describe('buildMarkdown', () => { expect(markdown).toMatchSnapshot(); }); - it.only('should render markdown for methods with `optional` as param', async () => { + it('should render markdown for methods with `optional` as param', async () => { const documentationSource = ` /** Example class jsdoc */ class API {
[okidoc-md] cleanup `it.only` in tests
wix_okidoc
train
js
7e093635280e47ce7202fa9876beb57e8a1183b3
diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js index <HASH>..<HASH> 100644 --- a/cordova-lib/src/plugman/fetch.js +++ b/cordova-lib/src/plugman/fetch.js @@ -251,8 +251,10 @@ function copyPlugin(plugin_dir, plugins_dir, link) { var dest = path.join(plugins_dir, pinfo.id); shell.rm('-rf', dest); if (link) { - events.emit('verbose', 'Linking plugin "' + plugin_dir + '" => "' + dest + '"'); - fs.symlinkSync(plugin_dir, dest, 'dir'); + var isRelativePath = plugin_dir[1] != ':' && plugin_dir[0] != path.sep; + var fixedPath = isRelativePath ? path.join(path.relative(plugins_dir, process.env.PWD || process.cwd()), plugin_dir) : plugin_dir; + events.emit('verbose', 'Linking "' + dest + '" => "' + fixedPath + '"'); + fs.symlinkSync(fixedPath, dest, 'dir'); } else { shell.mkdir('-p', dest); events.emit('verbose', 'Copying plugin "' + plugin_dir + '" => "' + dest + '"');
CB-<I> Fix plugin add --link when plugin given as relative path
apache_cordova-lib
train
js
9b29f3f22783112406d9c1a6db47165a297c3942
diff --git a/torchvision/datasets/folder.py b/torchvision/datasets/folder.py index <HASH>..<HASH> 100644 --- a/torchvision/datasets/folder.py +++ b/torchvision/datasets/folder.py @@ -86,8 +86,8 @@ def make_dataset( continue for root, _, fnames in sorted(os.walk(target_dir, followlinks=True)): for fname in sorted(fnames): - path = os.path.join(root, fname) - if is_valid_file(path): + if is_valid_file(fname): + path = os.path.join(root, fname) item = path, class_index instances.append(item)
Faster dataset indexing (#<I>)
pytorch_vision
train
py
485d566dec67a96239978e3ee367e19d20377ad7
diff --git a/spikeextractors/sortingextractor.py b/spikeextractors/sortingextractor.py index <HASH>..<HASH> 100644 --- a/spikeextractors/sortingextractor.py +++ b/spikeextractors/sortingextractor.py @@ -540,9 +540,12 @@ class SortingExtractor(ABC, BaseExtractor): unit_ids: (array_like, int) The list (or single value) of unit_ids for which the properties will be copied """ - if unit_ids is None: + # Second condition: Ensure dictionary is not empty + if unit_ids is None and len(self._properties.keys()) > 0: self._properties = deepcopy(sorting._properties) else: + if unit_ids is None: + unit_ids = sorting.get_unit_ids() if isinstance(unit_ids, int): curr_property_names = sorting.get_unit_property_names(unit_id=unit_ids) for curr_property_name in curr_property_names:
avoid deepcopy for multisorting extractors
SpikeInterface_spikeextractors
train
py
1796e0dd56e5e4d2acec1e1f8a8a7c5417c1acce
diff --git a/Neos.Flow/Migrations/Code/Version20180415105700.php b/Neos.Flow/Migrations/Code/Version20180415105700.php index <HASH>..<HASH> 100644 --- a/Neos.Flow/Migrations/Code/Version20180415105700.php +++ b/Neos.Flow/Migrations/Code/Version20180415105700.php @@ -29,6 +29,6 @@ class Version20180415105700 extends AbstractMigration */ public function up() { - $this->searchAndReplaceRegex('~(CacheAwareInterface.*)(public function getCacheEntryIdentifier\\(\\))~s', '${1}public function getCacheEntryIdentifier(): string', ['php']); + $this->searchAndReplaceRegex('~(CacheAwareInterface.*public function getCacheEntryIdentifier\\(\\))([^{:]*{)~s', '${1}: string${2}', ['php']); } }
BUGFIX: Only add type hint if not already present
neos_flow-development-collection
train
php
2177a1ae8f1915a52bddf9e7500f77751517efdb
diff --git a/staticconf/config.py b/staticconf/config.py index <HASH>..<HASH> 100644 --- a/staticconf/config.py +++ b/staticconf/config.py @@ -1,7 +1,6 @@ """ Static configuration. """ -from functools import partial import logging import os import time @@ -201,7 +200,7 @@ class ConfigurationWatcher(object): self.inodes = self._get_inodes() self.min_interval = min_interval self.last_check = time.time() - self.reloader = reloader or partial(reload, all_names=True) + self.reloader = reloader or ReloadCallbackChain(all_names=True) def get_filename_list(self, filenames): if isinstance(filenames, basestring): @@ -247,7 +246,7 @@ class ReloadCallbackChain(object): def __init__(self, namespace=DEFAULT, all_names=False, callbacks=None): self.namespace = namespace self.all_names = all_names - self.callbacks = dict(callbacks) if callbacks else {} + self.callbacks = dict(callbacks or ()) def add(self, identifier, callback): self.callbacks[identifier] = callback
Use ReloadCallbackChain as the default reloader func in a ConfigurationWatcher.
dnephin_PyStaticConfiguration
train
py
10e26f19e461d5e506de5d26109833638cb3608a
diff --git a/freemius/includes/class-fs-api.php b/freemius/includes/class-fs-api.php index <HASH>..<HASH> 100755 --- a/freemius/includes/class-fs-api.php +++ b/freemius/includes/class-fs-api.php @@ -289,7 +289,9 @@ self::$_options->set_option( 'api_force_http', true, true ); - $test = $this->_api->Test(); + $test = is_null( $unique_anonymous_id ) ? + $this->_api->Test() : + $this->_api->Test( $this->_call( 'ping.json?uid=' . $unique_anonymous_id ) ); } return $test;
[api] [https] [fix] When falls back to HTTP in connectivity test, make sure to ping with anonymous id.
Freemius_wordpress-sdk
train
php
1825413598f773f2555617563082dccde8c44904
diff --git a/mongoctl/repository.py b/mongoctl/repository.py index <HASH>..<HASH> 100644 --- a/mongoctl/repository.py +++ b/mongoctl/repository.py @@ -106,9 +106,8 @@ def _db_repo_connect(): ############################################################################### def validate_repositories(): if not(has_file_repository() or has_db_repository() or has_commandline_servers_or_clusters()): - raise MongoctlException("Invalid 'mongoctl.config': No fileRepository" - " or databaseRepository configured. At least" - " one repository has to be configured.") + log_warning("*******\nNo fileRepository or databaseRepository configured." + " At least one repository has to be configured.\n*******") ############################################################################### def set_commandline_servers_and_clusters(servers_json_str, clusters_json_str):
warn instead of raise exception when no repos are configured
mongolab_mongoctl
train
py
bfa0f96822c310759394640dc2965fceb091a3a4
diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index <HASH>..<HASH> 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -97,6 +97,10 @@ func stateTestCmd(ctx *cli.Context) error { // Run the test and aggregate the result result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true} state, err := test.Run(st, cfg) + // print state root for evmlab tracing + if ctx.GlobalBool(MachineFlag.Name) && state != nil { + fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%x\"}\n", state.IntermediateRoot(false)) + } if err != nil { // Test failed, mark as so and dump any state to aid debugging result.Pass, result.Error = false, err.Error() @@ -105,10 +109,6 @@ func stateTestCmd(ctx *cli.Context) error { result.State = &dump } } - // print state root for evmlab tracing (already committed above, so no need to delete objects again - if ctx.GlobalBool(MachineFlag.Name) && state != nil { - fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%x\"}\n", state.IntermediateRoot(false)) - } results = append(results, *result)
cmd/evm: fix state dump (#<I>)
ethereum_go-ethereum
train
go
ba54c1a7d9f1229b1597ead46eadc824f77e5e88
diff --git a/native/xxhash_go17.go b/native/xxhash_go17.go index <HASH>..<HASH> 100644 --- a/native/xxhash_go17.go +++ b/native/xxhash_go17.go @@ -1,4 +1,4 @@ -// +build go1.7 appengine safe +// +build go1.7 go1.7,appengine go1.7,safe package xxhash
fix build with safe on < go<I>
OneOfOne_xxhash
train
go
451d23663162ad54ff00f0fad3a56c4f632b270b
diff --git a/src/androidTest/java/com/couchbase/lite/RevisionsTest.java b/src/androidTest/java/com/couchbase/lite/RevisionsTest.java index <HASH>..<HASH> 100644 --- a/src/androidTest/java/com/couchbase/lite/RevisionsTest.java +++ b/src/androidTest/java/com/couchbase/lite/RevisionsTest.java @@ -169,6 +169,7 @@ public class RevisionsTest extends LiteTestCase { public void testRevisionIdEquivalentRevisions() throws Exception { // This test causes crash with CBL Java on OSX + // TODO: Github Ticket: https://github.com/couchbase/couchbase-lite-java/issues/55 if(System.getProperty("java.vm.name").equalsIgnoreCase("Dalvik")) { // two revisions with the same content and the same json
Added comment for disabled test case for CBL Java.
couchbase_couchbase-lite-android
train
java
e890e4245f39a46d86e27fc0b86aa28e93a944c5
diff --git a/src/main/java/net/malisis/core/renderer/MalisisRenderer.java b/src/main/java/net/malisis/core/renderer/MalisisRenderer.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/malisis/core/renderer/MalisisRenderer.java +++ b/src/main/java/net/malisis/core/renderer/MalisisRenderer.java @@ -204,6 +204,7 @@ public class MalisisRenderer extends TileEntitySpecialRenderer implements IBlock public void set(Block block) { this.block = block; + this.blockState = block.getDefaultState(); } /** @@ -722,10 +723,10 @@ public class MalisisRenderer extends TileEntitySpecialRenderer implements IBlock vertex.setColor(color); // alpha - if (!params.usePerVertexAlpha.get()) + if (params != null && !params.usePerVertexAlpha.get()) vertex.setAlpha(params.alpha.get()); - if (renderType == RenderType.ITEM) + if (renderType == RenderType.ITEM && params != null) vertex.setNormal(params.direction.get()); wr.addVertexData(getVertexData(vertex));
Fixed blockState not being set when block was set
Ordinastie_MalisisCore
train
java
0a6ea926ffac41b0d422e03c45fa03712f87b425
diff --git a/readthedocs_ext/readthedocs.py b/readthedocs_ext/readthedocs.py index <HASH>..<HASH> 100644 --- a/readthedocs_ext/readthedocs.py +++ b/readthedocs_ext/readthedocs.py @@ -208,8 +208,13 @@ class HtmlBuilderMixin(BuilderMixin): """ log.info(bold('copying searchtools... '), nonl=True) - path_src = os.path.join(package_dir, 'themes', 'basic', 'static', - 'searchtools.js_t') + if sphinx.version_info < (1, 8): + search_js_file = 'searchtools.js_t' + else: + search_js_file = 'searchtools.js' + path_src = os.path.join( + package_dir, 'themes', 'basic', 'static', search_js_file + ) if os.path.exists(path_src): path_dest = os.path.join(self.outdir, '_static', 'searchtools.js') if renderer is None: @@ -231,7 +236,7 @@ class HtmlBuilderMixin(BuilderMixin): self.get_static_readthedocs_context() )) else: - log.warning('Missing searchtools.js_t') + log.warning('Missing {}'.format(search_js_file)) log.info('done')
Make search override compatible with sphinx <I> The file was renamed in <URL>
rtfd_readthedocs-sphinx-ext
train
py
1f715e94cd53f33166187ece6c2518cad9cf9bea
diff --git a/impala/sqlalchemy.py b/impala/sqlalchemy.py index <HASH>..<HASH> 100644 --- a/impala/sqlalchemy.py +++ b/impala/sqlalchemy.py @@ -132,7 +132,6 @@ class ImpalaDialect(DefaultDialect): return impala.dbapi def initialize(self, connection): - self.server_version_info = self._get_server_version_info(connection) self.default_schema_name = connection.connection.default_db def _get_server_version_info(self, connection):
Update sqlalchemy.py (#<I>) Removed default execution of `select version()`, this causes a failure in Hive as the `version()` function does not exist in Hive. I have tested and verified that this change fixes SQLAlchemy connection for Hive.
cloudera_impyla
train
py
3d3809a21b393a23be85cac61e7f84bdecb041d8
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index <HASH>..<HASH> 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -750,7 +750,8 @@ func supportedVersion(version string) bool { if strings.HasPrefix(version, "3.5.0") || strings.HasPrefix(version, "3.6.0") || strings.HasPrefix(version, "3.7.0") || - strings.HasPrefix(version, "3.8.0") { + strings.HasPrefix(version, "3.8.0") || + strings.HasPrefix(version, "3.9.0") { return true } return false
Add <I> support (mattermost)
42wim_matterbridge
train
go
9239013e39735e10de9701049a98400636ac3385
diff --git a/scripts/make.go b/scripts/make.go index <HASH>..<HASH> 100644 --- a/scripts/make.go +++ b/scripts/make.go @@ -8,6 +8,7 @@ import ( "path/filepath" "runtime" "sort" + "strconv" "strings" "github.com/go-delve/delve/pkg/goversion" @@ -222,7 +223,18 @@ func canMacnative() bool { if strings.TrimSpace(getoutput("go", "env", "CGO_ENABLED")) != "1" { return false } - _, err := os.Stat("/usr/include/sys/types.h") + + macOSVersion := strings.Split(strings.TrimSpace(getoutput("/usr/bin/sw_vers", "-productVersion")), ".") + minor, err := strconv.ParseInt(macOSVersion[1], 10, 64) + if err != nil { + return false + } + + typesHeader := "/usr/include/sys/types.h" + if minor >= 15 { + typesHeader = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/types.h" + } + _, err = os.Stat(typesHeader) if err != nil { return false }
scripts: support macOS <I> or later macOS hasn't /usr/include/sys/types.h header with Canalina or later. switch types.h path to CommandLineTools if kernel minor version up to <I> or later.
go-delve_delve
train
go
5a56512a4be894024b86cd91103c243a690d29d8
diff --git a/db/storage.go b/db/storage.go index <HASH>..<HASH> 100644 --- a/db/storage.go +++ b/db/storage.go @@ -134,7 +134,7 @@ func (s *Storage) Teams() *mgo.Collection { } func init() { - ticker = time.NewTicker(72 * time.Hour) + ticker = time.NewTicker(time.Hour) go retire(ticker) }
db: use smaller ticker for garbage collection
tsuru_tsuru
train
go
7bd84f5803fcd49a61a039fb860d9e7dcc2cfda2
diff --git a/test/testfeatures.js b/test/testfeatures.js index <HASH>..<HASH> 100644 --- a/test/testfeatures.js +++ b/test/testfeatures.js @@ -9,7 +9,7 @@ var path = require('path'); */ function importScript(filename) { // TODO(rnystrom): Hack. Assumes this is being run from a sibling of src/. - filename = path.join('../src/', filename); + filename = path.join(__dirname, '../src/', filename); var script = fs.readFileSync(filename, 'utf8'); if (!script) { throw new Error('Failed to import ' + filename); @@ -291,7 +291,7 @@ importScript('traceur.js'); // Run all of the feature scripts. var tests = 0; var passes = 0; -runFeatureScripts('feature'); +runFeatureScripts(path.join(__dirname, 'feature')); clearLastLine(); if (passes == tests) {
Fix testfeature.js to work from any directory
google_traceur-compiler
train
js
d374f531484e98f65a9e3521974cfb843920abb5
diff --git a/zipline/errors.py b/zipline/errors.py index <HASH>..<HASH> 100644 --- a/zipline/errors.py +++ b/zipline/errors.py @@ -159,3 +159,13 @@ class TradingControlViolation(ZiplineError): msg = """ Order for {amount} shares of {sid} violates trading constraint {constraint}. """.strip() + + +class IncompatibleHistoryFrequency(ZiplineError): + """ + Raised when a frequency is given to history which is not supported. + At least, not yet. + """ + msg = """ +Minute history requires minute frequency input data. +Either use daily history or provide minute frequency data.""".strip()
MAINT: Add custom exception for incompatible history frequency specification.
quantopian_trading_calendars
train
py
e8c73170ba2d2211637e5e88c4582609ef6b1c9f
diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -273,7 +273,7 @@ class CakeRequest implements ArrayAccess { $config = Configure::read('App'); extract($config); - if (!$base) { + if (empty($base)) { $base = $this->base; } @@ -281,7 +281,7 @@ class CakeRequest implements ArrayAccess { $this->webroot = $base . '/'; return $base; } - if (!$baseUrl) { + if (empty($baseUrl)) { $replace = array('<', '>', '*', '\'', '"'); $base = str_replace($replace, '', dirname(env('PHP_SELF')));
Ficing a couple of notices when using a mocked CakeRequest
cakephp_cakephp
train
php
6705ef1842b44bf1e3a616ec0e81441ef416aad6
diff --git a/src/server/pfs/db/driver.go b/src/server/pfs/db/driver.go index <HASH>..<HASH> 100644 --- a/src/server/pfs/db/driver.go +++ b/src/server/pfs/db/driver.go @@ -40,6 +40,10 @@ type ErrBranchExists struct { error } +type ErrCommitFinished struct { + error +} + const ( repoTable Table = "Repos" diffTable Table = "Diffs" @@ -862,7 +866,9 @@ func (d *driver) PutFile(file *pfs.File, handle string, if err != nil { return err } - + if commit.Finished != nil { + return ErrCommitFinished{fmt.Errorf("commit %v has already been finished", commit.ID)} + } _client := client.APIClient{BlockAPIClient: d.blockClient} blockrefs, err := _client.PutBlock(delimiter, reader) if err != nil {
Fix a FUSE regression Looks like this code got removed in a merge somewhere recently
pachyderm_pachyderm
train
go
34d1a51d4df7010650749e9bc30c5f51e67973b8
diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index <HASH>..<HASH> 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -451,7 +451,7 @@ class Exchange(object): self.raise_error(ExchangeError, url, method, e) except HTTPError as e: - self.handle_errors(response.status_code, response.reason, url, method, headers, http_response, None) + self.handle_errors(response.status_code, response.reason, url, method, headers, http_response, json_response) self.handle_rest_errors(e, response.status_code, http_response, url, method) self.raise_error(ExchangeError, url, method, e, http_response)
pass json response to handle errors
ccxt_ccxt
train
py
8df86bd9d12b445224a83973a12480ee2dc2e209
diff --git a/lib/utils/deprecation_utils.js b/lib/utils/deprecation_utils.js index <HASH>..<HASH> 100644 --- a/lib/utils/deprecation_utils.js +++ b/lib/utils/deprecation_utils.js @@ -47,6 +47,9 @@ function displayMethodDeprecationMessage(deprecationNoticeObject) { } function getDeprecationMessage(deprecated, preferred, targetType) { - return `The ${targetType} '${deprecated}' is deprecated and will be removed in the next major release.` + - ` Please use '${preferred}' instead.`; + const firstPart = `The ${targetType} '${deprecated}' is deprecated and will be removed in the next major release.`; + if (!preferred) { + return firstPart; + } + return `${firstPart} Please use '${preferred}' instead.`; }
Added case where there's no preferred object/method
jhipster_generator-jhipster
train
js
8b31996d818792111ed02a31680745c7711f8296
diff --git a/lib/api_client.js b/lib/api_client.js index <HASH>..<HASH> 100644 --- a/lib/api_client.js +++ b/lib/api_client.js @@ -17,7 +17,7 @@ APIClient.prototype.AWS_US_EAST_HOST = 'mq-aws-us-east-1.iron.io'; - APIClient.prototype.RACKSPACE_HOST = 'mq-rackspace-dfw.iron.io'; + APIClient.prototype.RACKSPACE_HOST = 'mq-rackspace-ord.iron.io'; function APIClient(options) { var defaultOptions;
updated rackspace host to ORD Chicago DFW is not publicly available.
iron-io_iron_mq_node
train
js
7818f864f16beeb75602f5a42fc2aca1c64f87a1
diff --git a/tests/integration/states/test_user.py b/tests/integration/states/test_user.py index <HASH>..<HASH> 100644 --- a/tests/integration/states/test_user.py +++ b/tests/integration/states/test_user.py @@ -152,10 +152,14 @@ class UserTest(ModuleCase, SaltReturnAssertsMixin): # user ret = self.run_state("group.present", name=self.user_name) self.assertSaltTrueReturn(ret) + if salt.utils.platform.is_darwin(): + gid = grp.getgrnam("staff").gr_gid + else: + gid = self.user_name ret = self.run_state( "user.present", name=self.user_name, - gid=self.user_name, + gid=gid, usergroup=False, home=self.user_home, )
Get GID from staff as int instead of user_name
saltstack_salt
train
py
c505ee3ca182c493681d388bdc0c5cb0eb6742a2
diff --git a/js/webtrees.js b/js/webtrees.js index <HASH>..<HASH> 100644 --- a/js/webtrees.js +++ b/js/webtrees.js @@ -1375,6 +1375,7 @@ function activate_colorbox() { // TODO - gallery feature not working correctly... jQuery("a[rel=gallery]").live("click",function(e){ e.preventDefault(); + jQuery("a[rel=gallery]").colorbox(); jQuery(this).colorbox({open:true}); }); }
Minor tweak to colorbox so that gallery function now works. Still need to group media into separate galleries for pages with multiple tabs.
fisharebest_webtrees
train
js
a272f11db80f1db9e2e7387eb0b98c8422302b6e
diff --git a/tests/VerboseTest.php b/tests/VerboseTest.php index <HASH>..<HASH> 100644 --- a/tests/VerboseTest.php +++ b/tests/VerboseTest.php @@ -1002,6 +1002,7 @@ class VerbosityTest extends BaseRollbarTest $pre = null, $post = null ) { + $unitTest = $this; // Quiet scenario $this->prepareForLogMocking( array('verbose' => \Rollbar\Config::VERBOSE_NONE), @@ -1009,8 +1010,8 @@ class VerbosityTest extends BaseRollbarTest ); $this->withTestLambdas( $test, - function () { - $this->expectQuiet(); + function () use ($unitTest) { + $unitTest->expectQuiet(); }, $pre, $post
test(dev options): pass unit test object through closure for php<I> Closes #<I>
rollbar_rollbar-php
train
php
d33e6e075097f60f32d0c487b111a984fffb42ec
diff --git a/Minimal-J/src/main/java/org/minimalj/frontend/edit/Editor.java b/Minimal-J/src/main/java/org/minimalj/frontend/edit/Editor.java index <HASH>..<HASH> 100644 --- a/Minimal-J/src/main/java/org/minimalj/frontend/edit/Editor.java +++ b/Minimal-J/src/main/java/org/minimalj/frontend/edit/Editor.java @@ -280,9 +280,9 @@ public abstract class Editor<T> { if (answer == DialogResult.YES) { // finish will be called at the end of save save(); - } else { // Cancel or Close + } else if (answer == DialogResult.NO) { cancel(); - } + } // else do nothing (dialog will not close) } }; ClientToolkit.getToolkit().showConfirmDialog("Sollen die aktuellen Eingaben gespeichert werden?", "Schliessen",
Editor.checkClose: Reaction if user chose 'cancel' was wrong
BrunoEberhard_minimal-j
train
java
a4c40cf03fc24f8fb546e0be50f3de74291343cb
diff --git a/js/coinbase.js b/js/coinbase.js index <HASH>..<HASH> 100644 --- a/js/coinbase.js +++ b/js/coinbase.js @@ -999,7 +999,7 @@ module.exports = class coinbase extends Exchange { } } - async prepareAccountRequest (limit, params) { + prepareAccountRequest (limit, params) { const accountId = this.safeString2 (params, 'account_id', 'accountId'); const request = { 'account_id': accountId, @@ -1012,7 +1012,7 @@ module.exports = class coinbase extends Exchange { async prepareAccountRequestWithCurrencyCode (code, limit, params) { const request = this.prepareAccountRequest (limit, params); - if (request['accountId'] === undefined) { + if (request['account_id'] === undefined) { if (code === undefined) { throw new ArgumentsRequired (this.id + ' method requires an account_id (or accountId) parameter OR a currency code'); } @@ -1020,7 +1020,7 @@ module.exports = class coinbase extends Exchange { if (accountId === undefined) { throw new ExchangeError (this.id + ' invalid currency code'); } - request['accountId'] = accountId; + request['account_id'] = accountId; } return request; }
[coinbase] fix bad merge
ccxt_ccxt
train
js
0ba7837899d6659a790a5484811b49cf579d1a0c
diff --git a/Tone/core/Buffer.js b/Tone/core/Buffer.js index <HASH>..<HASH> 100644 --- a/Tone/core/Buffer.js +++ b/Tone/core/Buffer.js @@ -486,7 +486,7 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/type/Type"], function(Tone) * @static */ Tone.Buffer.cancelDownloads = function(){ - Tone.Buffer._downloadQueue.forEach(function(request){ + Tone.Buffer._downloadQueue.slice().forEach(function(request){ Tone.Buffer._removeFromDownloadQueue(request); request.abort(); });
cloning queue to remove items within forEach loop
Tonejs_Tone.js
train
js
f5de75959ad544e80f08d6adaffa7026df3380ef
diff --git a/route_linux.go b/route_linux.go index <HASH>..<HASH> 100644 --- a/route_linux.go +++ b/route_linux.go @@ -550,7 +550,6 @@ func (h *Handle) RouteAppend(route *Route) error { return h.routeHandle(route, req, nl.NewRtMsg()) } -======= // RouteAddEcmp will add a route to the system. func RouteAddEcmp(route *Route) error { return pkgHandle.RouteAddEcmp(route)
Remove "=======" characters left over from merge
vishvananda_netlink
train
go
de1a4515f552705b4f5d440394a45ea6bbd2883a
diff --git a/rows/utils/__init__.py b/rows/utils/__init__.py index <HASH>..<HASH> 100644 --- a/rows/utils/__init__.py +++ b/rows/utils/__init__.py @@ -1259,6 +1259,16 @@ def scale_number(n, divider=1000, suffix=None, multipliers="KMGTPEZ", decimal_pl return fmt_str.format(n=n, multiplier=multiplier, suffix=suffix) +class NotNullWrapper(io.BufferedReader): + """BufferedReader which removes NUL (`\x00`) from source stream""" + + def read(self, n): + return super().read(n).replace(b"\x00", b"") + + def readline(self): + return super().readline().replace(b"\x00", b"") + + # Shortcuts csv2sqlite = csv_to_sqlite sqlite2csv = sqlite_to_csv
Add NotNullWrapper (make it easy to deal with CSV with NULs)
turicas_rows
train
py
e5d97cf8ffc6bc1be45c46254d478c405de53623
diff --git a/ldapcherry/backend/__init__.py b/ldapcherry/backend/__init__.py index <HASH>..<HASH> 100644 --- a/ldapcherry/backend/__init__.py +++ b/ldapcherry/backend/__init__.py @@ -8,7 +8,7 @@ from ldapcherry.exceptions import MissingParameter -class Backend: +class Backend(object): def __init__(self, config, logger, name, attrslist, key): """ Initialize the backend
making Backend skeleton a child class of object this enables the use of super()
kakwa_ldapcherry
train
py
be614baedbe87bf4735707f8e6676f71f414c70e
diff --git a/lib/sorcery/adapters/active_record_adapter.rb b/lib/sorcery/adapters/active_record_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/sorcery/adapters/active_record_adapter.rb +++ b/lib/sorcery/adapters/active_record_adapter.rb @@ -6,7 +6,8 @@ module Sorcery @model.send(:"#{name}=", value) end primary_key = @model.class.primary_key - @model.class.where(:"#{primary_key}" => @model.send(:"#{primary_key}")).update_all(attrs) + updated_count = @model.class.where(:"#{primary_key}" => @model.send(:"#{primary_key}")).update_all(attrs) + updated_count == 1 end def save(options = {})
Make `#update_attributes` behavior identical to `#update` (#<I>) Another choice of implemention is like this: ``` @model.class.find_by(:"#{primary_key}" => @model.send(:"#{primary_key}")).update(attrs) ``` but for some reasons I don't adopt it. First it makes 2 queries instead of one. Secondly it has potential risk to race conditions.
Sorcery_sorcery
train
rb
1c91c6aa8ee003e158ddc9613686b51fe257954d
diff --git a/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/AfterStage.java b/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/AfterStage.java index <HASH>..<HASH> 100644 --- a/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/AfterStage.java +++ b/jgiven-core/src/main/java/com/tngtech/jgiven/annotation/AfterStage.java @@ -8,9 +8,11 @@ import java.lang.annotation.Target; /** * Marks methods to be executed after a stage has been executed. - * Essentially means that the method is executed on next call of a step method of the next stage. + * This essentially means that the method is executed + * either on next call of a step method of the next stage, + * or, for the last stage, after the scenario (but before any {@link AfterScenario} method). * <p> - * Can be used to finish builders, for example. + * {@code @AfterStage} can be used to finish builders, for example. * <p> * It is guaranteed that {@code @AfterStage} methods are only invoked once. */
adding more details to @AfterStage's JavaDoc
TNG_JGiven
train
java
368c0c3e43178fff6311b0b492bd8bb661d2071a
diff --git a/oct2py/tests/test_usage.py b/oct2py/tests/test_usage.py index <HASH>..<HASH> 100644 --- a/oct2py/tests/test_usage.py +++ b/oct2py/tests/test_usage.py @@ -17,7 +17,7 @@ class BasicUsageTest(test.TestCase): """ def setUp(self): self.oc = Oct2Py() - self.oc.addpath(os.path.dirname(__file__)) + self.oc.addpath(self.oc.genpath(os.path.dirname(__file__))) def tearDown(self): self.oc.exit()
Try a nested call for the first call
blink1073_oct2py
train
py
4e65b39d4af5fce5e2e40d0d0a85a7f88dd68030
diff --git a/app/controllers/kuhsaft/pages_controller.rb b/app/controllers/kuhsaft/pages_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/kuhsaft/pages_controller.rb +++ b/app/controllers/kuhsaft/pages_controller.rb @@ -2,6 +2,7 @@ module Kuhsaft class PagesController < ::ApplicationController respond_to :html before_action :find_page_by_url, only: :show + helper_method :is_kuhsaft_page? def index @search = params[:search] @@ -38,6 +39,5 @@ module Kuhsaft def is_kuhsaft_page? is_a? Kuhsaft::PagesController end - helper_method :is_kuhsaft_page? end end
move macrodeclaration to the top
brandleadership_kuhsaft
train
rb
aef034414ff5319aea77432bb124f821e0c97017
diff --git a/hwt/hdl/types/bitsVal.py b/hwt/hdl/types/bitsVal.py index <HASH>..<HASH> 100644 --- a/hwt/hdl/types/bitsVal.py +++ b/hwt/hdl/types/bitsVal.py @@ -522,7 +522,7 @@ class BitsVal(EventCapableVal): elif s is False: pass else: - raise NotImplementedError() + raise NotImplementedError("Signed multiplication") elif isinstance(other._dtype, Integer): pass
better description of not implemented in Bits.__mul__
Nic30_hwt
train
py
9b9b8041d577ba8a8dd1f4ab1e79333ee6d53a5f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -518,6 +518,9 @@ // const DeepDiff = require('deep-diff'); // const { DeepDiff } = require('deep-diff'); - root.DeepDiff = accumulateDiff; + if (root) { + root.DeepDiff = accumulateDiff; + } + return accumulateDiff; }));
Fix the case when this/root is undefined
flitbit_diff
train
js
a7eb601f96098280632d9a21c90682d0365bfb5b
diff --git a/src/store.js b/src/store.js index <HASH>..<HASH> 100644 --- a/src/store.js +++ b/src/store.js @@ -1311,7 +1311,7 @@ function mapValueWithState(lastValue, nextValue) { enumerable: true, }); return acc; - }, Object.create(lastValue)), + }, Object.create(Object.getPrototypeOf(lastValue))), ); definitions.set(result, definitions.get(lastValue));
fix(store): correct prototype for mapping state of the model in store factory
hybridsjs_hybrids
train
js
8181d5ed149bec74cbce7c6beac07e6f8243db99
diff --git a/readline.go b/readline.go index <HASH>..<HASH> 100644 --- a/readline.go +++ b/readline.go @@ -48,6 +48,7 @@ type Config struct { UniqueEditLine bool // force use interactive even stdout is not a tty + StdinFd int StdoutFd int ForceUseInteractive bool @@ -58,7 +59,10 @@ type Config struct { } func (c *Config) useInteractive() bool { - return c.ForceUseInteractive || IsTerminal(c.StdoutFd) + if c.ForceUseInteractive { + return true + } + return IsTerminal(c.StdoutFd) && IsTerminal(c.StdinFd) } func (c *Config) Init() error { @@ -75,6 +79,9 @@ func (c *Config) Init() error { if c.Stderr == nil { c.Stderr = Stderr } + if c.StdinFd == 0 { + c.StdinFd = StdinFd + } if c.StdoutFd == 0 { c.StdoutFd = StdoutFd }
disable interactive when stdin is not a tty
chzyer_readline
train
go
58f8fc2c574d2165e3641c40b1919479392c7e94
diff --git a/test/resque_test.rb b/test/resque_test.rb index <HASH>..<HASH> 100644 --- a/test/resque_test.rb +++ b/test/resque_test.rb @@ -290,7 +290,7 @@ describe "Resque" do describe "stats" do it "allows to set custom stat_data_store" do - dummy = DummyStatStore.new + dummy = Object.new Resque.stat_data_store = dummy assert_equal dummy, Resque.stat_data_store end diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -188,21 +188,6 @@ ensure Resque::Failure.backend = previous_backend end -class DummyStatStore - def stat(stat) - 0 - end - - def increment_stat(stat, by) - end - - def decrement_stat(stat, by) - end - - def clear_stat(stat) - end -end - require 'time' class Time
No need to define a dummy store just to test a reader and writter
resque_resque
train
rb,rb
68340b1288712a2388360c3f720445afdf886367
diff --git a/src/babel/types/index.js b/src/babel/types/index.js index <HASH>..<HASH> 100644 --- a/src/babel/types/index.js +++ b/src/babel/types/index.js @@ -25,7 +25,7 @@ function registerType(type: string, skipAliasCheck?: boolean) { } export var STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; -export var NATIVE_TYPE_NAMES = ["Array", "Object", "Number", "Boolean", "Date", "Array", "String"]; +export var NATIVE_TYPE_NAMES = ["Array", "Object", "Number", "Boolean", "Date", "Array", "String", "Promise"]; export var FLATTENABLE_KEYS = ["body", "expressions"]; export var FOR_INIT_KEYS = ["left", "init"]; export var COMMENT_KEYS = ["leadingComments", "trailingComments"];
add Promise to the list of native types - fixes #<I>
babel_babel
train
js
33c9a8329e146412ab84fe12fb38f683e04142ed
diff --git a/deployment/freebsd/__init__.py b/deployment/freebsd/__init__.py index <HASH>..<HASH> 100644 --- a/deployment/freebsd/__init__.py +++ b/deployment/freebsd/__init__.py @@ -204,3 +204,16 @@ class WebserverJail(api.BaseJail): reloaded = self.console('/usr/local/etc/rc.d/nginx reload') if 'nginx not running' in reloaded: self.console('/usr/local/etc/rc.d/nginx start') + + +class CleanserJail(api.BaseJail): + + ctype = 'zfs' + sshd = True + ip_addr = '127.0.0.3' + ports_to_install = [ + 'graphics/netpbm', + 'print/ghostscript9', + 'editors/libreoffice', + 'archive/zip', + ]
basic cleanser jail definition TODO: upload middleware scripts, use configurable ssh key
ZeitOnline_briefkasten
train
py
16964a044c7c77adb729b3184422340066ce2426
diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb index <HASH>..<HASH> 100644 --- a/lib/haml/exec.rb +++ b/lib/haml/exec.rb @@ -306,6 +306,7 @@ END def watch_or_update require 'sass' require 'sass/plugin' + ::Sass::Plugin.options.merge! @options[:for_engine] ::Sass::Plugin.options[:unix_newlines] = @options[:unix_newlines] if @args[1] && !@args[0].include?(':')
[Sass] Make sure --watch and --update respect the engine options. Closes gh-<I>
sass_ruby-sass
train
rb
d6d64443c7fe091ac30afe7af0ab9d396bdea05b
diff --git a/src/enrichment.js b/src/enrichment.js index <HASH>..<HASH> 100644 --- a/src/enrichment.js +++ b/src/enrichment.js @@ -2,7 +2,6 @@ var assert = require('assert'); var resource = require('./resource'); -var _ = require('lodash'); var Company = require('./enrichment/company'); var Person = require('./enrichment/person'); diff --git a/src/enrichment/company.js b/src/enrichment/company.js index <HASH>..<HASH> 100644 --- a/src/enrichment/company.js +++ b/src/enrichment/company.js @@ -2,7 +2,6 @@ var assert = require('assert'); var resource = require('../resource'); -var _ = require('lodash'); exports.Company = resource.create('Company', {api: 'company', version: 2}) .extend({ diff --git a/src/enrichment/person.js b/src/enrichment/person.js index <HASH>..<HASH> 100644 --- a/src/enrichment/person.js +++ b/src/enrichment/person.js @@ -2,7 +2,6 @@ var assert = require('assert'); var resource = require('../resource'); -var _ = require('lodash'); exports.Person = resource.create('Person', {api: 'person', version: 2}) .extend({
Remove lodash when it's not required.
clearbit_clearbit-node
train
js,js,js
a485644c38d93bd8ca6e18058aa700dfa9d7b304
diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -380,7 +380,7 @@ abstract class Utils $pretty_offset = "UTC${offset_prefix}${offset_formatted}"; - $timezone_list[$timezone] = "(${pretty_offset}) $timezone"; + $timezone_list[$timezone] = "(${pretty_offset}) ".str_replace('_', ' ', $timezone); } return $timezone_list;
Replace underscore with space for display of timezones #<I> (#<I>) Thanks!
getgrav_grav
train
php
147646866692f2854a730b7ad59144910b5229cb
diff --git a/tests/cfg_test.py b/tests/cfg_test.py index <HASH>..<HASH> 100644 --- a/tests/cfg_test.py +++ b/tests/cfg_test.py @@ -25,10 +25,10 @@ class CFGTestCase(unittest.TestCase): successor does not have the node in its ingoing.''' self.assertNotIn(successor, node.outgoing, - '\n%s was mistakenly found in the outgoing list containing: ' % successor.label + '[' + ', '.join([x.label for x in node.outgoing]) + ']') + '\n%s was mistakenly found in the outgoing list of %s containing: ' % (successor.label, node.label) + '[' + ', '.join([x.label for x in node.outgoing]) + ']') self.assertNotIn(node, successor.ingoing, - '\n%s was mistakenly found in the ingoing list containing: ' % node.label + '[' + ', '.join([x.label for x in successor.ingoing]) + ']') + '\n%s was mistakenly found in the ingoing list of %s containing: ' % (node.label, successor.label) + '[' + ', '.join([x.label for x in successor.ingoing]) + ']') def cfg_list_to_dict(self, list): '''This method converts the CFG list to a dict, making it easier to find nodes to test.
improve feedback from assertConnected methods
python-security_pyt
train
py
49160b8a5c6b7799bbc9bdbd791852b8c6598aee
diff --git a/android/src/com/nitobi/phonegap/GpsListener.java b/android/src/com/nitobi/phonegap/GpsListener.java index <HASH>..<HASH> 100644 --- a/android/src/com/nitobi/phonegap/GpsListener.java +++ b/android/src/com/nitobi/phonegap/GpsListener.java @@ -50,6 +50,7 @@ public class GpsListener implements LocationListener { public Location getLocation() { + cLoc = mLocMan.getLastKnownLocation(LocationManager.GPS_PROVIDER); return cLoc; } diff --git a/android/src/com/nitobi/phonegap/NetworkListener.java b/android/src/com/nitobi/phonegap/NetworkListener.java index <HASH>..<HASH> 100644 --- a/android/src/com/nitobi/phonegap/NetworkListener.java +++ b/android/src/com/nitobi/phonegap/NetworkListener.java @@ -50,6 +50,7 @@ public class NetworkListener implements LocationListener { public Location getLocation() { + cLoc = mLocMan.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); return cLoc; }
Cherry picking the listeners to get GeoLocation to work
apache_cordova-ios
train
java,java
fd5341814894b5fc540f1389aa788cc844ca1554
diff --git a/selendroid-standalone/src/main/java/io/selendroid/android/impl/DefaultAndroidEmulator.java b/selendroid-standalone/src/main/java/io/selendroid/android/impl/DefaultAndroidEmulator.java index <HASH>..<HASH> 100644 --- a/selendroid-standalone/src/main/java/io/selendroid/android/impl/DefaultAndroidEmulator.java +++ b/selendroid-standalone/src/main/java/io/selendroid/android/impl/DefaultAndroidEmulator.java @@ -278,8 +278,14 @@ public class DefaultAndroidEmulator extends AbstractDevice implements AndroidEmu log.info("Emulator start took: " + (System.currentTimeMillis() - start) / 1000 + " seconds"); log.info("Please have in mind, starting an emulator takes usually about 45 seconds."); - - while (!unlockEmulatorScreen()) { + unlockEmulatorScreen(); + while (!isScreenUnlocked()) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("checking for screen unlocked"); } }
adding a sleep inbetween ps checks
selendroid_selendroid
train
java
4c71b281c40af703904bac3d140a2f231efa82bf
diff --git a/test/soml/helper.rb b/test/soml/helper.rb index <HASH>..<HASH> 100644 --- a/test/soml/helper.rb +++ b/test/soml/helper.rb @@ -43,7 +43,8 @@ module RuntimeTests end def connected - return false unless ENV["REMOTE_PI"] + return false if ENV["REMOTE_PI"].nil? or (ENV["REMOTE_PI"] == "") + puts "remote " + ENV["REMOTE_PI"] user , rest = ENV["REMOTE_PI"].split("@") machine , port = rest.to_s.split(":") return @@conn if defined?(@@conn)
3 try to get travis to work and behave like my machine, remote debugging going on
ruby-x_rubyx
train
rb
7dbcc9797ec3048bcb1db37fa4c619d6adbcf24f
diff --git a/lib/raven/integrations/rack.rb b/lib/raven/integrations/rack.rb index <HASH>..<HASH> 100644 --- a/lib/raven/integrations/rack.rb +++ b/lib/raven/integrations/rack.rb @@ -41,10 +41,6 @@ module Raven end def call(env) - # clear context at the beginning of the request to ensure a clean slate - Context.clear! - BreadcrumbBuffer.clear! - # store the current environment in our local context for arbitrary # callers env['raven.requested_at'] = Time.now @@ -64,6 +60,9 @@ module Raven Raven::Rack.capture_exception(error, env) if error response + ensure + Context.clear! + BreadcrumbBuffer.clear! end end
Rack: clear context in ensure. If Sentry causes exception, make sure we still clear contexts
getsentry_raven-ruby
train
rb
7e87b96481b6a75cdac5693cca8fe6fcfad714a9
diff --git a/src/js/string.js b/src/js/string.js index <HASH>..<HASH> 100644 --- a/src/js/string.js +++ b/src/js/string.js @@ -32,7 +32,7 @@ ch.extend("watcher").as("string", function (conf) { // Define the conditions of this interface conf.conditions = [{ name: "text", - patt: /^([a-zA-Z\s]+)$/ + patt: /^([^0-9]+[áéíóúâêîôûäëïöüàèìòùÁÉÍÓÚÂÊÎÔÛÄËÏÖÜÀÈÌÒÙçÇ\s]*[a-zA-Z\s]*)$/ },{ name:"email", patt: /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/
GH-<I> Added accent characters to the regular expression of the string watcher
mercadolibre_chico
train
js
1863f3828635633171c98dab817b87b5b07e18fa
diff --git a/models/repo.go b/models/repo.go index <HASH>..<HASH> 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1414,6 +1414,10 @@ func DeleteRepository(uid, repoID int64) error { return err } + if err = sess.Commit(); err != nil { + return fmt.Errorf("Commit: %v", err) + } + // Remove repository files. repoPath := repo.repoPath(sess) RemoveAllWithNotice("Delete repository files", repoPath) @@ -1425,10 +1429,6 @@ func DeleteRepository(uid, repoID int64) error { RemoveAllWithNotice("Delete attachment", attachmentPaths[i]) } - if err = sess.Commit(); err != nil { - return fmt.Errorf("Commit: %v", err) - } - if repo.NumForks > 0 { if _, err = x.Exec("UPDATE `repository` SET fork_id=0,is_fork=? WHERE fork_id=?", false, repo.ID); err != nil { log.Error(4, "reset 'fork_id' and 'is_fork': %v", err)
models/repo: fix SQLite3 database-lock when fail to delete repository (#<I>)
gogs_gogs
train
go
6ee867472a9768fea7eb6223f9fc318588b27edf
diff --git a/test/com/google/javascript/jscomp/IntegrationTest.java b/test/com/google/javascript/jscomp/IntegrationTest.java index <HASH>..<HASH> 100644 --- a/test/com/google/javascript/jscomp/IntegrationTest.java +++ b/test/com/google/javascript/jscomp/IntegrationTest.java @@ -5309,7 +5309,7 @@ public final class IntegrationTest extends IntegrationTestCase { "var a={a:9}; a=void 0===a?{a:5}:a;alert(3+a.a)"); } - // TODO(b/69850796): Re-enable if/when InlineFunctions supports inlining default parameters + // TODO(b/78345133): Re-enable if/when InlineFunctions supports inlining default parameters public void disabled_testDefaultParametersNonTranspiling() { CompilerOptions options = createCompilerOptions(); CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options); @@ -5348,7 +5348,7 @@ public final class IntegrationTest extends IntegrationTestCase { "}(1,1,1,1,1))")); } - // TODO(b/69850796): Re-enable if/when InlineFunctions supports rest parameters that are + // TODO(tbreisacher): Re-enable if/when InlineFunctions supports rest parameters that are // object patterns. public void disabled_testRestObjectPatternParametersNonTranspiling() { CompilerOptions options = createCompilerOptions();
Remove obsolete bug number in TODO comments ------------- Created by MOE: <URL>
google_closure-compiler
train
java
9bbc1ce0207ae979df9293686630f1f56db40276
diff --git a/qiskit/tools/parallel.py b/qiskit/tools/parallel.py index <HASH>..<HASH> 100644 --- a/qiskit/tools/parallel.py +++ b/qiskit/tools/parallel.py @@ -58,7 +58,8 @@ from qiskit.util import local_hardware_info from qiskit.tools.events.pubsub import Publisher # Set parallel flag -os.environ['QISKIT_IN_PARALLEL'] = 'FALSE' +if os.getenv('QISKIT_IN_PARALLEL') is None: + os.environ['QISKIT_IN_PARALLEL'] = 'FALSE' # Number of local physical cpus CPU_COUNT = local_hardware_info()['cpus']
Allow bypassing parallel mode at init (#<I>)
Qiskit_qiskit-terra
train
py
741f507c23309e4a12a8c7125233df9d501759c6
diff --git a/cake/libs/router.php b/cake/libs/router.php index <HASH>..<HASH> 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1041,7 +1041,7 @@ class Router { * @access public * @static */ - function requestRoute() { + function &requestRoute() { $self =& Router::getInstance(); return $self->__currentRoute[0]; } @@ -1053,7 +1053,7 @@ class Router { * @access public * @static */ - function currentRoute() { + function &currentRoute() { $self =& Router::getInstance(); return $self->__currentRoute[count($self->__currentRoute) - 1]; }
Fixing reference errors in php4.
cakephp_cakephp
train
php
95d2fd46c99c99d2fe91e79b5dc573d9383acf56
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,7 @@ fuse(Contour, require('events').EventEmitter); */ Contour.get = function get(brand) { if (!~available.indexOf(brand)) brand = 'nodejitsu'; - var base = path.join(__dirname, 'assets', brand); + var base = path.join(__dirname, 'pagelets', brand); return fs.readdirSync(base).reduce(function reduce(memo, file) { if ('.styl' !== path.extname(file)) return memo;
[fix] get files from pagelets directory
nodejitsu_contour
train
js
11208f63c450c716da4d3d458f607c412feeba13
diff --git a/classes/phing/tasks/ext/git/GitBaseTask.php b/classes/phing/tasks/ext/git/GitBaseTask.php index <HASH>..<HASH> 100644 --- a/classes/phing/tasks/ext/git/GitBaseTask.php +++ b/classes/phing/tasks/ext/git/GitBaseTask.php @@ -56,10 +56,10 @@ abstract class GitBaseTask extends Task */ public function init() { - require_once 'VersionControl/Git.php'; + @include_once 'VersionControl/Git.php'; if (false == class_exists('VersionControl_Git')) { - throw new Exception("The Git tasks depend on PEAR\'s " - . "VersionControl_Git package."); + throw new BuildException("The Git tasks depend on PEAR\'s " + . "VersionControl_Git package.", $this->getLocation()); } }
Suppress errors to allow class_exists() to run
phingofficial_phing
train
php
4c36e05f2757d294c6ad06029ba6c32c5af707db
diff --git a/src/ol/ol.js b/src/ol/ol.js index <HASH>..<HASH> 100644 --- a/src/ol/ol.js +++ b/src/ol/ol.js @@ -17,12 +17,6 @@ ol.ASSUME_TOUCH = false; /** - * @define {boolean} Replace unused entries with NaNs. - */ -ol.BUFFER_REPLACE_UNUSED_ENTRIES_WITH_NANS = goog.DEBUG; - - -/** * TODO: rename this to something having to do with tile grids * see https://github.com/openlayers/ol3/issues/2076 * @define {number} Default maximum zoom for default tile grids.
Remove unused define Should have been removed in #<I>
openlayers_openlayers
train
js
54858cdae64ee6f83e585c823e2adb9e749ac41d
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -4463,8 +4463,15 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve // give some time for the browser to load the "reloading" page Thread.sleep(TimeUnit.SECONDS.toMillis(5)); LOGGER.info(String.format("Restarting VM as requested by %s", exitUser)); - for (RestartListener listener : RestartListener.all()) - listener.onRestart(); + for (RestartListener listener : RestartListener.all()) { + try { + listener.onRestart(); + } catch (Throwable t) { + LOGGER.log(Level.WARNING, + "RestartListener failed, ignoring and continuing with restart, this indicates a bug in the associated plugin or Jenkins code", + t); + } + } lifecycle.restart(); } catch (InterruptedException | InterruptedIOException e) { LOGGER.log(Level.WARNING, "Interrupted while trying to restart Jenkins", e);
[JENKINS-<I>] protect Jenkins against bad RestartListeners (#<I>)
jenkinsci_jenkins
train
java
7bf2abb86fc99d9fd2f5862ba5517212654bf184
diff --git a/lib/ezfile/classes/ezlog.php b/lib/ezfile/classes/ezlog.php index <HASH>..<HASH> 100644 --- a/lib/ezfile/classes/ezlog.php +++ b/lib/ezfile/classes/ezlog.php @@ -51,10 +51,11 @@ class eZLog } /*! + \static \public Writes a message $message to a given file name $name and directory $dir for logging */ - function write( $message, $logName = 'common.log', $dir = '' ) + static function write( $message, $logName = 'common.log', $dir = '' ) { $ini = eZINI::instance(); $dir = $ini->variable( 'FileSettings', 'VarDir' ). '/' .$ini->variable( 'FileSettings', 'LogDir' );
- Fixed bug #<I>: eZLog::write is not declared static, but it is invoked as such git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/unstable/<I>-<I>-<I>-php5@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
38a8cf9f3004e8683d08d7eabc9f9019d6031ee8
diff --git a/lib/state_machine/node_collection.rb b/lib/state_machine/node_collection.rb index <HASH>..<HASH> 100644 --- a/lib/state_machine/node_collection.rb +++ b/lib/state_machine/node_collection.rb @@ -62,7 +62,7 @@ module StateMachine # will be replaced with the updated ones. def update(node) @indices.each do |attribute, index| - old_key = index.key(node) + old_key = index.respond_to?(:key) ? index.key(node) : index.index(node) new_key = node.send(attribute) # Only replace the key if it's changed
Fix Hash#key not being available in < Ruby <I>
pluginaweek_state_machine
train
rb
d32232d229a4ab5bda689ecf9dfd2fad3f04ad5b
diff --git a/src/Mediawiki.php b/src/Mediawiki.php index <HASH>..<HASH> 100644 --- a/src/Mediawiki.php +++ b/src/Mediawiki.php @@ -117,7 +117,7 @@ class Mediawiki 'users' ); - if (class_exists($class) && in_array($name, $accessible)) + if (class_exists($class) && \in_array($name, $accessible)) { if (!isset($this->$name)) {
Optimize function calls for PHP 7 based on zend_try_compile_special_func
joomla-framework_mediawiki-api
train
php
0dd6afe128e0b7b5fa3a4c77ba0291f089c004df
diff --git a/cmd/gomu/cmd/cli/new/template/docker.go b/cmd/gomu/cmd/cli/new/template/docker.go index <HASH>..<HASH> 100644 --- a/cmd/gomu/cmd/cli/new/template/docker.go +++ b/cmd/gomu/cmd/cli/new/template/docker.go @@ -5,8 +5,10 @@ var Dockerfile = `FROM golang:alpine AS builder ENV CGO_ENABLED=0 GOOS=linux WORKDIR /go/src/{{.Alias}} RUN apk --update --no-cache add ca-certificates gcc libtool make musl-dev protoc -COPY . /go/src/{{.Alias}} -RUN make {{if not .Client}}init proto {{end}}tidy build +COPY {{if not .Client}}Makefile {{end}go.mod go.sum ./ +RUN {{if not .Client}}make init && {{end}}go mod download +COPY . . +RUN make {{if not .Client}}proto {{end}}tidy build FROM scratch COPY --from=builder /etc/ssl/certs /etc/ssl/certs
Optimize Dockerfile generated by Gomu (#<I>) This change prevents having to rebuild the entire Docker image when your source code changes.
micro_go-micro
train
go