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
3d21ee60f42f4423fbdad1f2667d9f4b812449da
diff --git a/src/Karma/Hydrator.php b/src/Karma/Hydrator.php index <HASH>..<HASH> 100644 --- a/src/Karma/Hydrator.php +++ b/src/Karma/Hydrator.php @@ -102,20 +102,20 @@ class Hydrator implements ConfigurableProcessor public function hydrate($environment) { - $distFiles = $this->collectDistFiles(); + $files = $this->collectFiles(); - foreach($distFiles as $file) + foreach($files as $file) { $this->hydrateFile($file, $environment); } $this->info(sprintf( '%d files generated', - count($distFiles) + count($files) )); } - private function collectDistFiles() + private function collectFiles() { $pattern = sprintf('.*\%s$', $this->suffix); if($this->nonDistFilesOverwriteAllowed === true) @@ -390,9 +390,9 @@ class Hydrator implements ConfigurableProcessor public function rollback() { - $distFiles = $this->collectDistFiles(); + $files = $this->collectFiles(); - foreach($distFiles as $file) + foreach($files as $file) { $this->rollbackFile($file); }
refactor: change name of collection file method (not only dist are loaded)
Niktux_karma
train
php
3cbec0b81ac0faed1b365461f41b258435de4d37
diff --git a/admin/tool/uploaduser/locallib.php b/admin/tool/uploaduser/locallib.php index <HASH>..<HASH> 100644 --- a/admin/tool/uploaduser/locallib.php +++ b/admin/tool/uploaduser/locallib.php @@ -360,6 +360,7 @@ function uu_allowed_roles() { */ function uu_allowed_roles_cache() { $allowedroles = get_assignable_roles(context_course::instance(SITEID), ROLENAME_SHORT); + $rolecache = []; foreach ($allowedroles as $rid=>$rname) { $rolecache[$rid] = new stdClass(); $rolecache[$rid]->id = $rid; @@ -379,6 +380,7 @@ function uu_allowed_roles_cache() { */ function uu_allowed_sysroles_cache() { $allowedroles = get_assignable_roles(context_system::instance(), ROLENAME_SHORT); + $rolecache = []; foreach ($allowedroles as $rid => $rname) { $rolecache[$rid] = new stdClass(); $rolecache[$rid]->id = $rid;
MDL-<I> tool_uploaduser: Fix undefined variable warning
moodle_moodle
train
php
081825932bdefd2ec7794498d81e061149c425d1
diff --git a/src/main/java/io/vlingo/actors/Stage.java b/src/main/java/io/vlingo/actors/Stage.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/vlingo/actors/Stage.java +++ b/src/main/java/io/vlingo/actors/Stage.java @@ -51,15 +51,23 @@ public class Stage implements Stoppable { definition.parameters(), TestMailbox.Name, definition.actorName()); - return actorFor( - redefinition, - protocol, - definition.parentOr(world.defaultParent()), - null, - null, - definition.supervisor(), - definition.loggerOr(world.defaultLogger()) - ).toTestActor(); + + try { + return actorFor( + redefinition, + protocol, + definition.parentOr(world.defaultParent()), + null, + null, + definition.supervisor(), + definition.loggerOr(world.defaultLogger()) + ).toTestActor(); + + } catch (Exception e) { + world.defaultLogger().log("vlingo/actors: FAILED: " + e.getMessage(), e); + e.printStackTrace(); + return null; + } } public final Protocols testActorFor(final Definition definition, final Class<?>[] protocols) {
Added more logging for test actor creations, which often goes wrong during early development.
vlingo_vlingo-actors
train
java
e0225b8b54b295cff38e24929856a333a9ce0872
diff --git a/ghost/members-api/static/auth/components/FormInput.js b/ghost/members-api/static/auth/components/FormInput.js index <HASH>..<HASH> 100644 --- a/ghost/members-api/static/auth/components/FormInput.js +++ b/ghost/members-api/static/auth/components/FormInput.js @@ -1,4 +1,4 @@ -export default ({type, name, placeholder, value = '', error, onInput, required, className, children, icon}) => ( +export default ({type, name, placeholder, value = '', error, onInput, required, disabled, className, children, icon}) => ( <div className="gm-form-element"> <div className={[ (className ? className : ""), @@ -12,6 +12,7 @@ export default ({type, name, placeholder, value = '', error, onInput, required, value={ value } onInput={ (e) => onInput(e, name) } required={ required } + disabled={ disabled } className={[ (value ? "gm-input-filled" : ""), (error ? "gm-error" : "")
Added support for disabled form elements no-issue This can be used for a coupon input in future
TryGhost_Ghost
train
js
9177a6bca8ca598a79166691a33e2359449d932c
diff --git a/package-command.php b/package-command.php index <HASH>..<HASH> 100644 --- a/package-command.php +++ b/package-command.php @@ -5,7 +5,7 @@ if ( ! class_exists( 'WP_CLI' ) ) { } $autoload = dirname( __FILE__ ) . '/vendor/autoload.php'; -if ( file_exists( $autoload ) ) { +if ( file_exists( $autoload ) && ! class_exists( 'Package_Command' ) ) { require_once $autoload; } WP_CLI::add_command( 'package', 'Package_Command' );
If `Package_Command` already exists, don't need the autoloader
wp-cli_package-command
train
php
78bf1af94e4ba7348b4f8d55037e6d7abdef2f23
diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -598,7 +598,11 @@ class Worker */ public function sleep($seconds) { - usleep($seconds * 1000000); + if ($seconds < 1) { + usleep($seconds * 1000000); + } else { + sleep($seconds); + } } /**
Use `usleep` in case when sleep time less than 1 second (#<I>)
laravel_framework
train
php
d1e856e4ca1442d4a0e68b5a3eb7f941b931645d
diff --git a/src/views/shared/list/_full_header.haml.php b/src/views/shared/list/_full_header.haml.php index <HASH>..<HASH> 100644 --- a/src/views/shared/list/_full_header.haml.php +++ b/src/views/shared/list/_full_header.haml.php @@ -13,9 +13,6 @@ %span.stat Total %span.badge=$count - %span.stat - Showing - %span.badge=count($listing) -# Potentially contain other buttons .pull-right.btn-toolbar
Removing the "showing" stat
BKWLD_decoy
train
php
4d1a08676c471f18bd70a95d25d96bfcba93458c
diff --git a/gosu-lab/src/main/java/editor/search/UsageTarget.java b/gosu-lab/src/main/java/editor/search/UsageTarget.java index <HASH>..<HASH> 100644 --- a/gosu-lab/src/main/java/editor/search/UsageTarget.java +++ b/gosu-lab/src/main/java/editor/search/UsageTarget.java @@ -293,15 +293,16 @@ public class UsageTarget private static SearchElement findTarget( IFeatureInfo fi, IParsedElement ref ) { - if( !(fi.getOwnersType() instanceof IFileRepositoryBasedType) ) + IType type = fi.getOwnersType(); + type = type instanceof IMetaType ? ((IMetaType)type).getType() : type; + if( !(type instanceof IFileRepositoryBasedType) ) { return null; } - IFileRepositoryBasedType declaringType = (IFileRepositoryBasedType)fi.getOwnersType(); + IFileRepositoryBasedType declaringType = (IFileRepositoryBasedType)type; if( fi instanceof ITypeInfo ) { - IType type = fi.getOwnersType(); if( type instanceof IGosuClass ) { return new SearchElement( ((IGosuClass)type).getClassStatement().getClassDeclaration() );
Gosu Lab - fix navigation to member through meta type
gosu-lang_gosu-lang
train
java
fac22aa2c1ef3b5b08d0bdb0bfd19430b78c3854
diff --git a/openstack/resource_openstack_networking_port_v2.go b/openstack/resource_openstack_networking_port_v2.go index <HASH>..<HASH> 100644 --- a/openstack/resource_openstack_networking_port_v2.go +++ b/openstack/resource_openstack_networking_port_v2.go @@ -10,7 +10,6 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/ports" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" ) func resourceNetworkingPortV2() *schema.Resource { @@ -114,9 +113,8 @@ func resourceNetworkingPortV2() *schema.Resource { Required: true, }, "ip_address": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.SingleIP(), + Type: schema.TypeString, + Optional: true, }, }, },
Networking v2: Revert validation of fixed_ip ip_address (#<I>)
terraform-providers_terraform-provider-openstack
train
go
b64b9a02ad42223f7e9060bce824ee2e5f472f56
diff --git a/troposphere/autoscaling.py b/troposphere/autoscaling.py index <HASH>..<HASH> 100644 --- a/troposphere/autoscaling.py +++ b/troposphere/autoscaling.py @@ -32,7 +32,7 @@ class AutoScalingGroup(AWSObject): 'MaxSize': (basestring, True), 'MinSize': (basestring, True), 'NotificationConfiguration': (basestring, False), - 'Tags': (list, True), + 'Tags': (list, False), # Although docs say these are required 'VPCZoneIdentifier': (list, False), }
Don't make Tags a required AutoScalingGroup property Despite the documentation saying this is required, none of the examples have Tags in them. So we'll make this an optional property for now..
cloudtools_troposphere
train
py
791043f3d74b0e218bea55ea52301fa5ddafb4a7
diff --git a/kernel/setup/steps/ezstep_create_sites.php b/kernel/setup/steps/ezstep_create_sites.php index <HASH>..<HASH> 100644 --- a/kernel/setup/steps/ezstep_create_sites.php +++ b/kernel/setup/steps/ezstep_create_sites.php @@ -492,10 +492,14 @@ class eZStepCreateSites extends eZStepInstaller if ( $db->databaseName() == 'mysql' ) { - // We try to use InnoDB table type if it is available, else we use the default type. - $innoDBAvail = $db->arrayQuery( "SHOW VARIABLES LIKE 'have_innodb';" ); - if ( $innoDBAvail[0]['Value'] == 'YES' ) - $params['table_type'] = 'innodb'; + $engines = $db->arrayQuery( 'SHOW ENGINES' ); + foreach( $engines as $engine ) { + if ( $engine['Engine'] == 'InnoDB' && in_array( $engine['Support'], array( 'YES', 'DEFAULT' ) ) ) + { + $params['table_type'] = 'innodb'; + break; + } + } } if ( !$dbSchema->insertSchema( $params ) )
Replace deprecated check for innodb support Since MySQL <I>, the server variable `have_innodb` has been removed. The command `SHOW ENGINES` instead is supported since MySQL <I>. See <URL>
ezsystems_ezpublish-legacy
train
php
ea596f2e0abaa72c195440a9757b8213eaa8f70d
diff --git a/CHANGES.rst b/CHANGES.rst index <HASH>..<HASH> 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -25,6 +25,8 @@ Removed Fixed ----- +- :kbd:`^c` not able to terminate initialization process due to the handler + registered. Known issue ----------- diff --git a/ehforwarderbot/__main__.py b/ehforwarderbot/__main__.py index <HASH>..<HASH> 100644 --- a/ehforwarderbot/__main__.py +++ b/ehforwarderbot/__main__.py @@ -332,11 +332,14 @@ def main(): setup_logging(args, conf) setup_telemetry(conf['telemetry']) + init(conf) + + # Only register graceful stop signals when we are ready to start + # polling threads. atexit.register(stop_gracefully) signal.signal(signal.SIGTERM, stop_gracefully) signal.signal(signal.SIGINT, stop_gracefully) - init(conf) poll() diff --git a/ehforwarderbot/__version__.py b/ehforwarderbot/__version__.py index <HASH>..<HASH> 100644 --- a/ehforwarderbot/__version__.py +++ b/ehforwarderbot/__version__.py @@ -1,3 +1,3 @@ # coding=utf-8 -__version__ = "2.1.0" +__version__ = "2.1.1.dev1"
fix: ^c not able to stop the init process (#<I>)
blueset_ehForwarderBot
train
rst,py,py
2d5760fbb34a147632db44cd7127ef19df5d2557
diff --git a/src/grid/GroupedByServerChargesGridView.php b/src/grid/GroupedByServerChargesGridView.php index <HASH>..<HASH> 100644 --- a/src/grid/GroupedByServerChargesGridView.php +++ b/src/grid/GroupedByServerChargesGridView.php @@ -77,7 +77,7 @@ class GroupedByServerChargesGridView extends BillGridView ], 'columns' => array_filter([ Yii::$app->user->can('bill.update') ? 'checkbox' : null, - 'type_label', 'label', + 'type_label', 'name', 'quantity', 'sum', 'sum_with_children', 'time', ]), ]);
fixed parts Description displaying in bill view (#<I>)
hiqdev_hipanel-module-finance
train
php
542cbb0f1efa19fafda5ca2d4aa046be99791e24
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -30,7 +30,9 @@ var deparam = function(qs) { for(var i=0; i<parts.length; i++) { var pair = parts[i].split("="); - var key = decodeURIComponent(pair[0]), value = decodeURIComponent(pair[1]); + // split the key to handle multi arguments + var key = decodeURIComponent(pair[0]).split("[]")[0], + value = decodeURIComponent(pair[1]); var curValue = deparamed[key]; var curType = typeof(curValue);
added depram support for multi arguments
dailymuse_mithril-coat
train
js
40e1519f26fd654eac7e0170c2edb14e61641533
diff --git a/src/Console/Commands/ExportMessages.php b/src/Console/Commands/ExportMessages.php index <HASH>..<HASH> 100644 --- a/src/Console/Commands/ExportMessages.php +++ b/src/Console/Commands/ExportMessages.php @@ -48,9 +48,17 @@ class ExportMessages extends Command $adapter = new Local( $filepath ); $filesystem = new Filesystem( $adapter ); - $contents = 'let messages = ' . json_encode( $messages ); + $contents = 'export default ' . json_encode( $messages ); - $filesystem->write( $filename, $contents ); + if ( $filesystem->has( $filename ) ) { + + $filesystem->delete( $filename ); + $filesystem->write( $filename, $contents ); + + } else { + + $filesystem->write( $filename, $contents ); + } $this->info( 'Messages exported to JavaScript file, you can find them at ' . $filepath . DIRECTORY_SEPARATOR . $filename );
Check if messages file already exists and replace it with the new file
kg-bot_laravel-localization-to-vue
train
php
990e0e8e65247980dcf37124b58872e93d68793b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='registration', - version='0.3p2', + version='0.3p3', description='User-registration application for Django', author='James Bennett', author_email='james@b-list.org',
And push a version bump to setup.py just becaue
ubernostrum_django-registration
train
py
15a00b4be0deccd9f7a4a2dce9e85d951b7fcdaf
diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index <HASH>..<HASH> 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -646,7 +646,7 @@ class block_base { * @return boolean * @todo finish documenting this function */ - function user_can_addto(&$page) { + function user_can_addto($page) { return true; }
blocks editing ui: MDL-<I> Remove stupid pass by reference. Was causing errors when this method was called via block_method_result
moodle_moodle
train
php
7932d03ba83c0c38ce8d393ee70113a15bd291db
diff --git a/astromodels/functions/template_model.py b/astromodels/functions/template_model.py index <HASH>..<HASH> 100644 --- a/astromodels/functions/template_model.py +++ b/astromodels/functions/template_model.py @@ -410,7 +410,7 @@ class TemplateModel(Function1D): # Figure out the shape of the data matrices data_shape = map(lambda x: x.shape[0], self._parameters_grids.values()) - + self._interpolators = [] for energy in self._energies: @@ -487,7 +487,7 @@ class TemplateModel(Function1D): # Gather all interpolations for these parameters' values at all defined energies # (these are the logarithm of the values) - log_interpolations = np.array(map(lambda i:self._interpolators[i](parameters_values), + log_interpolations = np.array(map(lambda i:self._interpolators[i](np.atleast_1d(parameters_values)), range(self._energies.shape[0]))) # Now interpolate the interpolations to get the flux at the requested energies @@ -523,4 +523,4 @@ class TemplateModel(Function1D): # # data['extra_setup'] = {'data_file': self._data_file} - return data \ No newline at end of file + return data
1D templates were failing. added np.atleast_1d to fix
threeML_astromodels
train
py
b9f22dd6a4ceb519e0207c74651f03ee99873a3e
diff --git a/beetle/base.py b/beetle/base.py index <HASH>..<HASH> 100644 --- a/beetle/base.py +++ b/beetle/base.py @@ -73,10 +73,13 @@ class Writer(object): def write(self): for destination, content in self.files(): - destination_folder = os.path.dirname(destination) + self.write_file(destination, content) - if not os.path.exists(destination_folder): - os.makedirs(destination_folder) + def write_file(self, destination, content): + destination_folder = os.path.dirname(destination) - with open(destination, 'wb') as fo: - fo.write(content) + if not os.path.exists(destination_folder): + os.makedirs(destination_folder) + + with open(destination, 'wb') as fo: + fo.write(content)
Splitted actual writing to a new function.
cknv_beetle
train
py
1c6dc7c3afc032ed28270cb8a710eb6f899ccd6b
diff --git a/tornado/wsgi.py b/tornado/wsgi.py index <HASH>..<HASH> 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -43,7 +43,7 @@ import urllib from tornado import escape from tornado import httputil from tornado import web -from tornado.escape import native_str, utf8 +from tornado.escape import native_str, utf8, parse_qs_bytes from tornado.util import b try: @@ -146,7 +146,7 @@ class HTTPRequest(object): self.files = {} content_type = self.headers.get("Content-Type", "") if content_type.startswith("application/x-www-form-urlencoded"): - for name, values in cgi.parse_qs(self.body).iteritems(): + for name, values in parse_qs_bytes(native_str(self.body)).iteritems(): self.arguments.setdefault(name, []).extend(values) elif content_type.startswith("multipart/form-data"): if 'boundary=' in content_type:
Fix keys in wsgi request arguments being bytes in python3 when content-type is application/x-www-form-urlencoded.
tornadoweb_tornado
train
py
97796c27b85dcf883b14eca1a9267051687902c5
diff --git a/lib/epub/publication/package/guide.rb b/lib/epub/publication/package/guide.rb index <HASH>..<HASH> 100644 --- a/lib/epub/publication/package/guide.rb +++ b/lib/epub/publication/package/guide.rb @@ -30,10 +30,6 @@ module EPUB attr_accessor :guide, :type, :title, :href, :iri - - def to_s - iri.to_s - end end end end diff --git a/lib/epub/publication/package/manifest.rb b/lib/epub/publication/package/manifest.rb index <HASH>..<HASH> 100644 --- a/lib/epub/publication/package/manifest.rb +++ b/lib/epub/publication/package/manifest.rb @@ -36,10 +36,6 @@ module EPUB attr_accessor :manifest, :id, :href, :media_type, :fallback, :properties, :media_overlay, :iri - - def to_s - iri.to_s - end end end end
Remove #to_s from Publication::Package::Manifest and Guide to help debugging
KitaitiMakoto_epub-parser
train
rb,rb
e3143451762d058e8ae6c5efa86494c19f920d48
diff --git a/src/Persistence/Db/Criteria/LoadCriteriaMapper.php b/src/Persistence/Db/Criteria/LoadCriteriaMapper.php index <HASH>..<HASH> 100644 --- a/src/Persistence/Db/Criteria/LoadCriteriaMapper.php +++ b/src/Persistence/Db/Criteria/LoadCriteriaMapper.php @@ -66,7 +66,17 @@ class LoadCriteriaMapper $relationsToLoad[$alias] = $memberRelation; foreach ($memberRelation->getParentColumnsToLoad() as $column) { - $select->addColumn($column, Expr::tableColumn($select->getTable(), $column)); + if ($select->getTable()->hasColumn($column)) { + $select->addColumn($column, Expr::tableColumn($select->getTable(), $column)); + continue; + } else { + foreach ($select->getJoins() as $join) { + if ($join->getTable()->hasColumn($column)) { + $select->addColumn($column, Expr::column($join->getTableName(), $join->getTable()->getColumn($column))); + continue; + } + } + } } if (!($mapping instanceof ToOneEmbeddedObjectMapping)) {
Fix issue with joined members and and parent columns
dms-org_core
train
php
e504e5a8de9532c3ef9d772e437baede7a311637
diff --git a/h2o-algos/src/test/java/hex/deeplearning/DeepLearningReproducibilityTest.java b/h2o-algos/src/test/java/hex/deeplearning/DeepLearningReproducibilityTest.java index <HASH>..<HASH> 100644 --- a/h2o-algos/src/test/java/hex/deeplearning/DeepLearningReproducibilityTest.java +++ b/h2o-algos/src/test/java/hex/deeplearning/DeepLearningReproducibilityTest.java @@ -59,9 +59,8 @@ public class DeepLearningReproducibilityTest extends TestUtil { p._input_dropout_ratio = 0.2; p._train_samples_per_iteration = 3; p._hidden_dropout_ratios = new double[]{0.4, 0.1}; - p._epochs = 3.32; + p._epochs = 0.32; p._quiet_mode = true; - p._single_node_mode = true; p._force_load_balance = false; p._reproducible = repro; DeepLearning dl = new DeepLearning(p);
Speed up DL Repro test.
h2oai_h2o-3
train
java
ac7e1bc47a9361733820b43171cbdb6e6ba5aa07
diff --git a/plex/__init__.py b/plex/__init__.py index <HASH>..<HASH> 100644 --- a/plex/__init__.py +++ b/plex/__init__.py @@ -2,7 +2,7 @@ import logging log = logging.getLogger(__name__) -__version__ = '0.6.2' +__version__ = '0.6.3' try:
Bumped version to <I>
fuzeman_plex.py
train
py
37e3b0be622b8fe19b99cf0352c50ec821c7f5b7
diff --git a/src/Service/PullRequest.php b/src/Service/PullRequest.php index <HASH>..<HASH> 100644 --- a/src/Service/PullRequest.php +++ b/src/Service/PullRequest.php @@ -48,50 +48,6 @@ class PullRequest } /** - * @param string $user - * @return self - */ - public function userName($user) - { - $this->userName = $user; - - return $this; - } - - /** - * @param string $repository - * @return self - */ - public function repository($repository) - { - $this->repository = $repository; - - return $this; - } - - /** - * @param string $startSha - * @return self - */ - public function startSha($startSha) - { - $this->startSha = $startSha; - - return $this; - } - - /** - * @param string $endSha - * @return self - */ - public function endSha($endSha) - { - $this->endSha = $endSha; - - return $this; - } - - /** * @param string $userName * @param string $repository * @param string $startSha
Fix: Remove code not covered by tests
localheinz_github-changelog
train
php
dee114d4c42a6b81d5ad551bd9634893f03fe70e
diff --git a/examples/webgl-points-layer.js b/examples/webgl-points-layer.js index <HASH>..<HASH> 100644 --- a/examples/webgl-points-layer.js +++ b/examples/webgl-points-layer.js @@ -81,13 +81,12 @@ function setStyleStatus(valid) { const editor = document.getElementById('style-editor'); editor.addEventListener('input', function() { const textStyle = editor.value; - if (JSON.stringify(JSON.parse(textStyle)) === JSON.stringify(literalStyle)) { - return; - } - try { - literalStyle = JSON.parse(textStyle); - refreshLayer(); + const newLiteralStyle = JSON.parse(textStyle); + if (JSON.stringify(newLiteralStyle) !== JSON.stringify(literalStyle)) { + literalStyle = newLiteralStyle; + refreshLayer(); + } setStyleStatus(true); } catch (e) { setStyleStatus(false);
Guard against JSON.parse errors. Also show successful style parse status after a style error was corrected but it is the same style as previously.
openlayers_openlayers
train
js
bb81a37cdc1a3f0bd87241722c6fc584d71f3005
diff --git a/server/monitor_test.go b/server/monitor_test.go index <HASH>..<HASH> 100644 --- a/server/monitor_test.go +++ b/server/monitor_test.go @@ -389,11 +389,9 @@ func TestConnzLastActivity(t *testing.T) { t.Fatalf("Expected LastActivity to be valid\n") } - // On Windows, looks like the precision is too low, and if we - // don't wait, first and last would be equal. - if runtime.GOOS == "windows" { - time.Sleep(100 * time.Millisecond) - } + // Just wait a bit to make sure that there is a difference + // between first and last. + time.Sleep(100 * time.Millisecond) // Sub should trigger update. nc.Subscribe("hello.world", func(m *nats.Msg) {})
Fix flapping test Introduce sleep when checking activity updates. I had fixed it originally for Windows and then made it for all platform recently but only for the publish case. I missed the subscribe test.
nats-io_gnatsd
train
go
c322d00804bca3190a94dfa6572a0367612149b9
diff --git a/django_extensions/management/commands/sync_media_s3.py b/django_extensions/management/commands/sync_media_s3.py index <HASH>..<HASH> 100644 --- a/django_extensions/management/commands/sync_media_s3.py +++ b/django_extensions/management/commands/sync_media_s3.py @@ -111,7 +111,7 @@ class Command(BaseCommand): raise CommandError('MEDIA_ROOT must be set in your settings.') self.DIRECTORY = settings.MEDIA_ROOT - self.verbosity = int(options.get('verbose', 1)) + self.verbosity = int(options.get('verbosity')) self.prefix = options.get('prefix') self.do_gzip = options.get('gzip') self.do_expires = options.get('expires') @@ -230,7 +230,7 @@ class Command(BaseCommand): # Backwards compatibility for Django r9110 if not [opt for opt in Command.option_list if opt.dest=='verbosity']: Command.option_list += ( - optparse.make_option('-v', '--verbose', - dest='verbose', default=1, action='count', + optparse.make_option('-v', '--verbosity', + dest='verbosity', default=1, action='count', help="Verbose mode. Multiple -v options increase the verbosity."), )
Updating the verbosity option to actually work.
django-extensions_django-extensions
train
py
7989e673df9ab99248b9fcefd4f9b09377fe3ced
diff --git a/napalm/base/helpers.py b/napalm/base/helpers.py index <HASH>..<HASH> 100644 --- a/napalm/base/helpers.py +++ b/napalm/base/helpers.py @@ -248,7 +248,7 @@ def textfsm_extractor(cls, template_name, raw_text): def find_txt(xml_tree, path, default="", namespaces=None): """ Extracts the text value from an XML tree, using XPath. - In case of error, will return a default value. + In case of error or text element unavailability, will return a default value. :param xml_tree: the XML Tree object. Assumed is <type 'lxml.etree._Element'>. :param path: XPath to be applied, in order to extract the desired data. @@ -265,7 +265,10 @@ def find_txt(xml_tree, path, default="", namespaces=None): if xpath_length and xpath_applied[0] is not None: xpath_result = xpath_applied[0] if isinstance(xpath_result, type(xml_tree)): - value = xpath_result.text.strip() + if xpath_result.text: + value = xpath_result.text.strip() + else: + value = default else: value = xpath_result else:
added lxml text retrieval not to fail if no text avail (#<I>)
napalm-automation_napalm
train
py
10a4b7a6e797e485df43dad99ac267b3d54ffe2c
diff --git a/test/perfplot_test.py b/test/perfplot_test.py index <HASH>..<HASH> 100644 --- a/test/perfplot_test.py +++ b/test/perfplot_test.py @@ -58,7 +58,7 @@ def test_no_labels(): def test_automatic_scale(): - from perfplot.main import PerfplotData, si_time + from perfplot.main import PerfplotData # (expected_prefix, time in nanoseconds, expected_timing) format test_cases = [ @@ -81,7 +81,7 @@ def test_automatic_scale(): logy=False, automatic_order=True, # True except for last test-case - automatic_scale=(True if i != len(test_cases)-1 else False) + automatic_scale=(True if i != len(test_cases) - 1 else False) ) # Has the correct prefix been applied? assert data.timings_unit == exp_prefix
Fix flake8 formatting errors in tests - Unused import flake8(F<I>) - Missing whitespace around operator flake8(E<I>)
nschloe_perfplot
train
py
8b1da81830be4157cff15bb53c741041e0a2d714
diff --git a/node-tests/lint-test.js b/node-tests/lint-test.js index <HASH>..<HASH> 100644 --- a/node-tests/lint-test.js +++ b/node-tests/lint-test.js @@ -8,4 +8,7 @@ var paths = [ 'index.js', ]; -lint(paths); +lint(paths, { + timeout: 10000, + slow: 2000, +});
tests/lint: Increase timeouts
ember-cli_ember-cli-legacy-blueprints
train
js
b784faf45d825e763edd0ae7a47858b1a46d1798
diff --git a/bitshares/amount.py b/bitshares/amount.py index <HASH>..<HASH> 100644 --- a/bitshares/amount.py +++ b/bitshares/amount.py @@ -79,11 +79,16 @@ class Amount(dict): self["asset"] = Asset(args[1], bitshares_instance=self.bitshares) self["symbol"] = self["asset"]["symbol"] - elif amount and asset: + elif amount and asset and isinstance(asset, Asset): self["amount"] = amount self["asset"] = asset self["symbol"] = self["asset"]["symbol"] + elif amount and asset and isinstance(asset, str): + self["amount"] = amount + self["asset"] = Asset(asset) + self["symbol"] = asset + else: raise ValueError
[amount] make sure that quote/base can be dealt with as strings
bitshares_python-bitshares
train
py
206d645ba0e72960e5b3358efebc660c61c856c6
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,10 @@ function createlib (Map, q) { } }; + DeferMap.prototype.exists = function (name) { + return !!this._map.get(name); + }; + return DeferMap; }
just take look if name exists in DeferMap
allex-lowlevel-libs_defermap
train
js
6648fcdf9f6f1c221c8737fe9bd1d2452a47ba52
diff --git a/src/test/java/org/sonar/plugins/buildbreaker/BuildBreakerPluginTest.java b/src/test/java/org/sonar/plugins/buildbreaker/BuildBreakerPluginTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/sonar/plugins/buildbreaker/BuildBreakerPluginTest.java +++ b/src/test/java/org/sonar/plugins/buildbreaker/BuildBreakerPluginTest.java @@ -19,9 +19,11 @@ */ package org.sonar.plugins.buildbreaker; -import org.junit.Test; -import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.core.IsNot.not; +import static org.junit.Assert.assertThat; +import org.junit.Test; public class BuildBreakerPluginTest { @@ -29,4 +31,11 @@ public class BuildBreakerPluginTest { public void oneExtensionIsRegistered() { assertThat(new BuildBreakerPlugin().getExtensions().size(), is(1)); } + + @Test + public void justToIncreaseCoverage() { + assertThat(new BuildBreakerPlugin().getName(), not(nullValue())); + assertThat(new BuildBreakerPlugin().getKey(), is("build-breaker")); + assertThat(new BuildBreakerPlugin().getDescription(), not(nullValue())); + } }
build-breaker plugin : add a test just to increase coverage ;o)
SonarQubeCommunity_sonar-build-breaker
train
java
c7f81f14dfe02a2b3839b86d9fd47ce784aeeca6
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -26,7 +26,7 @@ module ActiveRecord when Range, Arel::Relation attribute.in(value) when ActiveRecord::Base - attribute.eq(Arel.sql(value.quoted_id)) + attribute.eq(value.id) when Class # FIXME: I think we need to deprecate this behavior attribute.eq(value.name)
arel can escape the id, so avoid using the database connection
rails_rails
train
rb
0772a1fb81058a06e8e5d4e808de5d87fca2cb8c
diff --git a/lib/expression/node/OperatorNode.js b/lib/expression/node/OperatorNode.js index <HASH>..<HASH> 100644 --- a/lib/expression/node/OperatorNode.js +++ b/lib/expression/node/OperatorNode.js @@ -280,13 +280,6 @@ OperatorNode.prototype._toTex = function(callbacks) { case 'OperatorNode:divide': //op contains '\\frac' at this point return op + lhsTex + rhsTex; - - case 'OperatorNode:to': - rhsTex = '{' + latex.toUnit(rhs.toTex(callbacks)) + '}'; - if (parens[1]) { - rhsTex = '\\left(' + rhsTex + '\\right)'; - } - break; } return lhsTex + ' ' + op + ' ' + rhsTex; diff --git a/lib/util/latex.js b/lib/util/latex.js index <HASH>..<HASH> 100644 --- a/lib/util/latex.js +++ b/lib/util/latex.js @@ -498,11 +498,3 @@ exports.toFunction = function (node, callbacks, name) { //fallback return defaultToTex(node, callbacks, name); } - -exports.toUnit = (function() { - var _toUnit = latexToFn(units); - - return function(value, notSpaced) { - return _toUnit(value); - }; -}());
util/latex: Get rid of toUnit ( hasn't been working anyway )
josdejong_mathjs
train
js,js
f4ad2012f67281ce8369f97ce47f410bfdcf8cb4
diff --git a/sirmordred/task_projects.py b/sirmordred/task_projects.py index <HASH>..<HASH> 100644 --- a/sirmordred/task_projects.py +++ b/sirmordred/task_projects.py @@ -31,7 +31,6 @@ import requests from copy import deepcopy -from sirmordred.config import Config from sirmordred.task import Task from sirmordred.eclipse_projects_lib import compose_title, compose_projects_json @@ -69,7 +68,7 @@ class TaskProjects(Task): return cls.projects_last_diff @classmethod - def get_repos_by_backend_section(cls, backend_section): + def get_repos_by_backend_section(cls, global_data_sources, backend_section): """ return list with the repositories for a backend_section """ repos = [] projects = TaskProjects.get_projects() @@ -77,7 +76,7 @@ class TaskProjects(Task): for pro in projects: if backend_section in projects[pro]: backend = Task.get_backend(backend_section) - if backend in Config.get_global_data_sources() and cls.GLOBAL_PROJECT in projects \ + if backend in global_data_sources and cls.GLOBAL_PROJECT in projects \ and pro != cls.GLOBAL_PROJECT: logger.debug("Skip global data source %s for project %s", backend, pro)
[task_projects] Allow to accept list of global source This code changes the method `get_repos_by_backend_section` to accept a list of global data sources defined in the cfg, instead of relying on hard-coded ones.
chaoss_grimoirelab-sirmordred
train
py
9961d687c824625920b408010e2d418db627faab
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -165,6 +165,13 @@ class Minion(object): ''' return bool(tgt.count(self.opts['hostname'])) + def _facter_match(self, tgt): + ''' + Reads in the facter regular expresion match + ''' + comps = tgt.split() + return bool(re.match(comps[1], self.opts['facter'][comps[0]]) + def _return_pub(self, ret): ''' Return the data from the executed command to the master server
Add facter matching to salt minion lookups
saltstack_salt
train
py
ff042e67d00e8292232addadfdb0681877d8723a
diff --git a/src/test/java/org/takes/facets/auth/social/PsGithubTest.java b/src/test/java/org/takes/facets/auth/social/PsGithubTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/takes/facets/auth/social/PsGithubTest.java +++ b/src/test/java/org/takes/facets/auth/social/PsGithubTest.java @@ -159,12 +159,12 @@ public final class PsGithubTest { Matchers.equalTo("urn:github:1") ); MatcherAssert.assertThat( - identity.properties().get(LOGIN), - Matchers.equalTo(OCTOCAT) + identity.properties().get(PsGithubTest.LOGIN), + Matchers.equalTo(PsGithubTest.OCTOCAT) ); MatcherAssert.assertThat( identity.properties().get("avatar"), - Matchers.equalTo(OCTOCAT_GIF_URL) + Matchers.equalTo(PsGithubTest.OCTOCAT_GIF_URL) ); } } @@ -210,11 +210,11 @@ public final class PsGithubTest { ); return new RsJSON( Json.createObjectBuilder() - .add(LOGIN, OCTOCAT) + .add(PsGithubTest.LOGIN, PsGithubTest.OCTOCAT) .add("id", 1) .add( "avatar_url", - OCTOCAT_GIF_URL + PsGithubTest.OCTOCAT_GIF_URL ) .build() );
Static fields should be accessed in a static way
yegor256_takes
train
java
b6afadcf9ed70669e6045995ca0ac8d0a0f5d80d
diff --git a/spec/narray_spec.rb b/spec/narray_spec.rb index <HASH>..<HASH> 100644 --- a/spec/narray_spec.rb +++ b/spec/narray_spec.rb @@ -56,6 +56,10 @@ types.each do |dtype| it{expect(@a).to eq [1,2,3,5,7,11]} it{expect(@a.to_a).to eq [1,2,3,5,7,11]} it{expect(@a.to_a).to be_kind_of Array} + it{expect(@a.dup).to eq @a} + it{expect(@a.clone).to eq @a} + it{expect(@a.dup.object_id).not_to eq @a.object_id} + it{expect(@a.clone.object_id).not_to eq @a.object_id} it{expect(@a.eq([1,1,3,3,7,7])).to eq [1,0,1,0,1,0]} it{expect(@a[3..4]).to eq [5,7]}
test for clone, dup
ruby-numo_numo-narray
train
rb
06a382e59c69ca1f083933a418e9f56269f25bf2
diff --git a/salt/utils/minion.py b/salt/utils/minion.py index <HASH>..<HASH> 100644 --- a/salt/utils/minion.py +++ b/salt/utils/minion.py @@ -2,10 +2,11 @@ ''' Utility functions for minions ''' +# Import python libs from __future__ import absolute_import import os import threading - +# Import salt libs import salt.utils import salt.payload @@ -81,4 +82,30 @@ def _read_proc_file(path, opts): pass return None + if not _check_cmdline(data): + try: + os.remove(path) + except IOError: + pass + return None return data + + +def _check_cmdline(data): + ''' + Check the proc filesystem cmdline to see if this process is a salt process + ''' + if salt.utils.is_windows(): + return True + pid = data.get('pid') + if not pid: + return False + path = os.path.join('/proc/{0}/cmdline'.format(pid)) + if not os.path.isfile(path): + return False + try: + with salt.utils.fopen(path, 'rb') as fp_: + if 'salt' in fp_.read(): + return True + except (OSError, IOError): + return False
Add a check that the cmdline of the found proc matches (#<I>)
saltstack_salt
train
py
32d7f7d3478d5da4ccdec494d417f0acb7461407
diff --git a/test/markdown.spec.js b/test/markdown.spec.js index <HASH>..<HASH> 100644 --- a/test/markdown.spec.js +++ b/test/markdown.spec.js @@ -48,6 +48,8 @@ describe( 'markdown', function() { [ '<span>a</span>', '<span>a</span>' ], [ '&lt;span&gt;a&lt;/span&gt;', '<span>a</span>' ], [ '<span style="color:red;">red</span>', '<span style="color:red;">red</span>' ], + [ '<span>bad\nunaffected <span style="color: purple">el</span>.', '<p>&lt;span&gt;bad</p>unaffected <span style="color: purple">el</span>.' ], + [ '<span style=\'color:red;\'>red</span>', '<span style=\'color:red;\'>red</span>' ], [ '><', '&gt;&lt;' ], // sanitized html [ '<span style="color:red;" onclick="alert(\"gotcha!\")">click me</span>', '<span style="color:red;">click me</span>' ],
added: more markdown-to-html tests
enketo_enketo-transformer
train
js
e679ccfdda67743705cade424bb83c6c4851ae42
diff --git a/spec/chai-helpers/backbone-el.js b/spec/chai-helpers/backbone-el.js index <HASH>..<HASH> 100644 --- a/spec/chai-helpers/backbone-el.js +++ b/spec/chai-helpers/backbone-el.js @@ -49,7 +49,7 @@ new Assertion( Backbone ).to.be.an( 'object', "Global variable 'Backbone' not available" ); // Verify that the subject has an el property, and that the el is initialized - new Assertion( subject.el ).to.be.an( 'object', "The 'el' property of the view appears to be missing" ); + new Assertion( subject.el ).to.be.an.instanceof( HTMLElement, "The 'el' property of the view appears to be missing" ); // Examine el if ( elProperties.tagName ) {
Fixed Chai test helper for updated environment
hashchange_backbone.declarative.views
train
js
927230760174468be42ea7e28ee52d786c6bfe7c
diff --git a/src/decorate.js b/src/decorate.js index <HASH>..<HASH> 100644 --- a/src/decorate.js +++ b/src/decorate.js @@ -40,7 +40,7 @@ export function makeDecoratorComponent(configs, BaseComponent) { return reduce( 'defaultProps', configs, - getDefaultProps ? getDefaultProps() : {} + typeof getDefaultProps === 'function' ? getDefaultProps() : {} ) },
be more careful about getDefaultProps
HubSpot_react-decorate
train
js
8368e08cfaa3aded5aed88f244d2e2eed450e265
diff --git a/lib/ext/property.js b/lib/ext/property.js index <HASH>..<HASH> 100644 --- a/lib/ext/property.js +++ b/lib/ext/property.js @@ -277,13 +277,13 @@ module.exports = function(should, Assertion) { }, true); /** - * Asserts given object has exact keys. + * Asserts given object has exact keys. Compared to `properties`, `keys` does not accept Object as a argument. * * @name keys * @alias Assertion#key * @memberOf Assertion * @category assertion property - * @param {Array|...string|Object} [keys] Keys to check + * @param {Array|...string} [keys] Keys to check * @example * * ({ a: 10}).should.have.keys('a');
correct jsdoc for Assertion#keys Assertion#keys does not accept Object as a argument. The jsdoc comment describes that it can accept Object.
shouldjs_should.js
train
js
42bdbc35d2b5d16cfc6e2afb3e9cb7b7475f12c2
diff --git a/spyderlib/widgets/qscieditor.py b/spyderlib/widgets/qscieditor.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/qscieditor.py +++ b/spyderlib/widgets/qscieditor.py @@ -805,10 +805,10 @@ class QsciEditor(TextEditBaseWidget): if margin == 0: self.__show_code_analysis_results(line) - def mouseMoveEvent(self, event): - line = self.get_line_number_at(event.pos()) - self.__show_code_analysis_results(line) - QsciScintilla.mouseMoveEvent(self, event) +# def mouseMoveEvent(self, event): +# line = self.get_line_number_at(event.pos()) +# self.__show_code_analysis_results(line) +# QsciScintilla.mouseMoveEvent(self, event) def add_prefix(self, prefix): """Add prefix to current line or selected line(s)"""
Editor/code analysis results: tooltips are no longer shown automatically on mouse hover
spyder-ide_spyder
train
py
3854ae88e6dc53ce61c181cf54fd7ef98f85c523
diff --git a/sam/auxtags.go b/sam/auxtags.go index <HASH>..<HASH> 100644 --- a/sam/auxtags.go +++ b/sam/auxtags.go @@ -72,7 +72,7 @@ func NewAux(t Tag, typ byte, value interface{}) (Aux, error) { a = Aux{t[0], t[1], 'I', 0, 0, 0, 0, 0} binary.LittleEndian.PutUint32(a[4:8], uint32(i)) default: - return nil, fmt.Errorf("sam: unsigned integer value out of range %d > %d", i, math.MaxUint32) + return nil, fmt.Errorf("sam: unsigned integer value out of range %d > %d", i, uint(math.MaxUint32)) } return a, nil case int8: @@ -147,7 +147,7 @@ func NewAux(t Tag, typ byte, value interface{}) (Aux, error) { return nil, fmt.Errorf("sam: wrong dynamic type %T for 'B' tag", value) } l := rv.Len() - if l > math.MaxUint32 { + if uint(l) > math.MaxUint32 { return nil, fmt.Errorf("sam: array too long for 'B' tag") } a := Aux{t[0], t[1], 'B', 0, 0, 0, 0, 0}
sam: fix bounds checks for <I>-bit int archs Previously untyped math.MaxUint<I> overflowed int on <I> bit archs. Don't use uint<I> in check to avoid truncating overflowed arrays on <I> bit archs.
biogo_hts
train
go
e6243b31f9892d10374a0d0779646158ae990e56
diff --git a/slumber/__init__.py b/slumber/__init__.py index <HASH>..<HASH> 100644 --- a/slumber/__init__.py +++ b/slumber/__init__.py @@ -27,8 +27,8 @@ class Resource(object): obj = copy.deepcopy(self) obj.object_id = id return obj - - def get(self, **kwargs): + + def _request(self, method, **kwargs): url = urlparse.urljoin(self.domain, self.endpoint) if hasattr(self, "object_id"): @@ -36,10 +36,14 @@ class Resource(object): if kwargs: url = "?".join([url, urllib.urlencode(kwargs)]) - - resp, content = self.http_client.get(url) + + resp, content = self.http_client.request(url, method) return json.loads(content) + + def get(self, **kwargs): + return self._request("GET", **kwargs) + class APIMeta(object):
refactor get into a wrapper around a generic _request method
samgiles_slumber
train
py
841943f26b9440be01d685060ae1289056623242
diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index <HASH>..<HASH> 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -383,7 +383,7 @@ def _train( # # This code treates ``_train_part()`` calls as not "pure" because: # 1. there is randomness in the training process unless parameters ``seed`` - # and ``is_deterministic`` are set + # and ``deterministic`` are set # 2. even with those parameters set, the output of one ``_train_part()`` call # relies on global state (it and all the other LightGBM training processes # coordinate with each other)
[docs] fix param name typo in comments (#<I>)
Microsoft_LightGBM
train
py
09249e8a37237943c039e009b849bd8285711079
diff --git a/cluster/manager.go b/cluster/manager.go index <HASH>..<HASH> 100644 --- a/cluster/manager.go +++ b/cluster/manager.go @@ -168,8 +168,9 @@ func (c *ClusterManager) initNode(db *Database) (*api.Node, bool) { db.NodeEntries[c.config.NodeId] = NodeEntry{Id: c.selfNode.Id, Ip: c.selfNode.Ip, GenNumber: c.selfNode.GenNumber} - logrus.Infof("Node %s joining cluster... \n\tCluster ID: %s\n\tIP: %s", - c.config.NodeId, c.config.ClusterId, c.selfNode.Ip) + logrus.Infof("Node %s joining cluster...", c.config.NodeId) + logrus.Infof("Cluster ID: %s", c.config.ClusterId) + logrus.Infof("Node IP: %s", c.selfNode.Ip) return &c.selfNode, exists }
Print cluster informatio in multi line format
libopenstorage_openstorage
train
go
9a16109a0f04d452888d2754336c2db7f688a906
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index <HASH>..<HASH> 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -8,6 +8,7 @@ CarrierWave.configure do |config| region: ENV['S3_REGION'] } config.fog_directory = ENV['S3_BUCKET_NAME'] + config.fog_public = false elsif Rails.env.test? config.storage = :file config.enable_processing = false
set acl on newly created objects to private This sets the Access Control List for newly created/uploader images to be the canned-ACL called `private`. This grants full control to owners with no access to anyone else. see [acl overview](<URL>) Since we are using presigned-urls objects being privates makes no difference.
ministryofjustice_peoplefinder
train
rb
4aceedf29bc630352369aaab6fd8f3cb7a4d9d27
diff --git a/base.php b/base.php index <HASH>..<HASH> 100644 --- a/base.php +++ b/base.php @@ -937,9 +937,11 @@ final class Base { **/ function route($pattern,$handler,$ttl=0,$kbps=0) { $types=array('sync','ajax'); - if (is_array($pattern)) + if (is_array($pattern)) { foreach ($pattern as $item) $this->route($item,$handler,$ttl,$kbps); + return; + } preg_match('/([\|\w]+)\h+([^\h]+)'. '(?:\h+\[('.implode('|',$types).')\])?/',$pattern,$parts); if (empty($parts[2])) @@ -974,12 +976,18 @@ final class Base { /** * Provide ReST interface by mapping HTTP verb to class method + * @return NULL * @param $url string * @param $class string * @param $ttl int * @param $kbps int **/ function map($url,$class,$ttl=0,$kbps=0) { + if (is_array($url)) { + foreach ($url as $item) + $this->map($item,$class,$ttl,$kbps); + return; + } $fluid=preg_match('/@\w+/',$url); foreach (explode('|',self::VERBS) as $method) if ($fluid ||
Support array as first argument of map()
bcosca_fatfree-core
train
php
df534585e909b64a571d43fb651bfd15703512c3
diff --git a/telethon/client/messages.py b/telethon/client/messages.py index <HASH>..<HASH> 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -221,18 +221,18 @@ class _IDsIter(RequestIter): async def _init(self, entity, ids): # TODO We never actually split IDs in chunks, but maybe we should if not utils.is_list_like(ids): - self.ids = [ids] + ids = [ids] elif not ids: raise StopAsyncIteration elif self.reverse: - self.ids = list(reversed(ids)) + ids = list(reversed(ids)) else: - self.ids = ids + ids = ids if entity: entity = await self.client.get_input_entity(entity) - self.total = len(self.ids) + self.total = len(ids) from_id = None # By default, no need to validate from_id if isinstance(entity, (types.InputChannel, types.InputPeerChannel)): diff --git a/telethon/version.py b/telethon/version.py index <HASH>..<HASH> 100644 --- a/telethon/version.py +++ b/telethon/version.py @@ -1,3 +1,3 @@ # Versions should comply with PEP440. # This line is parsed in setup.py: -__version__ = '1.6' +__version__ = '1.6.1'
Actually fix ids= not being a list, bump <I>
LonamiWebs_Telethon
train
py,py
983048909b12fe0eabd73c67f64a198efb3d0e13
diff --git a/pkg/build/controller/controller.go b/pkg/build/controller/controller.go index <HASH>..<HASH> 100644 --- a/pkg/build/controller/controller.go +++ b/pkg/build/controller/controller.go @@ -371,8 +371,9 @@ func (bc *BuildPodController) HandlePod(pod *kapi.Pod) error { } glog.V(4).Infof("Build %s/%s status was updated %s -> %s", build.Namespace, build.Name, build.Status.Phase, nextStatus) - handleBuildCompletion(build, bc.RunPolicies) - + if buildutil.IsBuildComplete(build) { + handleBuildCompletion(build, bc.RunPolicies) + } } return nil }
only run handleBuildCompletion on completed builds
openshift_origin
train
go
d8ddad657644663897b746866900100a06cf821f
diff --git a/timber/src/test/java/timber/log/TimberTest.java b/timber/src/test/java/timber/log/TimberTest.java index <HASH>..<HASH> 100644 --- a/timber/src/test/java/timber/log/TimberTest.java +++ b/timber/src/test/java/timber/log/TimberTest.java @@ -224,7 +224,6 @@ public class TimberTest { .hasNoMoreMessages(); } - @Ignore("Currently failing because wasn't actually asserting before") @Test public void debugTreeGeneratedTagIsLoggable() { Timber.plant(new Timber.DebugTree() { private static final int MAX_TAG_LENGTH = 23; @@ -243,12 +242,12 @@ public class TimberTest { }); class ClassNameThatIsReallyReallyReallyLong { { - Timber.d("Hello, world!"); + Timber.i("Hello, world!"); } } new ClassNameThatIsReallyReallyReallyLong(); assertLog() - .hasDebugMessage("TimberTest$1ClassNameTh", "Hello, world!") + .hasInfoMessage("TimberTest$1ClassNameTh", "Hello, world!") .hasNoMoreMessages(); }
Fix ignored test by using INFO log instead of DEBUG log
JakeWharton_timber
train
java
6ee62197ef5d15eb7d703988239449da14c963d9
diff --git a/src/basis/utils/base64.js b/src/basis/utils/base64.js index <HASH>..<HASH> 100644 --- a/src/basis/utils/base64.js +++ b/src/basis/utils/base64.js @@ -52,7 +52,7 @@ } function decode(input, useUTF8){ - input = input.replace(/[^a-z0-9\+\/]/ig, ''); + input = input.replace(/[^a-zA-Z0-9\+\/]/g, ''); var output = []; var chr1, chr2, chr3; @@ -91,6 +91,6 @@ // module.exports = { - encode: typeof btoa == 'function' ? btoa.bind(global) : encode, - decode: typeof atob == 'function' ? atob.bind(global) : decode + encode: encode, + decode: decode };
don't use btoa/atob as replacement for bas<I> encoding/decoding because out if support for non-latin symbols
basisjs_basisjs
train
js
24978d2bfafb8c6df7aa07a5dfdb8e001788cd1e
diff --git a/host/cli/collect-debug-info.go b/host/cli/collect-debug-info.go index <HASH>..<HASH> 100644 --- a/host/cli/collect-debug-info.go +++ b/host/cli/collect-debug-info.go @@ -29,6 +29,7 @@ var debugCmds = [][]string{ {os.Args[0], "version"}, {"virsh", "-c", "lxc:///", "list"}, {"virsh", "-c", "lxc:///", "net-list"}, + {"route", "-n"}, {"iptables", "-L", "-v", "-n", "--line-numbers"}, }
host: Collect `route -n` output in collect-debug-info This is useful when inverstigating network routing issues.
flynn_flynn
train
go
b85926e6f0e68368db83db38fca9e33d36796cac
diff --git a/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java b/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java index <HASH>..<HASH> 100644 --- a/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java @@ -30,7 +30,7 @@ public class SampleWebUiApplication { @Bean public MessageRepository messageRepository() { - return new InMemoryMessageRespository(); + return new InMemoryMessageRepository(); } @Bean
Fix the rest of the typo InMemoryRepository's name
spring-projects_spring-boot
train
java
3c6c465dc8ecc5046c86dae78e12f84adf5567da
diff --git a/src/angularJwt/services/jwt.js b/src/angularJwt/services/jwt.js index <HASH>..<HASH> 100644 --- a/src/angularJwt/services/jwt.js +++ b/src/angularJwt/services/jwt.js @@ -11,7 +11,7 @@ throw 'Illegal base64url string!'; } } - return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js + return decodeURIComponent(escape(window.atob(output))); //polifyll https://github.com/davidchambers/Base64.js }
Little trick for utf-8 encoding support Hello ! I had an encoding error with the claims data (I put a name like "Ézéchiel" for example, and the "é" was bad format). This patch fix encoding problem using basic solution from : <URL>
auth0_angular-jwt
train
js
1087ffb63902c891b019f9c3bff35d7db105f8d9
diff --git a/rejected/mcp.py b/rejected/mcp.py index <HASH>..<HASH> 100644 --- a/rejected/mcp.py +++ b/rejected/mcp.py @@ -230,7 +230,7 @@ class MasterControlProgram(object): # Iterate through all of the consumers for consumer_ in self._all_consumers: self._logger.debug('Polling %s', consumer_.name) - if consumer_.state == consumer.Consumer.STOPPED: + if consumer_.state == consumer.RejectedConsumer.STOPPED: self._logger.warn('Found stopped consumer %s', consumer_.name) non_active_consumers.append(consumer_.name) else: @@ -342,10 +342,10 @@ class MasterControlProgram(object): for name in data: # Create a dict for our calculations - stats[name] = {consumer.Consumer.TIME_SPENT: 0, - consumer.Consumer.PROCESSED: 0, - consumer.Consumer.ERROR: 0, - consumer.Consumer.REDELIVERED: 0} + stats[name] = {consumer.RejectedConsumer.TIME_SPENT: 0, + consumer.RejectedConsumer.PROCESSED: 0, + consumer.RejectedConsumer.ERROR: 0, + consumer.RejectedConsumer.REDELIVERED: 0} # Iterate through all of the data points for consumer_ in data[name]:
Consumer -> RejectedConsumer
gmr_rejected
train
py
5f6bb542147edd4d7c3bbd8797340c22e0c1f368
diff --git a/bika/lims/browser/__init__.py b/bika/lims/browser/__init__.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/__init__.py +++ b/bika/lims/browser/__init__.py @@ -20,8 +20,9 @@ class BrowserView(BrowserView): security.declarePublic('ulocalized_time') def ulocalized_time(self, time, long_format=None, time_only=None): - return ulocalized_time(time, long_format, time_only, self.context, - 'bika', self.request) + if time: + return ulocalized_time(time, long_format, time_only, self.context, + 'bika', self.request) @lazy_property def portal(self):
Fix #<I>: prevent ulocalized_time from defaulting to today's date
senaite_senaite.core
train
py
571a22bb87b07ea38b35ff076f38c754ebc117bb
diff --git a/src/Entity/Base.php b/src/Entity/Base.php index <HASH>..<HASH> 100644 --- a/src/Entity/Base.php +++ b/src/Entity/Base.php @@ -6,10 +6,13 @@ use GameScan\WoW\WowApiRequest; class Base { - protected $apiRequest; + protected $apiRequest = null; - public function __construct(WowApiRequest $apiRequest = null) + protected function getApiRequest() { - $this->apiRequest = $apiRequest !== null ? $apiRequest : new WowApiRequest(new ApiConfiguration()); + if($this->apiRequest === null){ + $this->apiRequest = new WowApiRequest(new ApiConfiguration()); + } + return $this->apiRequest; } }
api request is not anymore set in constructor. So we could instantiate class with functional information
Game-scan_WoW
train
php
976c61772292eb518fb1d548eaf62c12492c3d12
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,16 @@ import sys, os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.pngmath', + 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode', + 'sphinx.ext.graphviz' +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
added graphviz sphinx extension
henzk_django-productline
train
py
f6aa750eee4187e6d57e4c2009a5546304e3c1a0
diff --git a/mod/assign/lib.php b/mod/assign/lib.php index <HASH>..<HASH> 100644 --- a/mod/assign/lib.php +++ b/mod/assign/lib.php @@ -1130,11 +1130,11 @@ function assign_user_outline($course, $user, $coursemodule, $assignment) { $gradingitem = $gradinginfo->items[0]; $gradebookgrade = $gradingitem->grades[$user->id]; - if (!$gradebookgrade) { + if (empty($gradebookgrade->str_long_grade)) { return null; } $result = new stdClass(); - $result->info = get_string('outlinegrade', 'assign', $gradebookgrade->grade); + $result->info = get_string('outlinegrade', 'assign', $gradebookgrade->str_long_grade); $result->time = $gradebookgrade->dategraded; return $result;
MDL-<I> Assign: User outline report grade display Use str_long_grade for user outline report because it handles scales and no grade. Thanks to Jean-Daniel Descoteaux for suggesting this fix.
moodle_moodle
train
php
84c02ab61ffad5c2ecc629a40528df86c790ff4f
diff --git a/core/roboconf-core/src/main/java/net/roboconf/core/commands/BulkCommandInstructions.java b/core/roboconf-core/src/main/java/net/roboconf/core/commands/BulkCommandInstructions.java index <HASH>..<HASH> 100644 --- a/core/roboconf-core/src/main/java/net/roboconf/core/commands/BulkCommandInstructions.java +++ b/core/roboconf-core/src/main/java/net/roboconf/core/commands/BulkCommandInstructions.java @@ -227,7 +227,7 @@ public class BulkCommandInstructions extends AbstractCommandInstruction { } // "Delete all" => "delete" - if(( elt.toString() + " all" ).equals( s )) { + if(( elt.toString() + " all" ).equalsIgnoreCase( s )) { result = elt; break; }
[ci skip] Replace equals by equalsIgnoreCase
roboconf_roboconf-platform
train
java
945ccb3810b53a2ca61ff36df18fe5ba1f4ee17a
diff --git a/src/Utility/DatabaseUtility.php b/src/Utility/DatabaseUtility.php index <HASH>..<HASH> 100644 --- a/src/Utility/DatabaseUtility.php +++ b/src/Utility/DatabaseUtility.php @@ -15,7 +15,7 @@ class DatabaseUtility */ public function getTables($dbConf) { - $link = mysqli_connect($dbConf['host'], $dbConf['user'], $dbConf['password'], $dbConf['dbname']); + $link = mysqli_connect($dbConf['host'], $dbConf['user'], $dbConf['password'], $dbConf['dbname'], $dbConf['port']); $result = $link->query('SHOW TABLES'); $allTables = []; while ($row = $result->fetch_row()) {
[TASK] Use port-parameter in mysqli_connect DB-port is configurable through arguments and should be used for the connection as well
sourcebroker_deployer-extended-database
train
php
2594726b8de08898d7699abf5f6b97d4a1ad93d5
diff --git a/modules/decorators.js b/modules/decorators.js index <HASH>..<HASH> 100755 --- a/modules/decorators.js +++ b/modules/decorators.js @@ -13,7 +13,7 @@ const routeMethods = { get: 'get', post: 'post', put: 'put', - delete: 'delete', + del: 'delete', patch: 'patch', all: '*' };
change delete decorator -> del
bakjs_bak
train
js
5f45b959118f63fffbe6875051d14e60ef382bce
diff --git a/tests/test_utils.py b/tests/test_utils.py index <HASH>..<HASH> 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -91,11 +91,10 @@ async def main(): await server.wait_closed() if __name__ == '__main__': - asyncio.run(main()) + asyncio.get_event_loop().run_until_complete(main()) """ -@pytest.mark.skipif(sys.version_info < (3, 7, 0), reason='Python < 3.7.0') @pytest.mark.parametrize('sig_num', [signal.SIGINT, signal.SIGTERM]) def test_graceful_exit_normal_server(sig_num): cmd = [sys.executable, '-u', '-c', NORMAL_SERVER] @@ -125,11 +124,10 @@ async def main(): await asyncio.sleep(10) if __name__ == '__main__': - asyncio.run(main()) + asyncio.get_event_loop().run_until_complete(main()) """ -@pytest.mark.skipif(sys.version_info < (3, 7, 0), reason='Python < 3.7.0') @pytest.mark.parametrize('sig1, sig2', [ (signal.SIGINT, signal.SIGINT), (signal.SIGTERM, signal.SIGTERM),
Fixed graceful_exit tests to run in all Python versions
vmagamedov_grpclib
train
py
7001281b885c84e9530bca90f6434783313507af
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -101,7 +101,8 @@ module.exports = function(grunt) { filename: 'esp-js.min.js' }, plugins: [ - new webpack.optimize.UglifyJsPlugin({minimize: true}) + new webpack.optimize.UglifyJsPlugin({minimize: true}), + new webpack.optimize.OccurenceOrderPlugin(true) ] } },
Consistent ordering of modules, should make PR merges much less noisy
esp_esp-js
train
js
9e5ef9cb0f8cfdd53c26d2bb493ba8a2ea166817
diff --git a/arty-charty/arty-charty.js b/arty-charty/arty-charty.js index <HASH>..<HASH> 100644 --- a/arty-charty/arty-charty.js +++ b/arty-charty/arty-charty.js @@ -318,7 +318,7 @@ makeMarkers(markerCords, chartIdx) { makeMarker(cx, cy, chartIdx, pointIdx) { return ( - <AmimatedCirclesMarker key={pointIdx} cx={cx} cy={cy} baseColor={this.props.data[chartIdx].lineColor} + <AmimatedCirclesMarker key={pointIdx} cx={cx} cy={cy} baseColor={this.props.data[chartIdx].lineColor || 'rgba(0,0,0,.5)'} active={this.state.activeMarker.chartIdx === chartIdx && this.state.activeMarker.pointIdx === pointIdx} /> ); }
Added default marker colour if lineColor is not set
redpandatronicsuk_arty-charty
train
js
d01d87752769ce0161a09d4bfa1c26fa1df412b0
diff --git a/lib/exception_handling_mailer.rb b/lib/exception_handling_mailer.rb index <HASH>..<HASH> 100644 --- a/lib/exception_handling_mailer.rb +++ b/lib/exception_handling_mailer.rb @@ -1,7 +1,7 @@ class ExceptionHandling::Mailer < ActionMailer::Base default :content_type => "text/html" - self.append_view_path "views" + self.append_view_path "#{File.dirname(__FILE__)}/../views" [:email_environment, :server_name, :sender_address, :exception_recipients, :escalation_recipients].each do |method| define_method method do
Use relative path in append_view_path
Invoca_exception_handling
train
rb
8e0dff4bca9d0cc85d78170087c0a8d309d3bbe0
diff --git a/dipper/sources/ZFIN.py b/dipper/sources/ZFIN.py index <HASH>..<HASH> 100644 --- a/dipper/sources/ZFIN.py +++ b/dipper/sources/ZFIN.py @@ -63,8 +63,8 @@ class ZFIN(Source): # 'enviro': {'file': 'pheno_environment.txt', 'url': 'http://zfin.org/Downloads/pheno_environment.txt'}, 'enviro': {'file': 'pheno_environment_fish.txt', 'url': 'http://zfin.org/Downloads/pheno_environment_fish.txt'}, 'stage': {'file': 'stage_ontology.txt', 'url': 'http://zfin.org/Downloads/stage_ontology.txt'}, - 'wild_expression': {'file': 'wildtype-expression.txt', - 'url': 'http://zfin.org/Downloads/wildtype-expression.txt'}, + # 'wild_expression': {'file': 'wildtype-expression.txt', + # 'url': 'http://zfin.org/Downloads/wildtype-expression.txt'}, 'mappings': {'file': 'mappings.txt', 'url': 'http://zfin.org/downloads/mappings.txt'}, 'backgrounds': {'file': 'genotype_backgrounds.txt', 'url': 'http://zfin.org/downloads/genotype_backgrounds.txt'},
zfin: removing wildtype expression as we don't use it yet
monarch-initiative_dipper
train
py
969edbc4d8fde48d8a3b1e6f61be23a417056923
diff --git a/outline/manager.js b/outline/manager.js index <HASH>..<HASH> 100644 --- a/outline/manager.js +++ b/outline/manager.js @@ -316,7 +316,8 @@ module.exports = function (doc) { const div = dom.createElement('div') return [ { paneName: 'home', label: 'Your stuff', icon: UI.icons.iconBase + 'noun_547570.svg' }, - { paneName: 'basicPreferences', label: 'Preferences', icon: UI.icons.iconBase + 'noun_Sliders_341315_00000.svg' }, + // TODO: Fix basicPreferences properly then reintroduce when ready + // { paneName: 'basicPreferences', label: 'Preferences', icon: UI.icons.iconBase + 'noun_Sliders_341315_00000.svg' }, { paneName: 'trustedApplications', label: 'Trusted Apps', icon: UI.icons.iconBase + 'noun_15177.svg.svg' }, { paneName: 'editProfile', label: 'Edit your profile', icon: UI.icons.iconBase + 'noun_492246.svg' } ]
Removing basicPreferences until we have it ready
solid_solid-panes
train
js
680d3e199bc7a1b6e6ebf8165821343396c21030
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,24 @@ from setuptools import setup setup(name='insultgenerator', - version='0.1', + version='0.2', packages=['insultgenerator'], + license='MIT', author='James Cheese', author_email='trust@tr00st.co.uk', install_requires=['six'], test_suite='insultgenerator.tests', + description='Random insult generator', + url="https://github.com/tr00st/insult_generator", package_data = { 'insultgenerator.wordlists': '*.txt', }, + classifiers = [ + 'Development Status :: 3 - Alpha', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'License :: OSI Approved :: MIT License', + ] )
Bumping version to <I> for initial unstable release
tr00st_insult_generator
train
py
c41f41aa59fce29ea571ccaa97136707b45b63eb
diff --git a/conn.go b/conn.go index <HASH>..<HASH> 100644 --- a/conn.go +++ b/conn.go @@ -42,7 +42,7 @@ func (c *Conn) RemoteAddr() net.Addr { } func (c *Conn) RemoteMultiaddr() ma.Multiaddr { - a, err := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s/p2p-circuit/ipfs/%s", c.remote.ID.Pretty(), c.Conn().RemotePeer().Pretty())) + a, err := ma.NewMultiaddr(fmt.Sprintf("/ipfs/%s/p2p-circuit/ipfs/%s", c.Conn().RemotePeer().Pretty(), c.remote.ID.Pretty())) if err != nil { panic(err) }
conn: fix RemoteMultiaddr consistency so that it works for both active and passive connections.
libp2p_go-libp2p-circuit
train
go
410e29ad87995059cd5baecbf784531c2b24b904
diff --git a/flask_appbuilder/baseviews.py b/flask_appbuilder/baseviews.py index <HASH>..<HASH> 100644 --- a/flask_appbuilder/baseviews.py +++ b/flask_appbuilder/baseviews.py @@ -924,7 +924,7 @@ class BaseCRUDView(BaseModelView): get_filter_args(self._filters) exclude_cols = self._filters.get_relation_cols() - item = self.datamodel.get(pk) + item = self.datamodel.get(pk, self._base_filters) # convert pk to correct type, if pk is non string type. pk = self.datamodel.get_pk_value(item)
#<I> limit direct url access for edit
dpgaspar_Flask-AppBuilder
train
py
873a1b0c781e591f4fe6ad2f387d8bd10be82c62
diff --git a/src/Remote.js b/src/Remote.js index <HASH>..<HASH> 100644 --- a/src/Remote.js +++ b/src/Remote.js @@ -203,7 +203,7 @@ module.exports = class { const synchronizeCommand = [ 'rsync', remoteShell, - this.options.rsyncOptions, + ...this.options.rsyncOptions, compression, ...excludes, '--delete-excluded',
🐛 Fix a bug preventing the use of several rsyncOptions
la-haute-societe_ssh-deploy-release
train
js
8fabcb2eca03150b1c0c3dbc88dd13123f76894f
diff --git a/railties/lib/generators/rails/mailer/templates/mailer.rb b/railties/lib/generators/rails/mailer/templates/mailer.rb index <HASH>..<HASH> 100644 --- a/railties/lib/generators/rails/mailer/templates/mailer.rb +++ b/railties/lib/generators/rails/mailer/templates/mailer.rb @@ -1,5 +1,5 @@ class <%= class_name %> < ActionMailer::Base - self.defaults = { :from => "from@example.com" } + self.defaults :from => "from@example.com" <% for action in actions -%> # Subject can be set in your I18n file at config/locales/en.yml diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index <HASH>..<HASH> 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -9,7 +9,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase run_generator assert_file "app/mailers/notifier.rb" do |mailer| assert_match /class Notifier < ActionMailer::Base/, mailer - assert_match /self\.defaults\ =\ \{\ :from\ =>\ "from@example\.com"\ \}/, mailer + assert_match /self\.defaults :from => "from@example.com"/, mailer end end
Update generators to use new defaults.
rails_rails
train
rb,rb
4ced24f6e76948800229048a94c65c944477c078
diff --git a/tests/test_params.py b/tests/test_params.py index <HASH>..<HASH> 100644 --- a/tests/test_params.py +++ b/tests/test_params.py @@ -81,7 +81,7 @@ def test_params_required_when_using_fixture(testdir, option, fixture_name): src = """ import pytest def test_func({0}): - assert True + {0} """.format(fixture_name) testdir.makepyfile(src) result = testdir.runpytest(*option.args)
Not only create, but use the fixture
ansible_pytest-ansible
train
py
5831b73c8dcc3a74d9d5709eddc563f82a5e193e
diff --git a/src/client/putfile_test.go b/src/client/putfile_test.go index <HASH>..<HASH> 100644 --- a/src/client/putfile_test.go +++ b/src/client/putfile_test.go @@ -58,4 +58,10 @@ func Example() { return //handle error } // buffer now contains "foo\n" + + // We can also see the Diff between the most recent commit and the first one: + buffer.Reset() + if err := pfs.GetFile(client, "repo", "master", "file", 0, 0, commit1.ID, nil, &buffer); err != nil { + return //handle error + } }
Adds an example of seeing diffs.
pachyderm_pachyderm
train
go
e66b77a8526f7193ab2c6de523483883219f1e54
diff --git a/basc_py4chan/thread.py b/basc_py4chan/thread.py index <HASH>..<HASH> 100644 --- a/basc_py4chan/thread.py +++ b/basc_py4chan/thread.py @@ -63,7 +63,7 @@ class Thread(object): @property def custom_spoiler(self): - return self.topic._data.get('custom_spoiler') + return self.topic._data.get('custom_spoiler', 0) @classmethod def _from_request(cls, board, res, id):
Added default value for custom_spoiler
bibanon_BASC-py4chan
train
py
bd4e03f353fc1be4098eeff396bec4f6935b1355
diff --git a/docs/pages/_document.js b/docs/pages/_document.js index <HASH>..<HASH> 100644 --- a/docs/pages/_document.js +++ b/docs/pages/_document.js @@ -31,6 +31,7 @@ gtag('config', 'UA-12967896-44'); `, }} /> + <link rel="shortcut icon" href="/pinterest_favicon.png" /> </Head> <body> <Main />
Docs: fix favicon (#<I>)
pinterest_gestalt
train
js
c333cf69ddcbedaa2c980067c1ea6021ff34af13
diff --git a/src/main/java/gov/adlnet/xapi/client/AgentClient.java b/src/main/java/gov/adlnet/xapi/client/AgentClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/gov/adlnet/xapi/client/AgentClient.java +++ b/src/main/java/gov/adlnet/xapi/client/AgentClient.java @@ -145,6 +145,16 @@ public class AgentClient extends BaseClient { throws MalformedURLException { super(uri, username, password); } + + public AgentClient(String uri, String encodedUsernamePassword) + throws MalformedURLException { + super(uri, encodedUsernamePassword); + } + + public AgentClient(URL uri, String encodedUsernamePassword) + throws MalformedURLException { + super(uri, encodedUsernamePassword); + } public Person getPerson(Agent a) throws IOException {
Added <I>bit creds param ability.
adlnet_jxapi
train
java
09b10b10e76a7fba7297fa22ea496cdc9efd3dae
diff --git a/src/Provide/Transfer/CliResponder.php b/src/Provide/Transfer/CliResponder.php index <HASH>..<HASH> 100644 --- a/src/Provide/Transfer/CliResponder.php +++ b/src/Provide/Transfer/CliResponder.php @@ -18,7 +18,7 @@ class CliResponder implements TransferInterface public function __invoke(ResourceObject $resourceObject, array $server) { unset($server); - $body = (string) $resourceObject; + $body = $resourceObject->toString(); // code $statusText = (new Code)->statusText[$resourceObject->code]; $ob = $resourceObject->code . ' ' . $statusText . PHP_EOL; @@ -28,7 +28,6 @@ class CliResponder implements TransferInterface } // empty line $ob .= PHP_EOL; - // body $ob .= $body;
replace __string() to toString() for expection thrown
bearsunday_BEAR.Package
train
php
6a4b3ea84239d28701fc07fedfc806fe7a7d0703
diff --git a/client.py b/client.py index <HASH>..<HASH> 100644 --- a/client.py +++ b/client.py @@ -1,8 +1,8 @@ -from slackclient import SlackClient from rtmbot import RtmBot slack_client = None + def init(config): global slack_client bot = RtmBot(config)
Update client.py for flake8 flake8 wasn't checking this file. ran flake8 against it to make sure it was compliant with coding guidelines
slackapi_python-rtmbot
train
py
512434ff0b890374acc97fddf609b18aa71f92e0
diff --git a/gns3converter/__init__.py b/gns3converter/__init__.py index <HASH>..<HASH> 100644 --- a/gns3converter/__init__.py +++ b/gns3converter/__init__.py @@ -12,6 +12,5 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from pkg_resources import get_distribution from .converter import Converter -__version__ = get_distribution('gns3-converter').version +__version__ = '0.1.0'
Define version statically, to ease freezing for Windows
dlintott_gns3-converter
train
py
db74d3115ee35362935d584f0b7dd51faacc628f
diff --git a/unpacker.go b/unpacker.go index <HASH>..<HASH> 100644 --- a/unpacker.go +++ b/unpacker.go @@ -178,13 +178,13 @@ EachLayer: fetchC[i] = make(chan struct{}) } - go func() { + go func(i int) { err := u.fetch(ctx, h, layers[i:], fetchC) if err != nil { fetchErr <- err } close(fetchErr) - }() + }(i) } select {
unpacker: Fix data race and possible data corruption
containerd_containerd
train
go
08fa2399abd98c2f89f167a692703df976c5fd4d
diff --git a/framework/Yii.php b/framework/Yii.php index <HASH>..<HASH> 100644 --- a/framework/Yii.php +++ b/framework/Yii.php @@ -23,5 +23,5 @@ class Yii extends \yii\BaseYii } spl_autoload_register(['Yii', 'autoload'], true, true); -Yii::$classMap = include(__DIR__ . '/classes.php'); +Yii::$classMap = require(__DIR__ . '/classes.php'); Yii::$container = new yii\di\Container;
Yii class `include` cass replaced to `require`
yiisoft_yii-core
train
php
8753c3d0bf68e996538eee3fbca394cf145767c2
diff --git a/lib/copy-sync/copy-file-sync.js b/lib/copy-sync/copy-file-sync.js index <HASH>..<HASH> 100644 --- a/lib/copy-sync/copy-file-sync.js +++ b/lib/copy-sync/copy-file-sync.js @@ -9,6 +9,7 @@ function copyFileSync (srcFile, destFile, options) { if (fs.existsSync(destFile)) { if (clobber) { + fs.chmodSync(destFile, parseInt('777', 8)) fs.unlinkSync(destFile) } else { throw Error('EEXIST')
Fix so copySync unlinking read only file will now work on nodejs <I>. This commit fixes #<I>.
jprichardson_node-fs-extra
train
js
ec6e13b9f1e3b71f4e6ac690287db83a95b4227d
diff --git a/lib/lolcommits.rb b/lib/lolcommits.rb index <HASH>..<HASH> 100644 --- a/lib/lolcommits.rb +++ b/lib/lolcommits.rb @@ -42,7 +42,7 @@ module Lolcommits def parse_git(dir='.') g = Git.open('.') commit = g.log.first - commit_msg = commit.message.split("\n").first.tranzlate + commit_msg = commit.message.split("\n").first commit_sha = commit.sha[0..10] basename = File.basename(g.dir.to_s) basename.sub!(/^\./, 'dot') #no invisible directories in output, thanks! @@ -63,6 +63,11 @@ module Lolcommits end # + # lolspeak translate the message + # + commit_msg = commit_msg.tranzlate + + # # Create a directory to hold the lolimages # if not File.directory? loldir
move tranzlate call so it applies to test commits as well
lolcommits_lolcommits
train
rb
70033a8f34a0b750eb33d4dff5d3a92647f59f5c
diff --git a/jwt-express.js b/jwt-express.js index <HASH>..<HASH> 100644 --- a/jwt-express.js +++ b/jwt-express.js @@ -230,7 +230,7 @@ module.exports = { /** * require - requires that data in the JWT's payload meets certain requirements - * If only the key is passed, it simply checks that payload[key] !== undefined + * If only the key is passed, it simply checks that payload[key] == true * @param string key The key used to load the data from the payload * @param string operator (Optional) The operator to compare the information * @param mixed value (Optional) The value to compare the data to @@ -250,8 +250,8 @@ module.exports = { ok; if (!operator) { - operator = '!=='; - value = undefined; + operator = '=='; + value = true; } if (operator == '==') {
Default require to check for truthy value
AustP_jwt-express
train
js
8204bdf6af5dce2319cadbf276080f22f8fb0713
diff --git a/Evtx/Nodes.py b/Evtx/Nodes.py index <HASH>..<HASH> 100644 --- a/Evtx/Nodes.py +++ b/Evtx/Nodes.py @@ -1413,7 +1413,7 @@ class BinaryTypeNode(VariantTypeNode): return self._length def string(self): - return base64.b64encode(self.binary()) + return base64.b64encode(self.binary()).decode('ascii') class GuidTypeNode(VariantTypeNode): @@ -1606,7 +1606,7 @@ class WstringArrayTypeNode(VariantTypeNode): bin = self.binary() acc = [] while len(bin) > 0: - match = re.search("((?:[^\x00].)+)", bin) + match = re.search(b"((?:[^\x00].)+)", bin) if match: frag = match.group() acc.append("<string>") @@ -1615,7 +1615,7 @@ class WstringArrayTypeNode(VariantTypeNode): bin = bin[len(frag) + 2:] if len(bin) == 0: break - frag = re.search("(\x00*)", bin).group() + frag = re.search(b"(\x00*)", bin).group() if len(frag) % 2 == 0: for _ in range(len(frag) // 2): acc.append("<string></string>\n")
nodes: better handle str/bytes handling for binary node
williballenthin_python-evtx
train
py
602050688b94bcfdf6976c6134d68f9048448a78
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -37,6 +37,7 @@ module RouteTranslator app = @@app = Class.new(Rails::Application) app.config.active_support.deprecation = :stderr app.paths["log"] = "#{tmp_path}/log/test.log" + app.paths["config/routes"] = File.join(app_path, routes_config) app.initialize! Rails.application = app end
Add tmp route file path to mock app
enriclluelles_route_translator
train
rb
62820c9e298c5a987e99a6d81246c39bca45a153
diff --git a/lib/rubocop/cop/surrounding_space.rb b/lib/rubocop/cop/surrounding_space.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/surrounding_space.rb +++ b/lib/rubocop/cop/surrounding_space.rb @@ -27,6 +27,7 @@ module Rubocop :args_add_block, :const_path_ref, :dot2, :dot3].include?(child) return true if grandparent == :unary && parent == :vcall + return true if parent == :command_call && child == :"::" false end diff --git a/spec/rubocop/cops/surrounding_space_spec.rb b/spec/rubocop/cops/surrounding_space_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/cops/surrounding_space_spec.rb +++ b/spec/rubocop/cops/surrounding_space_spec.rb @@ -49,6 +49,12 @@ module Rubocop space.offences.map(&:message).should == [] end + it 'accepts ::Kernel::raise' do + source = ['::Kernel::raise IllegalBlockError.new'] + space.inspect_source('file.rb', source) + space.offences.map(&:message).should == [] + end + it "accepts exclamation point negation" do space.inspect_source("file.rb", ['x = !a&&!b']) space.offences.map(&:message).should ==
Another special case with the :: operator.
rubocop-hq_rubocop
train
rb,rb
6b8f66d5f6d495454373a7b99f90e2606ba8296b
diff --git a/test/performance/SignerBench.php b/test/performance/SignerBench.php index <HASH>..<HASH> 100644 --- a/test/performance/SignerBench.php +++ b/test/performance/SignerBench.php @@ -35,7 +35,7 @@ abstract class SignerBench */ private $signature; - public final function init(): void + final public function init(): void { $this->signer = $this->signer(); $this->signingKey = $this->signingKey(); @@ -43,12 +43,12 @@ abstract class SignerBench $this->signature = $this->signer->sign(self::PAYLOAD, $this->signingKey); } - public final function benchSignature(): void + final public function benchSignature(): void { $this->signer->sign(self::PAYLOAD, $this->signingKey); } - public final function benchVerification(): void + final public function benchVerification(): void { $this->signer->verify($this->signature, self::PAYLOAD, $this->verificationKey); }
Switched public and final to match PSR2
lcobucci_jwt
train
php
01b773c104a8c1a752db6ea0c8ba1b5f22df3ba0
diff --git a/lib/instana/version.rb b/lib/instana/version.rb index <HASH>..<HASH> 100644 --- a/lib/instana/version.rb +++ b/lib/instana/version.rb @@ -1,4 +1,4 @@ module Instana - VERSION = "1.5.2" + VERSION = "1.6.0" VERSION_FULL = "instana-#{VERSION}" end
Bump gem version to <I>
instana_ruby-sensor
train
rb
03b3558a3760904de3d78ae2901963ee6d6370c7
diff --git a/plugins/Login/Auth.php b/plugins/Login/Auth.php index <HASH>..<HASH> 100644 --- a/plugins/Login/Auth.php +++ b/plugins/Login/Auth.php @@ -43,7 +43,7 @@ class Piwik_Login_Auth implements Piwik_Auth WHERE token_auth = ?', array($this->token_auth) ); - if(!$login !== false) + if($login !== false) { return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS, $login, $this->token_auth ); }
refs #<I> - fixes typo; it's too early in the morning for me to think about unit tests... git-svn-id: <URL>
matomo-org_matomo
train
php
729a2d53c8e4aad88993db16b0fcd6da5a11df4a
diff --git a/examples/uibench/app.js b/examples/uibench/app.js index <HASH>..<HASH> 100644 --- a/examples/uibench/app.js +++ b/examples/uibench/app.js @@ -101,7 +101,7 @@ } var tableTpl = t(function (children) { - return e('table').props({ className: 'Table' }).children(children).childrenType(ChildrenTypes.NON_KEYED_LIST); + return e('table').props({ className: 'Table' }).children(children).childrenType(ChildrenTypes.KEYED_LIST); }, InfernoDOM); function table(data) {
ignore the last commit - added keys properly and perf went way down on uibench
infernojs_inferno
train
js
7f0c21b052861a51861f8485a1aa8aec8870f725
diff --git a/lib/sauce/capybara.rb b/lib/sauce/capybara.rb index <HASH>..<HASH> 100644 --- a/lib/sauce/capybara.rb +++ b/lib/sauce/capybara.rb @@ -129,13 +129,15 @@ module Sauce require "rspec/core" ::RSpec.configure do |config| config.before :suite do - ::Capybara.configure do |config| + ::Capybara.configure do |capy_config| sauce_config = Sauce::Config.new - if sauce_config[:start_local_application] - host = sauce_config[:application_host] || "127.0.0.1" - port = sauce_config[:application_port] - config.app_host = "http://#{host}:#{port}" - config.run_server = false + if capy_config.app_host.nil? + if sauce_config[:start_local_application] + host = sauce_config[:application_host] || "127.0.0.1" + port = sauce_config[:application_port] + capy_config.app_host = "http://#{host}:#{port}" + capy_config.run_server = false + end end end end @@ -167,4 +169,4 @@ module Sauce Sauce::Capybara.configure_capybara_for_rspec end end -end \ No newline at end of file +end
Merged #<I> from vgrigoruk - Do not set Capybara.app_host if it is not nil
saucelabs_sauce_ruby
train
rb
974467d70d337d4c60414c792e275d367143217b
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -281,6 +281,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest scope(':version', :version => /.+/) do resources :users, :id => /.+?/, :format => /json|xml/ end + + get "products/list" end get 'sprockets.js' => ::TestRoutingMapper::SprocketsApp @@ -1300,6 +1302,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'account#shorthand', @response.body end + def test_match_shorthand_inside_namespace_with_controller + assert_equal '/api/products/list', api_products_list_path + get '/api/products/list' + assert_equal 'api/products#list', @response.body + end + def test_dynamically_generated_helpers_on_collection_do_not_clobber_resources_url_helper assert_equal '/replies', replies_path end
Add test to avoid regression of 1bfc5b4
rails_rails
train
rb