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
4025d88848a4f1b6cdb86241347e3580ccce856b
diff --git a/lib/onebox/engine/whitelisted_generic_onebox.rb b/lib/onebox/engine/whitelisted_generic_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/whitelisted_generic_onebox.rb +++ b/lib/onebox/engine/whitelisted_generic_onebox.rb @@ -19,6 +19,7 @@ module Onebox %w(23hq.com 500px.com 8tracks.com + abc.net.au about.com answers.com arstechnica.com
Add abc.net.au to whitelist.
discourse_onebox
train
rb
2ee4a2780fda827336eb6a9bdc85b151ab9676d0
diff --git a/IronCore.class.php b/IronCore.class.php index <HASH>..<HASH> 100644 --- a/IronCore.class.php +++ b/IronCore.class.php @@ -337,13 +337,14 @@ class IronCore } break; case Http_Exception::SERVICE_UNAVAILABLE: + case Http_Exception::GATEWAY_TIMEOUT: self::waitRandomInterval($retry); break; default: $this->reportHttpError($this->last_status, $_out); } } - $this->reportHttpError(503, "Service unavailable"); + $this->reportHttpError($this->last_status, "Service unavailable"); return null; } @@ -436,6 +437,7 @@ class Http_Exception extends Exception const PRECONDITION_FAILED = 412; const INTERNAL_ERROR = 500; const SERVICE_UNAVAILABLE = 503; + const GATEWAY_TIMEOUT = 504; } /**
Retry operation after a Gateway Timeout
iron-io_iron_core_php
train
php
806b405b121e84b55f9e84b92a4ed4228d5c6b42
diff --git a/formlayout.py b/formlayout.py index <HASH>..<HASH> 100644 --- a/formlayout.py +++ b/formlayout.py @@ -365,7 +365,11 @@ class FormWidget(QWidget): self.formlayout.addRow(QLabel(value)) self.widgets.append(None) continue - elif tuple_to_qfont(value) is not None: + tooltip = False + index = label.find('::') + if index != -1: + label, tooltip = label[:index], label[index+2:] + if tuple_to_qfont(value) is not None: field = FontLayout(value, self) elif text_to_qcolor(value).isValid(): field = ColorLayout(QColor(value), self) @@ -423,6 +427,8 @@ class FormWidget(QWidget): field.setDate(value) else: field = QLineEdit(repr(value), self) + if tooltip: + field.setToolTip(tooltip) self.formlayout.addRow(label, field) self.widgets.append(field)
Add ToolTip for any widget (when label is 'label::tooltip')
PierreRaybaut_formlayout
train
py
82105bec900bf0d50085bd14826131fd8f2f729a
diff --git a/captainhook/checkers/pytest_checker.py b/captainhook/checkers/pytest_checker.py index <HASH>..<HASH> 100644 --- a/captainhook/checkers/pytest_checker.py +++ b/captainhook/checkers/pytest_checker.py @@ -18,7 +18,7 @@ def run(files, temp_folder, arg=None): except ImportError: return NO_PYTEST_MSG - cmd = "py.test -q" + cmd = "py.test -q ." output = bash(cmd).value() output = output.rstrip().splitlines() diff --git a/captainhook/checkers/pytest_coverage_checker.py b/captainhook/checkers/pytest_coverage_checker.py index <HASH>..<HASH> 100644 --- a/captainhook/checkers/pytest_coverage_checker.py +++ b/captainhook/checkers/pytest_coverage_checker.py @@ -29,7 +29,7 @@ def run(files, temp_folder, arg=None): # set default level of threshold arg = arg or SCORE - cmd = "py.test -q --cov" + cmd = "py.test -q --cov ." output = bash(cmd).value() output = output.rstrip().splitlines()
up cmd in pytest checkers
alexcouper_captainhook
train
py,py
f5be217f73459fbae3f9f07ad0511815067fa43c
diff --git a/iconics-view-library/src/main/java/com/mikepenz/iconics/view/IconicsCheckableTextView.java b/iconics-view-library/src/main/java/com/mikepenz/iconics/view/IconicsCheckableTextView.java index <HASH>..<HASH> 100644 --- a/iconics-view-library/src/main/java/com/mikepenz/iconics/view/IconicsCheckableTextView.java +++ b/iconics-view-library/src/main/java/com/mikepenz/iconics/view/IconicsCheckableTextView.java @@ -77,8 +77,6 @@ public class IconicsCheckableTextView extends IconicsTextView implements Checkab TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconicsCheckableTextView, defStyle, 0); - mAnimateChanges = a.getBoolean(R.styleable.IconicsAnimateChanges_iiv_animate_icon_changes, true); - IconicsViewsAttrsReader.readIconicsCheckableTextView(a, mCheckedIconsBundle); //recycle the typedArray
- Removed wrong getting from attributes
mikepenz_Android-Iconics
train
java
6455e691611a8834ea7dfd142741d56dcbd6663b
diff --git a/roadhouse/group.py b/roadhouse/group.py index <HASH>..<HASH> 100644 --- a/roadhouse/group.py +++ b/roadhouse/group.py @@ -54,12 +54,15 @@ class SecurityGroupsConfig(object): # make sure we're up to date self.reload_remote_groups() - self._apply_groups() + vpc_groups = self.existing_groups + self._apply_groups(vpc_groups) # reloads groups from AWS, the authority self.reload_remote_groups() + vpc_groups = self.existing_groups - groups = {k.name:k for k in self.existing_groups} + + groups = {k.name:k for k in vpc_groups} for x,y in self.config.items(): # process 1 security group at a time @@ -137,8 +140,8 @@ class SecurityGroupsConfig(object): - def _apply_groups(self): - existing_group_names = [x.name for x in self.existing_groups] + def _apply_groups(self, vpc_groups): + existing_group_names = [x.name for x in vpc_groups] for x,y in self.config.items(): options = y.get('options', {}) desc = options.get('description', " ")
trying to stop using self.existing_groups, since we need to filter by VPC
awsroadhouse_roadhouse
train
py
1bf4d36ffbb1d0245d49e39460b8c7d659d8d85e
diff --git a/pandora/transport.py b/pandora/transport.py index <HASH>..<HASH> 100644 --- a/pandora/transport.py +++ b/pandora/transport.py @@ -26,7 +26,7 @@ DEFAULT_API_HOST = "tuner.pandora.com/services/json/" logger = logging.getLogger(__name__) -def retries(max_tries, exceptions=(IOError,)): +def retries(max_tries, exceptions=(Exception,)): """Function decorator implementing retrying logic. exceptions: A tuple of exception classes; default (Exception,)
Change base exception for retries back to 'Exception' handle pyOpenSSL exceptions.
mcrute_pydora
train
py
23d7a715d7901ccf91c60d6fd7a57934d2d1cea8
diff --git a/lib/ImageResize.php b/lib/ImageResize.php index <HASH>..<HASH> 100644 --- a/lib/ImageResize.php +++ b/lib/ImageResize.php @@ -740,7 +740,7 @@ class ImageResize * * @param integer $expectedSize * @param integer $position - * @return float|integer + * @return integer */ protected function getCropPosition($expectedSize, $position = self::CROPCENTER) { @@ -758,7 +758,7 @@ class ImageResize $size = $expectedSize / 4; break; } - return $size; + return (int) $size; } /**
Updated return type to avoid implicit float to int conversion
gumlet_php-image-resize
train
php
504b050049e424d21383497c8c8d90a02bd55a49
diff --git a/lib/carthage_cache/version.rb b/lib/carthage_cache/version.rb index <HASH>..<HASH> 100644 --- a/lib/carthage_cache/version.rb +++ b/lib/carthage_cache/version.rb @@ -1,3 +1,3 @@ module CarthageCache - VERSION = "0.3.0" + VERSION = "0.3.1" end
Bumps version <I>.
Wolox_carthage_cache
train
rb
d868b7517c2259fbd2139a17e8fc183c5e74116a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -40,13 +40,26 @@ function TeamFortress2(steam) { // "extend" the default steam.gamesPlayed function so we can catch when TF2 starts up var gamesPlayed = steam.gamesPlayed; - steam.gamesPlayed = function(appids) { - if(typeof appids === 'number') { + steam.gamesPlayed = function(input) { + var appids = input; + + if(appids.games_played) { + appids = appids.games_played; + } + + if(!(appids instanceof Array)) { appids = [appids]; } - if(appids.indexOf(440) != -1) { - self._isInTF2 = true; + self._isInTF2 = false; + for(var i = 0; i < appids.length; i++) { + if(appids[i] == 440 || appids[i].game_id == 440) { + self._isInTF2 = true; + break; + } + } + + if(self._isInTF2) { if(!self.haveGCSession) { self._connect(); } @@ -56,7 +69,6 @@ function TeamFortress2(steam) { self._helloInterval = null; } - self._isInTF2 = false; self.haveGCSession = false; self._hadGCSession = false; }
Fixed support for node-steam <I> official SteamUser
DoctorMcKay_node-tf2
train
js
a63fa8b0f53db9a0b84c5805a43062d7f6687031
diff --git a/fluent_dashboard/appsettings.py b/fluent_dashboard/appsettings.py index <HASH>..<HASH> 100644 --- a/fluent_dashboard/appsettings.py +++ b/fluent_dashboard/appsettings.py @@ -121,6 +121,7 @@ FLUENT_DASHBOARD_APP_GROUPS = getattr(settings, 'FLUENT_DASHBOARD_APP_GROUPS', ( ], 'exclude': [ # Show in other sections: + 'fluent_comments.*', 'fluentcms_contactform.*', 'fluent_contents.plugins.sharedcontent.*', # Less relevant, not producing pages: @@ -145,6 +146,7 @@ FLUENT_DASHBOARD_APP_GROUPS = getattr(settings, 'FLUENT_DASHBOARD_APP_GROUPS', ( # User comments, responses, etc.. 'models': ( 'django.contrib.comments.*', + 'fluent_comments.*', 'fluentcms_contactform.*', 'threadedcomments.*', 'zinnia.*',
Fix showing fluent-comments in "Interactive" block by default
django-fluent_django-fluent-dashboard
train
py
bbf63126ea2569485c1c42cdcb91cf18c8b569d4
diff --git a/src/js/bokeh.js b/src/js/bokeh.js index <HASH>..<HASH> 100644 --- a/src/js/bokeh.js +++ b/src/js/bokeh.js @@ -67,14 +67,11 @@ //the get function, will resolve an instances defaults first //then check the parents actual val, and finally check class defaults. //display options cannot go into defaults - var HasParent = HasReference.extend({ initialize : function(attrs, options){ var self = this; if (!_.isNullOrUndefined(attrs['parent'])){ - self.parent_id = attrs['parent']['id']; - self.parent_type = attrs['parent']['type']; - self.parent = self.get_parent(); + self.parent = self.resolve_ref(self.get('parent')); } }, get_parent : function(){
HasParent now uses new resolve_ref function to resolve the parent
bokeh_bokeh
train
js
c91967063c1faff666b1e11ce02f0a36c75cb3bb
diff --git a/token.go b/token.go index <HASH>..<HASH> 100644 --- a/token.go +++ b/token.go @@ -7,6 +7,7 @@ package sqlparser import ( "bytes" "fmt" + "io" "strings" "github.com/xwb1989/sqlparser/dependency/sqltypes" @@ -17,7 +18,7 @@ const EOFCHAR = 0x100 // Tokenizer is the struct used to generate SQL // tokens for the parser. type Tokenizer struct { - InStream *strings.Reader + InStream io.ByteReader AllowComments bool ForceEOF bool lastChar uint16
Minor change to allow the Tokenizer to accept a io.ByteReader This makes it possible to use the Tokenizer with other types of Readers, not just strings.
xwb1989_sqlparser
train
go
fd1d7bb104f17caf24ce8dfb62886c0439f3ef43
diff --git a/tests/integration/modules/modulewithnometadatasupportTest.php b/tests/integration/modules/modulewithnometadatasupportTest.php index <HASH>..<HASH> 100644 --- a/tests/integration/modules/modulewithnometadatasupportTest.php +++ b/tests/integration/modules/modulewithnometadatasupportTest.php @@ -62,7 +62,7 @@ class Integration_Modules_ModuleWithNoMetadataSupportTest extends BaseModuleTest $this->assertSame( array(), $aGarbage ); } - public function testModuleMisMatchMetadata() + public function testModuleMissMatchMetadata() { // modules to be activated during test preparation $aInstallModules = array(
ESDEV-<I> Change oxModulelist::getDeletedExtension to use metadata validator Changed integration test name
OXID-eSales_oxideshop_ce
train
php
cb730bf3984c8dc08c1290e5004d71c31bf2ef58
diff --git a/umis/umis.py b/umis/umis.py index <HASH>..<HASH> 100644 --- a/umis/umis.py +++ b/umis/umis.py @@ -177,7 +177,11 @@ def tagcount(sam, out, genemap, output_evidence_table, positional, minevidence, gene_map = None if genemap: with open(genemap) as fh: - gene_map = dict(p.strip().split() for p in fh) + try: + gene_map = dict(p.strip().split() for p in fh) + except ValueError: + logger.error('Incorrectly formatted gene_map, need to be tsv.') + sys.exit() if positional: tuple_template = '{0},{1},{2},{3}'
Checking that loading gene_map works, fixes #<I>
vals_umis
train
py
df310310b7e1a7d84b1abf7f1711575588db54da
diff --git a/asciimathml.py b/asciimathml.py index <HASH>..<HASH> 100644 --- a/asciimathml.py +++ b/asciimathml.py @@ -11,7 +11,7 @@ Element_ = Element def El(tag, *args, **kwargs): text = kwargs.pop('text', '') - element = Element_(tag, attrib=kwargs.get('attrib', {})) + element = Element_(tag, **kwargs.get('attrib', {})) element.text = text for child in args: @@ -121,7 +121,7 @@ def remove_private(n): return n def copy(n): - m = El(tag=n.tag, attrib=n.attrib, text=n.text) + m = El(tag=n.tag, text=n.text, attrib=dict(n.items())) for c in n.getchildren(): m.append(copy(c))
fixed creation and copying of node attribs
favalex_python-asciimathml
train
py
ef003d1d1121736069cb408a26bf1f362359a762
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,7 @@ function CLIProgress(text, settings) { if (text.indexOf('[[BAR') > -1) { var maxBarWidth = windowSize.width - stringLength(text); if (!progress.settings.max) progress.settings.max = progress.settings.current > 0 ? progress.settings.current : 0; - var barCompleteWidth = Math.round(Math.min(progress.settings.current, progress.settings.max) / (progress.settings.max * maxBarWidth)); + var barCompleteWidth = Math.round(progress.settings.current / progress.settings.max * maxBarWidth); var completeBits = Array(barCompleteWidth).join(progress.settings.completeChar); var incompleteBits = maxBarWidth - barCompleteWidth > 0 ? Array(maxBarWidth - barCompleteWidth).join(progress.settings.incompleteChar) : '';
BUGFIX: Yet more bar maths fixes
hash-bang_yapb
train
js
54a66cb0ce883da9da8221e5a08a9637ec97afbd
diff --git a/ipyrad/assemble/consens_se.py b/ipyrad/assemble/consens_se.py index <HASH>..<HASH> 100644 --- a/ipyrad/assemble/consens_se.py +++ b/ipyrad/assemble/consens_se.py @@ -257,7 +257,7 @@ class Step5: start = time.time() jobs = {sample.name: [] for sample in self.samples} printstr = ("consens calling ", "s5") - self.data._progressbar(0, 0, start, printstr) + self.data._progressbar(0, 1, start, printstr) # submit jobs for sample in self.samples: @@ -278,7 +278,7 @@ class Step5: while 1: ready = [i.ready() for i in allsyncs] self.data._progressbar(len(ready), sum(ready), start, printstr) - time.sleep(0.1) + time.sleep(0.5) if len(ready) == sum(ready): self.data._print("") break
fix for progress bar in s5
dereneaton_ipyrad
train
py
8c468d56556a4010e943370fb3c7006deec8838a
diff --git a/main/unpack.js b/main/unpack.js index <HASH>..<HASH> 100755 --- a/main/unpack.js +++ b/main/unpack.js @@ -354,9 +354,11 @@ unpack = function(args,v){ Object.defineProperty(ReadBuffer.prototype,'unpack',{value: function(constructor,callback){ - var args; + var args,flags; if(!callback){ + flags = brFlags.get(this); + if(flags[flags.length - 1] === true) throw 'To use generic chained unpack calls you must call ReadBuffer.start first'; args = []; callback = constructor; }else args = [constructor]; @@ -364,6 +366,11 @@ Object.defineProperty(ReadBuffer.prototype,'unpack',{value: function(constructor return resolve(com.resFunction,[callback,this.goTo('start',unpack),args,this],com.resCallback); }}); +Object.defineProperty(ReadBuffer.prototype,'start',{value: function(data){ + if(brFlags.get(this).pop()) brPool.get(this).push(data); + brFlags.get(this).push(false); +}}); + Object.defineProperty(ReadBuffer.prototype,'end',{value: function(data){ if(brFlags.get(this).pop()) brPool.get(this).push(data); com.resolvers.of(this).get().pop().resolve(data);
Hotfix: circular references now work properly
manvalls_ebjs
train
js
c00e7aa919624e4f26a6bc0a924892a87dbd91c0
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/inspector.rb +++ b/actionpack/lib/action_dispatch/routing/inspector.rb @@ -51,7 +51,7 @@ module ActionDispatch end def internal? - controller =~ %r{^rails/info|^rails/welcome} || path =~ %r{^#{Rails.application.config.assets.prefix}} + controller =~ %r{\Arails/(info|welcome)} || path =~ %r{\A#{Rails.application.config.assets.prefix}} end def engine?
Match the controller and path names defensively. Use '\A' instead of '^', and make the alteration shorter.
rails_rails
train
rb
22d1d6c1cf82a74c1da55f2ea00f7a49e662290b
diff --git a/iacli/ia.py b/iacli/ia.py index <HASH>..<HASH> 100755 --- a/iacli/ia.py +++ b/iacli/ia.py @@ -2,11 +2,12 @@ """A command line interface for Archive.org. usage: - ia [--version] [--help] <command> [<args>...] + ia [--version|--help|--debug] <command> [<args>...] options: --version -h, --help + -d, --debug [default: True] commands: configure Configure `ia`. @@ -20,6 +21,9 @@ commands: See 'ia <command> --help' for more information on a specific command. """ +from sys import exit +from subprocess import call + from docopt import docopt from internetarchive import __version__ @@ -58,7 +62,15 @@ def main(): # command line. module = 'iacli.ia_{0}'.format(cmd) globals()['ia_module'] = __import__(module, fromlist=['iacli']) - ia_module.main(argv) + + # Exit with ``ia <command> --help`` if anything goes wrong. + try: + ia_module.main(argv) + except Exception, exception: + if not args.get('--debug'): + call(['ia', cmd, '--help']) + exit(1) + raise exception if __name__ == '__main__':
Exit with `ia <command> --help` if anything goes wrong. Added `--debug` option as well, to print any tracebacks/exceptions to terminal.
jjjake_internetarchive
train
py
f5bb455d84197f1cc3eb04ab50eba915167746ac
diff --git a/template/cordova/lib/package.js b/template/cordova/lib/package.js index <HASH>..<HASH> 100644 --- a/template/cordova/lib/package.js +++ b/template/cordova/lib/package.js @@ -67,7 +67,7 @@ module.exports.getPackageFileInfo = function (packageFile) { var pkgName = path.basename(packageFile); // CordovaApp.Windows_0.0.1.0_anycpu_debug.appx // CordovaApp.Phone_0.0.1.0_x86_debug.appxbundle - var props = /.*\.(Phone|Windows|Windows80)_((?:\d\.)*\d*)_(AnyCPU|x64|x86|ARM)(?:_(Debug))?.(appx|appxbundle)$/i.exec(pkgName); + var props = /.*\.(Phone|Windows|Windows80)_((?:\d*\.)*\d*)_(AnyCPU|x64|x86|ARM)(?:_(Debug))?.(appx|appxbundle)$/i.exec(pkgName); if (props) { return {type : props[1].toLowerCase(), arch : props[3].toLowerCase(),
Fixed regex used in getPackageFileInfo(). The previous regex update fixed only versions with multiple digits in last part of version number.
apache_cordova-windows
train
js
d02d3c54868a7fc162d6ba8cd9cdc7a4ec61cfc3
diff --git a/lib/macho/macho_file.rb b/lib/macho/macho_file.rb index <HASH>..<HASH> 100644 --- a/lib/macho/macho_file.rb +++ b/lib/macho/macho_file.rb @@ -215,7 +215,11 @@ module MachO # All shared libraries linked to the Mach-O. # @return [Array<String>] an array of all shared libraries def linked_dylibs - dylib_load_commands.map(&:name).map(&:to_s) + # Some linkers produce multiple `LC_LOAD_DYLIB` load commands for the same + # library, but at this point we're really only interested in a list of + # unique libraries this Mach-O file links to, thus: `uniq`. (This is also + # for consistency with `FatFile` that merges this list across all archs.) + dylib_load_commands.map(&:name).map(&:to_s).uniq end # Changes the shared library `old_name` to `new_name`
MachOFile: de-duplicate list of linked dylibs
Homebrew_ruby-macho
train
rb
b63df642117d5782d22d805c1508f01bb0d7931a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ setup( # For a discussion on single-sourcing the version across setup.py and the # project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.0.0', # Required + version='1.1.0', # Required # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field:
Updating version and deploying to Pypi
MisterY_price-database
train
py
6e86d9f88e0071d838deb1412669af8a5518461c
diff --git a/lib/compiler/index.js b/lib/compiler/index.js index <HASH>..<HASH> 100644 --- a/lib/compiler/index.js +++ b/lib/compiler/index.js @@ -44,8 +44,7 @@ var stages = { }, eval: function(code, options) { - var program = new Program(code); - program.scheduler = options.scheduler; + var program = new Program(code, options); program._eval(); program.validate(); diff --git a/lib/program.js b/lib/program.js index <HASH>..<HASH> 100644 --- a/lib/program.js +++ b/lib/program.js @@ -13,10 +13,11 @@ var view = require('./runtime/procs/view'); var errors = require('./errors'); class Program { - constructor(code) { + constructor(code, options) { this.env = {}; this.visitGen = 0; this.events = new EventEmitter(); + this.scheduler = options.scheduler; this.code = code; } set_env(env) {
program.js - assign scheduler during program object construction
juttle_juttle
train
js,js
c03db77e71ec8304ba5245c98bda9a89c64a1593
diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py index <HASH>..<HASH> 100644 --- a/glue/ligolw/lsctables.py +++ b/glue/ligolw/lsctables.py @@ -158,7 +158,7 @@ class SnglBurstTable(metaio.Table): def set_start(self, gps): self.start_time, self.start_time_ns = gps.seconds, gps.nanoseconds - def peak(self): + def get_peak(self): return lal.LIGOTimeGPS(self.peak_time, self.peak_time_ns) def set_peak(self, gps):
Fix peak time method name in SnglBurst.
gwastro_pycbc-glue
train
py
6ff00cf6f0cbcf0e3845e35bd49549c20d166958
diff --git a/src/elements.js b/src/elements.js index <HASH>..<HASH> 100644 --- a/src/elements.js +++ b/src/elements.js @@ -930,6 +930,18 @@ export class CanvasElement extends Element { } } +export class MediaElement extends Element { + + /** @returns {Promise} */ + play() { + return this._el.play() || Promise.resolve(); + } + + pause() { + this._el.pause(); + } +} + // ----------------------------------------------------------------------------- // Element Selectors and Constructors @@ -959,6 +971,7 @@ export function $(query, context=null) { if (svgTags.indexOf(tagName) >= 0) return new SVGElement(el); if (formTags.indexOf(tagName) >= 0) return new FormElement(el); if (tagName === 'canvas') return new CanvasElement(el); + if (isOneOf(tagName, 'video', 'audio')) return new MediaElement(el); return new Element(el); }
New MediaElement class with play and pause methods
mathigon_boost.js
train
js
aec4e73c991e234626f7cbe47c3428e4bb11f896
diff --git a/src/svg.js b/src/svg.js index <HASH>..<HASH> 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2163,11 +2163,12 @@ function arrayFirstValue(arr) { return el; }; var eldata = {}; + // SIERRA Element.data()/Element.removeData(): Do these correspond to _data- attributes, and if so, can you ordinarily use the the dataset API within SVG? /*\ * Element.data [ method ] ** - * Adds or retrieves given value asociated with given key. + * Adds or retrieves given value associated with given key. ** * See also @Element.removeData - key (string) key to store data
EDIT and COMMENT Element.data
adobe-webplatform_Snap.svg
train
js
7dc0ff1f32231f71b0a81f0582bad698b4187df3
diff --git a/lib/model/Model.js b/lib/model/Model.js index <HASH>..<HASH> 100644 --- a/lib/model/Model.js +++ b/lib/model/Model.js @@ -411,9 +411,11 @@ class Model { // Memoize relations but only for this class. The hasOwnProperty check // will fail for subclasses and the value gets recreated. if (!this.hasOwnProperty('$$relations')) { - const relationMappings = typeof this.relationMappings === 'function' - ? this.relationMappings() - : this.relationMappings; + let relationMappings = this.relationMappings; + + if (typeof relationMappings === 'function') { + relationMappings = relationMappings.call(this); + } const relations = Object.keys(relationMappings || {}).reduce((relations, relationName) => { const mapping = relationMappings[relationName];
prevent relationMappings from being called twice
Vincit_objection.js
train
js
16d7e861e2c6630a0223d0ee57bda9eac2164d76
diff --git a/lib/webmock/http_lib_adapters/httpclient_adapter.rb b/lib/webmock/http_lib_adapters/httpclient_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/webmock/http_lib_adapters/httpclient_adapter.rb +++ b/lib/webmock/http_lib_adapters/httpclient_adapter.rb @@ -209,13 +209,13 @@ if defined?(::HTTPClient) end def remove_authorization_header headers - headers.reject! do |k, v| - next unless k =~ /[Aa]uthorization/ - if v.is_a? Array - v.reject! { |v| v =~ /^Basic / } - v.length == 0 - elsif v.is_a? String - v =~ /^Basic / + headers.reject! do |name, value| + next unless name =~ /[Aa]uthorization/ + if value.is_a? Array + value.reject! { |v| v =~ /^Basic / } + value.length == 0 + elsif value.is_a? String + value =~ /^Basic / end end end
Don't shadow outer variable in reject! block. This emits a warning when running a test suite with warnings enabled. Renaming the outer variables to name and value make it slightly more readable and removes the warning.
bblimke_webmock
train
rb
43f46945a35a2281894c602d6557686e2536db16
diff --git a/lib/https/ca.js b/lib/https/ca.js index <HASH>..<HASH> 100644 --- a/lib/https/ca.js +++ b/lib/https/ca.js @@ -137,9 +137,23 @@ function getCacheCert(hostname) { return customPairs[hostname] || cachePairs.get(hostname) || certsCache.get(hostname); } +var curIndex = 0; +function getIndex() { + ++curIndex; + if (curIndex < 10) { + return '0' + curIndex; + } + if (curIndex > 99) { + curIndex = 0; + return '00'; + } + return curIndex; +} + + function createSelfCert(hostname) { var serialNumber = crypto.createHash('sha1') - .update(hostname + RANDOM_SERIAL, 'binary').digest('hex') + workerIndex; + .update(hostname + RANDOM_SERIAL, 'binary').digest('hex') + getIndex() + workerIndex; var cert = createCert(pki.setRsaPublicKey(ROOT_KEY.n, ROOT_KEY.e), serialNumber, true); cert.setSubject([{ name: 'commonName',
refactor: refine serialNumber
avwo_whistle
train
js
a2b6b968af185c43acf11851c2069daa8069a5f0
diff --git a/src/Dexie.js b/src/Dexie.js index <HASH>..<HASH> 100644 --- a/src/Dexie.js +++ b/src/Dexie.js @@ -793,7 +793,7 @@ export default function Dexie(dbName, options) { } // Provide arguments to the scope function (for backward compatibility) - var tableArgs = storeNames.map(function (name) { return trans.tables[name]; }); + var tableArgs = storeNames.map(function (name) { return allTables[name]; }); tableArgs.push(trans); var returnValue; @@ -3058,7 +3058,7 @@ props(Dexie, { override: override, // Export our Events() function - can be handy as a toolkit Events: Events, - events: Events, // Backward compatible lowercase version. Deprecate. + events: { get: Debug.deprecated(()=>Events) }, // Backward compatible lowercase version. // Utilities getByKeyPath: getByKeyPath, setByKeyPath: setByKeyPath,
Removed use of deprecated Transaction method
dfahlander_Dexie.js
train
js
f0029d8dba8e76862e743226dda9534054eff1d3
diff --git a/src/Services/DependencyInjection/ContainerFactory.php b/src/Services/DependencyInjection/ContainerFactory.php index <HASH>..<HASH> 100644 --- a/src/Services/DependencyInjection/ContainerFactory.php +++ b/src/Services/DependencyInjection/ContainerFactory.php @@ -2,6 +2,7 @@ namespace Graphael\Services\DependencyInjection; +use Graphael\Security\Authorization\UsernameVoter; use Graphael\Security\JwtFactory; use Graphael\Security\Provider\JwtAuthProvider; use Graphael\Security\SecurityFacade; @@ -151,6 +152,7 @@ class ContainerFactory $container->setAlias(AuthorizationCheckerInterface::class, AuthorizationChecker::class); $container->register(RoleVoter::class, RoleVoter::class); + $container->register(UsernameVoter::class, UsernameVoter::class); } private static function getParameters($prefix)
CARD-<I>: Username voter to DI
linkorb_graphael
train
php
f38bf69fbfe3a718ca9e79d37d763160bd6ba81e
diff --git a/test/all.js b/test/all.js index <HASH>..<HASH> 100644 --- a/test/all.js +++ b/test/all.js @@ -212,6 +212,7 @@ function delete_message(done) { }) }, +{'timeout_coefficient': 2}, function send_message_api(done) { cqs.CreateQueue({name:'api_tests', DefaultVisibilityTimeout:60}, function(er, api_tests) { if(er) throw er;
Slightly more time to test the full API
jhs_cqs
train
js
b8147664c77d4c9fe8bec356698aa36051a9660a
diff --git a/lib/dalli/server.rb b/lib/dalli/server.rb index <HASH>..<HASH> 100644 --- a/lib/dalli/server.rb +++ b/lib/dalli/server.rb @@ -241,7 +241,7 @@ module Dalli def reset_stats req = [REQUEST, OPCODES[:stat], 'reset'.bytesize, 0, 0, 0, 'reset'.bytesize, 0, 0, 'reset'].pack(FORMAT[:stat]) write(req) - keyvalue_response + generic_response end def cas(key) diff --git a/test/test_dalli.rb b/test/test_dalli.rb index <HASH>..<HASH> 100644 --- a/test/test_dalli.rb +++ b/test/test_dalli.rb @@ -103,6 +103,31 @@ describe 'Dalli' do end end + should "support stats" do + memcached do |dc| + stats = dc.stats + # make sure that get_hits would not equal 0 + dc.get(:a) + + assert stats.is_a?(Hash) + servers = stats.keys + + servers.each do |s| + assert_operator 0, :<, stats[s]["get_hits"].to_i + end + + # reset_stats test + dc.reset_stats + stats = dc.stats + servers = stats.keys + + # check if reset was performed + servers.each do |s| + assert_equal 0, dc.stats[s]["get_hits"].to_i + end + end + end + should "support the fetch operation" do memcached do |dc| dc.flush
Tests for stats & reset stats [#<I>]
petergoldstein_dalli
train
rb,rb
2e255335d2cd0c598f238b5abf595f9ad8e7d907
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 @@ -11,14 +11,27 @@ def has_file_allowed_extension(filename, extensions): Args: filename (string): path to a file + extensions (iterable of strings): extensions to consider (lowercase) Returns: - bool: True if the filename ends with a known image extension + bool: True if the filename ends with one of given extensions """ filename_lower = filename.lower() return any(filename_lower.endswith(ext) for ext in extensions) +def is_image_file(filename): + """Checks if a file is an allowed image extension. + + Args: + filename (string): path to a file + + Returns: + bool: True if the filename ends with a known image extension + """ + return has_file_allowed_extension(filename, IMG_EXTENSIONS) + + def find_classes(dir): classes = [d for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d))] classes.sort()
Fix documentation and add is_image_file (#<I>)
pytorch_vision
train
py
82b1419db3c38e6e6ff309d2d0eb4c7f8891567f
diff --git a/lib/heroku/command/logs.rb b/lib/heroku/command/logs.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/command/logs.rb +++ b/lib/heroku/command/logs.rb @@ -32,6 +32,7 @@ module Heroku::Command next unless output = format_with_colors(chk) puts output end + rescue Errno::EPIPE end # logs:cron
rescue broken pipe during log output allows interoperability with other tools, ie `heroku logs | head -n 1` closes #<I>
heroku_legacy-cli
train
rb
5c89db8f105765e2ae10d49222f108fdacbdf525
diff --git a/payflowpro/tests/client.py b/payflowpro/tests/client.py index <HASH>..<HASH> 100644 --- a/payflowpro/tests/client.py +++ b/payflowpro/tests/client.py @@ -67,6 +67,9 @@ r""" >>> # Here is another example with a shipping address, new credit card and >>> # without the optional charge. +>>> new_acct = 5105105105105100 +>>> new_expdate = 0215 +>>> new_cvc = 456 >>> responses, unconsumed_data = client.profile_modify( ... profile_id='RT0000000002', extras=[ ... Profile(profilename="Joe Bloggs", start=052413,), @@ -110,4 +113,4 @@ r""" if __name__=="__main__": import doctest doctest.testmod() - \ No newline at end of file +
Assigned values to example variables as reported in issue #<I> Thanks for reporting, @michaelhelmick!
bkeating_python-payflowpro
train
py
41281029d264dc493fa5b4e04bdc79f7c3c446d3
diff --git a/src/Jobs/MakeSearchable.php b/src/Jobs/MakeSearchable.php index <HASH>..<HASH> 100644 --- a/src/Jobs/MakeSearchable.php +++ b/src/Jobs/MakeSearchable.php @@ -35,7 +35,7 @@ class MakeSearchable implements ShouldQueue */ public function handle() { - if (empty($this->models)) { + if (!$this->models->count()) { return; }
$this->models is a collection : Should check via count()
laravel_scout
train
php
09cec18f26b169c606f06d995e0a8fc9416731ff
diff --git a/lib/pkgcloud/openstack/orchestration/client/stacks.js b/lib/pkgcloud/openstack/orchestration/client/stacks.js index <HASH>..<HASH> 100644 --- a/lib/pkgcloud/openstack/orchestration/client/stacks.js +++ b/lib/pkgcloud/openstack/orchestration/client/stacks.js @@ -103,7 +103,8 @@ exports.createStack = function (details, callback) { path: details.preview ? urlJoin(_urlPrefix, 'preview'): _urlPrefix, body: { stack_name: details.name, - environment: details.environment, + // environment is required from the API, but may be empty + environment: details.environment ? JSON.stringify(details.environment) : JSON.stringify({}), timeout_mins: typeof details.timeout === 'number' ? details.timeout : parseInt(details.timeout) } }; @@ -130,6 +131,12 @@ exports.createStack = function (details, callback) { if (typeof details.disableRollback === 'boolean') { createOptions.body['disable_rollback'] = details.disableRollback; } + + // if we're adopting a stack, copy the parameters (if any) from the stackData to + // the request payload + if (details.stackData.parameters) { + createOptions.body.parameters = details.stackData.parameters; + } } return self._request(createOptions, function (err, body) {
Adding some clarifications for createStack
pkgcloud_pkgcloud
train
js
7390245d5a262c743b6e282cad752fed7b3a885a
diff --git a/src/AbstractQueryBuilder.php b/src/AbstractQueryBuilder.php index <HASH>..<HASH> 100644 --- a/src/AbstractQueryBuilder.php +++ b/src/AbstractQueryBuilder.php @@ -244,7 +244,7 @@ abstract class AbstractQueryBuilder extends \yii\base\BaseObject implements Quer list($column, $values) = $operands; - if (count($column) > 1) { + if ($column instanceof \Countable && count($column) > 1) { return $this->buildCompositeInCondition($operator, $column, $values); } elseif (is_array($column)) { $column = reset($column);
Fixed AbstractQueryBuilder::buildInCondition(), added check if $column is \Countable otherwise it will Exception
hiqdev_yii2-hiart
train
php
d8cb1db05bcb78b69a557d92fb1c0b192039c508
diff --git a/sendgrid_backend/mail.py b/sendgrid_backend/mail.py index <HASH>..<HASH> 100644 --- a/sendgrid_backend/mail.py +++ b/sendgrid_backend/mail.py @@ -1,5 +1,6 @@ import base64 from email.mime.base import MIMEBase +import email.utils import mimetypes import uuid @@ -40,21 +41,27 @@ class SendgridBackend(BaseEmailBackend): raise return success + def _parse_email_address(self, address): + name, addr = email.utils.parseaddr(address) + if not name: + name = None + return addr, name + def _build_sg_mail(self, msg): mail = Mail() - mail.from_email = Email(msg.from_email) + mail.from_email = Email(*self._parse_email_address(msg.from_email)) mail.subject = msg.subject personalization = Personalization() for addr in msg.to: - personalization.add_to(Email(addr)) + personalization.add_to(Email(*self._parse_email_address(addr))) for addr in msg.cc: - personalization.add_cc(Email(addr)) + personalization.add_cc(Email(*self._parse_email_address(addr))) for addr in msg.bcc: - personalization.add_bcc(Email(addr)) + personalization.add_bcc(Email(*self._parse_email_address(addr))) personalization.subject = msg.subject
Adds rfc<I> support
sklarsa_django-sendgrid-v5
train
py
88382b9a7ad822d9a0bb6275c2bdb67c5b0ef5cd
diff --git a/app/controllers/shipit/merge_status_controller.rb b/app/controllers/shipit/merge_status_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/shipit/merge_status_controller.rb +++ b/app/controllers/shipit/merge_status_controller.rb @@ -17,6 +17,8 @@ module Shipit else render html: '' end + rescue ArgumentError + render html: '' end def enqueue
Render an empty response if the referer is not a PR
Shopify_shipit-engine
train
rb
9a1d07e250048e4f32f5b0337dea41e08ca1aee8
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/handler/failover/DefaultFailoverExecutor.java b/moco-core/src/main/java/com/github/dreamhead/moco/handler/failover/DefaultFailoverExecutor.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/handler/failover/DefaultFailoverExecutor.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/handler/failover/DefaultFailoverExecutor.java @@ -18,7 +18,6 @@ import java.util.Optional; import java.util.function.Predicate; import java.util.stream.Collectors; -import static com.github.dreamhead.moco.util.Jsons.writeToFile; import static com.google.common.collect.ImmutableList.of; public final class DefaultFailoverExecutor implements FailoverExecutor {
removed unused import in default failover executor
dreamhead_moco
train
java
40b186325d5f1462771ef0a683a09cda256314ea
diff --git a/lib/producer.js b/lib/producer.js index <HASH>..<HASH> 100644 --- a/lib/producer.js +++ b/lib/producer.js @@ -23,9 +23,9 @@ var connect = function(_amqpUrl) { } if (connecting) { - var deferred = Promise.defer(); + var deferred = new Promise(); reqQueue.push(deferred); - return deferred.promise; + return deferred; } connecting = true; @@ -66,7 +66,7 @@ var createChannel = function() { amqpIntervalId = clearInterval(amqpIntervalId); while(reqQueue.length > 0) { - reqQueue.shift().resolve(amqpChannel); + reqQueue.shift()(); } connected = true; @@ -144,8 +144,8 @@ var produce = function(_queue, _msg, _options) { Logger.info('[AMQP] Producer send msg: ' + _msg + ' to queue: ' + _queue); if (!connected) { - return connect().then(function(channel) { - return channel.sendToQueue(_queue, _msg, _options) + return connect().then(function() { + return amqpChannel.sendToQueue(_queue, _msg, _options); }); } else { return Promise.resolve(amqpChannel.sendToQueue(_queue, new Buffer(_msg), _options));
Dont use deprecated defer
dial-once_node-bunnymq
train
js
e09149aaeb5d58b1fabde3a932578479f7ba86fe
diff --git a/tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php b/tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php index <HASH>..<HASH> 100644 --- a/tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php +++ b/tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php @@ -7,7 +7,6 @@ use Orchestra\Testbench\TestCase; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Schema; -use Illuminate\Auth\EloquentUserProvider; use Illuminate\Foundation\Auth\User as Authenticatable; class InteractsWithAuthenticationTest extends TestCase
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
adf8c8f9da684d8e575815d1b2684bc14af9965f
diff --git a/buildbot/slave/commands.py b/buildbot/slave/commands.py index <HASH>..<HASH> 100644 --- a/buildbot/slave/commands.py +++ b/buildbot/slave/commands.py @@ -1625,8 +1625,11 @@ class SourceBase(Command): assert isinstance(rc, int) if rc == 0: return defer.succeed(0) - # Attempt a recursive chmod and re-try the rm -rf after. - command = ["chmod", "-R", "u+rwx", os.path.join(self.builder.basedir, dirname)] + # Attempt a recursive chmod and re-try the rm -rf after. The '-f' here + # works around a broken 'chmod -R' on FreeBSD (it tries to recurse into a + # directory for which it doesn't have permission, before changing that + # permission) + command = ["chmod", "-Rf", "u+rwx", os.path.join(self.builder.basedir, dirname)] c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=0, timeout=self.timeout, maxTime=self.maxTime, usePTY=False)
use chmod -Rf FreeBSD's chmod fails on directories for which it does not have rwx permissions. The -f allows chmod to modify permissions on such directories (which makes buildbot's tests pass), but it does not then recurse into the directory.
buildbot_buildbot
train
py
498d6299581bead0f582431b8133d8b5f8760618
diff --git a/hugolib/site_sections.go b/hugolib/site_sections.go index <HASH>..<HASH> 100644 --- a/hugolib/site_sections.go +++ b/hugolib/site_sections.go @@ -152,6 +152,8 @@ func unwrapPage(in interface{}) (*Page, error) { return v.Page, nil case *PageWithoutContent: return v.Page, nil + case nil: + return nil, nil default: return nil, fmt.Errorf("%T not supported", in) } diff --git a/hugolib/site_sections_test.go b/hugolib/site_sections_test.go index <HASH>..<HASH> 100644 --- a/hugolib/site_sections_test.go +++ b/hugolib/site_sections_test.go @@ -166,6 +166,11 @@ PAG|{{ .Title }}|{{ $sect.InSection . }} assert.Equal("empty3.md", b.Pages[0].File.LogicalName()) }}, + {"empty3", func(p *Page) { + xxx := p.s.getPage(KindPage, "empty3", "nil") + assert.Nil(xxx) + assert.Equal(xxx.Eq(nil), true) + }}, {"top", func(p *Page) { assert.Equal("Tops", p.title) assert.Len(p.Pages, 2)
hugolib: Allow nil to be unwrapped as *Page Previously, calls to *Page.Eq(nil) would always return false because the unwrapPage func didn't support the nil case. Add support for unwrapping nil to a *Page. Fixes #<I>
gohugoio_hugo
train
go,go
2795e242ced32e6467375235fae656759af495a6
diff --git a/src/projexui/xtimer.py b/src/projexui/xtimer.py index <HASH>..<HASH> 100644 --- a/src/projexui/xtimer.py +++ b/src/projexui/xtimer.py @@ -145,19 +145,6 @@ class XTimer(QtCore.QObject): with QtCore.QReadLocker(self.__lock): return self.__singleShot - def moveToThread(self, thread): - """ - Moves this timer object to its own thread. If the timer is already - running, then we need to stop it before it is moved. - - :param thread | <QtCore.QThread> - """ - if self.__timer: - self.stop() - raise RuntimeError('QTimer exists on another thread.') - - super(XTimer, self).moveToThread(thread) - def setInterval(self, msecs): """ Sets the interval in milliseconds for this timer.
removed the overloaded moveToThread for the XTimer
bitesofcode_projexui
train
py
02cb150a6d89acf84200879c3cbc83217584eec7
diff --git a/sdk/python/setup.py b/sdk/python/setup.py index <HASH>..<HASH> 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -65,12 +65,31 @@ def version(default): version = default + ".dev1" return version + +if os.name == 'nt': + conf_dir = "C:\\Program Files (x86)\\Intel\\sawtooth\\conf" + data_dir = "C:\\Program Files (x86)\\Intel\\sawtooth\\data" + log_dir = "C:\\Program Files (x86)\\Intel\\sawtooth\\logs" +else: + conf_dir = "/etc/sawtooth" + data_dir = "/var/lib/sawtooth" + log_dir = "/var/log/sawtooth" + +data_files = [ + (conf_dir, []), + (os.path.join(conf_dir, "keys"), []), + (data_dir, []), + (log_dir, []), +] + + setup(name='sawtooth-sdk', version=version('0.8.1'), description='Sawtooth Lake Python SDK', author='Intel Corporation', url='https://github.com/hyperledger/sawtooth-core', packages=find_packages(), + data_files=data_files, install_requires=[ "sawtooth-signing", "protobuf",
Create directories when installing python sdk
hyperledger_sawtooth-core
train
py
3292833e48c8431e50ec6e1f44719f73af7e95e8
diff --git a/broker/adapter/natsstream/adapter.go b/broker/adapter/natsstream/adapter.go index <HASH>..<HASH> 100644 --- a/broker/adapter/natsstream/adapter.go +++ b/broker/adapter/natsstream/adapter.go @@ -61,7 +61,7 @@ func Create(name string, choria *choria.Framework) (*NatStream, error) { adapter := &NatStream{ log: log.WithFields(log.Fields{"component": "nats_stream_adapter", "name": name}), - work: make(chan adaptable, 1000), + work: make(chan adaptable, 50000), } var err error
(#<I>) increate the nats stream adapter work channel
choria-io_go-choria
train
go
8db7975e20fe790d747ea753f50d966afa3da91c
diff --git a/impl/src/main/java/org/jboss/arquillian/container/weld/embedded/Utils.java b/impl/src/main/java/org/jboss/arquillian/container/weld/embedded/Utils.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/jboss/arquillian/container/weld/embedded/Utils.java +++ b/impl/src/main/java/org/jboss/arquillian/container/weld/embedded/Utils.java @@ -182,14 +182,18 @@ final class Utils { beanClasses.add(loadedClass); } else { + boolean isExcluded = false; for (Metadata<Filter> filterMetadata : beansXml.getScanning().getExcludes()) { FilterPredicate excludePredicate = new FilterPredicate(filterMetadata, resourceLoader); - if (!excludePredicate.test(findClassName(classEntry.getKey()))) { - Class<?> loadedClass = classLoader.loadClass( - findClassName(classEntry.getKey())); - beanClasses.add(loadedClass); + if (excludePredicate.test(findClassName(classEntry.getKey()))) { + isExcluded = true; + break; } } + if (!isExcluded) { + Class<?> loadedClass = classLoader.loadClass(findClassName(classEntry.getKey())); + beanClasses.add(loadedClass); + } } } return beanClasses;
ARQ-<I>: Excluded elements in beans.xml by the Weld Arquillian plugin is an all check instead of an any
arquillian_arquillian-container-weld
train
java
62821cafb52426031bd992d16fb7d11fd3f0881e
diff --git a/spec/guard/notifiers/file_notifier_spec.rb b/spec/guard/notifiers/file_notifier_spec.rb index <HASH>..<HASH> 100644 --- a/spec/guard/notifiers/file_notifier_spec.rb +++ b/spec/guard/notifiers/file_notifier_spec.rb @@ -4,8 +4,12 @@ require 'spec_helper' describe Guard::Notifier::FileNotifier do describe '.available?' do - it 'is always true' do - subject.should be_available + it 'is true if there is a file in options' do + subject.should be_available(true, :path => '.guard_result') + end + + it 'is false if there is no path in options' do + subject.should_not be_available end end @@ -26,6 +30,7 @@ describe Guard::Notifier::FileNotifier do # specified. So, we just don't do anything in .notify if there's no path. it 'does not write to a file if no path is specified' do subject.should_not_receive(:write) + ::Guard::UI.should_receive(:error).with ":file notifier requires a :path option" subject.notify('success', 'any title', 'any message', 'any image', { }) end
FileNotifier uses new available? options to determine if a path was given
guard_notiffany
train
rb
6c6f277261f4dbdcff73fec2f2d7548597255c7a
diff --git a/chef/lib/chef/provider/cookbook_file.rb b/chef/lib/chef/provider/cookbook_file.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/cookbook_file.rb +++ b/chef/lib/chef/provider/cookbook_file.rb @@ -44,9 +44,6 @@ class Chef Chef::Log.debug("#{@new_resource} staging #{file_cache_location} to #{tempfile.path}") tempfile.close FileUtils.cp(file_cache_location, tempfile.path) - # Since the @new_resource.path file will not be updated - # at the time of converge, we must use the tempfile - update_new_file_state(tempfile.path) end Chef::Log.info("#{@new_resource} created file #{@new_resource.path}") end
CHEF-<I>, fixed bug for permissions in cookbook provider.
chef_chef
train
rb
6eb6158a1c1efb59b49ac786812a5a350b1db8ea
diff --git a/lib/inherited_resources.rb b/lib/inherited_resources.rb index <HASH>..<HASH> 100644 --- a/lib/inherited_resources.rb +++ b/lib/inherited_resources.rb @@ -27,14 +27,14 @@ end ActiveSupport.on_load(:action_controller) do # We can remove this check and change to `on_load(:action_controller_base)` in Rails 5.2. - break unless self == ActionController::Base - - # If you cannot inherit from InheritedResources::Base you can call - # inherit_resources in your controller to have all the required modules and - # funcionality included. - def self.inherit_resources - InheritedResources::Base.inherit_resources(self) - initialize_resources_class_accessors! - create_resources_url_helpers! + if self == ActionController::Base + # If you cannot inherit from InheritedResources::Base you can call + # inherit_resources in your controller to have all the required modules and + # funcionality included. + def self.inherit_resources + InheritedResources::Base.inherit_resources(self) + initialize_resources_class_accessors! + create_resources_url_helpers! + end end end
Do not use local jump in the on_load hook Some versions of Ruby will fail with a LocalJumpError. Fixes #<I>
activeadmin_inherited_resources
train
rb
39b3d937086181da33162138f6e8465ccde761cb
diff --git a/src/Fluent.php b/src/Fluent.php index <HASH>..<HASH> 100644 --- a/src/Fluent.php +++ b/src/Fluent.php @@ -8,7 +8,7 @@ use LaravelDoctrine\Fluent\Builders\Field; use LaravelDoctrine\Fluent\Builders\Inheritance\Inheritance; use LaravelDoctrine\Fluent\Builders\LifecycleEvents; use LaravelDoctrine\Fluent\Builders\Overrides\Override; -use LaravelDoctrine\Fluent\Builders\Primary;e; +use LaravelDoctrine\Fluent\Builders\Primary; use LaravelDoctrine\Fluent\Relations\ManyToMany; use LaravelDoctrine\Fluent\Relations\ManyToOne; use LaravelDoctrine\Fluent\Relations\OneToMany;
Removed extra "e;" in use staments.
laravel-doctrine_fluent
train
php
85a4aea79daff972d601888e0f34ef9dd7a333ec
diff --git a/src/Service/DataChangeTrackService.php b/src/Service/DataChangeTrackService.php index <HASH>..<HASH> 100644 --- a/src/Service/DataChangeTrackService.php +++ b/src/Service/DataChangeTrackService.php @@ -23,7 +23,7 @@ class DataChangeTrackService return; } - if (!isset($this->dcr_cache["{$object->ID}-{$object->Classname}"])) { + if (!isset($this->dcr_cache["{$object->ID}-{$object->Classname}-$type"])) { $this->dcr_cache["{$object->ID}-{$object->Classname}"] = DataChangeRecord::create(); }
fix(DataChangeTrackService) Ensure different change types are tracked differently
symbiote_silverstripe-datachange-tracker
train
php
bc99c8bcd2c2a23749716b9c5d8397fe0ceb0655
diff --git a/dist/loader.js b/dist/loader.js index <HASH>..<HASH> 100755 --- a/dist/loader.js +++ b/dist/loader.js @@ -1250,7 +1250,7 @@ define( results[name] = function() { // var that = this var args = [].slice.call(arguments) - Util.each(this, function(instance, index) { + Util.each(this, function(instance /*, index*/ ) { if (!instance[name]) return // that[index] = instance[name].apply(instance, args) diff --git a/src/loader.js b/src/loader.js index <HASH>..<HASH> 100644 --- a/src/loader.js +++ b/src/loader.js @@ -704,7 +704,7 @@ define( results[name] = function() { // var that = this var args = [].slice.call(arguments) - Util.each(this, function(instance, index) { + Util.each(this, function(instance /*, index*/ ) { if (!instance[name]) return // that[index] = instance[name].apply(instance, args)
- 'index' is defined but never used
thx_brix-loader
train
js,js
e2c654b0ecae5ea4a780a5be9ed9795e5ac5687f
diff --git a/src/js/select2/selection/single.js b/src/js/select2/selection/single.js index <HASH>..<HASH> 100644 --- a/src/js/select2/selection/single.js +++ b/src/js/select2/selection/single.js @@ -66,7 +66,9 @@ define([ }; SingleSelection.prototype.clear = function () { + this.$selection.find('.select2-selection__rendered').empty(); + this.$selection.find('.select2-selection__rendered').attr('title',''); // clear tooltip on empty }; SingleSelection.prototype.display = function (data, container) {
on clear cleared tooltip too when placeholder present
select2_select2
train
js
7277b00516905f0e26c78c063b7f84044c069b6d
diff --git a/lib/master.js b/lib/master.js index <HASH>..<HASH> 100644 --- a/lib/master.js +++ b/lib/master.js @@ -479,7 +479,7 @@ function isProduction() { } function isDebug() { - return process.execArgv.indexOf('--debug') !== -1 || typeof v8debug !== 'undefined'; + return process.execArgv.some(argv => argv.includes('--debug') || argv.includes('--inspect')); } function getAddress({ addressType, address, port, protocal }) {
fix: debug status detect should support inspect (#<I>)
eggjs_egg-cluster
train
js
bdc591854588f232a3e3040d2ed3f994e688ff81
diff --git a/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb b/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb index <HASH>..<HASH> 100644 --- a/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +++ b/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb @@ -25,3 +25,4 @@ PuppetLint.new_check(:quoted_booleans) do problem[:token].type = problem[:token].value.upcase.to_sym end end +PuppetLint.configuration.send('disable_quoted_booleans')
Disable quoted_booleans check by default The style guide has been updated since this check was written so that quoted booleans are no longer a warning. Closes #<I> Closes #<I>
rodjek_puppet-lint
train
rb
d42eb68a2e83d710458037d5b601d8c32221164d
diff --git a/src/util/animationhandler.js b/src/util/animationhandler.js index <HASH>..<HASH> 100644 --- a/src/util/animationhandler.js +++ b/src/util/animationhandler.js @@ -2,7 +2,7 @@ import CSS from "./stylehooks"; import { WEBKIT_PREFIX, HTML, DOCUMENT } from "../const"; // https://twitter.com/jaffathecake/status/570872103227953153 -var LEGACY_BROWSER = !("visibilityState" in DOCUMENT), +var LEGACY_BROWSER = !("visibilityState" in DOCUMENT || "webkitVisibilityState" in DOCUMENT), TRANSITION_PROPS = ["timing-function", "property", "duration", "delay"].map((prop) => "transition-" + prop), parseTimeValue = (value) => { var result = parseFloat(value) || 0;
fix LEGACY_BROWSER constant
chemerisuk_better-dom
train
js
a80954ff4405396e8cac24e88f7b231526893a26
diff --git a/src/Models/Tenant.php b/src/Models/Tenant.php index <HASH>..<HASH> 100644 --- a/src/Models/Tenant.php +++ b/src/Models/Tenant.php @@ -127,13 +127,13 @@ class Tenant extends BaseTenant implements HasMedia */ public function __construct(array $attributes = []) { - parent::__construct($attributes); - $this->mergeFillable(['social', 'style']); $this->mergeCasts(['social' => SchemalessAttributes::class, 'style' => 'string']); $this->mergeRules(['social' => 'nullable', 'style' => 'nullable|string|strip_tags|max:150', 'tags' => 'nullable|array']); + + parent::__construct($attributes); } /**
Fix constructor initialization order (fill attributes should come next after merging fillables & rules)
rinvex_cortex-tenants
train
php
4ac6e2a08c4c83e9094d36e468d84f8313823699
diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index <HASH>..<HASH> 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -65,10 +65,8 @@ func (d *ESX5Driver) ReloadVM() error { func (d *ESX5Driver) Start(vmxPathLocal string, headless bool) error { for i := 0; i < 20; i++ { - err := d.sh("vim-cmd", "vmsvc/power.on", d.vmId) - if err != nil { - return err - } + //intentionally not checking for error since poweron may fail specially after initial VM registration + d.sh("vim-cmd", "vmsvc/power.on", d.vmId) time.Sleep((time.Duration(i) * time.Second) + 1) running, err := d.IsRunning(vmxPathLocal) if err != nil {
Dont check for poweron command error to force retry at state check (#<I>)
hashicorp_packer
train
go
eaee0d244eb35539cea168ee8e2ce33c6b37b9d5
diff --git a/appliance/redis/cmd/flynn-redis-api/main.go b/appliance/redis/cmd/flynn-redis-api/main.go index <HASH>..<HASH> 100644 --- a/appliance/redis/cmd/flynn-redis-api/main.go +++ b/appliance/redis/cmd/flynn-redis-api/main.go @@ -1,6 +1,7 @@ package main import ( + "errors" "fmt" "io" "net" @@ -288,7 +289,7 @@ func (h *Handler) serveDeleteCluster(w http.ResponseWriter, req *http.Request, _ appName := release.Env["FLYNN_REDIS"] if appName == "" { h.Logger.Error("unable to find app name", "release.id", releaseID) - httphelper.Error(w, err) + httphelper.Error(w, errors.New("unable to find app name")) return } h.Logger.Info("found release app", "app.name", appName)
appliance/redis: Fix HTTP error when app cannot be found
flynn_flynn
train
go
a5e4a926fdb4c2cd2f03ba5da501dda3602aab6b
diff --git a/muffin_redis.py b/muffin_redis.py index <HASH>..<HASH> 100644 --- a/muffin_redis.py +++ b/muffin_redis.py @@ -159,6 +159,9 @@ class Plugin(BasePlugin): except Exception: self.app.logger.exception('Pubsub reading failure') # and continue working + # unless we are testing + if self.cfg.fake: + raise # TODO: maybe we need special handling for other exceptions? def __getattr__(self, name):
_pubsub_reader_proc: raise exceptions when in test mode
klen_muffin-redis
train
py
653c9c9afb404cdca992b4d10d33e694401e463a
diff --git a/satpy/readers/viirs_sdr.py b/satpy/readers/viirs_sdr.py index <HASH>..<HASH> 100644 --- a/satpy/readers/viirs_sdr.py +++ b/satpy/readers/viirs_sdr.py @@ -234,7 +234,7 @@ class VIIRSSDRFileHandler(HDF5FileHandler): old_chunks = data.chunks dask_data = data.data.rechunk((tuple(rows_per_gran), data.data.chunks[1])) dask_data = da.map_blocks(_apply_factors, dask_data, factors, - chunks=data.chunks, dtype=data.dtype, + chunks=dask_data.chunks, dtype=data.dtype, meta=np.array([[]], dtype=data.dtype)) data.data = dask_data.rechunk(old_chunks) return data
Fix using the wrong number of chunks in viirs sdr scaling
pytroll_satpy
train
py
64b0c320ddd3df7fdc48bcef2a92ab54fffb6965
diff --git a/src/Assely/Posttype/Posttype.php b/src/Assely/Posttype/Posttype.php index <HASH>..<HASH> 100644 --- a/src/Assely/Posttype/Posttype.php +++ b/src/Assely/Posttype/Posttype.php @@ -119,7 +119,7 @@ abstract class Posttype extends Repository } /** - * Checks if we on post type screen, + * Checks if we on post type screen,. * * @return bool */
Apply fixes from StyleCI (#<I>)
assely_framework
train
php
7b32cb1eb991132f537a3349947cde711245c5fa
diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -373,7 +373,14 @@ class Container implements ArrayAccess { */ protected function getReboundCallbacks($abstract) { - return array_get($this->reboundCallbacks, $abstract, array()); + if (isset($this->reboundCallbacks[$abstract])) + { + return $this->reboundCallbacks[$abstract]; + } + else + { + return array(); + } } /** @@ -634,7 +641,14 @@ class Container implements ArrayAccess { */ public function isShared($abstract) { - $shared = array_get($this->bindings, "{$abstract}.shared"); + if (isset($this->bindings[$abstract]['shared'])) + { + $shared = $this->bindings[$abstract]['shared']; + } + else + { + $shared = false; + } return isset($this->instances[$abstract]) || $shared === true; }
Fix bug in container isShared.
laravel_framework
train
php
6f8cd8641782093cb0a043e7789108f6cacb0aa2
diff --git a/toot/console.py b/toot/console.py index <HASH>..<HASH> 100644 --- a/toot/console.py +++ b/toot/console.py @@ -50,7 +50,7 @@ def editor(value): # Check editor executable exists exe = shutil.which(value) if not exe: - raise ArgumentTypeError(f"Editor `{value}` not found") + raise ArgumentTypeError("Editor `{}` not found".format(value)) return exe
Fix compatibility with py<<I>
ihabunek_toot
train
py
2ca08707cd89cc0bf2eda08f0226a24285150865
diff --git a/huey/contrib/djhuey/__init__.py b/huey/contrib/djhuey/__init__.py index <HASH>..<HASH> 100644 --- a/huey/contrib/djhuey/__init__.py +++ b/huey/contrib/djhuey/__init__.py @@ -114,6 +114,7 @@ revoke_all = HUEY.revoke_all revoke_by_id = HUEY.revoke_by_id is_revoked = HUEY.is_revoked result = HUEY.result +scheduled = HUEY.scheduled # Hooks. on_startup = HUEY.on_startup
Expose scheduled method in Django helper
coleifer_huey
train
py
5925ba4a1f500163a0645071bf8403e41c9729e9
diff --git a/src/feat/agencies/contracts.py b/src/feat/agencies/contracts.py index <HASH>..<HASH> 100644 --- a/src/feat/agencies/contracts.py +++ b/src/feat/agencies/contracts.py @@ -277,6 +277,9 @@ class AgencyManager(log.LogProxy, log.Logger, common.StateMachineMixin, def get_agent_side(self): return self.manager + def cleanup(self): + pass + # notify_finish() implemented in common.TransientInitiatorMediumBase ### IAgencyListenerInternal Methods ### @@ -575,6 +578,9 @@ class AgencyContractor(log.LogProxy, log.Logger, common.StateMachineMixin, def get_agent_side(self): return self.contractor + def cleanup(self): + pass + # notify_finish() implemented in common.TransientInterestedMediumBase ### IAgencyListenerInternal Methods ###
Add missing cleanup() methods on AgencyContractor and AgencyManager.
f3at_feat
train
py
23542709234006c00b36cd885963d31654104f08
diff --git a/spec/package_spec.rb b/spec/package_spec.rb index <HASH>..<HASH> 100644 --- a/spec/package_spec.rb +++ b/spec/package_spec.rb @@ -3,6 +3,11 @@ require 'spec_helper' describe ZendeskAppsSupport::Package do before do @package = ZendeskAppsSupport::Package.new('spec/app') + + lib_files_original_method = @package.method(:lib_files) + @package.stub(:lib_files) do |*args, &block| + lib_files_original_method.call(*args, &block).sort_by { |f| f.relative_path } + end end describe 'files' do
Sort lib_files in tests to ensure consistent ordering
zendesk_zendesk_apps_support
train
rb
635c98a8597221613ff801bfaaa37b9a0909ba02
diff --git a/src/main/java/com/p6spy/engine/common/Value.java b/src/main/java/com/p6spy/engine/common/Value.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/p6spy/engine/common/Value.java +++ b/src/main/java/com/p6spy/engine/common/Value.java @@ -123,7 +123,7 @@ public class Value { * {@code bytes}. */ private String toHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(bytes.length * 2); for (byte b : bytes) { int temp = (int) b & 0xFF; sb.append(HEX_CHARS[temp / 16]);
com.p6spy.engine.common.Value::toHexString using exact size for StringBuilder
p6spy_p6spy
train
java
c1118e99bff01116afc7f110d9d2562519c489d8
diff --git a/src/lib/widget.js b/src/lib/widget.js index <HASH>..<HASH> 100644 --- a/src/lib/widget.js +++ b/src/lib/widget.js @@ -56,9 +56,11 @@ define(['./assets', './webfinger', './hardcoded', './wireClient', './sync', './s } } - function setWidgetState(state) { + function setWidgetState(state, updateView) { widgetState = state; - displayWidgetState(state, userAddress); + if(updateView !== false) { + displayWidgetState(state, userAddress); + } fireState(state); } @@ -250,6 +252,8 @@ define(['./assets', './webfinger', './hardcoded', './wireClient', './sync', './s if(widgetState == 'connected') { wireClient.disconnectRemote(); store.forgetAll(); + // trigger 'disconnected' once, so the app can clear it's views. + setWidgetState('disconnected', true); setWidgetState('anonymous'); } else { platform.alert('you cannot disconnect now, please wait until the cloud is up to date...');
disconnected event for widget (fixes #<I>)
remotestorage_remotestorage.js
train
js
6f2764738794f4c2f5135d3e8917db9d86dacbb2
diff --git a/tests/test_bootstrap_calcs.py b/tests/test_bootstrap_calcs.py index <HASH>..<HASH> 100644 --- a/tests/test_bootstrap_calcs.py +++ b/tests/test_bootstrap_calcs.py @@ -69,11 +69,11 @@ class ComputationalTests(unittest.TestCase): # We should have the value in BR[lower_row, 0] = 3 so that there are 2 # elements in bootstrap_replicates (BR) that are less than this. I.e. # we want lower_row = 2. Note 2.56 rounded down is 2. - lower_row = np.floor(alpha / 2.0) + lower_row = int(np.floor(alpha / 2.0)) # 100 - 2.56 is 97.44. Rounded up, this is 98. # We want the row such that the value in the first column of that row # is 98, i.e. we want the row at index 97. - upper_row = np.floor(100 - (alpha / 2.0)) + upper_row = int(np.floor(100 - (alpha / 2.0))) # Create the expected results expected_results =\ bc.combine_conf_endpoints(self.bootstrap_replicates[lower_row],
Change upper and lower row to ints to avoid TravisCI testing errors.
timothyb0912_pylogit
train
py
ca056c4875a9769a9d26c8f88b91caaabc3f09cb
diff --git a/plugins/Feedback/Feedback.php b/plugins/Feedback/Feedback.php index <HASH>..<HASH> 100644 --- a/plugins/Feedback/Feedback.php +++ b/plugins/Feedback/Feedback.php @@ -99,6 +99,9 @@ class Feedback extends \Piwik\Plugin if ($nextReminderDate === false) { $model = new Model(); $user = $model->getUser($login); + if (empty($user['date_registered'])) { + return false; + } $nextReminderDate = Date::factory($user['date_registered'])->addDay(90)->getStartOfDay(); } else { $nextReminderDate = Date::factory($nextReminderDate);
Don't show feedback prompt when user does not exist (#<I>) Prevents an error in the UI that said ``` Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see <URL>): ``` when the user did not exist. Eg when you have "virtual" users that aren't actually existing in the user table.
matomo-org_matomo
train
php
4d3c99934cb30a8e74d2c5306e9c1ebbe52e544d
diff --git a/redis/redis.go b/redis/redis.go index <HASH>..<HASH> 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -56,11 +56,10 @@ const ( // be re-used or not. If an error occurs, by default we don't reuse the // connection, unless it was just a cache error. func resumableError(err error) bool { - switch err { - case ErrTimedOut, ErrServerError: - return false + if err == ErrServerError { + return true } - return true + return false // time outs, broken pipes, etc } // New returns a redis client using the provided server(s) with equal weight.
bugfix in resumable errors
fiorix_go-redis
train
go
757bded13592ca05d124215124b5808d9290e063
diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index <HASH>..<HASH> 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -29,6 +29,7 @@ from _pytest.mark.structures import Mark from _pytest.mark.structures import MarkDecorator from _pytest.mark.structures import NodeKeywords from _pytest.outcomes import fail +from _pytest.pathlib import Path from _pytest.store import Store if TYPE_CHECKING: @@ -361,8 +362,14 @@ class Node(metaclass=NodeMeta): else: truncate_locals = True + # excinfo.getrepr() formats paths relative to the CWD if `abspath` is False. + # It is possible for a fixture/test to change the CWD while this code runs, which + # would then result in the user seeing confusing paths in the failure message. + # To fix this, if the CWD changed, always display the full absolute path. + # It will be better to just always display paths relative to invocation_dir, but + # this requires a lot of plumbing (#6428). try: - abspath = os.getcwd() != str(self.config.invocation_dir) + abspath = Path(os.getcwd()) != Path(self.config.invocation_dir) except OSError: abspath = True
Use Path() instead of str for path comparison On Windows specifically is common to have drives diverging just by casing ("C:" vs "c:"), depending on the cwd provided by the user.
pytest-dev_pytest
train
py
909535e98678606b68ece3f800ed5de4f1e3f9ae
diff --git a/holoviews/core/options.py b/holoviews/core/options.py index <HASH>..<HASH> 100644 --- a/holoviews/core/options.py +++ b/holoviews/core/options.py @@ -107,7 +107,7 @@ class AbbreviatedException(Exception): self.msg = str(value) def __str__(self): - abbrev = 'Abbreviated %s: %s' % (self.etype.__name__, self.msg) + abbrev = '%s: %s' % (self.etype.__name__, self.msg) msg = ('To view the original traceback, catch this exception ' 'and access the traceback attribute.') return '%s\n\n%s' % (abbrev, msg)
Removed unnecessary repetition of the word 'Abbreviated'
pyviz_holoviews
train
py
aeeac3dab543439b9dd4ae645c96c9a22f390c82
diff --git a/types.js b/types.js index <HASH>..<HASH> 100644 --- a/types.js +++ b/types.js @@ -32,6 +32,7 @@ var map = { * Translates a single Obj-C 'type' into a valid node-ffi type. */ exports.map = function translate (type) { + if (!type) return 'void'; var rtn = map[type]; if (rtn) return rtn; // Meh, need better testing here
Fix for BridgeSupport functions that return "void".
TooTallNate_NodObjC
train
js
e3b7e4bca7538a6521aed2df8ed1adda6d592b12
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -39,7 +39,12 @@ class Config public function getMigrationsDir() { - return getcwd() . '/' . trim($this->_config['path']['migrations'], '/'); + $migrationsDir = $this->_config['path']['migrations']; + if($migrationsDir[0] === '/') { + return $migrationsDir; + } + + return getcwd() . '/' . rtrim($migrationsDir, '/'); } public function getDefaultEnvironment()
support absolute path of dir in config
sokil_php-mongo-migrator
train
php
1719800fdccf2b019d485f29aaae9581c880a829
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -11,5 +11,5 @@ setup(name = 'robotframework-rammbock', author_email = 'robotframework-users@googlegroups.com', url = 'http://github.com/robotframework/Rammbock/', package_dir = {'' : 'src'}, - packages = ['Rammbock'] + packages = ['Rammbock', 'Rammbock.templates'] )
fix setup.py to include tenmplates-package
robotframework_Rammbock
train
py
9e65194ba71db9fca8c4ddc12bbcae71fe99174d
diff --git a/tests/Integration/Database/EloquentBelongsToManyTest.php b/tests/Integration/Database/EloquentBelongsToManyTest.php index <HASH>..<HASH> 100644 --- a/tests/Integration/Database/EloquentBelongsToManyTest.php +++ b/tests/Integration/Database/EloquentBelongsToManyTest.php @@ -82,7 +82,9 @@ class EloquentBelongsToManyTest extends TestCase ['post_id' => $post->id, 'tag_id' => 400, 'flag' => ''], ]); - Carbon::setTestNow('2017-10-10 10:10:10'); + Carbon::setTestNow( + Carbon::createFromFormat('Y-m-d H:i:s', '2017-10-10 10:10:10') + ); $post->tags()->touch();
use carbon instance in setTestNow for tests to pass on setup lowest
laravel_framework
train
php
42315f88e5dcf29cc66a3515e92b35230f71812e
diff --git a/jira/resources.py b/jira/resources.py index <HASH>..<HASH> 100644 --- a/jira/resources.py +++ b/jira/resources.py @@ -380,8 +380,6 @@ class Issue(Resource): def __init__(self, options, session, raw=None): Resource.__init__(self, 'issue/{0}', options, session) - if raw: - self._parse_raw(raw) self.fields = None """ :type : Issue._IssueFields """ @@ -389,6 +387,8 @@ class Issue(Resource): """ :type : int """ self.key = None """ :type : str """ + if raw: + self._parse_raw(raw) def update(self, fields=None, update=None, async=None, jira=None, **fieldargs): """ diff --git a/tests/tests.py b/tests/tests.py index <HASH>..<HASH> 100755 --- a/tests/tests.py +++ b/tests/tests.py @@ -631,7 +631,6 @@ class IssueTests(unittest.TestCase): comment2.delete() comment3.delete() - @pytest.mark.xfail # Searched issued does not contain basic fields. def test_issue_equal(self): issue1 = self.jira.issue(self.issue_1) issue2 = self.jira.issue(self.issue_2)
(#<I>) Fix initialisation of resources.Issue when raw is passed in
pycontribs_jira
train
py,py
e8941083057453f16bae6e555917f77bb1c887e1
diff --git a/builder/etcd/etcd.go b/builder/etcd/etcd.go index <HASH>..<HASH> 100644 --- a/builder/etcd/etcd.go +++ b/builder/etcd/etcd.go @@ -349,14 +349,13 @@ func UpdateHostPort(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Int safely.GoDo(c, func() { ticker := time.NewTicker(10 * time.Second) for range ticker.C { - //log.Infof(c, "Setting SSHD host/port") if _, err := os.FindProcess(sshd); err != nil { log.Errf(c, "Lost SSHd process: %s", err) break } else { if err := setHostPort(client, base, host, port, ttl); err != nil { log.Errf(c, "Etcd error setting host/port: %s", err) - break + continue } } }
fix(builder): continue updating etcd after errors
deis_deis
train
go
1d3cea757bfe71722d90da252d1f31994c6930c5
diff --git a/pkg/minikube/exit/exit.go b/pkg/minikube/exit/exit.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/exit/exit.go +++ b/pkg/minikube/exit/exit.go @@ -75,7 +75,7 @@ func WithProblem(msg string, p *problem.Problem) { p.Display() console.Err("\n") console.ErrStyle(console.Sad, "If the above advice does not help, please let us know: ") - console.ErrStyle(console.URL, "https://github.com/kubernetes/minikube/issues/new") + console.ErrStyle(console.URL, "https://github.com/kubernetes/minikube/issues/new/choose") os.Exit(Config) } @@ -102,5 +102,5 @@ func displayError(msg string, err error) { console.Fatal("%s: %v", msg, err) console.Err("\n") console.ErrStyle(console.Sad, "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:") - console.ErrStyle(console.URL, "https://github.com/kubernetes/minikube/issues/new") + console.ErrStyle(console.URL, "https://github.com/kubernetes/minikube/issues/new/choose") }
Update github issues URL to chooser
kubernetes_minikube
train
go
30fa8e3f0682c5c51adcbf48c97c6eb7fd3f2eec
diff --git a/chainlet/concurrency/thread.py b/chainlet/concurrency/thread.py index <HASH>..<HASH> 100644 --- a/chainlet/concurrency/thread.py +++ b/chainlet/concurrency/thread.py @@ -112,11 +112,17 @@ class ThreadBundle(ConcurrentBundle): chain_types = ThreadLinkPrimitives() executor = DEFAULT_EXECUTOR + def __repr__(self): + return 'threads(%s)' % super(ThreadBundle, self).__repr__() + class ThreadChain(ConcurrentChain): chain_types = ThreadLinkPrimitives() executor = DEFAULT_EXECUTOR + def __repr__(self): + return 'threads(%s)' % super(ThreadChain, self).__repr__() + ThreadLinkPrimitives.base_bundle_type = ThreadBundle ThreadLinkPrimitives.base_chain_type = ThreadChain
threaded elements are repr'd as such
maxfischer2781_chainlet
train
py
a5584e38af66086e24f326dd827d0741052d604a
diff --git a/decidim-core/app/controllers/decidim/devise/sessions_controller.rb b/decidim-core/app/controllers/decidim/devise/sessions_controller.rb index <HASH>..<HASH> 100644 --- a/decidim-core/app/controllers/decidim/devise/sessions_controller.rb +++ b/decidim-core/app/controllers/decidim/devise/sessions_controller.rb @@ -8,7 +8,7 @@ module Decidim def after_sign_in_path_for(user) return first_login_authorizations_path if first_login_and_not_authorized?(user) && - !user.roles.include?("admin") + !user.role?("admin") super end
Reuse `#role?` method from `User` model (#<I>)
decidim_decidim
train
rb
ab2c931ed1522c6975eec791d05ce325fbb554d8
diff --git a/src/Bakame/Csv/Reader.php b/src/Bakame/Csv/Reader.php index <HASH>..<HASH> 100644 --- a/src/Bakame/Csv/Reader.php +++ b/src/Bakame/Csv/Reader.php @@ -214,6 +214,7 @@ class Reader extends AbstractCsv $csv->setEnclosure($this->enclosure); $csv->setEscape($this->escape); $csv->setFlags($this->flags); + $csv->setEncoding($this->encoding); return $csv; } diff --git a/src/Bakame/Csv/Writer.php b/src/Bakame/Csv/Writer.php index <HASH>..<HASH> 100644 --- a/src/Bakame/Csv/Writer.php +++ b/src/Bakame/Csv/Writer.php @@ -125,6 +125,7 @@ class Writer extends AbstractCsv $csv->setEnclosure($this->enclosure); $csv->setEscape($this->escape); $csv->setFlags($this->flags); + $csv->setEncoding($this->encoding); return $csv; }
add encoding settings to getWriter and getReader methods
thephpleague_csv
train
php,php
451bf820d3c36a60d759eb2427dc134767c06d7b
diff --git a/commands/generate/codemod.js b/commands/generate/codemod.js index <HASH>..<HASH> 100644 --- a/commands/generate/codemod.js +++ b/commands/generate/codemod.js @@ -1,8 +1,8 @@ -export const command = 'codemod <name>'; +export const command = 'codemod <codemod-name>'; export const desc = 'Generate a new codemod file'; export function builder(yargs) { - yargs.positional('name', { + yargs.positional('codemod-name', { describe: 'the name of the codemod to generate', }); }
Fix basic issue with generate codemod.
rwjblue_codemod-cli
train
js
099e3a9500969cf124d34b1696c5c6e163490277
diff --git a/src/parse-format/parse.js b/src/parse-format/parse.js index <HASH>..<HASH> 100644 --- a/src/parse-format/parse.js +++ b/src/parse-format/parse.js @@ -8,7 +8,7 @@ const match1to2 = /\d\d?/ // 0 - 99 const matchUpperAMPM = /[AP]M/ const matchLowerAMPM = /[ap]m/ const matchSigned = /[+-]?\d+/ // -inf - inf -const matchOffset = /([+-]\d\d:?\d\d|Z)/ // +00:00 -00:00 +0000, -0000 or Z +const matchOffset = /([+-]\d\d:?\d\d|Z)/ // +00:00 -00:00 +0000 -0000 or Z const matchAbbreviation = /[A-Z]{3,4}/ // CET const parseTokenExpressions = {}
Remove redundant comma in comment
prantlf_timezone-support
train
js
19c1fdff9d339f5b80f4033a5add60b6aadbd79c
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -74,6 +74,11 @@ app.set('views', [cfg.sources.views, app.xtcPath('/views')]); xtc.registerProjectMiddlewares = function(cb) { cb(express); + app.use(function(req, res, next) { + res.setHeader('X-Powered-By', 'xtc'); + next(); + }); + app.use(cfg.staticBaseUri, express.static(cfg.staticPath)); app.use(cfg.staticBaseUri, express.static(cfg.buildBasePath)); // in case buildBasePath is different from staticPath
X-Powered-By: xtc
MarcDiethelm_xtc
train
js
a45267e1931231904c13bccf55c99424a53c00f9
diff --git a/lib/mongoid/collections/operations.rb b/lib/mongoid/collections/operations.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/collections/operations.rb +++ b/lib/mongoid/collections/operations.rb @@ -28,6 +28,7 @@ module Mongoid #:nodoc: :drop, :drop_index, :drop_indexes, + :find_and_modify, :insert, :remove, :rename,
Make sure Collection#find_and_modify is delegated to. Fixes #<I>.
mongodb_mongoid
train
rb
2584bececa17003df85c90877d39e362a53fd26a
diff --git a/benchmarks/basic.rb b/benchmarks/basic.rb index <HASH>..<HASH> 100755 --- a/benchmarks/basic.rb +++ b/benchmarks/basic.rb @@ -77,9 +77,6 @@ seed puts "LOADED #{env.schema.users.count} users via ROM/Sequel" puts "LOADED #{ARUser.count} users via ActiveRecord" -puts "AAAAAAA: #{ROM_ENV.read(:users).user_json.to_a.inspect}" -puts "AAAAAAA: #{ARUser.all.to_a.map(&:as_json).inspect}" - USERS = ROM_ENV.read(:users).all Benchmark.ips do |x|
Remove left-over puts from benchmark script
rom-rb_rom
train
rb
95b3b2e9d58a32d874768e6f15a17cf8d1b08235
diff --git a/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php b/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php index <HASH>..<HASH> 100644 --- a/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php +++ b/lib/hz2600/Kazoo/Api/Entity/AbstractEntity.php @@ -154,6 +154,26 @@ abstract class AbstractEntity extends AbstractResource $this->setId(); } + + /** + * downloads or streams a media file + * @param boolean $stream Set to true to stream the file + * @return binary Media file + */ + public function getRaw($stream = false) + { + $this->setTokenValue($this->getEntityIdName(), $this->getId()); + $uri = $this->getURI('/raw'); + $x = $this->getSDK()->get($uri, array(), array('accept'=>'audio/*', 'content_type'=>'audio/*')); + + header('Content-Type: '.$x->getHeader('Content-Type')[0]); + header('content-length: '.$x->getHeader('content-length')[0]); + + if (!$stream) { + header('Content-Disposition: '.$x->getHeader('Content-Disposition')[0]); + } + echo $x->getBody(); + } /** * Explicitly fetch from Kazoo, typicall it lazy-loads.
Update AbstractEntity.php (#<I>) Moved from Media.php class
2600hz_kazoo-php-sdk
train
php
a125532b25b293e68e6ead81c76e31ded6799fd7
diff --git a/validator/txnintegration/validator_manager.py b/validator/txnintegration/validator_manager.py index <HASH>..<HASH> 100644 --- a/validator/txnintegration/validator_manager.py +++ b/validator/txnintegration/validator_manager.py @@ -254,6 +254,7 @@ class ValidatorManager(object): def is_running(self): if self._handle: + self._handle.poll() return self._handle.returncode is None return False diff --git a/validator/txnintegration/validator_network_manager.py b/validator/txnintegration/validator_network_manager.py index <HASH>..<HASH> 100644 --- a/validator/txnintegration/validator_network_manager.py +++ b/validator/txnintegration/validator_network_manager.py @@ -106,6 +106,8 @@ class ValidatorNetworkManager(object): self.validator_config['DataDirectory'] = self.data_dir self.validator_config["AdministrationNode"] = self.admin_node.Address + self.timeout = 3 + def __del__(self): if self.temp_data_dir: if os.path.exists(self.data_dir): @@ -316,7 +318,7 @@ class ValidatorNetworkManager(object): p.step() running_count = 0 - to = TimeOut(1) + to = TimeOut(self.timeout) with Progress("Giving validators time to shutdown: ") as p: while True: running_count = 0
modified vm.is_running() and changed vnm.shutdown() timeout to 3sec
hyperledger_sawtooth-core
train
py,py
2f7461c8752b23c40b09b554473d7b17910201ca
diff --git a/webwhatsapi/wapi_js_wrapper.py b/webwhatsapi/wapi_js_wrapper.py index <HASH>..<HASH> 100755 --- a/webwhatsapi/wapi_js_wrapper.py +++ b/webwhatsapi/wapi_js_wrapper.py @@ -1,4 +1,5 @@ import os +import time from selenium.common.exceptions import WebDriverException from six import string_types @@ -133,6 +134,10 @@ class NewMessagesObservable(Thread): try: self.webdriver.set_script_timeout(115200) # One hour timeout for this execution new_js_messages = self.wapi_js_wrapper.waitNewMessages(True) + + if not isinstance(new_js_messages, list): + raise Exception('Page reloaded or JS error, retrying in 2 seconds.') + new_messages = [] for js_message in new_js_messages: new_messages.append(factory_message(js_message, self.wapi_driver)) @@ -141,6 +146,7 @@ class NewMessagesObservable(Thread): except WapiPhoneNotConnectedException as e: pass except Exception as e: + time.sleep(2) pass def subscribe(self, observer):
- Adding realoding treatment in new message observable
mukulhase_WebWhatsapp-Wrapper
train
py
900c3f8c29704ec5d96a3f3da914abd377d2a599
diff --git a/src/wormhole/server/cli.py b/src/wormhole/server/cli.py index <HASH>..<HASH> 100644 --- a/src/wormhole/server/cli.py +++ b/src/wormhole/server/cli.py @@ -98,9 +98,13 @@ def start(cfg, signal_error, no_daemon, blur_usage, advertise_version, "--signal-error", is_flag=True, help="force all clients to fail with a message", ) +@click.option( + "--disallow-list", is_flag=True, + help="never send list of allocated nameplates", +) @click.pass_obj def restart(cfg, signal_error, no_daemon, blur_usage, advertise_version, - transit, rendezvous): + transit, rendezvous, disallow_list): """ Re-start a relay server """ @@ -111,6 +115,7 @@ def restart(cfg, signal_error, no_daemon, blur_usage, advertise_version, cfg.transit = str(transit) cfg.rendezvous = str(rendezvous) cfg.signal_error = signal_error + cfg.allow_list = not disallow_list restart_server(cfg)
server: make 'restart' accept --disallow-list too I should really move all the start/restart common arguments into a separate place, to make it easier to avoid this problem in the future.
warner_magic-wormhole
train
py
34265f8db8787b66988e6305d0bfd7a8a13573cb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -55,8 +55,10 @@ setup( 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5',
update setup.py to include version 2 & 3
mozilla_configman
train
py