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
28f268effb25e434a96668efc41f900df1046052
diff --git a/pyontutils/blackfynn_api.py b/pyontutils/blackfynn_api.py index <HASH>..<HASH> 100644 --- a/pyontutils/blackfynn_api.py +++ b/pyontutils/blackfynn_api.py @@ -184,9 +184,9 @@ def mvp(): def process_files(bf, files): - ns = [nifti1.load(f.as_posix()) for f in files if '.nii' in f.suffixes] - ms = [loadmat(f.as_posix()) for f in files if '.mat' in f.suffixes] - dcs = [dcmread(f.as_posix()) for f in files if '.dcm' in f.suffixes] # loaded dicom files + niftis = [nifti1.load(f.as_posix()) for f in files if '.nii' in f.suffixes] + mats = [loadmat(f.as_posix()) for f in files if '.mat' in f.suffixes] + dicoms = [dcmread(f.as_posix()) for f in files if '.dcm' in f.suffixes] # loaded dicom files embed() # XXX you will drop into an interactive terminal in this scope
bfapi clarified naming of file type collections
tgbugs_pyontutils
train
py
660ea15f4cc45844e03046222a8ede5d6e5e94ad
diff --git a/src/geo/gmaps/gmaps.geometry.js b/src/geo/gmaps/gmaps.geometry.js index <HASH>..<HASH> 100644 --- a/src/geo/gmaps/gmaps.geometry.js +++ b/src/geo/gmaps/gmaps.geometry.js @@ -35,7 +35,9 @@ function PointView(geometryModel) { icon: { url: '/assets/layout/default_marker.png', anchor: {x: 10, y: 10} - } + }, + raiseOnDrag: false, + crossOnDrag: false } );
removed animation when drag marker under GMaps
CartoDB_carto.js
train
js
dcfbf4774a65d3f6dbbdb7b3217201a662b9cd01
diff --git a/android/src/main/java/com/imagepicker/Utils.java b/android/src/main/java/com/imagepicker/Utils.java index <HASH>..<HASH> 100644 --- a/android/src/main/java/com/imagepicker/Utils.java +++ b/android/src/main/java/com/imagepicker/Utils.java @@ -8,7 +8,6 @@ import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; -import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.hardware.camera2.CameraCharacteristics; @@ -17,7 +16,6 @@ import android.net.Uri; import android.os.Build; import android.os.ParcelFileDescriptor; import android.provider.MediaStore; -import android.provider.OpenableColumns; import android.util.Base64; import android.util.Log; import android.webkit.MimeTypeMap; @@ -38,10 +36,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.nio.file.*; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileTime; -import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays;
fix(deps): remove unused Android Java dependancies (#<I>)
react-native-community_react-native-image-picker
train
java
1104360fd99d651a03442152581535b946dcdcc1
diff --git a/tests/scripts/unit/wee-screen.js b/tests/scripts/unit/wee-screen.js index <HASH>..<HASH> 100644 --- a/tests/scripts/unit/wee-screen.js +++ b/tests/scripts/unit/wee-screen.js @@ -258,7 +258,7 @@ describe('Screen', () => { resetState(); setScreenSize(3); expect(state.one).to.equal(false); - }) + }); }); describe('args', () => { @@ -269,11 +269,15 @@ describe('Screen', () => { callback(arg, one, two) { expect(one).to.equal('one'); expect(two).to.equal('two'); + + state.one = true; } }); setScreenSize(3); - }) + + expect(state.one).to.be.true; + }); }); describe('scope', () => { @@ -287,10 +291,14 @@ describe('Screen', () => { scope: obj, callback() { expect(this.one).to.equal('one'); + + state.one = true; } }); setScreenSize(3); + + expect(state.one).to.be.true; }); }); @@ -377,6 +385,9 @@ describe('Screen', () => { it('should return the current screen size', () => { setScreenSize(2); expect($screen.size()).to.equal(2); + + setScreenSize(3); + expect($screen.size()).to.equal(3); }); });
Add semi-colons and additional assertions
weepower_wee-core
train
js
f74c377a6d84033befff445b0e78b27f8ba4cb98
diff --git a/src/test/java/org/jpmml/sklearn/ClassifierTest.java b/src/test/java/org/jpmml/sklearn/ClassifierTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/jpmml/sklearn/ClassifierTest.java +++ b/src/test/java/org/jpmml/sklearn/ClassifierTest.java @@ -132,7 +132,7 @@ public class ClassifierTest extends SkLearnTest { @Test public void evaluateLGBMAudit() throws Exception { - evaluate("LGBM", "Audit", new RealNumberEquivalence(1)); + evaluate("LGBM", "Audit", new RealNumberEquivalence(2)); } @Test
Fixed the build for Java <I>
jpmml_jpmml-sklearn
train
java
ec31f5a9bd0453068e2d95ed7328ba0d01852936
diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -328,7 +328,7 @@ def version(*names, **kwargs): ''' saltenv = kwargs.get('saltenv', 'base') - installed_pkgs = list_pkgs(refresh=kwargs.get('refresh', False)) + installed_pkgs = list_pkgs(saltenv=saltenv, refresh=kwargs.get('refresh', False)) available_pkgs = get_repo_data(saltenv).get('repo') ret = {}
<I>/develop version() was ignoring saltenv setting.
saltstack_salt
train
py
84f98d75dd9b58a9a955731fec7aa1fda4fe07d7
diff --git a/src/Export/ExportCsv.php b/src/Export/ExportCsv.php index <HASH>..<HASH> 100644 --- a/src/Export/ExportCsv.php +++ b/src/Export/ExportCsv.php @@ -46,7 +46,11 @@ class ExportCsv extends Export array $data, DataGrid $grid ) use ($name, $outputEncoding, $delimiter, $includeBom): void { - $columns = $this->getColumns() ?? $this->grid->getColumns(); + $columns = $this->getColumns(); + + if ($columns === []) { + $columns = $this->grid->getColumns(); + } $csvDataModel = new CsvDataModel($data, $columns, $this->grid->getTranslator());
Fix ExportCsv blank output Regression from a<I>c9d<I>, which results in rows with no columns (since `getColumns` never returns `null`).
contributte_datagrid
train
php
a011ca5062e08021d5d800850d65ad7f523b1204
diff --git a/lib/component.js b/lib/component.js index <HASH>..<HASH> 100644 --- a/lib/component.js +++ b/lib/component.js @@ -90,7 +90,7 @@ }, /** * Hook called by React when the component is mounted on a DOM element. - Overriding this set this.el and this.$el (if jQuery available) on the + Overriding this to set this.el and this.$el (if jQuery available) on the component. Also starts component listeners. */ componentDidMount: function () { @@ -186,7 +186,8 @@ * @returns {this} */ remove: function () { - if (this.unmount()) this.el.remove(); + this.unmount(); + this.el.remove(); return this; }, /**
fixed remove method that was expecting old unmount return value
magalhas_backbone-react-component
train
js
7243086404cb2db8bd37d2888b02b94b4adf548c
diff --git a/lib/tty/command/execute.rb b/lib/tty/command/execute.rb index <HASH>..<HASH> 100644 --- a/lib/tty/command/execute.rb +++ b/lib/tty/command/execute.rb @@ -30,9 +30,9 @@ module TTY # redirect fds opts = ({ - :in => in_rd, in_wr => :close, - :out => out_wr, out_rd => :close, - :err => err_wr, err_rd => :close + :in => in_rd, # in_wr => :close, + :out => out_wr,# out_rd => :close, + :err => err_wr,# err_rd => :close }).merge(@process_options) pid = Process.spawn(cmd.to_command, opts)
Change to stop closing pipes in child process.
piotrmurach_tty-command
train
rb
997815d8b37357ecc0a826a3c0f17182b6370082
diff --git a/lib/infer.js b/lib/infer.js index <HASH>..<HASH> 100644 --- a/lib/infer.js +++ b/lib/infer.js @@ -888,14 +888,15 @@ case "in": case "instanceof": return true; } } - function literalType(val) { - switch (typeof val) { + function literalType(node) { + if (node.regex) return getInstance(cx.protos.RegExp); + switch (typeof node.value) { case "boolean": return cx.bool; case "number": return cx.num; case "string": return cx.str; case "object": case "function": - if (!val) return ANull; + if (!node.value) return ANull; return getInstance(cx.protos.RegExp); } } @@ -1091,7 +1092,7 @@ return scope.fnType ? scope.fnType.self : cx.topScope; }), Literal: ret(function(node) { - return literalType(node.value); + return literalType(node); }) }; @@ -1338,7 +1339,7 @@ return scope.fnType ? scope.fnType.self : cx.topScope; }, Literal: function(node) { - return literalType(node.value); + return literalType(node); } };
Fix type inference for unsyntactic regexps They get a .value of undefined, which would confuse literalType Issue #<I>
ternjs_tern
train
js
603275eabcb16262463ac32a6962ad44ca12cdb0
diff --git a/src/main/java/org/cactoos/collection/Immutable.java b/src/main/java/org/cactoos/collection/Immutable.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/cactoos/collection/Immutable.java +++ b/src/main/java/org/cactoos/collection/Immutable.java @@ -54,8 +54,8 @@ public final class Immutable<X> implements Collection<X> { * Ctor. * @param src Source collection */ - public Immutable(final Collection<X> src) { - this.col = src; + public Immutable(final Collection<? extends X> src) { + this.col = (Collection<X>) src; } @Override
(#<I>) Generified Immutable with unchecked cast
yegor256_cactoos
train
java
c5908b62f55fe1fceb038c01c6c669c99a404d39
diff --git a/src/oidcendpoint/scopes.py b/src/oidcendpoint/scopes.py index <HASH>..<HASH> 100644 --- a/src/oidcendpoint/scopes.py +++ b/src/oidcendpoint/scopes.py @@ -73,3 +73,7 @@ class Scopes: else: return available_scopes(endpoint_context) return [] + + def filter_scopes(self, client_id, endpoint_context, scopes): + allowed_scopes = self.allowed_scopes(client_id, endpoint_context) + return [s for s in scopes if s in allowed_scopes]
Added method filer_scopes().
IdentityPython_oidcendpoint
train
py
005ae12f26b99199e9ddac5cec78ae6498ef28cd
diff --git a/internal/service/redshift/cluster_data_source.go b/internal/service/redshift/cluster_data_source.go index <HASH>..<HASH> 100644 --- a/internal/service/redshift/cluster_data_source.go +++ b/internal/service/redshift/cluster_data_source.go @@ -37,6 +37,16 @@ func DataSourceCluster() *schema.Resource { Computed: true, }, + "availability_zone_relocation": { + Type: schema.TypeBool, + Computed: true, + }, + + "availability_zone_relocation_status": { + Type: schema.TypeString, + Computed: true, + }, + "bucket_name": { Type: schema.TypeString, Computed: true,
#<I> cluster_data_source: add computed schema
terraform-providers_terraform-provider-aws
train
go
e76946305bde76ac44bfd71036272012dbe2ed6f
diff --git a/ddsc/core/filedownloader.py b/ddsc/core/filedownloader.py index <HASH>..<HASH> 100644 --- a/ddsc/core/filedownloader.py +++ b/ddsc/core/filedownloader.py @@ -14,7 +14,7 @@ DOWNLOAD_FILE_CHUNK_SIZE = 20 * 1024 * 1024 MIN_DOWNLOAD_CHUNK_SIZE = DOWNLOAD_FILE_CHUNK_SIZE PARTIAL_DOWNLOAD_RETRY_TIMES = 5 -PARTIAL_DOWNLOAD_RETRY_SECONDS = 1 +PARTIAL_DOWNLOAD_RETRY_SECONDS = 20 class FileDownloader(object): diff --git a/ddsc/core/fileuploader.py b/ddsc/core/fileuploader.py index <HASH>..<HASH> 100644 --- a/ddsc/core/fileuploader.py +++ b/ddsc/core/fileuploader.py @@ -13,7 +13,7 @@ import traceback import sys SEND_EXTERNAL_PUT_RETRY_TIMES = 5 -SEND_EXTERNAL_RETRY_SECONDS = 1 +SEND_EXTERNAL_RETRY_SECONDS = 20 RESOURCE_NOT_CONSISTENT_RETRY_SECONDS = 2
Update swift retry settings based on oit feedback Changes to retry recommendations to <I> seconds pause based on a OIT ticket. > ...wait longer than 1 second between retries, perhaps <I> or <I> seconds may yield more successful results ...
Duke-GCB_DukeDSClient
train
py,py
6cbee2e80c7b57ea1b1de978696858f82371f4d8
diff --git a/src/redis_lock/__init__.py b/src/redis_lock/__init__.py index <HASH>..<HASH> 100644 --- a/src/redis_lock/__init__.py +++ b/src/redis_lock/__init__.py @@ -202,7 +202,9 @@ class Lock(object): logger.warn("UNLOCK_SCRIPT not cached.") self._client.eval(UNLOCK_SCRIPT, 2, self._name, self._signal, self._id) self._held = False - release = __exit__ + + def release(self, force=False): + return self.__exit__(force=force) class InterruptableThread(threading.Thread):
Only allow `force` argument in release method. The other arguments are unrelated (specific to context managers).
ionelmc_python-redis-lock
train
py
43c07e8b4415ed9c365ba39881c3b265edb23203
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java index <HASH>..<HASH> 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java @@ -148,6 +148,7 @@ public class DataSourceAutoConfiguration { @ConditionalOnProperty(prefix = "spring.datasource", name = "jmx-enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnClass(name = "org.apache.tomcat.jdbc.pool.DataSourceProxy") @Conditional(DataSourceAutoConfiguration.DataSourceAvailableCondition.class) + @ConditionalOnMissingBean(name = "dataSourceMBean") protected static class TomcatDataSourceJmxConfiguration { @Bean
Protect against duplicate datasource MBeans See gh-<I>
spring-projects_spring-boot
train
java
7fae95cce9d3c340e8df4ba631915773e55a8d3a
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,13 +5,15 @@ Bundler.require(:default) require 'active_record' -unless ENV['TRAVIS'] && ENV['QUALITY'] == 'false' - begin - require './spec/support/simplecov_helper' - include SimpleCovHelper - start_simple_cov("unit-#{RUBY_VERSION}") - rescue LoadError - puts "Coverage disabled." +unless ENV['TRAVIS'] + unless ENV['TRAVIS'] && ENV['QUALITY'] == 'false' + begin + require './spec/support/simplecov_helper' + include SimpleCovHelper + start_simple_cov("unit-#{RUBY_VERSION}") + rescue LoadError + puts "Coverage disabled." + end end end
Disable coverage on travis CI for now.
rpush_rpush
train
rb
5842639a7177871e7ebc4b6f01bc78e9f11edbbd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ reqs = [str(ir.req) for ir in install_reqs] setup( name="napalm-base", - version='0.23.2', + version='0.23.3', packages=find_packages(), author="David Barroso", author_email="dbarrosop@dravetech.com",
napalm-base release <I>
napalm-automation_napalm-base
train
py
86396f4b4f8be2c7e408cd71921c3c282e3f4ae9
diff --git a/src/webcams/FSWebcam.js b/src/webcams/FSWebcam.js index <HASH>..<HASH> 100644 --- a/src/webcams/FSWebcam.js +++ b/src/webcams/FSWebcam.js @@ -114,6 +114,7 @@ FSWebcam.prototype.generateSh = function( location ) { var setValues = scope.getControlSetString( scope.opts.setValues ); + var verbose = scope.opts.verbose ? "" : " -q" // Use memory if null location @@ -121,7 +122,8 @@ FSWebcam.prototype.generateSh = function( location ) { ? "- -" : location; - var sh = scope.bin + " -q " + var sh = scope.bin + + + verbose + " " + resolution + " " + output + " " + quality + " "
Fixed verbose toggle for fswebcam
chuckfairy_node-webcam
train
js
bcac254ec132aac5d1743f6fcb4c5f46a3b8b56c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,9 +22,9 @@ tests_require = [ 'flake8==3.2.1', 'hypothesis==3.11.3', 'hypothesis-pytest==0.19.0', - 'py==1.4.31', + 'py==1.4.34', 'pydocstyle==2.0.0', - 'pytest==3.1.1', + 'pytest==3.1.2', 'pytest-benchmark==3.1.0a2', 'pytest-cov==2.5.1', 'Sphinx==1.6.2',
update to latest pytest (<I>) and py (<I>)
jab_bidict
train
py
2d8c735aa6065b90772202e1215def59a992d035
diff --git a/cmd/ctr/run.go b/cmd/ctr/run.go index <HASH>..<HASH> 100644 --- a/cmd/ctr/run.go +++ b/cmd/ctr/run.go @@ -42,6 +42,10 @@ var runCommand = cli.Command{ Usage: "runtime name (linux, windows, vmware-linux)", Value: "linux", }, + cli.StringFlag{ + Name: "runtime-config", + Usage: "set the OCI config file for the container", + }, cli.BoolFlag{ Name: "readonly", Usage: "set the containers filesystem as readonly",
Add back the runtime-config flag in ctr run This flag was already implemented but could not be specified any more.
containerd_containerd
train
go
9f5477d91b2c4f5c8892ebc5dc9cc94953df30eb
diff --git a/pkg/kvstore/etcd.go b/pkg/kvstore/etcd.go index <HASH>..<HASH> 100644 --- a/pkg/kvstore/etcd.go +++ b/pkg/kvstore/etcd.go @@ -544,8 +544,6 @@ func (e *etcdClient) statusChecker() { newStatus := []string{} ok := 0 - e.getLogger().Debugf("Performing status check to etcd") - endpoints := e.client.Endpoints() for _, ep := range endpoints { st, err := e.determineEndpointStatus(ep)
etcd: Remove duplicate debug message The message is very noisy as it is in the background and is completely useless
cilium_cilium
train
go
95096b90b6a0b2fe43850e20e2d6eb5e37301ad0
diff --git a/src/main/java/com/googlecode/lanterna/screen/Screen.java b/src/main/java/com/googlecode/lanterna/screen/Screen.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/screen/Screen.java +++ b/src/main/java/com/googlecode/lanterna/screen/Screen.java @@ -90,7 +90,7 @@ public class Screen this.terminal.addResizeListener(new TerminalResizeListener()); - ScreenCharacter background = new ScreenCharacter(new ScreenCharacter(' ')); + ScreenCharacter background = new ScreenCharacter(' '); for(int y = 0; y < terminalHeight; y++) { for(int x = 0; x < terminalWidth; x++) { visibleScreen[y][x] = new ScreenCharacter(background);
What was the purpose of that?!?
mabe02_lanterna
train
java
648ae48de06b57d7d4d81c458b8fa36b63cca4fe
diff --git a/lib/chronic/time_zone.rb b/lib/chronic/time_zone.rb index <HASH>..<HASH> 100644 --- a/lib/chronic/time_zone.rb +++ b/lib/chronic/time_zone.rb @@ -7,10 +7,11 @@ module Chronic end def self.scan_for_all(token) - scanner = {/[PMCE][DS]T/i => :tz, - /(tzminus)?\d{4}/ => :tz} - scanner.keys.each do |scanner_item| - return self.new(scanner[scanner_item]) if scanner_item =~ token.word + { + /[PMCE][DS]T/i => :tz, + /(tzminus)?\d{4}/ => :tz + }.each do |item, symbol| + return self.new(symbol) if item =~ token.word end return nil end
no need for a lvar to hold symbols
mojombo_chronic
train
rb
ff9ab11c0353d92cfce5e6bb29d3680f4be76106
diff --git a/salt/modules/mount.py b/salt/modules/mount.py index <HASH>..<HASH> 100644 --- a/salt/modules/mount.py +++ b/salt/modules/mount.py @@ -332,6 +332,8 @@ def is_fuse_exec(cmd): # No point in running ldd on a command that doesn't exist if not cmd_path: return False + elif not _which('ldd'): + raise CommandNotFoundError('ldd') out = __salt__['cmd.run']('ldd {0}'.format(cmd_path)) return 'libfuse' in out
mount module: Raise an exception when ldd isn't available in is_fuse_exec()
saltstack_salt
train
py
1d4310a581bad9b26c4805078d4a4da1a8059584
diff --git a/cmsplugin_cascade/plugin_base.py b/cmsplugin_cascade/plugin_base.py index <HASH>..<HASH> 100644 --- a/cmsplugin_cascade/plugin_base.py +++ b/cmsplugin_cascade/plugin_base.py @@ -8,6 +8,7 @@ from .widgets import JSONMultiWidget class CascadePluginBase(CMSPluginBase): tag_type = 'div' render_template = 'cms/plugins/generic.html' + glossary_variables = [] _cached_child_classes = None class Media: @@ -117,3 +118,11 @@ class CascadePluginBase(CMSPluginBase): form.base_fields['glossary'].validators.append(field.run_validators) setattr(form, 'glossary_fields', self.glossary_fields) return form + + def save_model(self, request, obj, form, change): + if self.glossary_variables: + # transfer listed glossary variables from the current object to the new object + old_obj = super(CascadePluginBase, self).get_object(request, form.instance.id) + variables = dict((k, v) for k, v in old_obj.glossary.items() if k in self.glossary_variables) + obj.glossary.update(variables) + super(CascadePluginBase, self).save_model(request, obj, form, change)
CascadePluginBase got new attr: list glossary_variables can be overloaded to store arbitrary data in glossary from request to request
jrief_djangocms-cascade
train
py
e0201f0c1579212986c8e27c994fac0d2093d12b
diff --git a/pynos/versions/base/interface.py b/pynos/versions/base/interface.py index <HASH>..<HASH> 100644 --- a/pynos/versions/base/interface.py +++ b/pynos/versions/base/interface.py @@ -760,14 +760,14 @@ class Interface(object): >>> auth = ('admin', 'password') >>> dev = pynos.device.Device(conn=conn, auth=auth) >>> int_type = 'tengigabitethernet' - >>> name = '225/0/38' + >>> name = '225/0/37' >>> enabled = True >>> output = dev.interface.enable_switchport(int_type, name) >>> output = dev.interface.spanning_tree_state(int_type=int_type, ... name=name, enabled=enabled) >>> enabled = False >>> output = dev.interface.spanning_tree_state(int_type=int_type, - ... name=name, enable=enabled) + ... name=name, enabled=enabled) >>> int_type = 'vlan' >>> name = '102' >>> enabled = False
Changed the doctest to ensure that they all work. Change-Id: I9d<I>ead<I>d<I>f<I>aacb5f<I>d<I>f7ad<I>
brocade_pynos
train
py
4dfc9c3ce5666d23a604a5c03a4fe0c617847c66
diff --git a/libkbfs/folder_branch_ops.go b/libkbfs/folder_branch_ops.go index <HASH>..<HASH> 100644 --- a/libkbfs/folder_branch_ops.go +++ b/libkbfs/folder_branch_ops.go @@ -1628,8 +1628,14 @@ func (fbo *folderBranchOps) SetInitialHeadFromServer( }() if md.IsReadable() && fbo.config.Mode().PrefetchWorkers() > 0 { - // We `Get` the root block to ensure downstream prefetches occur. - _ = fbo.config.BlockOps().BlockRetriever().Request(ctx, + // We `Get` the root block to ensure downstream prefetches + // occur. Use a fresh context, in case `ctx` is canceled by + // the caller before we complete. + prefetchCtx := fbo.ctxWithFBOID(context.Background()) + fbo.log.CDebugf(ctx, + "Prefetching root block with a new context: FBOID=%s", + prefetchCtx.Value(CtxFBOIDKey)) + _ = fbo.config.BlockOps().BlockRetriever().Request(prefetchCtx, defaultOnDemandRequestPriority, md, md.data.Dir.BlockPointer, &DirBlock{}, TransientEntry) } else {
folder_branch_ops: use fresh ctx when prefetching TLF root block Otherwise the caller could cancel `ctx` after we return, and the block retriever will cancel the block fetch, and the bserver will log a warning about a context being canceled.
keybase_client
train
go
6bc7b2f7175291e374fef2e45890164abb3a64d8
diff --git a/src/Query.php b/src/Query.php index <HASH>..<HASH> 100644 --- a/src/Query.php +++ b/src/Query.php @@ -44,14 +44,26 @@ class Query { } /** + * @param array? $bindings Bindings for a prepared statement. * @return Row[] */ - public function execute(): array { + public function execute(?array $bindings = null): array { if (! is_string($this->query)) { throw new Exception\QueryNotBuiltException; } - $results = static::$database->query($this->query); + try { + $statement = static::$database->prepare($this->query); + } catch (\PDOException $e) { + // do nothing -- we'll check for the return val of $statement + // this is just to prevent a PDOException from stopping execution + } + + if (! $statement) { + return []; + } + + $results = $statement->execute($bindings); /** @todo: Fix this to throw an Exception (?) */ if (! $results) {
Changes Query::execute() to use prepared statements
p810_mysql-helper
train
php
c7769b1fe53327ffe4a0877360e07ab71881e85e
diff --git a/Kwf/Component/Generator/Abstract.php b/Kwf/Component/Generator/Abstract.php index <HASH>..<HASH> 100644 --- a/Kwf/Component/Generator/Abstract.php +++ b/Kwf/Component/Generator/Abstract.php @@ -67,6 +67,11 @@ abstract class Kwf_Component_Generator_Abstract foreach ($this->_settings['component'] as $k=>$i) { if (!$i) unset($this->_settings['component'][$k]); } + + if (array_key_exists('addUrlPart', $this->_settings)) { + $this->_addUrlPart = (bool)$this->_settings['addUrlPart']; + unset($this->_settings['addUrlPart']); + } } protected function _getModel() @@ -590,11 +595,7 @@ abstract class Kwf_Component_Generator_Abstract public function getAddUrlPart() { - if (isset($this->_settings['addUrlPart'])) { - return $this->_settings['addUrlPart']; - } else { - return $this->_addUrlPart; - } + return $this->_addUrlPart; } abstract public function getChildData($parentData, $select = array());
simplify code: don't have two places where addUrlPart setting is stored
koala-framework_koala-framework
train
php
0e940fad17470483088da6c84192c26cc55a87e7
diff --git a/packages/cozy-konnector-libs/src/libs/linkBankOperations.js b/packages/cozy-konnector-libs/src/libs/linkBankOperations.js index <HASH>..<HASH> 100644 --- a/packages/cozy-konnector-libs/src/libs/linkBankOperations.js +++ b/packages/cozy-konnector-libs/src/libs/linkBankOperations.js @@ -92,6 +92,7 @@ class Linker { /* Commit updates */ commitChanges() { + log('debug', `linkBankOperations: commiting ${this.toUpdate.length} changes`) return cozyClient.fetchJSON( 'POST', `/data/${DOCTYPE_OPERATIONS}/_bulk_docs`,
chore: Add log to know how many changes have been commited
konnectors_libs
train
js
4d88c2dd9417dee98d98ee82e324b833f5afee40
diff --git a/Tests/OAuth/ResourceOwner/FacebookResourceOwnerTest.php b/Tests/OAuth/ResourceOwner/FacebookResourceOwnerTest.php index <HASH>..<HASH> 100644 --- a/Tests/OAuth/ResourceOwner/FacebookResourceOwnerTest.php +++ b/Tests/OAuth/ResourceOwner/FacebookResourceOwnerTest.php @@ -12,6 +12,7 @@ namespace HWI\Bundle\OAuthBundle\Tests\OAuth\ResourceOwner; use HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\FacebookResourceOwner; +use Symfony\Component\HttpFoundation\Request; class FacebookResourceOwnerTest extends GenericOAuth2ResourceOwnerTest { @@ -28,6 +29,17 @@ json; 'realname' => 'name', ); + /** + * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationException + */ + public function testGetAccessTokenFailedResponse() + { + $this->mockBuzz('{"error": {"message": "invalid"}}', 'application/json; charset=utf-8'); + $request = new Request(array('code' => 'code')); + + $this->resourceOwner->getAccessToken($request, 'http://redirect.to/'); + } + protected function setUpResourceOwner($name, $httpUtils, array $options) { $options = array_merge(
Add Facebook specific test to cover previous merges
hwi_HWIOAuthBundle
train
php
3cfa479c01e927364edd8d5f96b86f602341d6b2
diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -471,19 +471,21 @@ class UnitOfWork implements PropertyChangedListener */ public function computeChangeSet(ClassMetadata $class, $entity) { - if ( ! $class->isInheritanceTypeNone()) { - $class = $this->em->getClassMetadata(get_class($entity)); - } - $oid = spl_object_hash($entity); if (isset($this->readOnlyObjects[$oid])) { return; } + if ( ! $class->isInheritanceTypeNone()) { + $class = $this->em->getClassMetadata(get_class($entity)); + } + $actualData = array(); + foreach ($class->reflFields as $name => $refProp) { $value = $refProp->getValue($entity); + if (isset($class->associationMappings[$name]) && ($class->associationMappings[$name]['type'] & ClassMetadata::TO_MANY) && $value !== null
Micro optimization in computeChangeSet when using readOnly entities.
doctrine_orm
train
php
00c84acf01e055fce2068d1a7c69168badf0c20d
diff --git a/trimesh/path/polygons.py b/trimesh/path/polygons.py index <HASH>..<HASH> 100644 --- a/trimesh/path/polygons.py +++ b/trimesh/path/polygons.py @@ -1,7 +1,5 @@ import numpy as np - -from shapely import vectorized from shapely.geometry import Polygon from rtree import Rtree @@ -331,6 +329,7 @@ def medial_axis(polygon, Vertex positions in space """ from scipy.spatial import Voronoi + from shapely import vectorized if resolution is None: resolution = np.reshape(polygon.bounds, (2, 2)).ptp(axis=0).max() / 100 @@ -485,6 +484,8 @@ def sample(polygon, count, factor=1.5, max_iter=10): Random points inside polygon where n <= count """ + from shapely import vectorized + bounds = np.reshape(polygon.bounds, (2, 2)) extents = bounds.ptp(axis=0)
import shapely.vectorized in function
mikedh_trimesh
train
py
98679a35f4c8f367a11f94be20c630c2d7b519e5
diff --git a/src/createHTMLAudioElementWithLoopEvent.js b/src/createHTMLAudioElementWithLoopEvent.js index <HASH>..<HASH> 100644 --- a/src/createHTMLAudioElementWithLoopEvent.js +++ b/src/createHTMLAudioElementWithLoopEvent.js @@ -1,23 +1,13 @@ const loopchange = new Event('loopchange'); -class HTMLAudioElementWithLoopEvent extends HTMLAudioElement { - get loop () { - return super.loop; - } - - set loop (value) { - super.loop = value; - this.dispatchEvent(loopchange); - } -} - -document.registerElement('audio-with-loop-event', { - prototype: HTMLAudioElementWithLoopEvent.prototype, - extends: 'audio' -}); - function createHTMLAudioElementWithLoopEvent () { - return document.createElement('audio', 'audio-with-loop-event'); + const audio = document.createElement('audio'); + new MutationObserver(() => { + audio.dispatchEvent(loopchange); + }).observe(audio, { + attributeFilter: ['loop'] + }); + return audio; } module.exports = createHTMLAudioElementWithLoopEvent;
Custom audio element actually native audio element with MutationObserver on loop.
benwiley4000_cassette
train
js
ea81dfe48b17171ed3ed7d58c47b29ef11253da2
diff --git a/src/immer.js b/src/immer.js index <HASH>..<HASH> 100644 --- a/src/immer.js +++ b/src/immer.js @@ -49,18 +49,14 @@ export function produce(baseState, producer, patchListener) { if (patchListener !== undefined && typeof patchListener !== "function") throw new Error("the third argument of a producer should not be set or a function") } - // if state is a primitive, don't bother proxying at all - if (typeof baseState !== "object" || baseState === null) { + // avoid proxying anything except plain objects and arrays + if (!isProxyable(baseState)) { const returnValue = producer(baseState) return returnValue === undefined ? baseState : normalizeResult(returnValue) } - if (!isProxyable(baseState)) - throw new Error( - `the first argument to an immer producer should be a primitive, plain object or array, got ${typeof baseState}: "${baseState}"` - ) return normalizeResult( getUseProxies() ? produceProxy(baseState, producer, patchListener)
fix(produce): avoid throwing on unproxyable objects
immerjs_immer
train
js
b4303ae4116a6797defc1ddaf496eef85cf9535a
diff --git a/concrete/src/Url/Resolver/Manager/ResolverManager.php b/concrete/src/Url/Resolver/Manager/ResolverManager.php index <HASH>..<HASH> 100644 --- a/concrete/src/Url/Resolver/Manager/ResolverManager.php +++ b/concrete/src/Url/Resolver/Manager/ResolverManager.php @@ -23,6 +23,7 @@ class ResolverManager implements ResolverManagerInterface */ public function __construct($default_handle = '', UrlResolverInterface $default_resolver = null) { + $this->priorityTree = []; if ($default_resolver) { $this->addResolver($default_handle, $default_resolver); }
Initialize ResolverManager::priorityTree Otherwise we risk to iterate on null
concrete5_concrete5
train
php
fc68dfcde7162bab206948e0f6fd5feb56a5299e
diff --git a/ObjJAcornCompiler.js b/ObjJAcornCompiler.js index <HASH>..<HASH> 100644 --- a/ObjJAcornCompiler.js +++ b/ObjJAcornCompiler.js @@ -1017,9 +1017,9 @@ LabeledStatement: function(node, st, c, format) { c(node.label, st, "IdentifierName"); if (format) { buffer.concat(":"); + buffer.concatFormat(format.afterColon); } else { buffer.concat(": "); - buffer.concatFormat(format.afterColon); } } c(node.body, st, "Statement");
Fixed: Minor format issue on label statement
mrcarlberg_objj-transpiler
train
js
84869d25cc9c4f83edafcc7183b39c5518847b86
diff --git a/lcdproc/server.py b/lcdproc/server.py index <HASH>..<HASH> 100644 --- a/lcdproc/server.py +++ b/lcdproc/server.py @@ -49,7 +49,7 @@ class Server(object): if "success" in response: # Normal successful reply break if "huh" in response: # Something went wrong - break + break if "connect" in response: # Special reply to "hello" break # TODO Keep track of which screen is displayed
Update lcdproc/server.py Removed trailing space
jinglemansweep_lcdproc
train
py
b2a3fde696d4715d227170a11667cfa69783e982
diff --git a/tests/index.php b/tests/index.php index <HASH>..<HASH> 100644 --- a/tests/index.php +++ b/tests/index.php @@ -583,6 +583,8 @@ function showDebugData(\Delight\Auth\Auth $auth, $result) { echo 'Session name' . "\t\t\t\t"; \var_dump(\session_name()); + echo 'Auth::createRememberCookieName()' . "\t"; + \var_dump(\Delight\Auth\Auth::createRememberCookieName()); echo "\n"; echo 'Auth::createCookieName(\'session\')' . "\t";
Add tests for method 'createRememberCookieName' from class 'Auth'
delight-im_PHP-Auth
train
php
6ee8e17c334793066ada08b13e0154a1fe8acb74
diff --git a/test/PHPMailer/MimeTypesTest.php b/test/PHPMailer/MimeTypesTest.php index <HASH>..<HASH> 100644 --- a/test/PHPMailer/MimeTypesTest.php +++ b/test/PHPMailer/MimeTypesTest.php @@ -23,10 +23,31 @@ final class MimeTypesTest extends TestCase { /** - * Miscellaneous calls to improve test coverage and some small tests. + * Test mime type mapping. + * + * @dataProvider dataMime_Types + * + * @param string $input Input text string. + * @param string $expected Expected funtion output. */ - public function testMiscellaneous() + public function testMime_Types($input, $expected) { - self::assertSame('application/pdf', PHPMailer::_mime_types('pdf'), 'MIME TYPE lookup failed'); + $result = PHPMailer::_mime_types($input); + self::assertSame($expected, $result, 'MIME TYPE lookup failed'); + } + + /** + * Data provider. + * + * @return array + */ + public function dataMime_Types() + { + return [ + 'Extension: pdf (lowercase)' => [ + 'input' => 'pdf', + 'expected' => 'application/pdf', + ], + ]; } }
MimeTypesTest: reorganize to use data provider * Maintains the same test code and test case. * Makes it easier to add additional test cases in the future.
PHPMailer_PHPMailer
train
php
1f5e99bb9c0da87deee796dd31f8e130a4cfd40b
diff --git a/lib/arel.rb b/lib/arel.rb index <HASH>..<HASH> 100644 --- a/lib/arel.rb +++ b/lib/arel.rb @@ -21,7 +21,7 @@ require 'arel/delete_manager' require 'arel/nodes' module Arel - VERSION = '7.1.1' + VERSION = '7.2.0' def self.sql raw_sql Arel::Nodes::SqlLiteral.new raw_sql
Arel master is alre <I> closes #<I>
rails_rails
train
rb
b70b6d9a6ef3ba3918c36d639488c531b40f6c15
diff --git a/lntest/timeouts.go b/lntest/timeouts.go index <HASH>..<HASH> 100644 --- a/lntest/timeouts.go +++ b/lntest/timeouts.go @@ -1,4 +1,4 @@ -// +build !darwin, !kvdb_etcd +// +build !darwin,!kvdb_etcd package lntest diff --git a/lntest/timeouts_etcd.go b/lntest/timeouts_etcd.go index <HASH>..<HASH> 100644 --- a/lntest/timeouts_etcd.go +++ b/lntest/timeouts_etcd.go @@ -1,4 +1,4 @@ -// +build !darwin, kvdb_etcd +// +build !darwin,kvdb_etcd package lntest
lntest/timeouts: remove spaces from build predicates Otherwise this breaks various conditional compilation targets and the linter.
lightningnetwork_lnd
train
go,go
f4a4ea6fd04c73e4c19c911798b85c6578611540
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -if ENV['CODECLIMATE_REPO_TOKEN'] +if (RUBY_VERSION >= '1.9') && ENV['CODECLIMATE_REPO_TOKEN'] require 'codeclimate-test-reporter' CodeClimate::TestReporter.start end
Only load coverage for Ruby <I>+ Mostly b/c SimpleCov (used by the test reporter) is <I>+
stevenharman_git_tracker
train
rb
c5e2e8c4b02a73e4aca3e1a3fce1ac57221f14b8
diff --git a/subliminal/plugins/TheSubDB.py b/subliminal/plugins/TheSubDB.py index <HASH>..<HASH> 100644 --- a/subliminal/plugins/TheSubDB.py +++ b/subliminal/plugins/TheSubDB.py @@ -33,7 +33,7 @@ class TheSubDB(PluginBase.PluginBase): site_name = 'SubDB' server_url = 'http://api.thesubdb.com' # for testing purpose, use http://sandbox.thesubdb.com instead api_based = True - user_agent = 'SubDB/1.0 (Subliminal/0.1; https://github.com/Diaoul/subliminal)' # defined by the API + user_agent = 'SubDB/1.0 (Subliminal/0.3; https://github.com/Diaoul/subliminal)' # defined by the API _plugin_languages = {'cs': 'cs', # the whole list is available with the API: http://sandbox.thesubdb.com/?action=languages 'da': 'da', 'de': 'de',
Fix wrong subliminal version in TheSubDB
Diaoul_subliminal
train
py
10c7f544d916f73245bdb37fde09c8cdcb2184e0
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -255,12 +255,10 @@ module ActiveSupport #:nodoc: end def load_dependency(file) - Dependencies.load_interlock do - if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching? - Dependencies.new_constants_in(Object) { yield } - else - yield - end + if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching? + Dependencies.new_constants_in(Object) { yield } + else + yield end rescue Exception => exception # errors from loading file exception.blame_file! file if exception.respond_to? :blame_file!
Don't apply locking around basic #load / #require That's outside our remit, and dangerous... if a caller has their own locking to protect against the natural race danger, we'll deadlock against it.
rails_rails
train
rb
039598babcb314dbde25ecc797680d460f9e05b4
diff --git a/test/unit/transports/azure_test.rb b/test/unit/transports/azure_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/transports/azure_test.rb +++ b/test/unit/transports/azure_test.rb @@ -2,6 +2,9 @@ require 'helper' +# Required because this test file acesses classes under Azure:: +require 'azure_mgmt_resources' + describe 'azure transport' do def transport(options = nil) ENV['AZURE_TENANT_ID'] = 'test_tenant_id'
Add require for Azure (#<I>)
inspec_train
train
rb
3a5521204994e2addb2d4dd37d60b85a0cfd6123
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -87,7 +87,7 @@ async function startProcessEngine(sqlitePath) { .send(JSON.stringify(packageInfo, null, 2)); }); - const iamConfigPath = path.join(process.env.CONFIG_PATH, 'sqlite', 'iam', 'iam_service.json'); + const iamConfigPath = path.join(process.env.CONFIG_PATH, process.env.NODE_ENV, 'iam', 'iam_service.json'); // eslint-disable-next-line global-require const iamConfig = require(iamConfigPath);
:lipstick: Obtain the Config Path with the NODE_ENV env. Variable
process-engine_process_engine_runtime
train
js
4947d29a5612b698861eec16d3545aaae9db23fc
diff --git a/lib/eye/dsl/main.rb b/lib/eye/dsl/main.rb index <HASH>..<HASH> 100644 --- a/lib/eye/dsl/main.rb +++ b/lib/eye/dsl/main.rb @@ -41,7 +41,7 @@ module Eye::Dsl::Main opts = Eye::Dsl::ConfigOpts.new opts.instance_eval(&block) - @parsed_config.settings.merge!(opts.config) + Eye::Utils.deep_merge!(@parsed_config.settings, opts.config) Eye::Dsl.debug '<= config' end diff --git a/lib/eye/dsl/process_opts.rb b/lib/eye/dsl/process_opts.rb index <HASH>..<HASH> 100644 --- a/lib/eye/dsl/process_opts.rb +++ b/lib/eye/dsl/process_opts.rb @@ -4,7 +4,7 @@ class Eye::Dsl::ProcessOpts < Eye::Dsl::Opts opts = Eye::Dsl::ChildProcessOpts.new opts.instance_eval(&block) if block @config[:monitor_children] ||= {} - @config[:monitor_children].merge!(opts.config) + Eye::Utils.deep_merge!(@config[:monitor_children], opts.config) end alias xmonitor_children nop
deep merge in other places in dsl
kostya_eye
train
rb,rb
0e54fb226bd4c6bf5a8055955a90b129d0d18cd6
diff --git a/scraper/util.py b/scraper/util.py index <HASH>..<HASH> 100644 --- a/scraper/util.py +++ b/scraper/util.py @@ -20,6 +20,14 @@ def execute(command, cwd=None): process = Popen(command, cwd=cwd, stdout=PIPE, stderr=STDOUT, shell=False) # nosec out, err = process.communicate() + + if process.returncode: + logging.error( + "Error Executing: command=%s, returncode=%d", + " ".join(command), + process.returncode, + ) + return str(out), str(err) @@ -130,7 +138,7 @@ def git_repo_to_sloc(url): cloc_json = json.loads(json_blob) sloc = cloc_json["SUM"]["code"] except json.decoder.JSONDecodeError: - logger.debug("Error Decoding: url=%s, out=%s", url, out) + logger.error("Error Decoding: url=%s, out=%s", url, out) sloc = 0 logger.debug("SLOC: url=%s, sloc=%d", url, sloc)
Check the return code of executed commands Add a check of the returncode of the command executed in scraper.util.execute() and output an error message if it is not zero. Additionally change the logging level from DEBUG to ERROR for failures to process the JSON output from cloc. These combined will make it more clear when failures in core functionality are occurring.
LLNL_scraper
train
py
341bfbf237408b639ce28c19a0aa99129c2d2fbe
diff --git a/public/javascripts/promotion.js b/public/javascripts/promotion.js index <HASH>..<HASH> 100644 --- a/public/javascripts/promotion.js +++ b/public/javascripts/promotion.js @@ -98,7 +98,7 @@ var promotion_page = (function($){ if (adding) { button.html(i18n.remove).addClass("remove_" + type).removeClass('add_'+type); if( type !== 'product'){ - if( changeset.productCount() === 0 ){ + if( changeset.products[product_id] === undefined ){ add_product_breadcrumbs(changeset.id, product_id, product_name); } }
fixing issue where adding a partial product after a full product would result in not being able to browse the partial product
Katello_katello
train
js
eb9a03e27670712016f7f7bfddae318941d34152
diff --git a/addon/serializers/rest-serializer.js b/addon/serializers/rest-serializer.js index <HASH>..<HASH> 100644 --- a/addon/serializers/rest-serializer.js +++ b/addon/serializers/rest-serializer.js @@ -2,6 +2,7 @@ import ActiveModelSerializer from './active-model-serializer'; import { camelize, singularize, pluralize } from '../utils/inflector'; export default ActiveModelSerializer.extend({ + serializeIds: 'always', keyForModel(type) { return camelize(type); diff --git a/tests/unit/serializers/rest-serializer-test.js b/tests/unit/serializers/rest-serializer-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/serializers/rest-serializer-test.js +++ b/tests/unit/serializers/rest-serializer-test.js @@ -29,3 +29,8 @@ test('it hyphenates camelized words', function(assert) { } }); }); + +test('serializeIds defaults to "always"', function(assert) { + let defaultState = new RestSerializer; + assert.equal(defaultState.serializeIds, 'always'); +});
RestSerializer should always serialize ids Override the default Serializer behavior in the RestSerializer to convert ids in the expected way.
samselikoff_ember-cli-mirage
train
js,js
44e3ea1828cbb0fcc37c77df239f78e4b0b239fa
diff --git a/src/gluon.js b/src/gluon.js index <HASH>..<HASH> 100644 --- a/src/gluon.js +++ b/src/gluon.js @@ -2,7 +2,7 @@ * @license * MIT License * - * Copyright (c) 2017 Goffert van Gool + * Copyright (c) 2018 Goffert van Gool * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,8 +23,8 @@ * SOFTWARE. */ -import { render } from '../lit-html/lib/shady-render.js'; -export { html } from '../lit-html/lib/shady-render.js'; +import { render } from '../../lit-html/lib/shady-render.js'; +export { html } from '../../lit-html/lib/shady-render.js'; // Key to store the HTML tag in a custom element class const TAG = Symbol('tag'); @@ -120,7 +120,7 @@ export class GluonElement extends HTMLElement { } if (this[NEEDSRENDER]) { this[NEEDSRENDER] = false; - render(this.template, this.renderRoot, this.constructor.is); + render(this.template, this.renderRoot, { scopeName: this.constructor.is, eventContext: this }); } } }
Update to lit-html <I>, fix relative imports
ruphin_gluonjs
train
js
9563c9e21f3a92ab84688a7854fa18b1d316a5ad
diff --git a/dist/pptxgen.js b/dist/pptxgen.js index <HASH>..<HASH> 100644 --- a/dist/pptxgen.js +++ b/dist/pptxgen.js @@ -5505,6 +5505,11 @@ var PptxGenJS = function(){ color: rgbToHex( Number(arrRGB1[0]), Number(arrRGB1[1]), Number(arrRGB1[2]) ), fill: rgbToHex( Number(arrRGB2[0]), Number(arrRGB2[1]), Number(arrRGB2[2]) ) }; + var fontFamily = jQuery(cell).css('font-family').replace(/["]/gi,'').split(", ")[0]; + if (fontFamily !== "" && fontFamily !== "inherit" && fontFamily !== "initial") { + objOpts.fontFace = fontFamily; + } + if ( ['left','center','right','start','end'].indexOf(jQuery(cell).css('text-align')) > -1 ) objOpts.align = jQuery(cell).css('text-align').replace('start','left').replace('end','right'); if ( ['top','middle','bottom'].indexOf(jQuery(cell).css('vertical-align')) > -1 ) objOpts.valign = jQuery(cell).css('vertical-align');
Add support for font family css when export HTML table to slide.
gitbrent_PptxGenJS
train
js
5a6810d59dce5490bca2f2ac06e7847813d67012
diff --git a/library/WT/MenuBar.php b/library/WT/MenuBar.php index <HASH>..<HASH> 100644 --- a/library/WT/MenuBar.php +++ b/library/WT/MenuBar.php @@ -51,12 +51,6 @@ class WT_MenuBar { $menu->addSubmenu($submenu); } } - //-- Welcome Menu customization - $filename = WT_ROOT.'includes/extras/custom_welcome_menu.php'; - if (file_exists($filename)) { - require $filename; - } - return $menu; }
Do not load includes/extras/custom_welcome_menu.php; it is most likely an old PGV menu that will not work. If we want to allow this sort of behaviour, we will do it a different way.
fisharebest_webtrees
train
php
981b9ab709bce49fadd1fd11bde6349300cfc4cc
diff --git a/lib/handlers/bin.js b/lib/handlers/bin.js index <HASH>..<HASH> 100644 --- a/lib/handlers/bin.js +++ b/lib/handlers/bin.js @@ -1050,6 +1050,7 @@ module.exports = Observable.extend({ processors: bin.settings.processors || {}, checksum: options.checksum || null, metadata: options.metadata, + latest: bin.latest || false }, settings: options.settings ? _.extend(options.settings, { panels: panels }) : { panels: panels } };
Pass through "latest" in jsbin.state on client
jsbin_jsbin
train
js
9703e33bd4bb11110537a072e7986059f69344ae
diff --git a/app.go b/app.go index <HASH>..<HASH> 100644 --- a/app.go +++ b/app.go @@ -42,6 +42,7 @@ type Application struct { *flagGroup *argGroup *cmdGroup + initialized bool commandHelp *string Name string Help string @@ -99,6 +100,9 @@ func (a *Application) Version(version string) *Application { } func (a *Application) init() error { + if a.initialized { + return nil + } if a.cmdGroup.have() && a.argGroup.have() { return fmt.Errorf("can't mix top-level Arg()s with Command()s") } @@ -125,6 +129,7 @@ func (a *Application) init() error { return err } } + a.initialized = true return nil }
Don't allow multiple initialization.
alecthomas_kingpin
train
go
00794d3878532c6f194b438a3f8e2a53df09e717
diff --git a/lib/caracal/core/models/table_cell_model.rb b/lib/caracal/core/models/table_cell_model.rb index <HASH>..<HASH> 100644 --- a/lib/caracal/core/models/table_cell_model.rb +++ b/lib/caracal/core/models/table_cell_model.rb @@ -76,8 +76,10 @@ module Caracal # because paragraph-level styles don't seem to # affect runs within tables. weirdsies. if model.respond_to?(:runs) - options.each do |k,v| - model.send(k, v) if model.respond_to?(k) + runs.each do |run| + options.each do |k,v| + run.send(k, v) if run.respond_to?(k) + end end end end
Fixed issue where cell style options were not being applied to runs correctly.
trade-informatics_caracal
train
rb
640a6958833d8313ec1f8e67516e5d0ba38b9dbb
diff --git a/kitnirc/client.py b/kitnirc/client.py index <HASH>..<HASH> 100644 --- a/kitnirc/client.py +++ b/kitnirc/client.py @@ -629,7 +629,7 @@ def _parse_msg(client, command, actor, args): recipient, _, message = args.partition(' :') chantypes = client.server.features.get("CHANTYPES", "#") if recipient[0] in chantypes: - recipient = client.server.channels.get(recipient.lower()) or recipient + recipient = client.server.get_channel(recipient) or recipient.lower() else: recipient = User(recipient) client.dispatch_event(command, actor, recipient, message)
Convert one more instance to get_channel
ayust_kitnirc
train
py
de231ac529fbea3a8bf1960e5a29902ff78ab670
diff --git a/concrete/blocks/youtube/view.php b/concrete/blocks/youtube/view.php index <HASH>..<HASH> 100644 --- a/concrete/blocks/youtube/view.php +++ b/concrete/blocks/youtube/view.php @@ -41,7 +41,7 @@ if (isset($iv_load_policy) && $iv_load_policy > 0) { $params[] = 'iv_load_policy=' . $iv_load_policy; } -if (isset($loop) && $loop) { +if (isset($loopEnd) && $loopEnd) { $params[] = 'loop=1'; } @@ -79,4 +79,4 @@ if (Page::getCurrentPage()->isEditMode()) { ?>" frameborder="0" allowfullscreen></iframe> </div> <?php -} ?> \ No newline at end of file +} ?>
loop Setting not working in youtube block (#<I>) The variable for the loop setting in the controller is $loopEnd (instead of $loop). Former-commit-id: 1acc<I>b<I>a<I>effe<I>ef<I>bf Former-commit-id: cb5ac7cba<I>d9ada2b5bbb9d3c2c<I>abd
concrete5_concrete5
train
php
af488a5062e1af5b85b7c25c2a58087cb9905a86
diff --git a/__init__.py b/__init__.py index <HASH>..<HASH> 100644 --- a/__init__.py +++ b/__init__.py @@ -20,5 +20,5 @@ __revision__ = "$Id$" # #--start constants-- -__version__ = "3.0a4" +__version__ = "3.0a5" #--end constants--
Bumping versions for <I>a5
pypa_setuptools
train
py
d91527a76a1a790602b9db3c5a7c9eeb7ed14d61
diff --git a/lib/mohawk/adapters/uia/table.rb b/lib/mohawk/adapters/uia/table.rb index <HASH>..<HASH> 100644 --- a/lib/mohawk/adapters/uia/table.rb +++ b/lib/mohawk/adapters/uia/table.rb @@ -2,7 +2,19 @@ module Mohawk module Adapters module UIA class Table < Control - include ElementLocator + class Row + attr_reader :index + + def initialize(table, element, index) + @table, @element, @index = table, element, index + end + + def to_hash + {text: element.name, row: index} + end + + end + include ElementLocator, Enumerable def select(which) find_row_with(which).select @@ -16,21 +28,21 @@ module Mohawk find_row_with(which).remove_from_selection end - def count - table.row_count - end - def headers table.headers.map &:name end + def each + all_items.each_with_index.map { |el, index| yield Row.new self, el, index } + end + def find_row_with(row_info) found_row = case row_info - when Hash - find_by_hash(row_info) - else - find(row_info) - end + when Hash + find_by_hash(row_info) + else + find(row_info) + end raise "A row with #{row_info} was not found" unless found_row found_row end
Table is Enumerable; returns Rows in uia adapter
leviwilson_mohawk
train
rb
07e64688d795176aa250da9ab71f10692ddc966c
diff --git a/lib/Less/Parser.php b/lib/Less/Parser.php index <HASH>..<HASH> 100644 --- a/lib/Less/Parser.php +++ b/lib/Less/Parser.php @@ -1042,7 +1042,7 @@ class Parser { private function parseOperand () { $negate = false; - $p = $this->input[$this->pos + 1]; + $p = isset($this->input[$this->pos + 1]) ? $this->input[$this->pos + 1] : ''; if ($this->peek('-') && ($p === '@' || $p === '(')) { $negate = $this->match('-'); }
Added test for string length to operator parser function. Fixes #5.
oyejorge_less.php
train
php
6cf4ffb73b0d21004c55ea7c66cdcc14e6dd6b41
diff --git a/mutagen/id3.py b/mutagen/id3.py index <HASH>..<HASH> 100644 --- a/mutagen/id3.py +++ b/mutagen/id3.py @@ -116,7 +116,7 @@ class ID3(mutagen.Metadata): if (2,2,0) <= self.version < (2,3,0): perframe = 6 if frames is None: frames = Frames_2_2 - while self.__readbytes+perframe < self.__size: + while self.__readbytes+perframe < self.__size+10: try: name, tag = self.load_frame(frames=frames) except EOFError: break
Handle short tags that hit the end - remember to count id3 header size. Test not included; unsure how best to test this.
quodlibet_mutagen
train
py
28c090ccb714fec37b3c1f3ab355523db2f4c73f
diff --git a/salt/config.py b/salt/config.py index <HASH>..<HASH> 100644 --- a/salt/config.py +++ b/salt/config.py @@ -2395,7 +2395,7 @@ def is_profile_configured(opts, provider, profile_name): alias, driver = provider.split(':') # Most drivers need a size, but some do not. - non_size_drivers = ['parallels', 'softlayer', 'softlayer_hw'] + non_size_drivers = ['opennebula', 'parallels', 'softlayer', 'softlayer_hw'] if driver not in non_size_drivers: required_keys.append('size')
Don't require opennebula profiles to have a size
saltstack_salt
train
py
b21c3692c1a00077875b0114d5aa653978c36ce0
diff --git a/src/protocol/recordBatch/v0/index.js b/src/protocol/recordBatch/v0/index.js index <HASH>..<HASH> 100644 --- a/src/protocol/recordBatch/v0/index.js +++ b/src/protocol/recordBatch/v0/index.js @@ -4,6 +4,9 @@ const crc32C = require('../crc32C') const { Types: Compression, lookupCodec } = require('../../message/compression') const MAGIC_BYTE = 2 +const COMPRESSION_MASK = 11 // The lowest 3 bits +const TIMESTAMP_MASK = 0 // The fourth lowest bit, always set this bit to 0 (since 0.10.0) +const TRANSACTIONAL_MASK = 16 // The fifth lowest bit /** * v0 @@ -30,13 +33,17 @@ const RecordBatch = async ({ maxTimestamp = Date.now(), partitionLeaderEpoch = 0, lastOffsetDelta = 0, + transactional = false, producerId = Long.fromValue(-1), // for idempotent messages producerEpoch = 0, // for idempotent messages firstSequence = 0, // for idempotent messages records = [], }) => { + const attributes = + (compression & COMPRESSION_MASK) | TIMESTAMP_MASK | transactional ? TRANSACTIONAL_MASK : 0 + const batchBody = new Encoder() - .writeInt16(compression & 0x3) + .writeInt16(attributes) .writeInt32(lastOffsetDelta) .writeInt64(firstTimestamp) .writeInt64(maxTimestamp)
Accept transactional flag on RecordBatch
tulios_kafkajs
train
js
660aaedea10fa3a668289e066986ff8e3eccac57
diff --git a/lib/distribot/workflow.rb b/lib/distribot/workflow.rb index <HASH>..<HASH> 100644 --- a/lib/distribot/workflow.rb +++ b/lib/distribot/workflow.rb @@ -104,6 +104,7 @@ module Distribot end def pause! + raise "Cannot pause unless running" unless self.running? self.add_transition(to: 'paused', timestamp: Time.now.utc.to_f) end @@ -121,6 +122,7 @@ module Distribot end def cancel! + raise "Cannot cancel unless running" unless self.running? self.add_transition(to: 'canceled', timestamp: Time.now.utc.to_f) end @@ -128,6 +130,10 @@ module Distribot self.current_phase == 'canceled' end + def running? + ! ( self.paused? || self.canceled? || self.finished? ) + end + def redis_id @redis_id ||= Distribot.redis_id("workflow", self.id) end
Disallow pause or cancel unless running.
distribot_distribot
train
rb
ed52df45e430fe352dadee8b3d7dda3188e5a8ae
diff --git a/lib/common.js b/lib/common.js index <HASH>..<HASH> 100644 --- a/lib/common.js +++ b/lib/common.js @@ -18,7 +18,6 @@ var config = require('getset').loadSync(config_file); // exports common.root_path = root_path; -common.script_path = script_path; common.version = version; common.program = program; common.os_name = os_name;
Removed script_path from lib/common.
prey_prey-node-client
train
js
5f2195ebbe1bf720a86f1e5ea7f2a1616dd771af
diff --git a/internetarchive/iarequest.py b/internetarchive/iarequest.py index <HASH>..<HASH> 100644 --- a/internetarchive/iarequest.py +++ b/internetarchive/iarequest.py @@ -300,15 +300,6 @@ def prepare_metadata(metadata, source_metadata=None, append=False): # Index all items which contain an index. for key in metadata: - # Parse string bools to proper bools. - try: - if metadata[key].lower() == 'true': - metadata[key] = True - elif metadata[key].lower() == 'false': - metadata[key] = False - except AttributeError: - pass - # Insert values from indexed keys into prepared_metadata dict. if (rm_index(key) in indexed_keys): try:
Don't convert "true"/"false" to True/False in upload.
jjjake_internetarchive
train
py
5c4d0a026dd20a857535eb724ecefa4b00210eb7
diff --git a/packages/openneuro-server/src/graphql/resolvers/snapshots.js b/packages/openneuro-server/src/graphql/resolvers/snapshots.js index <HASH>..<HASH> 100644 --- a/packages/openneuro-server/src/graphql/resolvers/snapshots.js +++ b/packages/openneuro-server/src/graphql/resolvers/snapshots.js @@ -186,7 +186,7 @@ export const filterLatestSnapshot = snapshots => { snapshots, snapshotCreationComparison, ) - return sortedSnapshots[0].tag + return sortedSnapshots[sortedSnapshots.length - 1].tag } else { return null }
fix(api): Fix inverted sort order for latestSnapshot
OpenNeuroOrg_openneuro
train
js
063a16f016d6e0508695b0404d3045b92756c939
diff --git a/spec/yelp/responses/base_spec.rb b/spec/yelp/responses/base_spec.rb index <HASH>..<HASH> 100644 --- a/spec/yelp/responses/base_spec.rb +++ b/spec/yelp/responses/base_spec.rb @@ -9,8 +9,8 @@ describe Yelp::Response::Base do it { is_expected.to be_a Yelp::Response::Base } it 'should create variables' do - expect(base.instance_variable_get('@a')).to eq 10 - expect(base.instance_variable_get('@b')).to eq 20 + expect(base.instance_variable_get(:@a)).to eq 10 + expect(base.instance_variable_get(:@b)).to eq 20 end end
Uses symbols for instance_variable_get (more idiomatic)
Yelp_yelp-ruby
train
rb
3bd35ecb1abb44dc604c1d1d07790e22819b8330
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java index <HASH>..<HASH> 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java @@ -55,7 +55,7 @@ import org.jxmpp.jid.Jid; * commands offered by a service and for processing commands requests. * * Pass in an XMPPConnection instance to - * {@link #getAddHocCommandsManager(org.jivesoftware.smack.XMPPConnection)} in order to + * {@link #getAddHocCommandsManager(XMPPConnection)} in order to * get an instance of this class. * * @author Gabriel Guardincerri
Do not fully qualify type in javadoc
igniterealtime_Smack
train
java
0af3e636f41fa17a6d76245d348aac54d74135fb
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -114,6 +114,7 @@ function first ( ) { if ( results [index] ) { promise.fulfill(results [index]); } + index ++; } return promise.fulfill(results.pop()); }); diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "promix", "description": "Mix promises with callbacks for improved control flow", - "version": "0.1.10", + "version": "0.1.11", "main": "./index", "author": { "name": "Pachet", diff --git a/test/test-core.js b/test/test-core.js index <HASH>..<HASH> 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -207,6 +207,7 @@ function concat ( test ) { module.exports = { join : join, fork : fork, + first : first, wrap : wrap, errorless : errorless, invoke : invoke,
Fixing bug with the way that results were being checked within the promix.first() method.
pachet_promix
train
js,json,js
5c10b9089f9fe9495d2ac00334130774dd05cddf
diff --git a/src/DaftObjectMemoryTree.php b/src/DaftObjectMemoryTree.php index <HASH>..<HASH> 100644 --- a/src/DaftObjectMemoryTree.php +++ b/src/DaftObjectMemoryTree.php @@ -130,7 +130,7 @@ abstract class DaftObjectMemoryTree extends DaftObjectMemoryRepository implement ) : ( ((array) $id === (array) $this->GetNestedObjectTreeRootId()) - ? $this->RecallDaftNestedObjectFullTree(0) + ? $this->RecallDaftNestedObjectFullTree($relativeDepthLimit) : [] ); }
relative path limit needs to be passed on
SignpostMarv_daft-nested-object
train
php
2e1d0003a9659252633bbe27dba347d83f74e64f
diff --git a/code/Heystack/Subsystem/Ecommerce/Purchasable/Interfaces/PurchasableHolderInterface.php b/code/Heystack/Subsystem/Ecommerce/Purchasable/Interfaces/PurchasableHolderInterface.php index <HASH>..<HASH> 100644 --- a/code/Heystack/Subsystem/Ecommerce/Purchasable/Interfaces/PurchasableHolderInterface.php +++ b/code/Heystack/Subsystem/Ecommerce/Purchasable/Interfaces/PurchasableHolderInterface.php @@ -62,6 +62,13 @@ interface PurchasableHolderInterface extends TransactionModifierInterface public function getPurchasable(IdentifierInterface $identifier); /** + * Retrieves a purchasable from the implementing class' internal cache of + * purchasables using the Primary string on the Identifier object + * @param \Heystack\Subsystem\Core\Identifier\IdentifierInterface $identifier + */ + public function getPurchasableByPrimaryIdentifier(IdentifierInterface $identifier); + + /** * Removes a purchasable from the implementing class' internal cache of * purchasables * @param \Heystack\Subsystem\Core\Identifier\IdentifierInterface $identifier
FEATURE: Added getPurchasableByPrimaryIdentifier() so that we can retrieve the purchasable just using a part of the identifier (Primary)
heyday_heystack-ecommerce-core
train
php
23e65e7b82f7232930021363dff7e882bc9e7b05
diff --git a/LiSE/LiSE/allegedb/__init__.py b/LiSE/LiSE/allegedb/__init__.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/allegedb/__init__.py +++ b/LiSE/LiSE/allegedb/__init__.py @@ -1221,6 +1221,8 @@ class ORM(object): if not to_keep: # unloading literally everything would make the game unplayable, # so don't + if hasattr(self, 'warning'): + self.warning("Not unloading, due to lack of keyframes") return caches = self._caches for past_branch, (
Add a warning when unload() can't do anything
LogicalDash_LiSE
train
py
8eda30f46b9d71765f80dbb6d67759b890ebb9c0
diff --git a/Entity/DataRepository.php b/Entity/DataRepository.php index <HASH>..<HASH> 100644 --- a/Entity/DataRepository.php +++ b/Entity/DataRepository.php @@ -278,9 +278,11 @@ class DataRepository extends EntityRepository throw new \LogicException("Family {$family->getCode()} does not have an attribute as label"); } if ($attribute->getType()->isRelation() || $attribute->getType()->isEmbedded()) { - continue; // @todo fixme + // @todo fixme properly with eav join support + $orCondition[] = $eavQb->attribute($attribute)->isNotNull(); + } else { + $orCondition[] = $eavQb->attribute($attribute)->like($term); } - $orCondition[] = $eavQb->attribute($attribute)->like($term); } return $eavQb->apply($eavQb->getOr($orCondition));
Temporary fix for nested attributeAsLabel properties
VincentChalnot_SidusEAVModelBundle
train
php
a44a05caabe0ee3d49f8c8ff06fb5d794cd61c1a
diff --git a/invenio_files_rest/models.py b/invenio_files_rest/models.py index <HASH>..<HASH> 100644 --- a/invenio_files_rest/models.py +++ b/invenio_files_rest/models.py @@ -500,6 +500,7 @@ class FileInstance(db.Model, Timestamp): current_app.config['FILES_REST_DEFAULT_STORAGE_CLASS'] \ if storage_class is None else \ storage_class + return self class ObjectVersion(db.Model, Timestamp):
models: minor fix * Adds support for chaining methods.
inveniosoftware_invenio-files-rest
train
py
91e3223528803a0bba84518d4108d69e30e2db01
diff --git a/src/Justimmo/Api/JustimmoApi.php b/src/Justimmo/Api/JustimmoApi.php index <HASH>..<HASH> 100644 --- a/src/Justimmo/Api/JustimmoApi.php +++ b/src/Justimmo/Api/JustimmoApi.php @@ -276,6 +276,8 @@ class JustimmoApi implements JustimmoApiInterface */ public function call($call, array $params = array()) { + $startTime = microtime(true); + if (!array_key_exists('culture', $params)) { $params['culture'] = $this->culture; } @@ -290,6 +292,13 @@ class JustimmoApi implements JustimmoApiInterface $this->logger->debug('cache found'); $this->logger->debug($content); + $this->logger->debug('call end', array( + 'url' => $url, + 'cache' => true, + 'time' => microtime(true) - $startTime, + 'response' => $content, + )); + return $content; } @@ -323,6 +332,13 @@ class JustimmoApi implements JustimmoApiInterface $this->cache->set($key, $response); + $this->logger->debug('call end', array( + 'url' => $url, + 'cache' => false, + 'time' => microtime(true) - $startTime, + 'response' => $response, + )); + return $response; }
statistic logging [skip ci]
justimmo_php-sdk
train
php
de953459f371672eb0cf7f2c2c4d32f06ee6d8d2
diff --git a/src/fileseq/all.py b/src/fileseq/all.py index <HASH>..<HASH> 100644 --- a/src/fileseq/all.py +++ b/src/fileseq/all.py @@ -35,7 +35,7 @@ Regular expression for matching a file sequence string. Example: /film/shot/renders/bilbo_bty.1-100#.exr """ -_SPLITTER_PATTERN = re.compile("([\:xy\-0-9,]*)([\#\@]*)") +_SPLITTER_PATTERN = re.compile("([\:xy\-0-9,]*)([\#\@]+)") """ Regular expression pattern for matching file names on disk.
Force the frameID to include at least one # or @ character
sqlboy_fileseq
train
py
86dd3e61d75ced498ea205792e6a2a7d429b76f4
diff --git a/src/Codeception/Module/WebDriver.php b/src/Codeception/Module/WebDriver.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/WebDriver.php +++ b/src/Codeception/Module/WebDriver.php @@ -2123,16 +2123,16 @@ class WebDriver extends CodeceptionModule implements * 'field1' => 'value', * 'checkbox' => [ * 'value of first checkbox', - * 'value of second checkbox, + * 'value of second checkbox', * ], * 'otherCheckboxes' => [ * true, * false, - * false + * false, * ], * 'multiselect' => [ * 'first option value', - * 'second option value' + * 'second option value', * ] * ]); * ?>
Update WebDriver documentation - typo in example (#<I>) Missing `'` in an example which break the style
Codeception_base
train
php
e997b8ba14803516fd5f4f01b2e041245ee52a9c
diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -64,6 +64,36 @@ class TestResponse } /** + * Assert that the response has a not found status code. + * + * @return $this + */ + public function assertNotFound() + { + PHPUnit::assertTrue( + $this->isNotFound(), + 'Response status code ['.$this->getStatusCode().'] is not a not found status code.' + ); + + return $this; + } + + /** + * Assert that the response has a forbidden status code. + * + * @return $this + */ + public function assertForbidden() + { + PHPUnit::assertTrue( + $this->isForbidden(), + 'Response status code ['.$this->getStatusCode().'] is not a forbidden status code.' + ); + + return $this; + } + + /** * Assert that the response has the given status code. * * @param int $status
Add additional methods for response status testing (#<I>)
laravel_framework
train
php
4323fb57aba4953a992b6de9a92fd42f4fd35309
diff --git a/spec/mysql2/statement_spec.rb b/spec/mysql2/statement_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mysql2/statement_spec.rb +++ b/spec/mysql2/statement_spec.rb @@ -764,7 +764,9 @@ RSpec.describe Mysql2::Statement do context 'close' do it 'should free server resources' do stmt = @client.prepare 'SELECT 1' + GC.disable expect { stmt.close }.to change(&method(:stmt_count)).by(-1) + GC.enable end it 'should raise an error on subsequent execution' do
Deflake statement_spec by preventing GC during assertion
brianmario_mysql2
train
rb
ad92f480fd42a17f09068a1e3dcbd30f340fd8c6
diff --git a/examples/other/export_x3d.py b/examples/other/export_x3d.py index <HASH>..<HASH> 100644 --- a/examples/other/export_x3d.py +++ b/examples/other/export_x3d.py @@ -1,5 +1,5 @@ -"""Embed a 3D scene -in a webpage with +"""Embed a 3D scene +in a webpage with x3dom and vtkplotter""" from vtkplotter import * @@ -10,7 +10,7 @@ e.pointColors(ec[:,1]) # add dummy colors along y t = Text(__doc__, pos=(3e03,5.5e03,1e04), s=350) show(e, t) -# This exports the scene and generates 2 files: +# This exports the scene and generates 2 files: # embryo.x3d and an example embryo.html to inspect in the browser exportWindow('embryo.x3d')
Removed trailing spaces in examples/other/export_x3d.py
marcomusy_vtkplotter
train
py
845969baa542adb5f0110e81cea913498aa24bb8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', setup( name='gspread', - packages=['gspread', 'gspread.v4'], + packages=['gspread'], description=description, long_description=long_description, version=version,
Exclude `v4` from setup
burnash_gspread
train
py
9ed2a7cc7813c232fdeac24ccdcd2cd5b2d3e329
diff --git a/webhooks.go b/webhooks.go index <HASH>..<HASH> 100644 --- a/webhooks.go +++ b/webhooks.go @@ -87,7 +87,6 @@ func (p ProxyInterceptCallbackWebhook) GetInteractionData() (InteractionData, er // text message response, or redirect a call to another number. type ProxyOutOfSessionCallbackWebhook struct { AccountSid string `form:"AccountSid"` - Body string `form:"Body"` SessionUniqueName string `form:"sessionUniqueName"` SessionAccountSid string `form:"sessionAccountSid"` SessionServiceSid string `form:"sessionServiceSid"` @@ -99,6 +98,10 @@ type ProxyOutOfSessionCallbackWebhook struct { SessionDateEnded time.Time `form:"sessionDateEnded"` SessionClosedReason string `form:"sessionClosedReason"` + // SMS Specific + Body string `form:"Body"` + SmsSid string `form:"SmsSid"` + To string `form:"To"` ToCity string `form:"ToCity"` ToState string `form:"ToState"`
Add SmsSid to OOS Webhook
sfreiberg_gotwilio
train
go
bc0cd7b7bfe28ae8ca55db369ae630cbc774d976
diff --git a/raft.go b/raft.go index <HASH>..<HASH> 100644 --- a/raft.go +++ b/raft.go @@ -201,8 +201,8 @@ func (r *Raft) appendEntries(rpc RPC, a *AppendEntriesRequest) (transition bool) Term: r.currentTerm, Success: false, } - var err error - defer rpc.Respond(resp, err) + var rpcErr error + defer rpc.Respond(resp, rpcErr) // Ignore an older term if a.Term < r.currentTerm { @@ -274,8 +274,8 @@ func (r *Raft) requestVote(rpc RPC, req *RequestVoteRequest) (transition bool) { Term: r.currentTerm, Granted: false, } - var err error - defer rpc.Respond(resp, err) + var rpcErr error + defer rpc.Respond(resp, rpcErr) // Ignore an older term if req.Term < r.currentTerm {
Ensure we don't return the wrong error as part of the RPC response
hashicorp_raft
train
go
68c5b016f9a2663abc9cd4aeb0cc0034949469ca
diff --git a/src/core/lombok/javac/apt/Processor.java b/src/core/lombok/javac/apt/Processor.java index <HASH>..<HASH> 100644 --- a/src/core/lombok/javac/apt/Processor.java +++ b/src/core/lombok/javac/apt/Processor.java @@ -256,12 +256,16 @@ public class Processor extends AbstractProcessor { for (int i = priorityLevels.length - 1; i >= 0; i--) { Long curLevel = priorityLevels[i]; Long nextLevel = (i == priorityLevels.length - 1) ? null : priorityLevels[i + 1]; + List<JCCompilationUnit> cusToAdvance = new ArrayList<JCCompilationUnit>(); for (Map.Entry<JCCompilationUnit, Long> entry : roots.entrySet()) { if (curLevel.equals(entry.getValue())) { - entry.setValue(nextLevel); + cusToAdvance.add(entry.getKey()); newLevels.add(nextLevel); } } + for (JCCompilationUnit unit : cusToAdvance) { + roots.put(unit, nextLevel); + } } newLevels.remove(null);
[i<I>] Another try to prevent NPEs on IBM J9
rzwitserloot_lombok
train
java
73332757ed85989f119bfb7561d8c777b4e0eaa6
diff --git a/lib/database/domain.js b/lib/database/domain.js index <HASH>..<HASH> 100644 --- a/lib/database/domain.js +++ b/lib/database/domain.js @@ -71,9 +71,11 @@ Domain.prototype = { return domainNameFromHost; } - var domainNameFromPath = Domain.getNameFromPath(source.url); - if (domainNameFromPath) - return domainNameFromPath; + if (source.url) { + var domainNameFromPath = Domain.getNameFromPath(source.url); + if (domainNameFromPath) + return domainNameFromPath; + } throw new Error('no domain name'); },
Fix error around undefined (or null) request.url
groonga_gcs
train
js
c244c890f6ff2b498c6239fe0a294d997484fb45
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( packages=['treetime'], install_requires = [ 'biopython>=1.66', - 'matplotlib>=2.0, ==2.*', + 'matplotlib>=2.0', 'numpy>=1.10.4', 'pandas>=0.17.1', 'scipy>=0.16.1' diff --git a/treetime/__init__.py b/treetime/__init__.py index <HASH>..<HASH> 100644 --- a/treetime/__init__.py +++ b/treetime/__init__.py @@ -7,4 +7,4 @@ from .gtr import GTR from .merger_models import Coalescent from .treeregression import TreeRegression from .argument_parser import make_parser -version="0.6.0" +version="0.6.1"
relax matplotlib requirement to allow version 3.*
neherlab_treetime
train
py,py
04b48c60ed468e758879c49bb0e07fedf8198afb
diff --git a/src/js/core/mediaelement.js b/src/js/core/mediaelement.js index <HASH>..<HASH> 100644 --- a/src/js/core/mediaelement.js +++ b/src/js/core/mediaelement.js @@ -389,8 +389,10 @@ class MediaElement { }, triggerAction = (methodName, args) => { try { - // Sometimes, playing native DASH media might throw `DOMException: The play() request was interrupted`. - if (methodName === 'play' && t.mediaElement.rendererName === 'native_dash') { + // Sometimes, playing native DASH media might throw `DOMException: The play() request was interrupted`. + // Add this for native HLS playback as well + if (methodName === 'play' && + (t.mediaElement.rendererName === 'native_dash' || t.mediaElement.rendererName === 'native_hls') { const response = t.mediaElement.renderer[methodName](args); if (response && typeof response.then === 'function') { response.catch(() => {
Added handling of the .play() promise errors to native_hls player
mediaelement_mediaelement
train
js
aaa4ff6c3cb8adbc7c90876b077d92cccd9b7332
diff --git a/src/Facade/Address.php b/src/Facade/Address.php index <HASH>..<HASH> 100755 --- a/src/Facade/Address.php +++ b/src/Facade/Address.php @@ -54,6 +54,11 @@ class Address return self::$sdk->get('customers/'.$customer.'/addresses', $terms); } + public static function Delete($customer, $id) + { + return self::$sdk->delete('customers/'.$customer.'/addresses/'.$id); + } + public static function Fields($customer = null, $id = null) { $uri = 'customers';
Add missing delete() method to Address facade
moltin_php-sdk
train
php
33297acd2f9c1ad14fb28fb903f95c7f98474e57
diff --git a/tests/test_general.py b/tests/test_general.py index <HASH>..<HASH> 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -12,11 +12,11 @@ from symfit import (Variable, Parameter, Fit, FitResults, Maximize, Likelihood, log, variables, parameters, Model, NumericalLeastSquares, Eq, Ge) from symfit.distributions import Gaussian, Exp -#from symfit.tests.tests_fit_result import TestFitResults -#from symfit.tests.tests_analytical_fit import TestAnalyticalFit -#from symfit.tests.tests_model import TestModel -#from symfit.tests.tests_ode import TestODE -#from symfit.tests.tests_constrained import TestConstrained +from tests.test_fit_result import TestFitResults +from tests.test_analytical_fit import TestAnalyticalFit +from tests.test_model import TestModel +from tests.test_ode import TestODE +from tests.test_constrained import TestConstrained if sys.version_info >= (3, 0): import inspect as inspect_sig
Re-enabled all tests.
tBuLi_symfit
train
py
28d59e1d63a116ca2f15c323db304c8946d08fed
diff --git a/labsuite/compilers/plate_map.py b/labsuite/compilers/plate_map.py index <HASH>..<HASH> 100644 --- a/labsuite/compilers/plate_map.py +++ b/labsuite/compilers/plate_map.py @@ -169,6 +169,6 @@ class Plate(): """ Returns the well position on this plate matching a particular value. """ - for pos in self.map: + for pos in sorted(self.map.keys()): if self.map[pos].strip() == value: return humanize_position(pos)
CSV Ingestion: Always return same well in value search.
Opentrons_opentrons
train
py
a1fb1a9e23e3952945e3409b52c72ff7b7b3a5d7
diff --git a/dev/com.ibm.ws.logging_test/test/com/ibm/ws/logging/utils/FileLogHolderTest.java b/dev/com.ibm.ws.logging_test/test/com/ibm/ws/logging/utils/FileLogHolderTest.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.logging_test/test/com/ibm/ws/logging/utils/FileLogHolderTest.java +++ b/dev/com.ibm.ws.logging_test/test/com/ibm/ws/logging/utils/FileLogHolderTest.java @@ -10,6 +10,11 @@ *******************************************************************************/ package com.ibm.ws.logging.utils; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + import java.io.File; import java.io.FilenameFilter; import java.io.IOException;
Issue <I>: Revert missing imports
OpenLiberty_open-liberty
train
java
9d013c2226bfcb8d0da8042f6f75298a6c4d1daf
diff --git a/whizzer/rpc/proxy.py b/whizzer/rpc/proxy.py index <HASH>..<HASH> 100644 --- a/whizzer/rpc/proxy.py +++ b/whizzer/rpc/proxy.py @@ -40,14 +40,6 @@ class Proxy(object): self.requests = dict() self.timeout = None - def set_timeout(self, timeout): - """Set the timeout of blocking calls, None means block forever. - - timeout -- seconds after which to raise a TimeoutError for blocking calls. - - """ - self.timeout = timeout - def call(self, method, *args): """Perform a synchronous remote call where the returned value is given immediately.
timeout is a property not a method
bfrog_whizzer
train
py
94d02ffe7fb4573c402570741bac5cc55616e55a
diff --git a/backtrader/feeds/yahoo.py b/backtrader/feeds/yahoo.py index <HASH>..<HASH> 100644 --- a/backtrader/feeds/yahoo.py +++ b/backtrader/feeds/yahoo.py @@ -139,7 +139,10 @@ class YahooFinanceCSVData(feed.CSVDataBase): # In v7, the final seq is "adj close", close, volume adjustedclose = c # c was read above c = float(linetokens[next(i)]) - v = float(linetokens[next(i)]) + try: + v = float(linetokens[next(i)]) + except: # cover the case in which volume is "null" + v = 0.0 if self.p.swapcloses: # swap closing prices if requested c, adjustedclose = adjustedclose, c
Handle volume as string null in YahooFinanceData
backtrader_backtrader
train
py
69909a7735e418376ba858135ac82446b4611aa2
diff --git a/src/DOM/Element.js b/src/DOM/Element.js index <HASH>..<HASH> 100644 --- a/src/DOM/Element.js +++ b/src/DOM/Element.js @@ -39,7 +39,7 @@ class Element extends Node { return window.innerHeight; } - getContext(contextType, context) { + getContext(contextType, contextOptions, context) { const possibleContext = context || global.__context; if (contextType != '2d' && possibleContext) { return possibleContext;
Fixed `gl.createBuffer is not a function`. With this change, I _believe_ `expo-pixi` works again with Expo SDK <I>.
expo_browser-polyfill
train
js
345f28336b4ab8ea0a63fc110b1f64fe8f8273a7
diff --git a/filterbank/filterbank2.py b/filterbank/filterbank2.py index <HASH>..<HASH> 100755 --- a/filterbank/filterbank2.py +++ b/filterbank/filterbank2.py @@ -229,6 +229,7 @@ class Filterbank(object): self.header = self.container.header self.n_ints_in_file = self.container.n_ints_in_file self.__setup_time_axis() + self.heavy = self.container.heavy #Loading data (default for light files). if self.container.data is not None: @@ -763,6 +764,8 @@ def cmd_tool(args=None): # Open filterbank data filename = args.filename load_data = not args.info_only + info_only = args.info_only + # only load one integration if looking at spectrum wtp = args.what_to_plot @@ -783,8 +786,13 @@ def cmd_tool(args=None): fil = Filterbank(filename, f_start=args.f_start, f_stop=args.f_stop,t_start=t_start, t_stop=t_stop,load_data=load_data) fil.info() + if fil.heavy: + info_only = True + # And if we want to plot data, then plot data. - if not args.info_only: + + if not info_only: + # check start & stop frequencies make sense #try: # if args.f_start:
Added the heavy parameter. A boolean to take control of how large the file is.
UCBerkeleySETI_blimpy
train
py
1fd3bf084eb35eed3b7508e1a99e7c61497ced20
diff --git a/lib/hocho/host.rb b/lib/hocho/host.rb index <HASH>..<HASH> 100644 --- a/lib/hocho/host.rb +++ b/lib/hocho/host.rb @@ -197,7 +197,7 @@ module Hocho alt = false begin Net::SSH.start(name, nil, ssh_options) - rescue Net::SSH::Exception, Errno::ECONNREFUSED => e + rescue Net::SSH::Exception, Errno::ECONNREFUSED, Net::SSH::Proxy::ConnectError => e raise if alt raise unless alternate_ssh_options_available? puts "[#{name}] Trying alternate_ssh_options due to #{e.inspect}"
handle Net::SSH::Proxy::ConnectError to switch to alternative
sorah_hocho
train
rb