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
5ba5cd0baa0fd21260ef6057ea072eca03ab7a8c
diff --git a/src/infi/gevent_utils/silent_greenlets.py b/src/infi/gevent_utils/silent_greenlets.py index <HASH>..<HASH> 100644 --- a/src/infi/gevent_utils/silent_greenlets.py +++ b/src/infi/gevent_utils/silent_greenlets.py @@ -4,6 +4,7 @@ greenlets that don't print exceptions to the screen and can reraise the exceptio import gevent import sys +import six from logging import getLogger logger = getLogger(__name__) @@ -38,7 +39,7 @@ def join(greenlet, timeout=None, raise_error=True): value = greenlet.get(block=True, timeout=timeout) if isinstance(value, SilentGreenletExceptionWrapper): if raise_error: - raise value.get_exc_info() + six.reraise(*value.get_exc_info()) else: return None return value
HOSTDEV-<I> use six to raise exception from a single silent Greenlet
Infinidat_infi.gevent_utils
train
py
5b81d3da6fe96a4b9039062f511492cec897210e
diff --git a/instabot/bot/bot_archive.py b/instabot/bot/bot_archive.py index <HASH>..<HASH> 100644 --- a/instabot/bot/bot_archive.py +++ b/instabot/bot/bot_archive.py @@ -11,7 +11,7 @@ def archive(self, media_id, undo=False): self.total_archived += int(not undo) self.total_unarchived += int(undo) return True - self.logger.info("Media id %s is not %s .", media_id, 'unarchived' if undo else 'archived') + self.logger.info("Media id %s is not %s.", media_id, 'unarchived' if undo else 'archived') return False
Update bot_archive.py
instagrambot_instabot
train
py
51c42463a7ee9a1d1c4f1ba07895aa4572f5b5e0
diff --git a/src/STYLES.js b/src/STYLES.js index <HASH>..<HASH> 100644 --- a/src/STYLES.js +++ b/src/STYLES.js @@ -1,3 +1,3 @@ module.exports = [ - 'default', 'info', 'warning', 'success', 'danger' + 'default', 'info', 'warning', 'success', 'danger', 'primary' ];
Add "primary" style for buttons, etc
GitbookIO_styleguide
train
js
5fa21cf6927bea3eb0b55947af4e05a34a78be5a
diff --git a/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java b/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java index <HASH>..<HASH> 100644 --- a/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java +++ b/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java @@ -23,9 +23,9 @@ public class OntologyTermIndexRepository extends AbstractOntologyRepository impl private static String ONTOLOGY_TERM_REPLACEMENT_VALUE = "\\s"; @Autowired - public OntologyTermIndexRepository(OntologyLoader loader, String name, SearchService searchService) + public OntologyTermIndexRepository(OntologyLoader loader, String entityName, SearchService searchService) { - super(name, searchService); + super(entityName, searchService); if (loader == null) throw new IllegalArgumentException("OntologyLoader is null!"); ontologyLoader = loader; }
refactored an argument in the constructor
molgenis_molgenis
train
java
6d338c2f8c91ccf6a8970928b0935e0f00b53ce2
diff --git a/lib/redshift_connector/importer/rebuild_rename.rb b/lib/redshift_connector/importer/rebuild_rename.rb index <HASH>..<HASH> 100644 --- a/lib/redshift_connector/importer/rebuild_rename.rb +++ b/lib/redshift_connector/importer/rebuild_rename.rb @@ -15,6 +15,7 @@ module RedshiftConnector old_table = "#{dest_table}_old" tmp_dao = @dao.dup + self.class.const_set(@dao.name.to_sym, tmp_dao) tmp_dao.table_name = tmp_table exec_update "drop table if exists #{tmp_table}"
dao class must have a name
bricolages_redshift-connector
train
rb
4727d032545d7c1251ee114f31eda4da36ba4e24
diff --git a/lxd/device/config/devices.go b/lxd/device/config/devices.go index <HASH>..<HASH> 100644 --- a/lxd/device/config/devices.go +++ b/lxd/device/config/devices.go @@ -11,7 +11,7 @@ type Device map[string]string // Clone returns a copy of the Device. func (device Device) Clone() Device { - copy := map[string]string{} + copy := make(map[string]string, len(device)) for k, v := range device { copy[k] = v @@ -159,7 +159,7 @@ func (list Devices) Update(newlist Devices, updateFields func(Device, Device) [] // Clone returns a copy of the Devices set. func (list Devices) Clone() Devices { - copy := Devices{} + copy := make(Devices, len(list)) for deviceName, device := range list { copy[deviceName] = device.Clone() @@ -170,7 +170,7 @@ func (list Devices) Clone() Devices { // CloneNative returns a copy of the Devices set as a native map[string]map[string]string type. func (list Devices) CloneNative() map[string]map[string]string { - copy := map[string]map[string]string{} + copy := make(map[string]map[string]string, len(list)) for deviceName, device := range list { copy[deviceName] = device.Clone()
lxd/device/config/devices: More efficient allocations
lxc_lxd
train
go
9ac27385bc274e57e3c04bfc103e9bacfad2f96b
diff --git a/core/src/main/java/org/eobjects/analyzer/connection/CouchDbDatastore.java b/core/src/main/java/org/eobjects/analyzer/connection/CouchDbDatastore.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/eobjects/analyzer/connection/CouchDbDatastore.java +++ b/core/src/main/java/org/eobjects/analyzer/connection/CouchDbDatastore.java @@ -29,6 +29,8 @@ public class CouchDbDatastore extends UsageAwareDatastore<CouchDbDataContext> im private static final long serialVersionUID = 1L; + public static final int DEFAULT_PORT = 5984; + private final String _hostname; private final Integer _port; private final String _username; @@ -78,7 +80,7 @@ public class CouchDbDatastore extends UsageAwareDatastore<CouchDbDataContext> im } else { dataContext = new CouchDbDataContext(httpClient); } - return new DatastoreConnectionImpl<CouchDbDataContext>(dataContext, this); + return new UpdateableDatastoreConnectionImpl<CouchDbDataContext>(dataContext, this); } public String getHostname() { @@ -86,6 +88,9 @@ public class CouchDbDatastore extends UsageAwareDatastore<CouchDbDataContext> im } public int getPort() { + if (_port == null) { + return DEFAULT_PORT; + } return _port; }
Ticket #<I>: Added dialog in DC for couch db datastores
datacleaner_AnalyzerBeans
train
java
64be24d189e9bfa31e5d10807460e88cf2bd3168
diff --git a/Granam/Tests/Tools/TestWithMockery.php b/Granam/Tests/Tools/TestWithMockery.php index <HASH>..<HASH> 100644 --- a/Granam/Tests/Tools/TestWithMockery.php +++ b/Granam/Tests/Tools/TestWithMockery.php @@ -51,10 +51,12 @@ abstract class TestWithMockery extends \PHPUnit_Framework_TestCase * Expects test class with name \Granam\Tests\Tools\TestWithMockery therefore extended by \Tests sub-namespace * and Test suffix * + * @param string $sutTestClass + * @param string $regexp * @return string|TestWithMockery */ - protected static function getSutClass() + protected static function getSutClass($sutTestClass = null, $regexp = '~\\\Tests(.+)Test$~') { - return preg_replace('~\\\Tests(.+)Test$~', '$1', get_called_class()); + return preg_replace($regexp, '$1', $sutTestClass ?: get_called_class()); } } \ No newline at end of file
Parameters to determine SUT class can be passed
granam_tools
train
php
2fd3fbda44d45566cb4ae34b957d9f1ded3a5169
diff --git a/lib/client/bundler/index.js b/lib/client/bundler/index.js index <HASH>..<HASH> 100644 --- a/lib/client/bundler/index.js +++ b/lib/client/bundler/index.js @@ -72,7 +72,7 @@ function getBundler(client){ module.exports = function(ss,options) { var proto = require('./proto')(ss, bundlers, bundlerById, options), - compressor = uglifyjs.Compressor(); + compressor = uglifyjs.Compressor({warnings:false}); function systemModule(name,wrap) { name = name.replace(/\.js$/,'');
fix(logging): no warnings by Uglify
socketstream_socketstream
train
js
8d3ea816bee6d633b106ed34fab6b15c15d9af41
diff --git a/openid/consumer/interface.py b/openid/consumer/interface.py index <HASH>..<HASH> 100644 --- a/openid/consumer/interface.py +++ b/openid/consumer/interface.py @@ -520,7 +520,7 @@ class OpenIDAuthRequest(object): Users of this library should not create instances of this class. Instances of this class are created by the library - whenever needed. + when needed. """ self.token = token self.server_id = server_id
[project @ doc project continuing]
openid_python-openid
train
py
72cf06c15e5ffd059a0aab156543eb1416813101
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,10 +17,10 @@ else: SKEL_PATH = 'etc/skel' KYTOS_SKEL_PATH = os.path.join(SKEL_PATH, 'kytos') -AUTHOR_PATH = os.path.join(KYTOS_SKEL_PATH, 'napp-structure/author') -NAPP_PATH = os.path.join(AUTHOR_PATH, 'napp') -ETC_FILES = [(os.path.join(BASE_ENV, AUTHOR_PATH), - [os.path.join(AUTHOR_PATH, '__init__.py')]), +USERNAME_PATH = os.path.join(KYTOS_SKEL_PATH, 'napp-structure/username') +NAPP_PATH = os.path.join(USERNAME_PATH, 'napp') +ETC_FILES = [(os.path.join(BASE_ENV, USERNAME_PATH), + [os.path.join(USERNAME_PATH, '__init__.py')]), (os.path.join(BASE_ENV, NAPP_PATH), [os.path.join(NAPP_PATH, '__init__.py'), os.path.join(NAPP_PATH, 'kytos.json.template'),
Rename remaining references to 'author'
kytos_kytos-utils
train
py
34ff65c29bb2c48ab22e992da41e4553617f6b26
diff --git a/src/adapters/File.js b/src/adapters/File.js index <HASH>..<HASH> 100644 --- a/src/adapters/File.js +++ b/src/adapters/File.js @@ -3,7 +3,7 @@ import Adapter from './Adapter'; export function defaultResolvePath(locale, namespace, options) { const { ext, path } = options; - const fileName = `${locale}${ext || ''}`; + const fileName = ext ? `${locale}${ext}` : locale; const namespacePath = namespace ? '/' + namespace.replace('.', '/') @@ -13,7 +13,7 @@ export function defaultResolvePath(locale, namespace, options) { ? `${namespacePath}/${fileName}` : fileName; - return namespaceFilePath + return path ? `${path}/${namespaceFilePath}` : namespaceFilePath; }
typo in the FILe adapter
CherryProjects_translate-maker
train
js
826ead6b2fd0013c1c248655cde6b6ed79827f21
diff --git a/Kwc/Box/OpenGraph/Image/Component.php b/Kwc/Box/OpenGraph/Image/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Box/OpenGraph/Image/Component.php +++ b/Kwc/Box/OpenGraph/Image/Component.php @@ -13,6 +13,7 @@ class Kwc_Box_OpenGraph_Image_Component extends Kwc_Abstract_Image_Component 'scale' => Kwf_Media_Image::SCALE_CROP ), ); + $ret['altText'] = false; return $ret; }
disable alt text for OpenGraph image, doesn't make much sense to have that
koala-framework_koala-framework
train
php
fd4c2ecdd614a734f1660584a63f1a77d5cc20af
diff --git a/lib/jeff.rb b/lib/jeff.rb index <HASH>..<HASH> 100644 --- a/lib/jeff.rb +++ b/lib/jeff.rb @@ -41,8 +41,7 @@ module Jeff # Internal: Returns an Excon::Connection. def connection - @connection ||= Excon.new endpoint, headers: headers, - idempotent: true + @connection ||= Excon.new endpoint, headers: headers end # Internal: Gets the String AWS endpoint.
Doesn't *really* provide idempotent requests
hakanensari_jeff
train
rb
8fb55264629e4c4abfc435715ebee07da2fb68e6
diff --git a/src/Aimeos/Shop/Command/AccountCommand.php b/src/Aimeos/Shop/Command/AccountCommand.php index <HASH>..<HASH> 100644 --- a/src/Aimeos/Shop/Command/AccountCommand.php +++ b/src/Aimeos/Shop/Command/AccountCommand.php @@ -81,6 +81,7 @@ class AccountCommand extends AbstractCommand \Illuminate\Foundation\Auth\User::findOrFail( $item->getId() ) ->forceFill( [ + 'siteid' => $this->option( 'super' ) ? '' : $item->getSiteId(), 'superuser' => ( $this->option( 'super' ) ? 1 : 0 ), 'email_verified_at' => now(), ] )->save();
Set empty site ID for superusers account so they are not bound to a site
aimeos_aimeos-laravel
train
php
54e2d7a2b545b67bc47a56d0d5fffa09fb4020db
diff --git a/taxtastic/subcommands/taxtable.py b/taxtastic/subcommands/taxtable.py index <HASH>..<HASH> 100644 --- a/taxtastic/subcommands/taxtable.py +++ b/taxtastic/subcommands/taxtable.py @@ -232,7 +232,6 @@ def build_taxtable(df, ranks): df = df.join(df['rank'], on='parent_id', rsuffix='_parent').reset_index() df['rank_parent'] = df['rank_parent'].astype( 'category', categories=ranks, ordered=True) - df['rank'] = df['rank'].astype('category', categories=ranks, ordered=True) lineages = df[df['tax_id'] == '1'].iloc[[0]] lineages.loc[:, 'root'] = lineages['tax_id'] df = df.drop(lineages.index) @@ -255,6 +254,7 @@ def build_taxtable(df, ranks): how='inner') lineages = lineages.append(at_rank) + # status message msg = '{} of {} rank lineages completed\r'.format(i, rank_count) sys.stderr.write(msg)
make only parent_rank column sortable when building lineages
fhcrc_taxtastic
train
py
7a36a3c88f136e10b43b1294057de5b8939bc10c
diff --git a/lib/weary/base.rb b/lib/weary/base.rb index <HASH>..<HASH> 100644 --- a/lib/weary/base.rb +++ b/lib/weary/base.rb @@ -47,7 +47,7 @@ module Weary # [<tt>with</tt>] An array of parameters that will be passed to the body or query of the request. If you pass a hash, it will define default <tt>values</tt> for params <tt>keys</tt> # [<tt>requires</tt>] Array of members of <tt>:with</tt> that are required by the resource. # [<tt>authenticates</tt>] Boolean value; does the resource require authentication? - # [<tt>url</tt>] The url of the resource. You can use the same flags as #construct_url + # [<tt>url</tt>] The url of the resource. # [<tt>follows</tt>] Boolean; Does this follow redirects? Defaults to true # [<tt>headers</tt>] Set headers for the HTTP Request def get(name,&block)
Removing reference to an old/outdated method
mwunsch_weary
train
rb
029f22bb13f2eb3ec5e3d2acdbb82cfb5b32171d
diff --git a/src/Schemata/Merger.php b/src/Schemata/Merger.php index <HASH>..<HASH> 100644 --- a/src/Schemata/Merger.php +++ b/src/Schemata/Merger.php @@ -18,7 +18,9 @@ class Merger { protected function array_compare_recursive(Array &$base = null, Array $acquisition) : Array { if(isset($base)){ $this->unsetDatatypeConflicts($base, $acquisition); + $this->unsetDatatypeConflicts($acquisition, $base); } + foreach ($acquisition as $key => $value) { // create new key in $base, if it is empty if (!isset($base[$key])) { @@ -62,13 +64,10 @@ class Merger { } protected function unsetDatatypeConflicts(Array &$a, Array &$b){ - foreach(['int','decimal'] as $datatype){ + foreach ( ['int', 'decimal'] as $datatype){ if (isset($a['datetime'], $b[$datatype])){ unset($a['datetime'], $b[$datatype]); } - if (isset($a[$datatype], $b['datetime'])){ - unset($a[$datatype], $b['datetime']); - } } } }
refactor DRY up unset
jpuck_etl
train
php
ab63cc3c2faa4d7efc0302fcaf48325f7be5390b
diff --git a/salt/modules/grub.py b/salt/modules/grub.py index <HASH>..<HASH> 100644 --- a/salt/modules/grub.py +++ b/salt/modules/grub.py @@ -2,6 +2,8 @@ Support for GRUB ''' +# TODO: Support grub2 + import os def __virtual__(): @@ -17,14 +19,10 @@ def _detect_conf(): ''' GRUB conf location differs depending on distro ''' - conf = ('CentOS', 'Scientific', 'RedHat', 'Fedora', 'CloudLinux') - menu = ('Ubuntu', 'Debian', 'Arch') - if __grains__['os'] in conf: + if __grains__['os_family'] == 'RedHat': return '/boot/grub/grub.conf' - elif __grains__['os'] in menu: - return '/boot/grub/menu.lst' - else: - return '/boot/grub/menu.lst' + # Defaults for Ubuntu, Debian, Arch, and others + return '/boot/grub/menu.lst' def version(): '''
salt.modules.grub: Remove code and don't change functionality Also add a few RedHat-ish distros to the list for grub.conf that weren't already. CloudLinux and OVS and the other variant of Oracle Linux come to mind.
saltstack_salt
train
py
de39143a1fd2e76c18f81321b8b1fa2327e34ce2
diff --git a/Source/com/drew/metadata/photoshop/PhotoshopReader.java b/Source/com/drew/metadata/photoshop/PhotoshopReader.java index <HASH>..<HASH> 100644 --- a/Source/com/drew/metadata/photoshop/PhotoshopReader.java +++ b/Source/com/drew/metadata/photoshop/PhotoshopReader.java @@ -98,7 +98,7 @@ public class PhotoshopReader implements JpegSegmentMetadataReader pos += 1; // Some basic bounds checking if (descriptionLength < 0 || descriptionLength + pos > length) - return; + throw new ImageProcessingException("Invalid string length"); // We don't use the string value here reader.skip(descriptionLength); pos += descriptionLength;
Throw on bounds failure, not return.
drewnoakes_metadata-extractor
train
java
45c09db1d7a88a526802ca32f770fa46b8eacf97
diff --git a/compiler/prelude/jsmapping.go b/compiler/prelude/jsmapping.go index <HASH>..<HASH> 100644 --- a/compiler/prelude/jsmapping.go +++ b/compiler/prelude/jsmapping.go @@ -139,7 +139,7 @@ var $externalize = function(v, t) { if (t === $js.Object) { return v; } - if (t.kind === $kindPtr) { + if (t.kind === $kindPtr && v !== t.nil) { var o = searchJsObject(v.$get(), t.elem); if (o !== undefined) { return o; diff --git a/js/js_test.go b/js/js_test.go index <HASH>..<HASH> 100644 --- a/js/js_test.go +++ b/js/js_test.go @@ -416,4 +416,9 @@ func TestNil(t *testing.T) { if !dummys.Call("isEqual", s, nil).Bool() { t.Fail() } + + type T struct{ Field *S } + if dummys.Call("testField", T{}) != nil { + t.Fail() + } }
fixed externalization of nil pointer inside of struct (fixes #<I>, again)
gopherjs_gopherjs
train
go,go
377aa39c2f460b2cc471ffefe65225b7572a921a
diff --git a/sllurp/llrp_proto.py b/sllurp/llrp_proto.py index <HASH>..<HASH> 100644 --- a/sllurp/llrp_proto.py +++ b/sllurp/llrp_proto.py @@ -3358,7 +3358,6 @@ class LLRPROSpec(dict): 'ROReportTrigger': 'Upon_N_Tags_Or_End_Of_AISpec', 'TagReportContentSelector': tagReportContentSelector, 'N': 0, - 'ImpinjTagReportContentSelector': None, }, }
don't add ImpinjTagReportContentSelector to ROSpec unless requested
ransford_sllurp
train
py
687654f553a83c303f39c9e5b6ac526823207be8
diff --git a/src/Console/PruneCommand.php b/src/Console/PruneCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/PruneCommand.php +++ b/src/Console/PruneCommand.php @@ -12,7 +12,7 @@ class PruneCommand extends Command * * @var string */ - protected $signature = 'telescope:prune'; + protected $signature = 'telescope:prune {--age=24}'; /** * The console command description. @@ -29,6 +29,6 @@ class PruneCommand extends Command */ public function handle(PrunableRepository $repository) { - $this->info($repository->prune(now()->subHours(24)).' entries pruned.'); + $this->info($repository->prune(now()->subHours($this->argument('age'))).' entries pruned.'); } }
Adding age parameter to pruning command Enabling the user to choose the age before records are being pruned from the repository (in hours)
laravel_telescope
train
php
5c2ffed27f53e0a3dffe7c6a4256a39baa0ae539
diff --git a/spec/support/scorm_engine.rb b/spec/support/scorm_engine.rb index <HASH>..<HASH> 100644 --- a/spec/support/scorm_engine.rb +++ b/spec/support/scorm_engine.rb @@ -1,6 +1,11 @@ module ScormEngineHelpers # - # + # If a real scorm engine is available this method will disable VCR and + # execute the passed block. It is useful for when we need to ensure certain + # records are present in SCORM engine, but we do not want them recorded as + # the act of recording would break later expectations. That is if we record + # importing a course and play it back other tests that expect the actual + # record to exist in SCORM will fail. # def against_real_scorm_engine return unless scorm_engine_is_available? @@ -13,14 +18,16 @@ module ScormEngineHelpers end # - # + # Check to see if a scorm engine is available. Probably true while developing + # locally, definitely not true in Travis. # def scorm_engine_is_available? ENV["SCORM_ENGINE_IS_AVAILABLE"] == "true" end # - # + # Ensure that the specified course exists in SCORM engine. Will import course + # if not present. # def ensure_course_exists(options = {}) response = options[:client].courses(course_id: options[:course_id]) @@ -29,7 +36,7 @@ module ScormEngineHelpers end # - # + # Attempt to import a course to SCORM engine. # def import_course(options = {}) options = {key: "RuntimeBasicCalls_SCORM20043rdEdition", may_create_new_version: true}.merge(options)
comment scorm engine spec helpers
instructure-bridge_scorm_engine
train
rb
f640243ee3bf69927179f2f38e6f78d1087f85be
diff --git a/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java b/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java index <HASH>..<HASH> 100644 --- a/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java +++ b/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java @@ -159,6 +159,7 @@ public class MapView extends ViewGroup implements IMapView, MapViewConstants, : tileRequestCompleteHandler; mTileProvider = tileProvider; mTileProvider.setTileRequestCompleteHandler(mTileRequestCompleteHandler); + updateTileSizeForDensity(mTileProvider.getTileSource()); this.mMapOverlay = new TilesOverlay(mTileProvider, mResourceProxy); mOverlayManager = new OverlayManager(mMapOverlay);
Issue #<I> Set the tile size from the constructor using the initial tile source.
osmdroid_osmdroid
train
java
34b7516b6a7d0ffe3fb68ce8294e6b6f1f0ba464
diff --git a/openid/test/test_discover.py b/openid/test/test_discover.py index <HASH>..<HASH> 100644 --- a/openid/test/test_discover.py +++ b/openid/test/test_discover.py @@ -65,7 +65,7 @@ class TestDiscoveryFailure(datadriven.DataDrivenTestCase): # string exception is raised. import warnings warnings.filterwarnings('ignore', 'raising a string.*', DeprecationWarning, - r'^openid\.test\.test_discover$', 76) + r'^openid\.test\.test_discover$', 77) class ErrorRaisingFetcher(object): """Just raise an exception when fetch is called"""
[project @ Fix the warning-silencing code in test_discover to reference the correct line number]
openid_python-openid
train
py
9b9659b281de88c6bfb740046c3dc821c700b290
diff --git a/deployer/src/main/java/net/kuujo/vertigo/NetworkFactory.java b/deployer/src/main/java/net/kuujo/vertigo/NetworkFactory.java index <HASH>..<HASH> 100644 --- a/deployer/src/main/java/net/kuujo/vertigo/NetworkFactory.java +++ b/deployer/src/main/java/net/kuujo/vertigo/NetworkFactory.java @@ -113,9 +113,11 @@ public class NetworkFactory implements VerticleFactory { @Override public void handle(AsyncResult<ActiveNetwork> result) { if (result.failed()) { + container.logger().warn("Failed to deploy network."); startResult.setFailure(result.cause()); } else { startResult.setResult((Void) null); + container.logger().info("Successfully deployed network."); container.exit(); } }
Add helper messages to deployer.
kuujo_vertigo
train
java
68ddd31fb4b6dc0f24bcf0c31f07709542daa8e0
diff --git a/cli/version.js b/cli/version.js index <HASH>..<HASH> 100644 --- a/cli/version.js +++ b/cli/version.js @@ -9,7 +9,7 @@ const logger = require('winston'); * @name version */ function version() { - const packageJson = require(path.resolve(process.cwd(), 'package.json')); + const packageJson = require(path.resolve(__dirname, '..', 'package.json')); logger.info('@blackbaud/skyux-builder: %s', packageJson.version); } diff --git a/test/cli-version.spec.js b/test/cli-version.spec.js index <HASH>..<HASH> 100644 --- a/test/cli-version.spec.js +++ b/test/cli-version.spec.js @@ -11,7 +11,7 @@ describe('cli version', () => { const version = 'this.should.match'; let stubs = {}; - stubs[path.join(process.cwd(), 'package.json')] = { + stubs[path.join(__dirname, '..', 'package.json')] = { '@noCallThru': true, version: version };
Pointing to correct installed location of package.json (#<I>)
blackbaud_skyux-builder
train
js,js
5d14d658378b382f75f05023706d5e9426001986
diff --git a/thefuck/utils.py b/thefuck/utils.py index <HASH>..<HASH> 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -1,5 +1,4 @@ import atexit -import json import os import pickle import re @@ -227,7 +226,7 @@ class Cache(object): def _get_key(self, fn, depends_on, args, kwargs): parts = (fn.__module__, repr(fn).split('at')[0], depends_on, args, kwargs) - return json.dumps(parts) + return str(pickle.dumps(parts)) def get_value(self, fn, depends_on, args, kwargs): if self._db is None: @@ -235,7 +234,6 @@ class Cache(object): depends_on = [Path(name).expanduser().absolute().as_posix() for name in depends_on] - # We can't use pickle here key = self._get_key(fn, depends_on, args, kwargs) etag = '.'.join(self._get_mtime(path) for path in depends_on)
#<I>: Use pickle for cache keys
nvbn_thefuck
train
py
6fceffe4a08a60aa16a143681eeed61128b5ae5d
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,7 @@ }) var utils = require('./utils') - window.SimpleJekyllSearch = function (_options) { + var simpleJekyllSearch = function (_options) { var errors = optionsValidator.validate(_options) if (errors.length > 0) { throwError('You must specify the following required options: ' + requiredOptions) @@ -57,8 +57,13 @@ } } + window.SimpleJekyllSearch = function (_options) { + var search = simpleJekyllSearch(_options) + _options.success.call(search) + return search + } + function initWithJSON (json) { - options.success(json) repository.put(json) registerInput() }
fixed success function is now called as callback
christian-fei_Simple-Jekyll-Search
train
js
06421258d5c94aee15f9cee875c6aca135792cdd
diff --git a/lib/table_cloth/configuration.rb b/lib/table_cloth/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/table_cloth/configuration.rb +++ b/lib/table_cloth/configuration.rb @@ -1,8 +1,8 @@ module TableCloth class Configuration - OPTIONS = %w(table thead th tbody tr td).map(&:to_sym) + ELEMENT_OPTIONS = %w(table thead th tbody tr td).map(&:to_sym) - OPTIONS.each do |option| + ELEMENT_OPTIONS.each do |option| class_eval <<-OPTION, __FILE__, __LINE__+1 def #{option} @#{option}_option ||= ActiveSupport::OrderedOptions.new diff --git a/spec/lib/configuration_spec.rb b/spec/lib/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/configuration_spec.rb +++ b/spec/lib/configuration_spec.rb @@ -2,11 +2,12 @@ require 'spec_helper' describe TableCloth::Configuration do subject { TableCloth::Configuration.new } - let(:options) { TableCloth::Configuration::OPTIONS } - it "has accessors for all options" do - options.each do |option| - expect(subject).to respond_to option + context "element options" do + TableCloth::Configuration::ELEMENT_OPTIONS.each do |option| + it "has an accessor for #{option}" do + expect(subject).to respond_to option + end end end
Refactor configuration class to be a little less strict on the options being set.
bobbytables_table_cloth
train
rb,rb
1301a2cb71aa097248ec6c5ee9d5fdb7fd791e38
diff --git a/src/main/java/com/profesorfalken/jpowershell/PowerShell.java b/src/main/java/com/profesorfalken/jpowershell/PowerShell.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/profesorfalken/jpowershell/PowerShell.java +++ b/src/main/java/com/profesorfalken/jpowershell/PowerShell.java @@ -149,7 +149,7 @@ public class PowerShell { Callable<String> commandProcessor = new PowerShellCommandProcessor("standard", p.getInputStream(), this.maxWait, this.waitPause, this.scriptMode); Callable<String> commandProcessorError = new PowerShellCommandProcessor("error", - p.getErrorStream(), this.maxWait, this.waitPause, this.scriptMode); + p.getErrorStream(), this.maxWait, this.waitPause, false); String commandOutput = ""; boolean isError = false;
Fix issue #9 Error case in not handled when executing script
profesorfalken_jPowerShell
train
java
7063f9132f2e94c6c810382a3609a900c9311621
diff --git a/vertebrate-event-emitter.js b/vertebrate-event-emitter.js index <HASH>..<HASH> 100644 --- a/vertebrate-event-emitter.js +++ b/vertebrate-event-emitter.js @@ -18,7 +18,7 @@ function getEventName(EventReference) { // EventReference instances are used as keys to get information about event // callbacks. An event can also be cancelled with an EventReference instance. export function EventReference(eventName, callback, count) { - allHandlersPrivateData.set(this, {eventName, callback, count}); + allHandlersPrivateData.set(this, {eventName: eventName, callback: callback, count: count}); } // This WeapMap instance has EventEmitter instances as keys, and Map instances
Don't use object literal shorthand.
qubyte_vertebrate-event-emitter
train
js
bb1ae9572d62e345cbc5fe19a683555d2c48adc5
diff --git a/datajoint/schemas.py b/datajoint/schemas.py index <HASH>..<HASH> 100644 --- a/datajoint/schemas.py +++ b/datajoint/schemas.py @@ -85,9 +85,10 @@ class Schema: connection.register(self) def __new__(self, schema_name, context=None, *, connection=None, create_schema=True, create_tables=True): + caller_module = inspect.getmodule(inspect.currentframe().f_back) if (schema_name not in schema_plugins or - schema_plugins[schema_name]['object'].module_name != inspect.getmodule( - inspect.currentframe().f_back).__name__): + caller_module is not None and + schema_plugins[schema_name]['object'].module_name == caller_module.__name__: return object.__new__(self) else: return schema_plugins[schema_name]['object'].load()
Determine if caller is from plugin2.
datajoint_datajoint-python
train
py
f9f8126b0cbbbc2407be0b9ad0b13a3cacb8934b
diff --git a/core/mocks/mocks.go b/core/mocks/mocks.go index <HASH>..<HASH> 100644 --- a/core/mocks/mocks.go +++ b/core/mocks/mocks.go @@ -162,6 +162,13 @@ type RouterServer struct { OutHandleStats struct { Res *core.StatsRes } + InHandleJoin struct { + Ctx context.Context + Req *core.JoinRouterReq + } + OutHandleJoin struct { + Res *core.JoinRouterRes + } } // NewRouterServer creates a new mock RouterServer @@ -185,6 +192,13 @@ func (m *RouterServer) HandleStats(ctx context.Context, in *core.StatsReq) (*cor return m.OutHandleStats.Res, m.Failures["HandleStats"] } +// HandleJoin implements the core.RouterServer interface +func (m *RouterServer) HandleJoin(ctx context.Context, in *core.JoinRouterReq) (*core.JoinRouterRes, error) { + m.InHandleJoin.Ctx = ctx + m.InHandleJoin.Req = in + return m.OutHandleJoin.Res, m.Failures["HandleJoin"] +} + // DutyManager mocks the dutycycle.DutyManager interface type DutyManager struct { Failures map[string]error
[feature/otaa] Add HandleJoin to mock routerserver
TheThingsNetwork_ttn
train
go
adf4ad2db16039fb8770b02a53d8f8a426992844
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -250,6 +250,7 @@ todo_include_todos = True autoclass_content = "both" +intersphinx_mapping = { + 'python': ('http://docs.python.org/', os.getenv('SPHINX_PYTHON_OBJECTS')), +} -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None}
Honour $SPHINX_PYTHON_OBJECTS for Python intersphinx cache.
JNRowe_upoints
train
py
f0cb1ba9b740d26a1dd9b6e18f8e0a5dead03e69
diff --git a/modules/orionode/lib/searchWorker.js b/modules/orionode/lib/searchWorker.js index <HASH>..<HASH> 100644 --- a/modules/orionode/lib/searchWorker.js +++ b/modules/orionode/lib/searchWorker.js @@ -19,7 +19,6 @@ try { var SUBDIR_SEARCH_CONCURRENCY = 10; var workspaceId = 'orionode'; - var workspaceName = 'Orionode Workspace'; var fieldList = "Name,NameLower,Length,Directory,LastModified,Location,Path,RegEx,WholeWord,CaseSensitive".split(","); function safePath(workspaceDir, p) { @@ -215,7 +214,7 @@ try { "Length": stats.size, "Location": "/file" + filePathFromWorkspace, "Name": filename, - "Path": workspaceName + filePathFromWorkspace + "Path": filePathFromWorkspace.substring(1) }); } if (!searchPattern) {
Bug <I> - Search panel shows "Orionode Workspace" in path
eclipse_orion.client
train
js
eab8b816b7d654f16bcb6537c830c96b364c7909
diff --git a/src/Users/ValueObjects/Email.php b/src/Users/ValueObjects/Email.php index <HASH>..<HASH> 100644 --- a/src/Users/ValueObjects/Email.php +++ b/src/Users/ValueObjects/Email.php @@ -36,7 +36,7 @@ class Email * @return string * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring */ - function __toString() + public function __toString() { return $this->getAddress(); } diff --git a/src/Users/ValueObjects/Password.php b/src/Users/ValueObjects/Password.php index <HASH>..<HASH> 100644 --- a/src/Users/ValueObjects/Password.php +++ b/src/Users/ValueObjects/Password.php @@ -41,7 +41,7 @@ class Password * @return string * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring */ - function __toString() + public function __toString() { return '******'; }
Visibility in magic methods for Email and Password
digbang_security
train
php,php
f3c3285f62614a2f2d55d1b53f99e90a819a365c
diff --git a/lib/dpl/provider/pages.rb b/lib/dpl/provider/pages.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/provider/pages.rb +++ b/lib/dpl/provider/pages.rb @@ -33,7 +33,7 @@ module DPL def initialize(context, options) super - @build_dir = File.join(src_dir, options[:local_dir] || '.') + @build_dir = File.absolute_path(options[:local_dir] || '.', src_dir) print_step "The target dir for deployment is '#{@build_dir}'." @project_name = options[:project_name] || fqdn || slug
Support setting local-dir to an absolute path.
travis-ci_dpl
train
rb
e296d50c9702668c88ddaad2ce8444ef08c14ac8
diff --git a/Classes/TYPO3/Form/Core/Model/FinisherContext.php b/Classes/TYPO3/Form/Core/Model/FinisherContext.php index <HASH>..<HASH> 100644 --- a/Classes/TYPO3/Form/Core/Model/FinisherContext.php +++ b/Classes/TYPO3/Form/Core/Model/FinisherContext.php @@ -11,7 +11,7 @@ namespace TYPO3\Form\Core\Model; * The TYPO3 project - inspiring people to share! * * */ -use \TYPO3\Form\Core\Runtime\FormRuntime; +use TYPO3\Form\Core\Runtime\FormRuntime; /** * The context that is passed to each finisher when executed. diff --git a/Classes/TYPO3/Form/Core/Model/FinisherInterface.php b/Classes/TYPO3/Form/Core/Model/FinisherInterface.php index <HASH>..<HASH> 100644 --- a/Classes/TYPO3/Form/Core/Model/FinisherInterface.php +++ b/Classes/TYPO3/Form/Core/Model/FinisherInterface.php @@ -11,7 +11,7 @@ namespace TYPO3\Form\Core\Model; * The TYPO3 project - inspiring people to share! * * */ -use \TYPO3\Form\Core\Model\FinisherContext; +use TYPO3\Form\Core\Model\FinisherContext; /** * Finisher that can be attached to a form in order to be invoked
[TASK] Remove leading backslash in use statement(s) Change-Id: I<I>c2e<I>ae6abf<I>ca<I>a5ac4f<I>fbb6b4e6bb7
neos_form
train
php,php
1a85299a5e4e9df66daa6e28441023b40c46ed8d
diff --git a/src/transformers/generation_tf_utils.py b/src/transformers/generation_tf_utils.py index <HASH>..<HASH> 100644 --- a/src/transformers/generation_tf_utils.py +++ b/src/transformers/generation_tf_utils.py @@ -96,7 +96,7 @@ class TFGenerationMixin: Whether to stop the beam search when at least ``num_beams`` sentences are finished per batch or not. num_beams (:obj:`int`, `optional`, defaults to 1): Number of beams for beam search. 1 means no beam search. - temperature (:obj:`float`, `optional`, defaults tp 1.0): + temperature (:obj:`float`, `optional`, defaults to 1.0): The value used to module the next token probabilities. top_k (:obj:`int`, `optional`, defaults to 50): The number of highest probability vocabulary tokens to keep for top-k-filtering.
Tiny typo fix (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
195e3efb7b64726cca20c22d60fecec1d29d1c61
diff --git a/devices/gledopto.js b/devices/gledopto.js index <HASH>..<HASH> 100644 --- a/devices/gledopto.js +++ b/devices/gledopto.js @@ -672,4 +672,11 @@ module.exports = [ description: 'Zigbee 3.0 smart home switch', extend: gledoptoExtend.switch(), }, + { + zigbeeModel: ['GL-B-004P'], + model: 'GL-B-004P', + vendor: 'Gledopto', + description: 'Filament LED light bulb E27 G95 7W pro', + extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495]}), + }, ];
Add GL-B-<I>P (#<I>) * added Gledopto G<I> * removed trailing whitespace * Update gledopto.js
Koenkk_zigbee-shepherd-converters
train
js
b9b508be66454c26c3b5ebf860e83527a54c2773
diff --git a/locator/src/main/java/org/talend/esb/servicelocator/client/internal/zk/ZKBackend.java b/locator/src/main/java/org/talend/esb/servicelocator/client/internal/zk/ZKBackend.java index <HASH>..<HASH> 100644 --- a/locator/src/main/java/org/talend/esb/servicelocator/client/internal/zk/ZKBackend.java +++ b/locator/src/main/java/org/talend/esb/servicelocator/client/internal/zk/ZKBackend.java @@ -356,8 +356,7 @@ public class ZKBackend implements ServiceLocatorBackend { return new ZooKeeper(locatorEndpoints, sessionTimeout, new WatcherImpl(connectionLatch)); } catch (IOException e) { - throw new ServiceLocatorException("At least one of the endpoints " - + locatorEndpoints + " does not represent a valid address."); + throw new ServiceLocatorException("A network failure occured when connecting to the ZooKeeper server", e); } }
Fixed logging to better see cause of TESB-<I>
Talend_tesb-rt-se
train
java
a88cb368f54d732cf1097aac53f292b3bd289b9f
diff --git a/django_admin_bootstrapped/renderers.py b/django_admin_bootstrapped/renderers.py index <HASH>..<HASH> 100644 --- a/django_admin_bootstrapped/renderers.py +++ b/django_admin_bootstrapped/renderers.py @@ -6,7 +6,10 @@ from django.contrib.admin.widgets import (AdminDateWidget, AdminTimeWidget, from django.forms import (FileInput, CheckboxInput, RadioSelect, CheckboxSelectMultiple) from bootstrap3 import renderers -from bootstrap3.html import add_css_class +try: + from bootstrap3.utils import add_css_class +except ImportError: + from bootstrap3.html import add_css_class from bootstrap3.text import text_value class BootstrapFieldRenderer(renderers.FieldRenderer):
Cope with django-bootstrap3 api change bootstrap3.html was moved to bootstrap3.utils See change: <URL>
django-admin-bootstrapped_django-admin-bootstrapped
train
py
c1a418da32f5eac09dbe88712f4fcdca80432862
diff --git a/tasks/makepot.js b/tasks/makepot.js index <HASH>..<HASH> 100644 --- a/tasks/makepot.js +++ b/tasks/makepot.js @@ -116,14 +116,16 @@ module.exports = function( grunt ) { args: cmdArgs, opts: { stdio: 'inherit' } }, function( error, result, code ) { - var pattern, pot; + var matches, pattern, pot; if ( 0 === code && grunt.file.exists( o.potFile ) ) { pot = grunt.file.read( o.potFile ); // Update the comments header. pattern = /# <!=([\s\S]+?)=!>/; - o.potComments = o.potComments || pot.match( pattern )[1]; + if ( '' === o.potComments && ( matches = pot.match( pattern ) ) ) { + o.potComments = matches[1]; + } o.potComments = '# ' + o.potComments.replace( /\n(# )?/g, '\n# ' ).replace( '{year}', new Date().getFullYear() ); pot = pot.replace( pattern, o.potComments );
Check for a comment header pattern match in case non-bundled i<I>n tools are being used.
cedaro_grunt-wp-i18n
train
js
5a15630ebe70b09917c5abad540d4e0c75540739
diff --git a/lib/pdf/reader/font.rb b/lib/pdf/reader/font.rb index <HASH>..<HASH> 100644 --- a/lib/pdf/reader/font.rb +++ b/lib/pdf/reader/font.rb @@ -56,6 +56,7 @@ class PDF::Reader when "ZapfDingbats" then self.encoding = PDF::Reader::Encoding.new("ZapfDingbatsEncoding") end + @basefont = font end def to_utf8(params) diff --git a/specs/font_spec.rb b/specs/font_spec.rb index <HASH>..<HASH> 100644 --- a/specs/font_spec.rb +++ b/specs/font_spec.rb @@ -47,4 +47,10 @@ context "PDF::Reader::Font" do f.to_utf8(str).should eql("abc\xC2\xA4") end + specify "should correctly store the font BaseFont" do + f = PDF::Reader::Font.new + f.basefont = :Helvetica + f.basefont.should eql(:Helvetica) + end + end
fixed a bug that prevented a font's BaseFont from being recorded correctly
yob_pdf-reader
train
rb,rb
c305d4e60a191eacc89e25ccde6f196f4c466253
diff --git a/src/system/modules/metamodelsattribute_numeric/config/config.php b/src/system/modules/metamodelsattribute_numeric/config/config.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodelsattribute_numeric/config/config.php +++ b/src/system/modules/metamodelsattribute_numeric/config/config.php @@ -17,3 +17,7 @@ $GLOBALS['METAMODELS']['attributes']['numeric']['class'] = 'MetaModels\Attribute\Numeric\Numeric'; $GLOBALS['METAMODELS']['attributes']['numeric']['image'] = 'system/modules/metamodelsattribute_numeric/html/numeric.png'; + +// non composerized Contao 2.X autoload support. +$GLOBALS['MM_AUTOLOAD'][] = dirname(__DIR__); +$GLOBALS['MM_AUTOLOAD'][] = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'deprecated';
added compat autoloader registration.
MetaModels_attribute_numeric
train
php
b821f3ce2941d9ee83b0b354639e38f55a2482c0
diff --git a/BAC0/infos.py b/BAC0/infos.py index <HASH>..<HASH> 100644 --- a/BAC0/infos.py +++ b/BAC0/infos.py @@ -12,5 +12,5 @@ __author__ = 'Christian Tremblay, P.Eng.' __email__ = 'christian.tremblay@servisys.com' __url__ = 'https://github.com/ChristianTremblay/BAC0' __download_url__ = 'https://github.com/ChristianTremblay/BAC0/archive/master.zip' -__version__ = '0.99.74' +__version__ = '0.99.75-beta' __license__ = 'LGPLv3' \ No newline at end of file
Setting develop branch in phase with latest master (I've done things wrong...)
ChristianTremblay_BAC0
train
py
c183bf8f5aab7c92fd8edfc362e6c40bd4a681ba
diff --git a/src/Framework/Framework.php b/src/Framework/Framework.php index <HASH>..<HASH> 100644 --- a/src/Framework/Framework.php +++ b/src/Framework/Framework.php @@ -45,10 +45,12 @@ class Framework { break; case 'worker': + set_time_limit(0); $container->worker->work(); exit; break; } + exit; } $slim = $container->slim; if (isset($_POST) && !empty($_POST)) {
give front controller ability to start queue workers
ryan-mahoney_Framework
train
php
ae9a69fe055c20d5d4f2c7b05160784134e5a4f6
diff --git a/lib/potatochop/version.rb b/lib/potatochop/version.rb index <HASH>..<HASH> 100644 --- a/lib/potatochop/version.rb +++ b/lib/potatochop/version.rb @@ -1,3 +1,3 @@ module Potatochop - VERSION = "0.0.1.alpha" + VERSION = "0.0.1.beta" end
Um, let's make it a beta.
VersaHQ_potatochop
train
rb
aa79058950fc44215689aec8c3aa76ad1e0483d7
diff --git a/build_config.php b/build_config.php index <HASH>..<HASH> 100644 --- a/build_config.php +++ b/build_config.php @@ -2,7 +2,7 @@ $buildConfig = array ( 'major' => 2, 'minor' => 5, - 'build' => 3, + 'build' => 4, 'shopgate_library_path' => "", 'plugin_name' => "library", 'display_name' => "Shopgate Library 2.5.x", diff --git a/classes/core.php b/classes/core.php index <HASH>..<HASH> 100644 --- a/classes/core.php +++ b/classes/core.php @@ -24,7 +24,7 @@ ################################################################################### # define constants ################################################################################### -define('SHOPGATE_LIBRARY_VERSION', '2.5.3'); +define('SHOPGATE_LIBRARY_VERSION', '2.5.4'); define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8'); define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../'));
Increased Shopgate Library <I>.x to version <I>.
shopgate_cart-integration-sdk
train
php,php
5cb29ef322e202b02b5b37609f75e7b8b1613c2c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -212,7 +212,7 @@ if PY3 and sys.platform.startswith('linux'): else: SCRIPTS.append('spyder') EXTLIST = ['.mo', '.svg', '.png', '.css', '.html', '.js', '.chm', '.ini', - '.txt', '.rst', '.qss'] + '.txt', '.rst', '.qss', '.tff', '.json'] if os.name == 'nt': SCRIPTS += ['spyder.bat'] EXTLIST += ['.ico']
Add fonts and json file in setup.py for "Spyder 3" theme
spyder-ide_spyder
train
py
b4f0124288318ec2127664ea6a8973ac38d21d11
diff --git a/test/lib/tasks/seed_rake_test.rb b/test/lib/tasks/seed_rake_test.rb index <HASH>..<HASH> 100644 --- a/test/lib/tasks/seed_rake_test.rb +++ b/test/lib/tasks/seed_rake_test.rb @@ -47,19 +47,35 @@ describe 'Seedbank rake.task' do describe "db:seed:original" do subject { Rake::Task['db:seed:original'] } - it "has no dependencies" do + it "is only dependent on db:abort_if_pending_migrations" do subject.prerequisites.must_equal %w[db:abort_if_pending_migrations] end - describe "when seeds are reloaded" do + it 'runs within Seedbank::Runner' do + FakeModel.expect :seed, true, ['db/seeds.rb'] + + subject.invoke + FakeModel.verify + end + + describe "when seeds are reloaded" do before do silence_warnings { Dummy::Application.load_tasks } end - it "still has no dependencies" do + it "is still only dependent on db:abort_if_pending_migrations" do subject.prerequisites.must_equal %w[db:abort_if_pending_migrations] end + + it 'still runs within Seedbank::Runner' do + skip 'TODO: Appears that it gets invoked twice after reloading.' + FakeModel.expect :seed, true, ['db/seeds.rb'] + + subject.invoke + + FakeModel.verify + end end end
Clean up a seed_rake_test a little.
james2m_seedbank
train
rb
e6207a6345068a569d8f2f62bd269beaa66d3061
diff --git a/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java b/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java index <HASH>..<HASH> 100644 --- a/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java +++ b/java/client/src/org/openqa/selenium/remote/ProtocolHandshake.java @@ -353,9 +353,7 @@ public class ProtocolHandshake { tempResponse = new Response(null); tempResponse.setStatus(ErrorCodes.SESSION_NOT_CREATED); tempResponse.setValue(jsonBlob); - } else if ( - ossStatus instanceof Number && - ((Number) ossStatus).intValue() == ErrorCodes.SESSION_NOT_CREATED) { + } else if (ossStatus instanceof Number) { tempResponse = new Response(null); tempResponse.setStatus(ErrorCodes.SESSION_NOT_CREATED); tempResponse.setValue(jsonBlob);
Attempt to be a little more informative if session is not created Based on a change in PR #<I>, but will always set the value of the error to "Session Not Created".
SeleniumHQ_selenium
train
java
e1cb04fe0b7e4b4240dd2ff1c8755e97c0b98745
diff --git a/lib/fog/glesys/models/compute/server.rb b/lib/fog/glesys/models/compute/server.rb index <HASH>..<HASH> 100644 --- a/lib/fog/glesys/models/compute/server.rb +++ b/lib/fog/glesys/models/compute/server.rb @@ -74,13 +74,11 @@ module Fog :disksize => disksize || "10", :memorysize => memorysize || "512", :cpucores => cpucores || "1", - :rootpassword => rootpassword, - :transfer => transfer || "500", - :bandwidth => bandwidth || "10", + :rootpassword => rootpassword } # optional options when creating a server: - [:ip, :ipv6, :description].each do |k| + [:description, :ip, :ipv6, :transfer, :bandwidth, :campaigncode, :sshkeyids, :sshkey].each do |k| options[k] = attributes[k] if attributes[k] end
[GleSYS] server/create: sync required and optional args with API spec
fog_fog
train
rb
c6139b935fedeafc2328480c27d980f190234b21
diff --git a/src/Definition/Loader/Annotation/FieldDecorator/GraphQLFieldDefinitionDecorator.php b/src/Definition/Loader/Annotation/FieldDecorator/GraphQLFieldDefinitionDecorator.php index <HASH>..<HASH> 100644 --- a/src/Definition/Loader/Annotation/FieldDecorator/GraphQLFieldDefinitionDecorator.php +++ b/src/Definition/Loader/Annotation/FieldDecorator/GraphQLFieldDefinitionDecorator.php @@ -216,7 +216,9 @@ class GraphQLFieldDefinitionDecorator implements FieldDefinitionDecoratorInterfa } if ($prop instanceof \ReflectionMethod) { - return lcfirst(preg_replace('/^(get|set)/', null, $prop->name)); + if ($methodName = lcfirst(preg_replace('/^(get|set|has|is)/', null, $prop->name))) { + return $methodName; + } } return $prop->name;
Drop 'has' and 'is' prefix on method names when create a field
ynloultratech_graphql-bundle
train
php
6e104953ee7c65d65df603d59794b05d6448ef23
diff --git a/src/DataType/SimpleValueObject.php b/src/DataType/SimpleValueObject.php index <HASH>..<HASH> 100644 --- a/src/DataType/SimpleValueObject.php +++ b/src/DataType/SimpleValueObject.php @@ -5,14 +5,14 @@ namespace JimmyOak\DataType; abstract class SimpleValueObject { /** - * @var string|int|null|... + * @var mixed */ private $value; /** * SimpleValueObject constructor. * - * @param int|null|string $value + * @param mixed $value */ public function __construct($value) {
@var from SimpleValueObject mixed
jimmyoak_utilities
train
php
dc58a4d648894098da114e5cc79c30702f8708c1
diff --git a/test/integration/parsing_quirks_test.rb b/test/integration/parsing_quirks_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/parsing_quirks_test.rb +++ b/test/integration/parsing_quirks_test.rb @@ -87,4 +87,17 @@ class ParsingQuirksTest < Minitest::Test end end + def test_unanchored_filter_arguments + with_error_mode(:lax) do + assert_template_result('hi',"{{ 'hi there' | split$$$:' ' | first }}") + + var = Variable.new("('x' | downcase)") + assert_equal [['downcase',[]]], var.filters + assert_equal "('x'", var.name + + var = Variable.new("variant.title | escape | remove:\"\"\" | remove: \"'\"") + assert_equal [["escape", []], ["remove", ["\"\""]]], var.filters + end + end + end # ParsingQuirksTest
Add quirks test for unanchored filter args
Shopify_liquid
train
rb
04da1330981f498939584923bb25ef171f1c7613
diff --git a/admin/public/page-properties/page-properties.js b/admin/public/page-properties/page-properties.js index <HASH>..<HASH> 100644 --- a/admin/public/page-properties/page-properties.js +++ b/admin/public/page-properties/page-properties.js @@ -71,9 +71,10 @@ angular.module('rcmAdminPage', ['rcmApi', 'rcmAdminApi']) $scope.name = data.name; $scope.siteLayoutOverride = data.siteLayoutOverride; $scope.publicReadAccess = data.publicReadAccess; - $scope.readAccessGroups = $scope.readAccessGroupOptions.find(function (potentialOption) { + var selectedReadAccessGroupOption = $scope.readAccessGroupOptions.find(function (potentialOption) { return JSON.stringify(potentialOption.value) === JSON.stringify(data.readAccessGroups); - }).value; + }); + $scope.readAccessGroups = selectedReadAccessGroupOption ? selectedReadAccessGroupOption.value : null }; /** *
Fix bug in new page read ACL system for axo <I>.
reliv_Rcm
train
js
b0f219ad177c8e9c261578586f0324cef0c71cd2
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -26,10 +26,6 @@ module Util # Change the process to a different user def self.chuser - if Facter["operatingsystem"].value == "Darwin" - $stderr.puts "Ruby on darwin is broken; puppetmaster will not set its UID to 'puppet' and must run as root" - return - end if group = Puppet[:group] group = self.gid(group) unless group
Removing chuser on darwin restriction For too long we have refused to change users on Darwin because a long time ago the ruby they shipped with was really, really broken. It's been fixed for a while, so this just removes the restriction.
puppetlabs_puppet
train
rb
ba1f2f7e19d66aedff8bc1d90bc1e80177fac33d
diff --git a/examples/get_annotations.py b/examples/get_annotations.py index <HASH>..<HASH> 100644 --- a/examples/get_annotations.py +++ b/examples/get_annotations.py @@ -57,7 +57,7 @@ if __name__ == '__main__': print(annotations) if params.download_path: - f= open(params.download_path+".csv","w+") + f= open(params.download_path+"/"+params.id_project+".csv","w+") f.write("ID;Image;Project;Term;User;Area;Perimeter;WKT \n") for annotation in annotations: f.write("{};{};{};{};{};{};{};{}\n".format(annotation.id,annotation.image,annotation.project,annotation.term,annotation.user,annotation.area,annotation.perimeter,annotation.location))
Add project ID as CSV file name
cytomine_Cytomine-python-client
train
py
e15fde674a48eb88b4d77d6f2beb7322c6bfb0dd
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java @@ -412,11 +412,7 @@ public class JvmTypesBuilder { public JvmConstructor toConstructor(EObject sourceElement, String simpleName, Procedure1<JvmConstructor> init) { JvmConstructor constructor = TypesFactory.eINSTANCE.createJvmConstructor(); constructor.setSimpleName(nullSaveName(simpleName)); - setBody(constructor, new Function1<ImportManager, CharSequence>() { - public CharSequence apply(ImportManager p) { - return "{}"; - } - }); + constructor.setVisibility(JvmVisibility.PUBLIC); if (init != null && simpleName != null) init.apply(constructor); return associate(sourceElement, constructor);
[xbase] Fix default constructor: No compilation strategy, public visibility
eclipse_xtext-extras
train
java
7acca5ab1e35cb6d55338beea4a41a0441309aaa
diff --git a/classes/ezsquidcachemanager.php b/classes/ezsquidcachemanager.php index <HASH>..<HASH> 100644 --- a/classes/ezsquidcachemanager.php +++ b/classes/ezsquidcachemanager.php @@ -37,9 +37,9 @@ class eZSquidCacheManager } /** - * Purges the given URL on the Squid server. The relative URL is passed. + * Purges the given URL on the Squid server. The relative URL is passed. * E.g. /en/products/url_alias_for_page - * + * * @static * @param string $url */ @@ -70,7 +70,7 @@ class eZSquidCacheManager { print( "Error purging cache" ); $response = 0; - } + } $rawResponse = ""; // fetch the SOAP response @@ -87,15 +87,17 @@ class eZSquidCacheManager /** * Checks if Squid pruge cache is enabled for object publish action - * + * * @static * @return bool */ public static function isEnabled() { $ini = eZINI::instance( 'squid.ini' ); - - if ( $ini->variable( 'Squid', 'PurgeCacheOnPublish' ) == 'enabled' ) + + if ( $ini->hasSection( 'Squid' ) + && $ini->hasVariable( 'Squid', 'PurgeCacheOnPublish' ) + && $ini->variable( 'Squid', 'PurgeCacheOnPublish' ) == 'enabled' ) { return true; }
- Fixed bug #<I>: Errors in debug output on "Finished" setup of setup wizard when using ezflow site package -This line, and those below, will be ignored-- M trunk/packages/ezflow_extension/ezextension/ezflow/classes/ezsquidcachemanager.php git-svn-id: <URL>
ezsystems_ezflow-ls-extension
train
php
ef62b95179a609ac71bc6902d2333d66814c029a
diff --git a/cli.js b/cli.js index <HASH>..<HASH> 100644 --- a/cli.js +++ b/cli.js @@ -162,8 +162,8 @@ var cli = function(options) { // Build menu var menu = menuLinks(files, options.basePath); - // Run files through StyleDocco parser. Async needed due to preprocessing. - async.map(files, function(file, cb) { + // Run files through preprocessor and StyleDocco parser. + async.mapSeries(files, function(file, cb) { var content = fs.readFileSync(file, 'utf-8'); preprocess(file, function(err, css) { cb(null, {
Avoid using up file descriptors if we process many files
jacobrask_styledocco
train
js
3f5ed741c67cd8066a47005a9ff955403a5508b0
diff --git a/app/models/no_cms/pages/page.rb b/app/models/no_cms/pages/page.rb index <HASH>..<HASH> 100644 --- a/app/models/no_cms/pages/page.rb +++ b/app/models/no_cms/pages/page.rb @@ -16,6 +16,7 @@ module NoCms::Pages accepts_nested_attributes_for :blocks, allow_destroy: true translates :title, :body, :slug, :path, :draft, :css_class, :css_id, :cache_enabled + accepts_nested_attributes_for :translations validates :title, presence: true validates :body, presence: true if NoCms::Pages.use_body?
Permit nested attributes on page's translations.
simplelogica_nocms-pages
train
rb
1fde9af82caefe75959ae7d883aa55669c7c48ce
diff --git a/events/config.js b/events/config.js index <HASH>..<HASH> 100644 --- a/events/config.js +++ b/events/config.js @@ -17,7 +17,8 @@ module.exports = { 13917282, 12117622, 17604562, - 4280832 + 4280832, + 14995732 ], blacklistWords: [ 'business',
data: remove meetup.com group
webuildorg_webuild-repos
train
js
00458d7b43648cd521d90ac2efb46ea6b7efa848
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,10 @@ setup_params = dict( zip_safe=False, setup_requires=[ 'hgtools', + 'pytest-runner', + ], + tests_require=[ + 'pytest', ], ) if __name__ == '__main__':
Run tests with pytest-runner.
jaraco_wolframalpha
train
py
c3425b8c89fb4b588ff9f3314993c740cbe44ab4
diff --git a/spyderlib/plugins/inspector.py b/spyderlib/plugins/inspector.py index <HASH>..<HASH> 100644 --- a/spyderlib/plugins/inspector.py +++ b/spyderlib/plugins/inspector.py @@ -15,6 +15,7 @@ from spyderlib.qt.QtCore import SIGNAL, QUrl, QTimer import re import os.path as osp import socket +import sys # Local imports from spyderlib.baseconfig import get_conf_path, _ @@ -256,7 +257,10 @@ class ObjectInspector(SpyderPluginWidget): # Object name layout_edit = QHBoxLayout() layout_edit.setContentsMargins(0, 0, 0, 0) - source_label = QLabel(_("Source")) + if sys.platform == 'darwin': + source_label = QLabel(_(" Source")) + else: + source_label = QLabel(_("Source")) layout_edit.addWidget(source_label) self.source_combo = QComboBox(self) self.source_combo.addItems([_("Console"), _("Editor")])
Object Inspector: Add some spaces to a QLabel to make the plugin look better on Mac
spyder-ide_spyder
train
py
a40750e596cdf6fb4b591d1c357d760d6c0bbb43
diff --git a/client/fingerprint_manager.go b/client/fingerprint_manager.go index <HASH>..<HASH> 100644 --- a/client/fingerprint_manager.go +++ b/client/fingerprint_manager.go @@ -371,8 +371,9 @@ func (fm *FingerprintManager) fingerprintDriver(name string, f fingerprint.Finge } fm.nodeLock.Unlock() - // If the driver is undetected, change the health status to unhealthy - // immediately. + // If either 1) the driver is undetected or 2) if the driver does not have + // periodic health checks enabled, set the health status to the match that + // of the fingerprinter if !hasPeriodicHealthCheck || !response.Detected && driverExists && driverIsHealthy { healthInfo := &structs.DriverInfo{ Healthy: response.Detected,
update comment for when the fingerprinter setting health status
hashicorp_nomad
train
go
f7fe4b14b0db9c0e5d733549679c3b8c367b41af
diff --git a/src/psd_tools2/api/effects.py b/src/psd_tools2/api/effects.py index <HASH>..<HASH> 100644 --- a/src/psd_tools2/api/effects.py +++ b/src/psd_tools2/api/effects.py @@ -344,8 +344,9 @@ class BevelEmboss(_Effect, _AngleMixin): @property def highlight_mode(self): """Highlight blending mode.""" - value = self.value.get(b'hglM').enum.name.lower() - return value.replace('blend_', '').replace('_', '-') + value = self.value.get(b'hglM').enum + value = value.decode() if isinstance(value, bytes) else value.name + return value.lower().replace('blend_', '').replace('_', '-') @property def highlight_color(self): @@ -360,7 +361,8 @@ class BevelEmboss(_Effect, _AngleMixin): @property def shadow_mode(self): """Shadow blending mode.""" - value = self.value.get(b'sdwM').enum.name.lower() + value = self.value.get(b'sdwM').enum + value = value.decode() if isinstance(value, bytes) else value.name return value.replace('blend_', '').replace('_', '-') @property
Workaround for enum and bytes mixed output
psd-tools_psd-tools
train
py
2add209691be335b3f95d806d777604b6cc50d2b
diff --git a/packages/generator-botkit/generators/app/templates/bot.js b/packages/generator-botkit/generators/app/templates/bot.js index <HASH>..<HASH> 100644 --- a/packages/generator-botkit/generators/app/templates/bot.js +++ b/packages/generator-botkit/generators/app/templates/bot.js @@ -107,7 +107,7 @@ const controller = new Botkit({ if (process.env.cms_uri) { controller.usePlugin(new BotkitCMSHelper({ - cms_uri: process.env.cms_uri, + uri: process.env.cms_uri, token: process.env.cms_token, })); } @@ -195,4 +195,4 @@ async function getBotUserByTeam(teamId) { console.error('Team not found in userCache: ', teamId); } } -<% } %> \ No newline at end of file +<% } %>
Change cms_uri to uri
howdyai_botkit
train
js
1e7c22c80a75b735959c75e86e62bacb9e441a6e
diff --git a/flags/common.go b/flags/common.go index <HASH>..<HASH> 100644 --- a/flags/common.go +++ b/flags/common.go @@ -21,7 +21,7 @@ const ( DefaultKeyFile = "key.pem" // DefaultCertFile is the default filename for the cert pem file DefaultCertFile = "cert.pem" - // FlagTLSVerify is the flag name for the tls verification option + // FlagTLSVerify is the flag name for the TLS verification option FlagTLSVerify = "tlsverify" ) @@ -73,7 +73,7 @@ func (commonOpts *CommonOptions) InstallFlags(flags *pflag.FlagSet) { // complete func (commonOpts *CommonOptions) SetDefaultOptions(flags *pflag.FlagSet) { // Regardless of whether the user sets it to true or false, if they - // specify --tlsverify at all then we need to turn on tls + // specify --tlsverify at all then we need to turn on TLS // TLSVerify can be true even if not set due to DOCKER_TLS_VERIFY env var, so we need // to check that here as well if flags.Changed(FlagTLSVerify) || commonOpts.TLSVerify {
Change tls to TLS
docker_cli
train
go
8fa6acf28bb07908e971c01f504156e700b1e7f2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ def get_version(): extras_require = { 'test': [ + 'flexmock==0.9.7', 'pytest>=2.3.5', 'psycopg2>=2.4.6', ],
Add flexmock to test requirements
kvesteri_postgresql-audit
train
py
403feb8ed1cb4b692a9d359ee3ad3a7000a9c4e1
diff --git a/workshift/signals.py b/workshift/signals.py index <HASH>..<HASH> 100644 --- a/workshift/signals.py +++ b/workshift/signals.py @@ -136,10 +136,17 @@ def manual_hour_adjustment(sender, instance, **kwargs): if old_pool_hours.hours != pool_hours.hours: # Reset and recalculate standings from all sources + signals.pre_save.disconnect( + manual_hour_adjustment, + ) utils.reset_standings( semester=pool_hours.pool.semester, pool_hours=[pool_hours], ) + signals.pre_save.connect( + manual_hour_adjustment, + sneder=PoolHours, + ) elif old_pool_hours.hour_adjustment != pool_hours.hour_adjustment: pool_hours.standing += pool_hours.hour_adjustment - \ old_pool_hours.hour_adjustment
Disconnect singal prior to reset_standings to prevent recursive loop
knagra_farnsworth
train
py
e43db04eac0a45b23ec86d29d9f6ba3d708eab17
diff --git a/req.go b/req.go index <HASH>..<HASH> 100644 --- a/req.go +++ b/req.go @@ -124,7 +124,7 @@ func (c *client) do(url string, method string, requestBody interface{}, result i } client := &http.Client{ - Timeout: 60 * time.Second, + Timeout: 3 * time.Minute, } if c.token != "" { r.Header.Add("Authorization", "Bearer "+c.token)
Increase HTTP client timeout from 1 to 3 minutes Some actions, such as listing requests, can take quite some time when enough resources have accumulated. This is rather a quick fix hoping for a proper configuration possibility to be added in a larger overhaul coming soon.
profitbricks_profitbricks-sdk-go
train
go
a5b230b81d0d23bf3f0681235de6bb90d6a956d0
diff --git a/pkg/dwarf/frame/parser.go b/pkg/dwarf/frame/parser.go index <HASH>..<HASH> 100644 --- a/pkg/dwarf/frame/parser.go +++ b/pkg/dwarf/frame/parser.go @@ -45,11 +45,18 @@ func cieEntry(data []byte) bool { } func parselength(ctx *parseContext) parsefunc { - var data = ctx.buf.Next(8) + binary.Read(ctx.buf, binary.LittleEndian, &ctx.length) - ctx.length = binary.LittleEndian.Uint32(data[:4]) - 4 // take off the length of the CIE id / CIE pointer. + if ctx.length == 0 { + // ZERO terminator + return parselength + } + + var data = ctx.buf.Next(4) + + ctx.length -= 4 // take off the length of the CIE id / CIE pointer. - if cieEntry(data[4:]) { + if cieEntry(data) { ctx.common = &CommonInformationEntry{Length: ctx.length} return parseCIE }
pkg/dwarf/frame: fix parsing of zero length entries Some linkers will sometimes insert a zero length entry between the last FDE of a CIE and the next CIE.
go-delve_delve
train
go
ba5ba9521eab6e4d7081488a37c4e69fb332bcb8
diff --git a/WrightTools/data/_data.py b/WrightTools/data/_data.py index <HASH>..<HASH> 100644 --- a/WrightTools/data/_data.py +++ b/WrightTools/data/_data.py @@ -549,14 +549,14 @@ class Data(Group): # get axis index -------------------------------------------------------------------------- axis_index = None if resultant is not None: - for i, (s, r) in enumerate(zip(self.shape, resultant)): + for i, (s, r) in enumerate(zip(wt_kit.joint_shape(*self.axes), resultant)): if s != r and r == 1 and axis_index is None: axis_index = i elif s == r: continue else: raise wt_exceptions.ValueError( - f"Invalid resultant shape '{resultant}' for shape {self.shape}. " + f"Invalid resultant shape '{resultant}' for shape {wt_kit.joint_shape(*self.axes)}. " + "Consider using `wt.kit.joint_shape` to join non-collapsed axes." )
Moments use joint_shape of axes (#<I>) * Use joint shape of axes in moment, not total data shape
wright-group_WrightTools
train
py
52a76490f2a6aeb83d11ee59431a2e1ab6bc4e05
diff --git a/src/hotkeys.js b/src/hotkeys.js index <HASH>..<HASH> 100644 --- a/src/hotkeys.js +++ b/src/hotkeys.js @@ -449,11 +449,15 @@ /** * Get a Hotkey object by key binding * - * @param {[string]} combo the key the Hotkey is bound to + * @param {[string]} [combo] the key the Hotkey is bound to. Returns all key bindings if no key is passed * @return {Hotkey} The Hotkey object */ function _get (combo) { + if (!combo) { + return scope.hotkeys; + } + var hotkey; for (var i = 0; i < scope.hotkeys.length; i++) {
Added option to get all keybindings Just by not passing any argument to get() method, all keybinds will be returned. Useful if you want to create your own custom cheatsheet.
chieffancypants_angular-hotkeys
train
js
fa246c27e8940eb983db098eda4e05404a01f8e2
diff --git a/examples/iframe-recurring-signup/charge.php b/examples/iframe-recurring-signup/charge.php index <HASH>..<HASH> 100644 --- a/examples/iframe-recurring-signup/charge.php +++ b/examples/iframe-recurring-signup/charge.php @@ -31,13 +31,13 @@ function createCustomer(HpsPayPlanService $service, HpsCardHolder $cardHolder) $customer->firstName = $cardHolder->firstName; $customer->lastName = $cardHolder->lastName; $customer->customerStatus = HpsPayPlanCustomerStatus::ACTIVE; - $customer->primaryEmail = $cardHolder->emailAddress; + $customer->primaryEmail = $cardHolder->email; $customer->addressLine1 = $cardHolder->address->address; $customer->city = $cardHolder->address->city; $customer->stateProvince = $cardHolder->address->state; $customer->zipPostalCode = $cardHolder->address->zip; $customer->country = $cardHolder->address->country; - $customer->phoneDay = $cardHolder->phoneNumber; + $customer->phoneDay = $cardHolder->phone; $response = $service->addCustomer($customer); return $response->customerKey; }
Name Correction on Object Properties The names "phoneNumber" and "emailAddress" on lines <I> and <I> were actually defined as "email" and "phone" on line <I>-<I>
hps_heartland-php
train
php
ef814effebd9ac91dc7d4b89ee14d46782bd6b62
diff --git a/guava/src/com/google/common/util/concurrent/RateLimiter.java b/guava/src/com/google/common/util/concurrent/RateLimiter.java index <HASH>..<HASH> 100644 --- a/guava/src/com/google/common/util/concurrent/RateLimiter.java +++ b/guava/src/com/google/common/util/concurrent/RateLimiter.java @@ -42,7 +42,7 @@ import javax.annotation.concurrent.ThreadSafe; * physical or logical resource is accessed. This is in contrast to {@link * java.util.concurrent.Semaphore} which restricts the number of concurrent * accesses instead of the rate (note though that concurrency and rate are closely related, - * e.g. see <a href="http://en.wikipedia.org/wiki/Little's_law">Little's Law</a>). + * e.g. see <a href="http://en.wikipedia.org/wiki/Little%27s_law">Little's Law</a>). * * <p>A {@code RateLimiter} is defined primarily by the rate at which permits * are issued. Absent additional configuration, permits will be distributed at a
Escaped instance of symbol "'" within a url so that more apps detect the full URL. ------------- Created by MOE: <URL>
google_guava
train
java
21a733a537363e04ec1039a6e9a634cf29540cca
diff --git a/lib/defaults.js b/lib/defaults.js index <HASH>..<HASH> 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -21,6 +21,7 @@ exports.MEDIA_ROOT = ''; // Low-level settings exports.PBKDF2_ITERATIONS = 10000; exports.PBKDF2_KEYLEN = 64; +exports.POSTS_BY_PAGE_ADMIN = 20; // Not editable exports.THEMES_ROOT = path.join(PROJECT_ROOT, 'themes'); diff --git a/lib/models/posts.js b/lib/models/posts.js index <HASH>..<HASH> 100644 --- a/lib/models/posts.js +++ b/lib/models/posts.js @@ -121,7 +121,7 @@ function allPublished(page, cb) { exports.allPublished = allPublished; function all(page, cb) { - var q, byPage = settings.get('POSTS_BY_PAGE'); + var q, byPage = settings.get('POSTS_BY_PAGE_ADMIN'); count(function(err, count) { if(err) return cb(err);
Separated admin/user posts count display
shinuza_captain-core
train
js,js
8b68c559ebb0f4c48a394455c2cb6d9e0af1f470
diff --git a/coaster/logger.py b/coaster/logger.py index <HASH>..<HASH> 100644 --- a/coaster/logger.py +++ b/coaster/logger.py @@ -10,7 +10,7 @@ except ImportError: import traceback import requests from pprint import pprint -from flask import request, session +from flask import g, request, session # global var as lazy in-memory cache @@ -73,6 +73,10 @@ class LocalVarFormatter(logging.Formatter): print >> sio, "\nSession cookie contents:" pprint(session, sio) + if g: + print >> sio, "\nApp context:" + pprint(vars(g), sio) + s = sio.getvalue() sio.close() if s[-1:] == "\n":
Include flask.g in traceback. Fixes #<I>
hasgeek_coaster
train
py
07beaff84d3e423a08f3391b1902d7592ca799f7
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -127,9 +127,9 @@ module Discordrb @prevent_ready = suppress_ready debug('Creating token cache') - @token_cache = Discordrb::TokenCache.new + token_cache = Discordrb::TokenCache.new debug('Token cache created successfully') - @token = login(type, email, password, token, @token_cache) + @token = login(type, email, password, token, token_cache) init_cache
Make token_cache no longer an instance variable as it's not needed
meew0_discordrb
train
rb
db5546944b8ae627b4764a2a25fd6c34e2e2edea
diff --git a/src/Sulu/Bundle/PreviewBundle/Preview/Renderer/PreviewRenderer.php b/src/Sulu/Bundle/PreviewBundle/Preview/Renderer/PreviewRenderer.php index <HASH>..<HASH> 100644 --- a/src/Sulu/Bundle/PreviewBundle/Preview/Renderer/PreviewRenderer.php +++ b/src/Sulu/Bundle/PreviewBundle/Preview/Renderer/PreviewRenderer.php @@ -115,8 +115,8 @@ class PreviewRenderer implements PreviewRendererInterface $partial = false, $options = [] ) { - $webspaceKey = $options['webspaceKey']; - $locale = $options['locale']; + $webspaceKey = $options['webspaceKey'] ?? null; + $locale = $options['locale'] ?? null; if (!$this->routeDefaultsProvider->supports(\get_class($object))) { throw new RouteDefaultsProviderNotFoundException($object, $id, $webspaceKey, $locale);
Prevent undefined array key error in PreviewRenderer if locale is not set (#<I>)
sulu_sulu
train
php
d89ea837466357171c1c53e2004bcda47fa4d6af
diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index <HASH>..<HASH> 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -236,6 +236,7 @@ class Controller: @settings.setter def settings(self, val): self._settings = val + self.save() self.notification.emit("settings.updated", val) @asyncio.coroutine
When we receive settings from the client save them on disk
GNS3_gns3-server
train
py
427651449ffff786dac7ca69bb61cce9363445a8
diff --git a/src/feat/interface/agency.py b/src/feat/interface/agency.py index <HASH>..<HASH> 100644 --- a/src/feat/interface/agency.py +++ b/src/feat/interface/agency.py @@ -11,11 +11,6 @@ class IAgency(Interface): def start_agent(factory, descriptor, *args, **kwargs): '''Start new agent from factory. Returns the L{IAgencyAngent}''' - def callLater(timeout, method, *args, **kwargs): - ''' - Wrapper for reactor.callLater. - ''' - def get_time(): ''' Use this to get current time. Should fetch the time from NTP server
Remove obsolete method from IAgency interface
f3at_feat
train
py
4c8b7ec74debd1ceee37eddbd5f123f5df147325
diff --git a/docgen/plugins/documentationjs-data.js b/docgen/plugins/documentationjs-data.js index <HASH>..<HASH> 100644 --- a/docgen/plugins/documentationjs-data.js +++ b/docgen/plugins/documentationjs-data.js @@ -74,7 +74,6 @@ function mapInstantSearch([instantsearchFactory, InstantSearch], symbols, files) // console.log(JSON.stringify(InstantSearchSymbol.params, null, 2)); const fileName = 'instantsearch.html'; - const symbolWithRelatedType = files[fileName] = { mode: '0764', contents: '', @@ -178,7 +177,7 @@ function findRelatedTypes(functionSymbol, symbols) { else { types = [...types, typeSymbol]; // iterate over each property to get their types - forEach(typeSymbol.properties, p => findParamsTypes(p)); + forEach(typeSymbol.properties, p => findParamsTypes({name: p.type.name, type: p.type})); } } }
fix(documentationjs): fix 2+ depth structs
algolia_instantsearch.js
train
js
362fee76a41c50bfe3b0a3d976031b57c58d705d
diff --git a/src/adapters/pouch.idb.js b/src/adapters/pouch.idb.js index <HASH>..<HASH> 100644 --- a/src/adapters/pouch.idb.js +++ b/src/adapters/pouch.idb.js @@ -480,6 +480,11 @@ var IdbPouch = function(opts, callback) { var leaves; txn.objectStore(DOC_STORE).get(id.docId).onsuccess = function(e) { var metadata = e.target.result; + // we can determine the result here if: + // 1. there is no such document + // 2. the document is deleted and we don't ask about specific rev + // When we ask with opts.rev we expect the answer to be either + // doc (possibly with _deleted=true) or missing error if (!e.target.result || (isDeleted(metadata, opts.rev) && !opts.rev)) { if (isDeleted(metadata, opts.rev)) { result = extend({}, Pouch.Errors.MISSING_DOC, {reason:"deleted"});
(#<I>) - add comment I'm pretty sure this part needs some comments as it's not so obvious why we behave like that
pouchdb_pouchdb
train
js
d62211731f22233ecb1503d07d03a70a6e733204
diff --git a/holoviews/core/operation.py b/holoviews/core/operation.py index <HASH>..<HASH> 100644 --- a/holoviews/core/operation.py +++ b/holoviews/core/operation.py @@ -129,13 +129,20 @@ class Operation(param.ParameterizedFunction): element_pipeline = getattr(element, '_pipeline', None) + + if hasattr(element, '_in_method'): + in_method = element._in_method + if not in_method: + element._in_method = True ret = self._process(element, key) + if hasattr(element, '_in_method') and not in_method: + element._in_method = in_method for hook in self._postprocess_hooks: ret = hook(self, ret, **kwargs) if (self._propagate_dataset and isinstance(ret, Dataset) - and isinstance(element, Dataset)): + and isinstance(element, Dataset) and not in_method): ret._dataset = element.dataset.clone() ret._pipeline = element_pipeline.instance( operations=element_pipeline.operations + [
Ensure operations do not recursively accumulate pipelines (#<I>)
pyviz_holoviews
train
py
05d8261985e9b3e6a99acaae642e07acd8eb5538
diff --git a/lib/bolt/applicator.rb b/lib/bolt/applicator.rb index <HASH>..<HASH> 100644 --- a/lib/bolt/applicator.rb +++ b/lib/bolt/applicator.rb @@ -7,6 +7,7 @@ require 'json' require 'logging' require 'minitar' require 'open3' +require 'bolt/error' require 'bolt/task' require 'bolt/apply_result' require 'bolt/util/puppet_log_level'
(maint) This was prevent bolt/pal from being required in module testing.
puppetlabs_bolt
train
rb
f3f2b834340fcd2932f2354e77249ff7d76528d8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() -version = '0.0.17' +version = '0.0.18' install_requires = [ 'chevron >= 0.13.1',
Release <I> (#<I>)
googleapis_protoc-java-resource-names-plugin
train
py
9675d206e7eb248460bd36fc938c7875c0737937
diff --git a/src/Console/Command/ProfileRunCommand.php b/src/Console/Command/ProfileRunCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/Command/ProfileRunCommand.php +++ b/src/Console/Command/ProfileRunCommand.php @@ -182,7 +182,7 @@ class ProfileRunCommand extends AbstractReportingCommand // If we're echoing to standard out, then we can run the logger and // progress indicator without compromising output formats such as json // and HTML. - if ($filepath != 'stdout') { + if ($filepath != 'stdout' || $input->getOption('format') == 'terminal') { $this->progressLogger->flushBuffer(); }
Ensure terminal output doesn't default to write to file.
drutiny_drutiny
train
php
a2bf2d173bfe7768cc7c95fae3922a7601f1b47b
diff --git a/djpaypal/models/payments.py b/djpaypal/models/payments.py index <HASH>..<HASH> 100644 --- a/djpaypal/models/payments.py +++ b/djpaypal/models/payments.py @@ -9,7 +9,7 @@ from .base import PaypalObject class Payment(PaypalObject): intent = models.CharField(max_length=9, choices=enums.PaymentIntent.choices) cart = models.CharField(max_length=127, db_index=True, null=True) - payer = JSONField() + payer = JSONField(null=True) transactions = JSONField() state = models.CharField(max_length=8, choices=enums.PaymentState.choices) experience_profile_id = models.CharField(max_length=127, db_index=True)
Allow null in Payment.payer
HearthSim_dj-paypal
train
py
50aabe1ff40d93454c7de39f599cbec9910c40fc
diff --git a/test/integration/replication_noise.py b/test/integration/replication_noise.py index <HASH>..<HASH> 100755 --- a/test/integration/replication_noise.py +++ b/test/integration/replication_noise.py @@ -219,7 +219,7 @@ def start_evil_monkey(master_repli_port, master_to_slave_corruption_p, slave_to_ return (master_socket, connected_proxied_socket) except Exception, e: print "connect: %s" % e - time.sleep(1) + #time.sleep(1) connect_failures = connect_failures + 1 if connect_failures > 60: self.shutting_down = True
Temporary fix for replication_noise test
rethinkdb_rethinkdb
train
py
824d9a3bd1e5691bf38acf09489849e129e5da7e
diff --git a/tool/tctl/common/user_command.go b/tool/tctl/common/user_command.go index <HASH>..<HASH> 100644 --- a/tool/tctl/common/user_command.go +++ b/tool/tctl/common/user_command.go @@ -85,7 +85,7 @@ func (u *UserCommand) Initialize(app *kingpin.Application, config *service.Confi u.userUpdate.Flag("set-roles", "List of roles for the user to assume, replaces current roles"). Default("").StringVar(&u.updateRoles) - u.userList = users.Command("ls", "List all user accounts "+helpPrefix) + u.userList = users.Command("ls", "Lists all user accounts.") u.userList.Flag("format", "Output format, 'text' or 'json'").Hidden().Default(teleport.Text).StringVar(&u.format) u.userDelete = users.Command("rm", "Deletes user accounts").Alias("del")
Remove Teleport DB Users only message for tctl users ls that is incorrect (#<I>)
gravitational_teleport
train
go
acc5225349b92b632f3d2ca342b623a76d8732cd
diff --git a/cpp/find_warnings.py b/cpp/find_warnings.py index <HASH>..<HASH> 100644 --- a/cpp/find_warnings.py +++ b/cpp/find_warnings.py @@ -36,6 +36,7 @@ from . import keywords from . import metrics from . import symbols from . import tokenize +from . import utils try: @@ -103,7 +104,7 @@ class WarningHunter(object): def _add_warning(self, msg, node, filename=None): if filename is not None: - src_metrics = metrics.Metrics(open(filename).read()) + src_metrics = metrics.Metrics(utils.read_file(filename)) else: filename = self.filename src_metrics = self.metrics
Support reading various encoding here too
myint_cppclean
train
py
f4868d09e28b5aa7e09661fc8f7343538333af35
diff --git a/reader.py b/reader.py index <HASH>..<HASH> 100644 --- a/reader.py +++ b/reader.py @@ -76,7 +76,7 @@ class Reader(object): for producer in producers: self.connect_to_nsqd( - producer['address'], + producer.get('address') or producer['hostname'], producer['tcp_port'], producer['http_port'] )
If producer has no address, fallback to hostname
wtolson_gnsq
train
py
abea17fb1f5bde4bf1b4c94873bc0f62c7b9f8ac
diff --git a/integration/helpers/config.go b/integration/helpers/config.go index <HASH>..<HASH> 100644 --- a/integration/helpers/config.go +++ b/integration/helpers/config.go @@ -15,7 +15,7 @@ func TurnOffColors() { func SetHomeDir() string { var err error - homeDir, err := ioutil.TempDir("", "cli-gats-test") + homeDir, err := ioutil.TempDir("", "cli-integration-test") Expect(err).NotTo(HaveOccurred()) os.Setenv("CF_HOME", homeDir)
change temp home dir prefix from gats to integration
cloudfoundry_cli
train
go
73f01bd5d968daca9365f6fd43d38cf18408550e
diff --git a/test/soql-builder.test.js b/test/soql-builder.test.js index <HASH>..<HASH> 100644 --- a/test/soql-builder.test.js +++ b/test/soql-builder.test.js @@ -272,6 +272,27 @@ describe("soql-builder", function() { /** * */ + describe("Query using $includes/$excludes operator", function() { + var soql = SOQLBuilder.createSOQL({ + table: "Contact", + conditions: { + Languages__c: { $includes: [ 'English', 'Japanese' ] }, + Certifications__c: { $excludes: [ 'Oracle' ] } + } + }); + + it("should equal to soql", function() { + assert.ok(soql === + "SELECT Id FROM Contact " + + "WHERE Languages__c INCLUDES ('English', 'Japanese') "+ + "AND Certifications__c EXCLUDES ('Oracle')" + ); + }); + }); + + /** + * + */ describe("Query for matching null", function() { var soql = SOQLBuilder.createSOQL({ table: "Account",
add spec test for inclues/excludes operator
jsforce_jsforce
train
js
bd6731a7bfd6e74190066c4f98f5423d452e53c3
diff --git a/connection.go b/connection.go index <HASH>..<HASH> 100644 --- a/connection.go +++ b/connection.go @@ -332,7 +332,7 @@ func (c *Connection) handleInitReq(frame *Frame) { return } - if req.Version != CurrentProtocolVersion { + if req.Version < CurrentProtocolVersion { c.protocolError(id, fmt.Errorf("Unsupported protocol version %d from peer", req.Version)) return }
Only return protocol errors if initReq version < 2 If we receive and initReq with a higher version, return an initRes with a lower version.
uber_tchannel-go
train
go