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
800cddd88da3c678ea0730833fc05433abcd4aa3
diff --git a/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/model/runner/RuleAdapter.java b/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/model/runner/RuleAdapter.java index <HASH>..<HASH> 100644 --- a/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/model/runner/RuleAdapter.java +++ b/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/model/runner/RuleAdapter.java @@ -187,7 +187,7 @@ public class RuleAdapter implements Rule { .ifPresent(field -> { field.setAccessible(true); try { - if (result.getValue() != null) { + if (field.getType().isAssignableFrom((result.getValue().getClass()))) { field.set(_pojoRule, result.getValue()); } } catch (Exception ex) {
updated RuleAdapter to not set result is it's not assignable
deliveredtechnologies_rulebook
train
java
1d45c1264c6ea3f661cdd322e856d7cd8fe11de2
diff --git a/connection.go b/connection.go index <HASH>..<HASH> 100644 --- a/connection.go +++ b/connection.go @@ -129,17 +129,20 @@ func (connection *redisConnection) heartbeat(errChan chan<- error) { errorCount++ - select { // try to add error to channel, but don't block - case errChan <- &HeartbeatError{RedisErr: err, Count: errorCount}: - default: - } - if errorCount >= HeartbeatErrorLimit { // reached error limit connection.StopAllConsuming() + // Clients reading from errChan need to see this error + // This allows them to shut themselves down + // Therefore we block adding it to errChan to ensure delivery + errChan <- &HeartbeatError{RedisErr: err, Count: errorCount} return + } else { + select { // try to add error to channel, but don't block + case errChan <- &HeartbeatError{RedisErr: err, Count: errorCount}: + default: + } } - // keep trying until we hit the limit } }
HeartbeatError is sent blocking on shutdown When the heartbeat error threshold is reached, and RMQ shuts itself down, the final HeartbeatError is sent in a blocking manner. We do this to ensure that if the client is listening for this error it is guaranteed to eventually see the error. If this critical error is dropped the client may be unaware that RMQ has stopped working and won't shut itself down.
adjust_rmq
train
go
406f31b274b6c2757099871fe33b562a7de0e217
diff --git a/mbed/mbed.py b/mbed/mbed.py index <HASH>..<HASH> 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -42,7 +42,11 @@ ver = '1.2.2' # Default paths to Mercurial and Git hg_cmd = 'hg' git_cmd = 'git' + +# override python command when running standalone Mbed CLI python_cmd = sys.executable +if os.path.basename(python_cmd).startswith('mbed'): + python_cmd = 'python' ignores = [ # Version control folders
Fall back to python when exec name starts with mbed, allows for standalone Mbed CLI install
ARMmbed_mbed-cli
train
py
dca6912c54ff3d32abe7446adbb899f06c97b970
diff --git a/pkg/kubectl/cmd/cp.go b/pkg/kubectl/cmd/cp.go index <HASH>..<HASH> 100644 --- a/pkg/kubectl/cmd/cp.go +++ b/pkg/kubectl/cmd/cp.go @@ -287,9 +287,22 @@ func (o *CopyOptions) copyFromPod(src, dest fileSpec) error { }() prefix := getPrefix(src.File) prefix = path.Clean(prefix) + // remove extraneous path shortcuts - these could occur if a path contained extra "../" + // and attempted to navigate beyond "/" in a remote filesystem + prefix = stripPathShortcuts(prefix) return untarAll(reader, dest.File, prefix) } +// stripPathShortcuts removes any leading or trailing "../" from a given path +func stripPathShortcuts(p string) string { + newPath := path.Clean(p) + if len(newPath) > 0 && string(newPath[0]) == "/" { + return newPath[1:] + } + + return newPath +} + func makeTar(srcPath, destPath string, writer io.Writer) error { // TODO: use compression here? tarWriter := tar.NewWriter(writer)
remove extra "../" when copying from pod to local
kubernetes_kubernetes
train
go
3de938d705764677b7f61a52796ab58a05249717
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -6196,6 +6196,14 @@ function unzip_file ($zipfile, $destination = '', $showstatus = true) { return false; } + //Clear $zipfile + $zipfile = cleardoubleslashes($zipfile); + + //Check zipfile exists + if (!file_exists($zipfile)) { + return false; + } + //If no destination, passed let's go with the same directory if (empty($destination)) { $destination = $zippath;
Added one check to test that the zipfile in unzip_file() is real!
moodle_moodle
train
php
db00c68fc170c4908051abaac982034cabe73c20
diff --git a/src/main/java/com/brettonw/bag/formats/text/FormatReaderText.java b/src/main/java/com/brettonw/bag/formats/text/FormatReaderText.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/brettonw/bag/formats/text/FormatReaderText.java +++ b/src/main/java/com/brettonw/bag/formats/text/FormatReaderText.java @@ -35,7 +35,20 @@ public class FormatReaderText extends FormatReader { for (String entry : entries) { entry = entry.trim (); if ((entry.length () > 0) && (! (entry.startsWith (ignoreEntryMarker)))) { - bagArray.add (entry); + if (pairSeparator != null) { + String[] fields = entry.split (pairSeparator); + if (fields.length > 1) { + BagArray fieldArray = new BagArray (fields.length); + for (String field : fields) { + fieldArray.add (field); + } + bagArray.add (fieldArray); + } else { + bagArray.add (fields[0]); + } + } else { + bagArray.add (entry); + } } } return bagArray;
minor update to allow reading array files with the pair delimiter, may want to come back to that someday...
brettonw_Bag
train
java
c97d6c65c0cb28e632a852cb31393825560d91ad
diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index <HASH>..<HASH> 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -124,8 +124,10 @@ class JoomlaBrowser extends WebDriver $I->click('Install'); // Wait while Joomla gets installed - $I->waitForText('Congratulations! Joomla! is now installed.', 30, 'h3'); + $this->debug('I wait for Joomla being installed'); + $I->waitForText('Congratulations! Joomla! is now installed.', 10, '//h3'); $this->debug('Joomla is now installed'); + $I->see('Congratulations! Joomla! is now installed.','//h3'); } /**
Move CSS locators to XPath in Joomla installation
joomla-projects_joomla-browser
train
php
16b242ae9078c12e8a9f2f3d0bb1c39af5a8f563
diff --git a/src/InputController/CLIController/CLIArgument.php b/src/InputController/CLIController/CLIArgument.php index <HASH>..<HASH> 100644 --- a/src/InputController/CLIController/CLIArgument.php +++ b/src/InputController/CLIController/CLIArgument.php @@ -3,7 +3,7 @@ * TypeValidator */ -namespace Orpheus\InputController; +namespace Orpheus\InputController\CLIController; /** * The CLIArgument class diff --git a/src/InputController/CLIController/CLIRoute.php b/src/InputController/CLIController/CLIRoute.php index <HASH>..<HASH> 100644 --- a/src/InputController/CLIController/CLIRoute.php +++ b/src/InputController/CLIController/CLIRoute.php @@ -7,9 +7,8 @@ namespace Orpheus\InputController\CLIController; use Orpheus\InputController\ControllerRoute; use Orpheus\InputController\InputRequest; -use Orpheus; use Orpheus\InputController\TypeValidator; -use Orpheus\InputController\CLIArgument; +use Orpheus\InputController\CLIController\CLIArgument; /** * The CLIRoute class
Implement CLI classes for MVC (unstable)
Sowapps_orpheus-inputcontroller
train
php,php
ed3723bf9f1e96d9d8eb5450df70fed6398d8b0f
diff --git a/src/com/opera/core/systems/OperaWebElement.java b/src/com/opera/core/systems/OperaWebElement.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/OperaWebElement.java +++ b/src/com/opera/core/systems/OperaWebElement.java @@ -114,6 +114,7 @@ public class OperaWebElement extends RemoteWebElement { return debugger.callFunctionOnObject(script, objectId, true); } + // TODO(andreastt): OPDRV-199 public void click() { assertElementNotStale(); assertElementDisplayed(); diff --git a/test/com/opera/core/systems/pages/WindowPage.java b/test/com/opera/core/systems/pages/WindowPage.java index <HASH>..<HASH> 100644 --- a/test/com/opera/core/systems/pages/WindowPage.java +++ b/test/com/opera/core/systems/pages/WindowPage.java @@ -71,6 +71,7 @@ public class WindowPage extends Page { String currentWindow = driver.getWindowHandle(); // Trigger new window load and wait for window to open + // TODO: OPDRV-199 windowLink.click(); try { Thread.sleep(100);
Adding a note about OPDRV-<I>
operasoftware_operaprestodriver
train
java,java
02272036286ade1ecd815f7b97002de0a19292e0
diff --git a/lib/html/pipeline/emoji_filter.rb b/lib/html/pipeline/emoji_filter.rb index <HASH>..<HASH> 100644 --- a/lib/html/pipeline/emoji_filter.rb +++ b/lib/html/pipeline/emoji_filter.rb @@ -65,7 +65,7 @@ module HTML if context[:asset_path] context[:asset_path].gsub(":file_name", "#{::CGI.escape(name)}.png") else - "emoji/#{::CGI.escape(name)}.png" + File.join("emoji", "#{::CGI.escape(name)}.png") end end
Using File.join to join asset path segments.
jch_html-pipeline
train
rb
33293cacbb50f7a90394319271e5da025a83910e
diff --git a/pysnmp/entity/rfc3413/ntforg.py b/pysnmp/entity/rfc3413/ntforg.py index <HASH>..<HASH> 100644 --- a/pysnmp/entity/rfc3413/ntforg.py +++ b/pysnmp/entity/rfc3413/ntforg.py @@ -171,6 +171,10 @@ class NotificationOriginator: ): debug.logger & debug.flagApp and debug.logger('sendNotification: notificationTarget %s, notificationName %s, additionalVarBinds %s, contextName "%s", instanceIndex %s' % (notificationTarget, notificationName, additionalVarBinds, contextName, instanceIndex)) + if contextName: + __SnmpAdminString, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') + contextName = __SnmpAdminString(contextName) + # 3.3 ( notifyTag, notifyType ) = config.getNotificationInfo(
cast non-default contextName into pyasn1 object to avoid Py3K comparation issues
etingof_pysnmp
train
py
465b8362c5950d2f77cb310fa12d04f0403f8bb5
diff --git a/lib/fog/hp/storage.rb b/lib/fog/hp/storage.rb index <HASH>..<HASH> 100644 --- a/lib/fog/hp/storage.rb +++ b/lib/fog/hp/storage.rb @@ -29,15 +29,16 @@ module Fog module Utils def cdn - @cdn ||= Fog::CDN.new( - :provider => 'HP', - :hp_account_id => @hp_account_id, - :hp_secret_key => @hp_secret_key, - :hp_auth_uri => @hp_auth_uri - ) - if @cdn.enabled? - @cdn - end + #@cdn ||= Fog::CDN.new( + # :provider => 'HP', + # :hp_account_id => @hp_account_id, + # :hp_secret_key => @hp_secret_key, + # :hp_auth_uri => @hp_auth_uri + #) + #if @cdn.enabled? + # @cdn + #end + nil end def url
Remove CDN integration from within Storage service, till CDN service is more mature.
fog_fog
train
rb
d350c0d45a471d79c4affc665cfe44a1f5c80688
diff --git a/src/DuskServer.php b/src/DuskServer.php index <HASH>..<HASH> 100644 --- a/src/DuskServer.php +++ b/src/DuskServer.php @@ -131,7 +131,7 @@ class DuskServer { $this->guardServerStarting(); - $this->process = new Process($this->prepareCommand()); + $this->process = Process::fromShellCommandline($this->prepareCommand()); $this->process->setWorkingDirectory($this->laravelPublicPath()); $this->process->start(); }
Update to Process::fromShellCommandline().
orchestral_testbench-dusk
train
php
684ede9e5848f078eb498500eaced861a694036b
diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index <HASH>..<HASH> 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -2,7 +2,28 @@ /** * CodeIgniter - * + *<?= form_open(current_url()); ?> +<?= +form_field( + 'email', + ['name' => 'p[username]', 'pattern' => esc(INPUT_PATTERN_EMAIL_HTML,'html'), 'autofocus' => false], + ['use_defaults' => true], + array_merge($label_col, ['text' => lang('PagesUser.logInFormEmailLabel')]), + $field_col +); +?> +<?= +form_field( + 'password', + ['name' => 'p[username]'], + ['use_defaults' => true], + array_merge($label_col, ['text' => lang('PagesUser.logInFormEmailLabel')]), + $field_col +); +?> +<?= form_close(); ?> + + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) @@ -927,7 +948,7 @@ if (! function_exists('parse_form_attributes')) foreach ($default as $key => $val) { - if($val !== false) + if(!is_bool($val)) { if ($key === 'value') {
Update form_helper.php better to use is_bool here (instead of my previous solution which was $value !== false) , that way we left more flexibility for users for pre/post process attributes
codeigniter4_CodeIgniter4
train
php
36cdf0dc007e2848bbf3e3050b4e280f49e3b91c
diff --git a/tasks/npm.js b/tasks/npm.js index <HASH>..<HASH> 100644 --- a/tasks/npm.js +++ b/tasks/npm.js @@ -26,7 +26,7 @@ module.exports = function(grunt) { var done = this.async(); var pkg = grunt.config('pkg'); var minor = parseInt(pkg.version.split('.')[1], 10); - var tag = minor % 2 ? 'latest' : 'canary'; + var tag = minor % 2 ? 'canary' : 'latest'; exec('npm publish --tag ' + tag, function(err, output, error) { if (err) return grunt.fail.fatal(err.message.replace(/\n$/, '.'));
Fix grunt npm-release task
karma-runner_karma
train
js
09afbf522f83f2e0db0d96b87908c2b9374df163
diff --git a/environs/azure/instance.go b/environs/azure/instance.go index <HASH>..<HASH> 100644 --- a/environs/azure/instance.go +++ b/environs/azure/instance.go @@ -62,7 +62,10 @@ func (azInstance *azureInstance) Addresses() ([]instance.Address, error) { func (azInstance *azureInstance) netInfo() (ip, netname string, err error) { err = azInstance.apiCall(false, func(c *azureManagementContext) error { - d, err := c.GetDeployment(&gwacl.GetDeploymentRequest{ServiceName: azInstance.ServiceName}) + d, err := c.GetDeployment(&gwacl.GetDeploymentRequest{ + ServiceName: azInstance.ServiceName, + DeploymentName: azInstance.ServiceName, + }) if err != nil { return err }
tweak to make the code actually work... turns out you need the deploymentname on GetdeploymentRequest
juju_juju
train
go
3f4ee09a41047eab98c69f15ee1a286d9104a841
diff --git a/lib/docker-sync/preconditions.rb b/lib/docker-sync/preconditions.rb index <HASH>..<HASH> 100644 --- a/lib/docker-sync/preconditions.rb +++ b/lib/docker-sync/preconditions.rb @@ -55,7 +55,7 @@ module Preconditions if Thor::Shell::Basic.new.yes?('Shall I install unison-fsmonitor for you? (y/N)') system cmd1 else - raise("Please install it, see https://github.com/hnsl/unox, or simply run :\n #{cmd1} && #{cmd2}") + raise("Please install it, see https://github.com/hnsl/unox, or simply run :\n #{cmd1}") end end @@ -65,7 +65,6 @@ module Preconditions `python -c 'import fsevents'` unless $?.success? Thor::Shell::Basic.new.say_status 'warning','Could not find macfsevents. Will try to install it using pip', :red - sudo = false if find_executable0('python') == '/usr/bin/python' Thor::Shell::Basic.new.say_status 'ok','You seem to use the system python, we will need sudo below' sudo = true
fix old leftover with cmd2, #<I>
EugenMayer_docker-sync
train
rb
643a2fb7205fe1b1d0e4881efb17f6a77550ca45
diff --git a/hydra_base/lib/attributes.py b/hydra_base/lib/attributes.py index <HASH>..<HASH> 100644 --- a/hydra_base/lib/attributes.py +++ b/hydra_base/lib/attributes.py @@ -1289,6 +1289,8 @@ def delete_duplicate_attributes(dupe_list): db.DBSession.flush() + return keeper + def remap_attribute_reference(old_attr_id, new_attr_id, flush=False): """ Remap everything which references old_attr_id to reference
Return keeper attribute when remapping attributes so clients can access the ID of the kept attribute
hydraplatform_hydra-base
train
py
5843974562500dfde9bc679aaf59f8cde0971fe7
diff --git a/event/registry.go b/event/registry.go index <HASH>..<HASH> 100644 --- a/event/registry.go +++ b/event/registry.go @@ -50,7 +50,7 @@ type registry struct { dispatcher func(r *registry, name string, ev ...interface{}) } -func NewRegistry() *registry { +func NewRegistry() EventRegistry { r := &registry{events: make(map[string]*list.List)} r.Parallel() return r @@ -89,6 +89,14 @@ func (r *registry) Dispatch(name string, ev ...interface{}) { r.dispatcher(r, name, ev...) } +func (r *registry) ClearEvents(name string) { + r.Lock() + defer r.Unlock() + if l, ok := r.events[name]; ok { + l.Init() + } +} + func (r *registry) Parallel() { r.dispatcher = (*registry).parallelDispatch }
Make struct registry conform to EventRegistry.
fluffle_goirc
train
go
c44dccf984abca2930cdee26769621079890452b
diff --git a/src/renderer/Renderer.js b/src/renderer/Renderer.js index <HASH>..<HASH> 100644 --- a/src/renderer/Renderer.js +++ b/src/renderer/Renderer.js @@ -36,7 +36,7 @@ export const FILTERING_THRESHOLD = 0.5; */ export const RTT_WIDTH = 1024; -export const MIN_VERTEX_TEXTURE_IMAGE_UNITS_NEEDED = 16; +export const MIN_VERTEX_TEXTURE_IMAGE_UNITS_NEEDED = 8; /** * @description Renderer constructor. Use it to create a new renderer bound to the provided canvas. diff --git a/test/unit/renderer/renderer.test.js b/test/unit/renderer/renderer.test.js index <HASH>..<HASH> 100644 --- a/test/unit/renderer/renderer.test.js +++ b/test/unit/renderer/renderer.test.js @@ -33,7 +33,7 @@ describe('src/renderer/Renderer', () => { }; const webGLInvalidImageTextureUnits = { MAX_RENDERBUFFER_SIZE: RTT_WIDTH, - MAX_VERTEX_TEXTURE_IMAGE_UNITS: 8, + MAX_VERTEX_TEXTURE_IMAGE_UNITS: 4, getExtension: () => ({}), getParameter };
Lower minimum MAX_VERTEX_TEXTURE_IMAGE_UNITS requirement
CartoDB_carto-vl
train
js,js
56045ad40a896e67f0155b43261d4c7e8dc6b1ed
diff --git a/environs/ec2/auth.go b/environs/ec2/auth.go index <HASH>..<HASH> 100644 --- a/environs/ec2/auth.go +++ b/environs/ec2/auth.go @@ -47,7 +47,7 @@ func expandFileName(f string) string { func authorizedKeys(path string) (string, error) { var files []string if path == "" { - files = []string{"id_dsa.pub", "id_rsa.pub", "identity.pub", "authorized_keys"} + files = []string{"id_dsa.pub", "id_rsa.pub", "identity.pub"} } else { files = []string{path} }
do not use authorized_keys file
juju_juju
train
go
b54144b67a9fc456576412afaf11c4642057a259
diff --git a/test/helpers/node.go b/test/helpers/node.go index <HASH>..<HASH> 100644 --- a/test/helpers/node.go +++ b/test/helpers/node.go @@ -251,10 +251,10 @@ func (s *SSHMeta) ExecContext(ctx context.Context, cmd string, options ...ExecOp wg: &wg, } + res.wg.Add(1) go func(res *CmdRes) { - start := time.Now() - res.wg.Add(1) defer res.wg.Done() + start := time.Now() err := s.sshClient.RunCommandContext(ctx, command) if err != nil { exiterr, isExitError := err.(*ssh.ExitError)
test: add WaitGroup delta before goroutine To avoid a WaitGroup.Wait() being executed without the execution of Add(1), the Add(1) should be perform before a go routine initialization.
cilium_cilium
train
go
55425229555c4f1bcb16a2af7619b25c3aa27a1f
diff --git a/go/vt/mysqlctl/schema.go b/go/vt/mysqlctl/schema.go index <HASH>..<HASH> 100644 --- a/go/vt/mysqlctl/schema.go +++ b/go/vt/mysqlctl/schema.go @@ -133,7 +133,7 @@ func ResolveTables(mysqld MysqlDaemon, dbName string, tables []string) ([]string // GetColumns returns the columns of table. func (mysqld *Mysqld) GetColumns(dbName, table string) ([]string, error) { - conn, err := mysqld.dbaPool.Get(context.TODO()) + conn, err := getPoolReconnect(context.TODO(), mysqld.dbaPool) if err != nil { return nil, err } @@ -152,7 +152,7 @@ func (mysqld *Mysqld) GetColumns(dbName, table string) ([]string, error) { // GetPrimaryKeyColumns returns the primary key columns of table. func (mysqld *Mysqld) GetPrimaryKeyColumns(dbName, table string) ([]string, error) { - conn, err := mysqld.dbaPool.Get(context.TODO()) + conn, err := getPoolReconnect(context.TODO(), mysqld.dbaPool) if err != nil { return nil, err }
Always verify pool connections when working on ApplySchema request. (#<I>) When we just get a connection from the pool it might be already closed due to MySQL restart or some other reason. This results in bogus errors returned to the user requesting to apply new schema. By using getPoolReconnect() instead we make sure that the connection we get is actually live. Note that only GetColumns() and GetPrimaryKeyColumns() need to be fixed, because all other places here already use getPoolReconnect().
vitessio_vitess
train
go
0d09f8fbd175fc626445acfe65bfcf04ed64e999
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ with open('requirements.txt') as f: setup( name='rip', - version='0.0.5c', + version='0.0.8c', description='A python framework for writing restful APIs.', long_description=readme + '\n\n' + history, author='Aplopio developers',
Update the version in setup.py
Aplopio_django_rip
train
py
b5ab71af7c9047363b36090ec910a1c2e10a188e
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -8,7 +8,6 @@ import ( "net/http" "net/url" "strings" - "sync" "time" "github.com/gogap/errors" @@ -46,13 +45,12 @@ type MNSClient interface { } type AliMNSClient struct { - Timeout int64 - url string - credential Credential - accessKeyId string - clientLocker sync.Mutex - client *http.Client - proxyURL string + Timeout int64 + url string + credential Credential + accessKeyId string + client *http.Client + proxyURL string } func NewAliMNSClient(url, accessKeyId, accessKeySecret string) MNSClient { @@ -152,9 +150,6 @@ func (p *AliMNSClient) Send(method Method, headers map[string]string, message in postBodyReader := strings.NewReader(string(xmlContent)) - p.clientLocker.Lock() - defer p.clientLocker.Unlock() - var req *http.Request if req, err = http.NewRequest(string(method), url, postBodyReader); err != nil { err = ERR_CREATE_NEW_REQUEST_FAILED.New(errors.Params{"err": err})
remove lock of http request, it will lock loing polling
gogap_ali_mns
train
go
ddb4854a794ab0b7794c10abf7cf544603fbb224
diff --git a/test/stream.js b/test/stream.js index <HASH>..<HASH> 100644 --- a/test/stream.js +++ b/test/stream.js @@ -1,7 +1,8 @@ var expect = require('chai').expect; var util = require('./util'); -var Stream = require('../lib/stream').Stream; +var stream = require('../lib/stream'); +var Stream = stream.Stream; function createStream() { var stream = new Stream(util.log); @@ -307,4 +308,17 @@ describe('stream.js', function() { }); }); }); + + describe('bunyan formatter', function() { + describe('`s`', function() { + var format = stream.serializers.s; + it('should assign a unique ID to each frame', function() { + var stream1 = createStream(); + var stream2 = createStream(); + expect(format(stream1)).to.be.equal(format(stream1)); + expect(format(stream2)).to.be.equal(format(stream2)); + expect(format(stream1)).to.not.be.equal(format(stream2)); + }); + }); + }); });
Stream tests: testin bunyan formatter.
molnarg_node-http2-protocol
train
js
c2634bac7269bcf07bd103dfe7d66e0fd790d7f2
diff --git a/flask_appbuilder/api/convert.py b/flask_appbuilder/api/convert.py index <HASH>..<HASH> 100644 --- a/flask_appbuilder/api/convert.py +++ b/flask_appbuilder/api/convert.py @@ -96,7 +96,6 @@ class Model2SchemaConverter(BaseModel2SchemaConverter): class Meta: model = _model fields = columns - strict = True load_instance = True sqla_session = self.datamodel.session @@ -105,7 +104,6 @@ class Model2SchemaConverter(BaseModel2SchemaConverter): class MetaSchema(SQLAlchemyAutoSchema, class_mixin): class Meta: model = _model - strict = True load_instance = True sqla_session = self.datamodel.session
refactor: remove unnecessary strict option from schemas (#<I>)
dpgaspar_Flask-AppBuilder
train
py
3eb732432691969dee8d22ac8feaf63c74c4b073
diff --git a/lib/WebSocket.js b/lib/WebSocket.js index <HASH>..<HASH> 100644 --- a/lib/WebSocket.js +++ b/lib/WebSocket.js @@ -465,6 +465,7 @@ function initAsClient(address, options) { var isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:'; var httpObj = isSecure ? https : http; var port = serverUrl.port || (isSecure ? 443 : 80); + var auth = serverUrl.auth; // expose state properties this._isServer = false; @@ -501,6 +502,12 @@ function initAsClient(address, options) { 'Sec-WebSocket-Key': key } }; + + // If we have basic auth + if (auth) { + requestOptions.headers['authorization'] = new Buffer('Basic ' + auth).toString('base64'); + } + if (options.value.protocol) { requestOptions.headers['Sec-WebSocket-Protocol'] = options.value.protocol; }
[fix] add ability to handle basic auth
websockets_ws
train
js
b78438d2ed22438b9acb275b48e0905de82174ad
diff --git a/angular-intercom.js b/angular-intercom.js index <HASH>..<HASH> 100644 --- a/angular-intercom.js +++ b/angular-intercom.js @@ -46,12 +46,22 @@ var _intercom = angular.isFunction($window.Intercom) ? $window.Intercom : angular.noop; if (_asyncLoading) { + // wait up to 1 sec before aborting + var _try = 10; // Load client in the browser - var onScriptLoad = function(callback) { + var onScriptLoad = function tryF(callback) { $timeout(function() { - // Resolve the deferred promise - // as the Intercom object on the window - deferred.resolve($window.Intercom); + if(_try === 0){ + return deferred.resolve($window.Intercom); + } + + if($window.Intercom){ + // Resolve the deferred promise + // as the Intercom object on the window + return deferred.resolve($window.Intercom); + } + _try--; + setTimeout(tryF.bind(null, callback), 100); // wait 100ms before next try }); }; createScript($document[0], onScriptLoad);
Retry each <I>ms for 1s intercom async loading, fixes #2
PatrickJS_angular-intercom
train
js
117f01833bbdc5c21fdf78796e8d5c737f803a9f
diff --git a/test_path.py b/test_path.py index <HASH>..<HASH> 100644 --- a/test_path.py +++ b/test_path.py @@ -910,17 +910,6 @@ class TestTempDir: d.__exit__(None, None, None) assert not d.exists() - def test_context_manager_exception(self): - """ - The context manager will not clean up if an exception occurs. - """ - d = TempDir() - d.__enter__() - (d / 'somefile.txt').touch() - assert not isinstance(d / 'somefile.txt', TempDir) - d.__exit__(TypeError, TypeError('foo'), None) - assert d.exists() - def test_context_manager_using_with(self): """ The context manager will allow using the with keyword and
Remove prior expectation that an exception causes a TempDir not to be cleaned up. Ref #<I>.
jaraco_path.py
train
py
869c891d11f5d0975a33ee6fae4c0d6720a184e2
diff --git a/Classes/Lightwerk/SurfTasks/Task/Transfer/RsyncTask.php b/Classes/Lightwerk/SurfTasks/Task/Transfer/RsyncTask.php index <HASH>..<HASH> 100755 --- a/Classes/Lightwerk/SurfTasks/Task/Transfer/RsyncTask.php +++ b/Classes/Lightwerk/SurfTasks/Task/Transfer/RsyncTask.php @@ -42,12 +42,6 @@ class RsyncTask extends Task { * @return void */ public function execute(Node $node, Application $application, Deployment $deployment, array $options = array()) { - // Create directory if it does not exist - $this->shell->executeOrSimulate( - 'mkdir -p ' . escapeshellarg($deployment->getApplicationReleasePath($application)), - $node, - $deployment - ); // Sync files $this->rsyncService->sync( // $sourceNode
[TASK] Removes mkdir from RsyncTask.php
lightwerk_SurfTasks
train
php
962b7d29d295972faa72581bad9ac202bc7bacc1
diff --git a/src/test/org/openscience/cdk/io/MDLV2000ReaderTest.java b/src/test/org/openscience/cdk/io/MDLV2000ReaderTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/io/MDLV2000ReaderTest.java +++ b/src/test/org/openscience/cdk/io/MDLV2000ReaderTest.java @@ -896,12 +896,13 @@ public class MDLV2000ReaderTest extends SimpleChemObjectReaderTest { IAtom[] atoms = AtomContainerManipulator.getAtomArray(molecule); - + int r1Count = 0; for (IAtom atom : atoms) { if (atom instanceof IPseudoAtom) { Assert.assertEquals("R1", ((IPseudoAtom) atom).getLabel()); + r1Count++; } } - + Assert.assertEquals(2, r1Count); } }
Also check that there are two such R1 atoms
cdk_cdk
train
java
06abdaf00ecf5829b54f020c2878f4591551fa11
diff --git a/test/parentchild.js b/test/parentchild.js index <HASH>..<HASH> 100644 --- a/test/parentchild.js +++ b/test/parentchild.js @@ -168,6 +168,7 @@ describe('parent child', function () { request.get(url, function (err, response, body) { should.not.exist(err) body = JSON.parse(body) + console.log(err, response, body); // this confirms that there are no orphans too! body.hits.total.should.equal(cities.length + (cities.length * people.length)) done()
Adding log to see why Travis fails
taskrabbit_elasticsearch-dump
train
js
b83127a94860d1810a8c63287c85d91b04ac1178
diff --git a/estnltk/layer/span.py b/estnltk/layer/span.py index <HASH>..<HASH> 100644 --- a/estnltk/layer/span.py +++ b/estnltk/layer/span.py @@ -23,7 +23,7 @@ class Span: self.parent = parent # type: Span if isinstance(start, int) and isinstance(end, int): - assert start < end + assert start <= end, (start, end) self._start = start self._end = end
allow Span with start==end
estnltk_estnltk
train
py
19f06284cd6ef8a3bd6f38df79355befec61368e
diff --git a/samples/boot/oauth2resourceserver-opaque/src/main/java/sample/OAuth2ResourceServerController.java b/samples/boot/oauth2resourceserver-opaque/src/main/java/sample/OAuth2ResourceServerController.java index <HASH>..<HASH> 100644 --- a/samples/boot/oauth2resourceserver-opaque/src/main/java/sample/OAuth2ResourceServerController.java +++ b/samples/boot/oauth2resourceserver-opaque/src/main/java/sample/OAuth2ResourceServerController.java @@ -16,7 +16,6 @@ package sample; import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -29,8 +28,8 @@ import org.springframework.web.bind.annotation.RestController; public class OAuth2ResourceServerController { @GetMapping("/") - public String index(@AuthenticationPrincipal OAuth2AuthenticatedPrincipal principal) { - return String.format("Hello, %s!", (String) principal.getAttribute("sub")); + public String index(@AuthenticationPrincipal(expression="subject") String subject) { + return String.format("Hello, %s!", subject); } @GetMapping("/message")
Update Opaque Token Sample Issue gh-<I>
spring-projects_spring-security
train
java
4dac7ad25714471a5049e455de0fd09c5a654226
diff --git a/validator/sawtooth_validator/server/core.py b/validator/sawtooth_validator/server/core.py index <HASH>..<HASH> 100644 --- a/validator/sawtooth_validator/server/core.py +++ b/validator/sawtooth_validator/server/core.py @@ -162,7 +162,7 @@ class Validator(object): server_private_key=network_private_key, heartbeat=True, public_endpoint=endpoint, - connection_timeout=30, + connection_timeout=120, max_incoming_connections=100, max_future_callback_workers=10, authorize=True,
increase connection_timeout to <I>
hyperledger_sawtooth-core
train
py
15fc7724a6382b3b652207868763ea9bac70b319
diff --git a/test_tableone.py b/test_tableone.py index <HASH>..<HASH> 100644 --- a/test_tableone.py +++ b/test_tableone.py @@ -78,6 +78,16 @@ class TestTableOne(object): assert x != y @with_setup(setup, teardown) + def test_examples_used_in_the_readme_run_without_raising_error(self): + + convars = ['time','age','bili','chol','albumin','copper','alk.phos','ast','trig','platelet','protime'] + catvars = ['status', 'ascites', 'hepato', 'spiders', 'edema','stage', 'sex'] + strat = 'trt' + nonnormal = ['bili'] + mytable = TableOne(self.data_pbc, convars, catvars, strat, nonnormal, pval=False) + mytable = TableOne(self.data_pbc, convars, catvars, strat, nonnormal, pval=True) + + @with_setup(setup, teardown) def test_overall_mean_and_std_as_expected_for_cont_variable(self): continuous=['normal','nonnormal','height']
add tests for example used in readme
tompollard_tableone
train
py
fa557e68813d5e213e8ad55b539f540d03e31e61
diff --git a/lib/tml.rb b/lib/tml.rb index <HASH>..<HASH> 100644 --- a/lib/tml.rb +++ b/lib/tml.rb @@ -38,6 +38,30 @@ module Tml module Decorators end module CacheAdapters end module Generators end + + def self.default_language + Tml.config.default_language + end + + def self.current_language + Tml.session.current_language + end + + def self.language(locale) + Tml.session.application.language(locale) + end + + def self.translate(label, description = '', tokens = {}, options = {}) + Tml.session.translate(label, description, tokens, options) + end + + def self.with_options(opts) + Tml.session.with_options(opts) do + if block_given? + yield + end + end + end end %w(tml/base.rb tml tml/api tml/rules_engine tml/tokens tml/tokenizers tml/decorators tml/cache_adapters tml/cache tml/ext).each do |f|
Added an external interface for application methods
translationexchange_tml-ruby
train
rb
b1c8508f258f9521fd5424142836a040895ba52e
diff --git a/src/frontend/assets/AppAsset.php b/src/frontend/assets/AppAsset.php index <HASH>..<HASH> 100644 --- a/src/frontend/assets/AppAsset.php +++ b/src/frontend/assets/AppAsset.php @@ -24,5 +24,6 @@ class AppAsset extends AssetBundle // This is a temporary fix because of https://github.com/yiisoft/yii2/issues/2310 // On Pjax page loading, ajax prefilter removes all CSS styles that are not on the main page 'hiqdev\yii2\assets\JqueryResizableColumns\ResizableColumnsAsset', + 'hiqdev\assets\pnotify\PNotifyAsset', ]; }
Added PNotifyAsset to AppAsset
hiqdev_hipanel-core
train
php
83534e5678a0f648e0cba767e3279714b3f774ce
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -247,13 +247,8 @@ module Rails return [] if options[:skip_sprockets] gems = [] - if options.dev? || options.edge? - gems << GemfileEntry.github('sass-rails', 'rails/sass-rails', nil, - 'Use SCSS for stylesheets') - else - gems << GemfileEntry.version('sass-rails', '~> 4.0', + gems << GemfileEntry.version('sass-rails', '~> 5.0', 'Use SCSS for stylesheets') - end gems << GemfileEntry.version('uglifier', '>= 1.3.0',
New applications should use sass-rails <I>
rails_rails
train
rb
e87724b47cd90493f21e26fd165f00fd2dab8f3a
diff --git a/fut/core.py b/fut/core.py index <HASH>..<HASH> 100644 --- a/fut/core.py +++ b/fut/core.py @@ -604,11 +604,12 @@ class Core(object): :params resource_id: Resource id. """ # TODO: add referer to headers (futweb) - return self.players[baseId(resource_id)] - ''' - url = '{0}{1}.json'.format(self.urls['card_info'], baseId(resource_id)) - return requests.get(url, timeout=self.timeout).json() - ''' + base_id = baseId(resource_id) + if base_id in self.players: + return self.players[base_id] + else: # not a player? + url = '{0}{1}.json'.format(self.urls['card_info'], base_id) + return requests.get(url, timeout=self.timeout).json() def searchDefinition(self, asset_id, start=0, count=35): """Return variations of the given asset id, e.g. IF cards.
core: fix cardInfo for not players
futapi_fut
train
py
efdfc12169d1b804156f998d8e897d79c6b5c183
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -81,7 +81,7 @@ Notifications.configure = function(options: Object) { if ( firstNotification !== null ) { this._onNotification(firstNotification, true); } - }); + }.bind(this)); } this.isLoaded = true;
Add missing this binding to popInitialNotification callback When popInitialNotification is true and app is closed, clicking on a notification causes an app crash
zo0r_react-native-push-notification
train
js
9e85a3dd3e1e1ccc317c86ab36c92c66ddbc6b34
diff --git a/src/TicketitServiceProvider.php b/src/TicketitServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/TicketitServiceProvider.php +++ b/src/TicketitServiceProvider.php @@ -6,6 +6,7 @@ use Collective\Html\FormFacade as CollectiveForm; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Route; +use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; use Kordy\Ticketit\Console\Htmlify; use Kordy\Ticketit\Controllers\InstallController; @@ -25,6 +26,10 @@ class TicketitServiceProvider extends ServiceProvider */ public function boot() { + if (!Schema::hasTable('migrations')) { + // Database isn't installed yet. + return; + } $installer = new InstallController(); // if a migration or new setting is missing scape to the installation
Check migrations table exists before attempting to read table
thekordy_ticketit
train
php
58706e6b0a78f81bc09b51b0d87e75cd8adcbb5f
diff --git a/src/Nut/ConfigSet.php b/src/Nut/ConfigSet.php index <HASH>..<HASH> 100644 --- a/src/Nut/ConfigSet.php +++ b/src/Nut/ConfigSet.php @@ -36,10 +36,11 @@ class ConfigSet extends AbstractConfig $value = $input->getArgument('value'); $backup = $input->getOption('backup'); - $updater->change($key, $value, $backup, true); - if (is_bool($value)) { - $value = $value ? 'true' : 'false'; - } + $newValue = $value === 'true' || $value === 'false' + ? filter_var($value, FILTER_VALIDATE_BOOLEAN) + : $value + ; + $updater->change($key, $newValue, $backup, true); $this->io->title(sprintf('Updating configuration setting in file %s', $this->file->getFullPath())); $this->io->success([
Pass boolean string as booleans to YamlUpdater
bolt_bolt
train
php
f12a42626637ceb90d8ccb2abcae94038b38bab1
diff --git a/src/OpenApi/Model/Parameter.php b/src/OpenApi/Model/Parameter.php index <HASH>..<HASH> 100644 --- a/src/OpenApi/Model/Parameter.php +++ b/src/OpenApi/Model/Parameter.php @@ -56,12 +56,12 @@ final class Parameter } } - public function getName(): ?string + public function getName(): string { return $this->name; } - public function getIn(): ?string + public function getIn(): string { return $this->in; } @@ -91,7 +91,7 @@ final class Parameter return $this->schema; } - public function getStyle(): string + public function getStyle(): ?string { return $this->style; }
Fix getStyle, getName, getIn return type to be consistent with construct. (#<I>)
api-platform_core
train
php
f6ecfede59433e3c7aaec5ede43b05fd6f137165
diff --git a/refiners/ALL/MissingComponentsRefiner.js b/refiners/ALL/MissingComponentsRefiner.js index <HASH>..<HASH> 100644 --- a/refiners/ALL/MissingComponentsRefiner.js +++ b/refiners/ALL/MissingComponentsRefiner.js @@ -40,6 +40,8 @@ result.start[component] = refResult.start[component] } }); + + result.start.impliedComponents = impliedComponents; } return results; }
impliedComponents after filling missing component
wanasit_chrono
train
js
227deb83c7607a244b5447f2bcc190cca889d33f
diff --git a/py3status/modules/backlight.py b/py3status/modules/backlight.py index <HASH>..<HASH> 100644 --- a/py3status/modules/backlight.py +++ b/py3status/modules/backlight.py @@ -109,7 +109,9 @@ class Py3status: else: raise Exception(STRING_NOT_AVAILABLE) - self.format = self.py3.update_placeholder_formats(self.format, {"level": ":d"}) + self.format = self.py3.update_placeholder_formats( + self.format, {"level": ":.0f"} + ) # check for an error code and an output self.command_available = False try:
backlight module: round brightness percentage instead of truncating (#<I>)
ultrabug_py3status
train
py
f93ff950803d2209f053f89fc13e1beea1804791
diff --git a/logstash_formatter.go b/logstash_formatter.go index <HASH>..<HASH> 100644 --- a/logstash_formatter.go +++ b/logstash_formatter.go @@ -44,7 +44,8 @@ func (f *LogstashFormatter) FormatWithPrefix(entry *logrus.Entry, prefix string) timeStampFormat := f.TimestampFormat if timeStampFormat == "" { - timeStampFormat = logrus.DefaultTimestampFormat + //timeStampFormat = logrus.DefaultTimestampFormat + timeStampFormat = "2006-01-02 15:04:05.000" } fields["@timestamp"] = entry.Time.Format(timeStampFormat)
time format with milliseconds (#<I>) Till the logstash hook will have a way to set time format, this change is applied.
bshuster-repo_logrus-logstash-hook
train
go
0457202d04cf05f4f2eefe9ee0df84306f39666a
diff --git a/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java b/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java index <HASH>..<HASH> 100644 --- a/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java +++ b/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java @@ -321,9 +321,6 @@ public class RestServiceClassCreator extends BaseSourceCreator { PathParam paramPath = arg.getAnnotation(PathParam.class); if (paramPath != null) { pathExpression = pathExpression.replaceAll(Pattern.quote("{" + paramPath.value() + "}"), "\"+" + toStringExpression(arg) + "+\""); - if (arg.getAnnotation(Attribute.class) != null) { - error("Attribute annotations not allowed on subresource locators"); - } } }
Removed restriction on @Attribute for sub resource locators
resty-gwt_resty-gwt
train
java
bbc34879162a078eb8a258e7d9e6b35e9b8c2107
diff --git a/src/Sonrisa/Component/Sitemap/SubmitSitemap.php b/src/Sonrisa/Component/Sitemap/SubmitSitemap.php index <HASH>..<HASH> 100644 --- a/src/Sonrisa/Component/Sitemap/SubmitSitemap.php +++ b/src/Sonrisa/Component/Sitemap/SubmitSitemap.php @@ -34,7 +34,7 @@ class SubmitSitemap //Validate URL format and Response if ( filter_var( $url, FILTER_VALIDATE_URL, array('options' => array('flags' => FILTER_FLAG_PATH_REQUIRED)) ) ) { if (self::sendHttpHeadRequest($url) === true ) { - return self::do_submit($url); + return self::submitSitemap($url); } throw new SitemapException("The URL provided ({$url}) holds no accessible sitemap file."); } @@ -47,7 +47,7 @@ class SubmitSitemap * @param $url string Valid URL being submitted. * @return array Array with the search engine submission success status as a boolean. */ - protected static function do_submit($url) + protected static function submitSitemap($url) { $response = array();
Fix for [Insight] PHP code should follow PSR-1 basic coding standard #5
nilportugues_php-sitemap
train
php
93565784dc14f9a01232ef56512ef1ce4419a875
diff --git a/imhotep/testing_utils.py b/imhotep/testing_utils.py index <HASH>..<HASH> 100644 --- a/imhotep/testing_utils.py +++ b/imhotep/testing_utils.py @@ -31,7 +31,6 @@ class Requester(object): return JsonWrapper(self.fixture, 200) - def calls_matching_re(mockObj, regex): matches = [] for call in mockObj.call_args_list:
E<I> too many blank lines
justinabrahms_imhotep
train
py
06109897439373ac270757c5feff11e95a7388fc
diff --git a/packages/crafty-preset-postcss/src/index.js b/packages/crafty-preset-postcss/src/index.js index <HASH>..<HASH> 100755 --- a/packages/crafty-preset-postcss/src/index.js +++ b/packages/crafty-preset-postcss/src/index.js @@ -165,7 +165,7 @@ module.exports = { .loader(require.resolve("css-loader")) .options({ importLoaders: 1, - sourceMap: crafty.getEnvironment() === "production" && bundle.extractCSS + sourceMap: crafty.getEnvironment() === "production" && !!bundle.extractCSS }); styleRule
crafty-preset-postcss: fix css-loader options - ensure that 'sourceMap' is always boolean
swissquote_crafty
train
js
a68bd1681cd76991739a9a89a2e327483bf5f178
diff --git a/socks.go b/socks.go index <HASH>..<HASH> 100644 --- a/socks.go +++ b/socks.go @@ -88,10 +88,10 @@ func dialSocks5(proxy, targetAddr string) (conn net.Conn, err error) { return } else if len(resp) != 2 { err = errors.New("Server does not respond properly.") - return + return } else if resp[0] != 5 { err = errors.New("Server does not support Socks 5.") - return + return } else if resp[1] != 0 { // no auth err = errors.New("socks method negotiation failed.") return @@ -159,7 +159,7 @@ func dialSocks4(socksType int, proxy, targetAddr string) (conn net.Conn, err err return } else if len(resp) != 8 { err = errors.New("Server does not respond properly.") - return + return } switch resp[1] { case 90:
Fix formatting with go fmt.
h12w_socks
train
go
9df9cc208be2769f4f228c08b818cd185e746155
diff --git a/quart/cli.py b/quart/cli.py index <HASH>..<HASH> 100644 --- a/quart/cli.py +++ b/quart/cli.py @@ -53,7 +53,10 @@ class ScriptInfo: module_path = Path(module_name).resolve() sys.path.insert(0, str(module_path.parent)) - import_name = module_path.with_suffix('').name + if module_path.is_file(): + import_name = module_path.with_suffix('').name + else: + import_name = module_path.name try: module = import_module(import_name) except ModuleNotFoundError as error:
Bugfix cli module name parsing Quart accepts the Gunicorn format ``file.ext:application`` but should also support the Flask format ``module_a.module_b:application``. To allow for both the code simply checks if the resolved path is a file then Gunicorn and if not Flask. This should help match expected Flask usage.
pgjones_quart
train
py
5de38282ad76579a68fd86b42b13bd2508d2d42d
diff --git a/lib/delta/delta.js b/lib/delta/delta.js index <HASH>..<HASH> 100644 --- a/lib/delta/delta.js +++ b/lib/delta/delta.js @@ -420,7 +420,7 @@ function findLocalConflict(node, callback) { } if(!syncedNode) { - logger.error('DELTA: node not found in database even if it should exists:', {targetPath, targetStat}); + logger.error('DELTA: node not found in database even if it should exists:', {targetPath, node, targetStat}); throw (new BlnDeltaError('Target node \' ' + targetPath + ' \' with ino \'' + targetStat.ino + '\' not found in db')); }
Improve logging when node is missing in db Related to: #<I>
gyselroth_balloon-node-sync
train
js
34d9bd0979d7d567eddf11547806c60631419287
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 @@ -1059,6 +1059,7 @@ module Discordrb end @ready_time = Time.now + @unavailable_timeout_time = Time.now when :RESUMED # The RESUMED event is received after a successful op 6 (resume). It does nothing except tell the bot the # connection is initiated (like READY would) and set a new heartbeat interval.
Set unavailable_timeout_time at READY so it's never nil
meew0_discordrb
train
rb
239c5792f6e80f48275b66ad095e37889a6274cf
diff --git a/android/CouchbaseLite/src/ce/java/com/couchbase/lite/ReplicatorConfiguration.java b/android/CouchbaseLite/src/ce/java/com/couchbase/lite/ReplicatorConfiguration.java index <HASH>..<HASH> 100644 --- a/android/CouchbaseLite/src/ce/java/com/couchbase/lite/ReplicatorConfiguration.java +++ b/android/CouchbaseLite/src/ce/java/com/couchbase/lite/ReplicatorConfiguration.java @@ -323,8 +323,8 @@ public final class ReplicatorConfiguration { public ReplicationFilter getPushFilter() { return pushFilter; } /** - * Gets a filter closure for validating whether the documents can be pushed - * to the remote endpoint. + * Gets a filter closure for validating whether the documents can be pulled from the + * remote endpoint. Only documents for which the closure returns true are replicated. */ public ReplicationFilter getPullFilter() { return pullFilter; }
Replication filters: fix pull filter getter comments.
couchbase_couchbase-lite-android
train
java
464f61fb44d6657311eacf129fb15eef5560c899
diff --git a/fshandler.go b/fshandler.go index <HASH>..<HASH> 100644 --- a/fshandler.go +++ b/fshandler.go @@ -324,6 +324,7 @@ func (h *fsHandler) createDirIndex(base *URI, filePath string) (*fsFile, error) var u URI base.CopyTo(&u) + u.Update(string(u.Path()) + "/") sort.Sort(sort.StringSlice(filenames)) for _, name := range filenames {
FSHandler index page: fixed urls to files
valyala_fasthttp
train
go
fec3b7c4e622812294d9f7c2154f23f42d16f51f
diff --git a/folderPane.js b/folderPane.js index <HASH>..<HASH> 100644 --- a/folderPane.js +++ b/folderPane.js @@ -25,7 +25,7 @@ module.exports = { // @@@@ kludge until we can get the solid-client version working // Force the folder by saving a dummy file inside it return kb.fetcher - .webOperation('PUT', newInstance.uri + '.dummy') + .webOperation('PUT', newInstance.uri + '.dummy', { contentType: 'application/octet-stream' }) .then(function () { console.log('New folder created: ' + newInstance.uri)
add contentType to folder creation with PUT
solid_folder-pane
train
js
4ae6aa0cc53c16672041644acad8671442cbb561
diff --git a/pypfopt/hierarchical_portfolio.py b/pypfopt/hierarchical_portfolio.py index <HASH>..<HASH> 100644 --- a/pypfopt/hierarchical_portfolio.py +++ b/pypfopt/hierarchical_portfolio.py @@ -153,7 +153,10 @@ class HRPOpt(base_optimizer.BaseOptimizer): # Compute distance matrix, with ClusterWarning fix as # per https://stackoverflow.com/questions/18952587/ - dist = ssd.squareform(((1 - corr) / 2) ** 0.5) + + # this can avoid some nasty floating point issues + matrix = np.sqrt(np.clip((1.0 - corr) / 2., a_min=0.0, a_max=1.0)) + dist = ssd.squareform(matrix, checks=False) self.clusters = sch.linkage(dist, "single") sort_ix = HRPOpt._get_quasi_diag(self.clusters)
quasi_diag replaced by pre_order of a tree
robertmartin8_PyPortfolioOpt
train
py
22f54c2dac9f851a841c21adc3a43550f5698619
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ tests_require = [ 'isort>=4.2.2', 'mock>=1.3.0', 'pydocstyle>=1.0.0', - 'pytest-cache>=1.0', 'pytest-cov>=1.8.0', 'pytest-pep8>=1.0.6', 'pytest>=2.8.0,!=3.3.0',
installation: removed pytest-cache dependency
inveniosoftware_invenio-oaiserver
train
py
14b13b43e3b0997a92885c81181bc778ac600320
diff --git a/pub/js/cookie.js b/pub/js/cookie.js index <HASH>..<HASH> 100644 --- a/pub/js/cookie.js +++ b/pub/js/cookie.js @@ -11,7 +11,7 @@ define(function() { return null; }, getJsonValue: function(cookieKey, jsonKey) { - var jsonData = JSON.parse(decodeURIComponent(this.get(cookieKey))); + var jsonData = JSON.parse(unescape(this.get(cookieKey))); if (null === jsonData || !jsonData.hasOwnProperty(jsonKey)) { return '';
Issue #<I>: Change cookie decodeURIComponent back to unescape
lizards-and-pumpkins_catalog
train
js
53f8a4e91546a2800c368600e32a4379b7559756
diff --git a/src/main/java/org/primefaces/component/datatable/feature/SortFeature.java b/src/main/java/org/primefaces/component/datatable/feature/SortFeature.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/primefaces/component/datatable/feature/SortFeature.java +++ b/src/main/java/org/primefaces/component/datatable/feature/SortFeature.java @@ -56,7 +56,16 @@ public class SortFeature implements DataTableFeature { for(int i = 0; i < sortKeys.length; i++) { UIColumn sortColumn = findSortColumn(table, sortKeys[i]); - String sortField = table.resolveStaticField(sortColumn.getValueExpression("sortBy")); + ValueExpression sortByVE = sortColumn.getValueExpression("sortBy"); + String sortField = null; + + if(sortColumn.isDynamic()) { + ((DynamicColumn) sortColumn).applyStatelessModel(); + sortField = table.resolveDynamicField(sortByVE); + } + else { + sortField = table.resolveStaticField(sortByVE); + } multiSortMeta.add(new SortMeta(sortColumn, sortField, SortOrder.valueOf(sortOrders[i]), sortColumn.getSortFunction())); }
LazyDataModel support for dynamic columns and multi sort
primefaces_primefaces
train
java
148153cdd654e39ed409d2e523be2837e42f9684
diff --git a/DataCollector/Collector.php b/DataCollector/Collector.php index <HASH>..<HASH> 100644 --- a/DataCollector/Collector.php +++ b/DataCollector/Collector.php @@ -17,7 +17,7 @@ class Collector extends DataCollector implements CollectorInterface, LateDataCol } public function getName() { - return 'logauth.tree_collector'; + return 'logauth.collector'; } public function collect(Request $request, Response $response, \Exception $exception = null) {
kristofer: Updated collector name
ordermind_symfony-logical-authorization-bundle
train
php
95900c5eefeb6391bfcfe81c5a757d52b49125b5
diff --git a/test/scenarios/rebalance.py b/test/scenarios/rebalance.py index <HASH>..<HASH> 100755 --- a/test/scenarios/rebalance.py +++ b/test/scenarios/rebalance.py @@ -12,8 +12,6 @@ op["timeout"] = IntFlag("--timeout", 600) op["num-nodes"] = IntFlag("--num-nodes", 3) opts = op.parse(sys.argv) -serve_flags = shlex.split(opts["serve-flags"]) - with driver.Metacluster() as metacluster: cluster = driver.Cluster(metacluster) executable_path, command_prefix, serve_options = scenario_common.parse_mode_flags(opts)
Removed unused serve_flags variable from shlex.
rethinkdb_rethinkdb
train
py
2371577e73ddbd26eff57f65d30801d479c05ace
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ class PyTest(Command): raise SystemExit(errno) setup(name='pyramid_webassets', - version='0.0', + version='0.1', description='pyramid_webassets', long_description=README + '\n\n' + CHANGES, classifiers=[
increased version for release to pypi
sontek_pyramid_webassets
train
py
4aa365b7f13fc1ed814ea9554c97aadf1a202e3a
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -104,24 +104,18 @@ module.exports = function(config) { version: '11', platform: 'Windows 8.1', }, - 'sl-safari-11': { + 'sl-safari-14': { base: 'SauceLabs', browserName: 'safari', - version: '11', - platform: 'macOS 10.13', + version: '14', + platform: 'macOS 11.00', }, - 'sl-safari-10': { + 'sl-safari-13': { base: 'SauceLabs', browserName: 'safari', - version: '10', - platform: 'OS X 10.12', + version: '13', + platform: 'OS X 10.15', }, - // 'sl-safari-9': { - // base: 'SauceLabs', - // browserName: 'safari', - // version: '9', - // platform: 'OS X 10.11', - // }, // 'sl-chrome-41': { // base: 'SauceLabs', // browserName: 'chrome',
chore: bumb safari test versions
material-components_material-components-web-components
train
js
512aade27a5b33362a8921661b0fd9c37d3e4549
diff --git a/lib/active_window_x/event_listener.rb b/lib/active_window_x/event_listener.rb index <HASH>..<HASH> 100644 --- a/lib/active_window_x/event_listener.rb +++ b/lib/active_window_x/event_listener.rb @@ -24,7 +24,6 @@ module ActiveWindowX @aw_atom = Atom.new @display, '_NET_ACTIVE_WINDOW' @name_atom = Atom.new @display, 'WM_NAME' @delete_atom = Atom.new @display, 'WM_DELETE_WINDOW' - puts "delete_atom: id:#{@delete_atom.id}" @conn = @display.connection @active_window = @root.active_window @@ -51,7 +50,12 @@ module ActiveWindowX begin while @continue event = listen timeout - yield event if event and event.type and not window_closed?(event.window) + next if not event + + if window_closed?(event.window) + event.window = @root.active_window + end + yield event if event.type end ensure @display.close if @display.closed? @@ -102,7 +106,7 @@ module ActiveWindowX end class Event - attr_reader :type, :window + attr_accessor :type, :window def initialize type, window @type = type; @window = window end
get new active_window if current active_window was closed
kui_active_window_x
train
rb
8f062a5d37602168f98d32e74fa06c151396019e
diff --git a/cleancat/base.py b/cleancat/base.py index <HASH>..<HASH> 100644 --- a/cleancat/base.py +++ b/cleancat/base.py @@ -13,9 +13,10 @@ class Field(object): base_type = None blank_value = None - def __init__(self, required=True, default=None, field_name=None): + def __init__(self, required=True, default=None, field_name=None, mutable=True): self.required = required self.default = default + self.mutable = mutable self.field_name = field_name def has_value(self, value): @@ -280,7 +281,10 @@ class Schema(object): try: # Treat non-existing fields like None. if field_name in self.raw_data or field_name not in self.data: - self.data[field_name] = field.clean(self.raw_data.get(field_name)) + value = field.clean(self.raw_data.get(field_name)) + if not field.mutable and self.orig_data and value in self.orig_data and value != self.orig_data[value]: + raise ValidationError('Value cannot be changed.') + self.data[field_name] = value except ValidationError, e: self.errors[field_name] = e.message
Adding Field.mutable attribute for fields that cannot be changed after they were set.
closeio_cleancat
train
py
bed70424f4d32b270b965d730128b255a23b07dc
diff --git a/src/org/openscience/cdk/Atom.java b/src/org/openscience/cdk/Atom.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/Atom.java +++ b/src/org/openscience/cdk/Atom.java @@ -116,6 +116,7 @@ public class Atom extends AtomType implements IAtom, Serializable, Cloneable { this.fractionalPoint3d = null; this.point3d = null; this.point2d = null; + this.hydrogenCount = 0; } /** @@ -129,6 +130,7 @@ public class Atom extends AtomType implements IAtom, Serializable, Cloneable { this.fractionalPoint3d = null; this.point3d = null; this.point2d = null; + this.hydrogenCount = 0; } /**
Several implementations expect the H-count to be zero by default, instead of unset :( git-svn-id: <URL>
cdk_cdk
train
java
9f257f021500f81b981bf1e5cdd111289013ed23
diff --git a/Controller/ClearbitController.php b/Controller/ClearbitController.php index <HASH>..<HASH> 100644 --- a/Controller/ClearbitController.php +++ b/Controller/ClearbitController.php @@ -43,7 +43,7 @@ class ClearbitController extends Controller $isNew = false; } - $form = $this->createFormBuilder($clearbitLocation) + $form = $this->createFormBuilder(Clearbit::class) ->add('apiKey', 'text', array( 'label' => 'API Key', 'attr' => array('help_text' => 'Find your API key at https://dashboard.clearbit.com/api')
CampaignChain/campaignchain#<I> Upgrade to Symfony 3.x
CampaignChain_channel-clearbit
train
php
581c028d181cc4582c8435ced5c0b104ac63346f
diff --git a/les/utils/expiredvalue.go b/les/utils/expiredvalue.go index <HASH>..<HASH> 100644 --- a/les/utils/expiredvalue.go +++ b/les/utils/expiredvalue.go @@ -88,8 +88,9 @@ func (e *ExpiredValue) Add(amount int64, logOffset Fixed64) int64 { if base >= 0 || uint64(-base) <= e.Base { // This is a temporary fix to circumvent a golang // uint conversion issue on arm64, which needs to - // be investigated further. FIXME - e.Base = uint64(int64(e.Base) + int64(base)) + // be investigated further. More details at: + // https://github.com/golang/go/issues/43047 + e.Base += uint64(int64(base)) return amount } net := int64(-float64(e.Base) / factor)
les: cosmetic rewrite of the arm<I> float bug workaround (#<I>) * les: revert arm float bug workaround to check go <I> * add traces to reproduce outside travis * simpler workaround
ethereum_go-ethereum
train
go
8e8d6c17fa32ff7da007d7b323f63f3da0a6b521
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,11 +26,11 @@ RSpec.configure do |c| end c.before(:suite) do - Delfos.reset! + Delfos.reset! if Delfos.respond_to?(:reset!) end c.before(:each) do - Delfos.reset! + Delfos.reset! if Delfos.respond_to?(:reset!) ShowClassInstanceVariables.variables_for(Delfos) Delfos.logger = $delfos_test_logger if defined? $delfos_test_logger end
only reset in specs when methods is defined: this is needed when running single unit tests
ruby-analysis_delfos
train
rb
d490db2f9632c4f1a63f50e7e7bcdc4025e98e2f
diff --git a/raven/base.py b/raven/base.py index <HASH>..<HASH> 100644 --- a/raven/base.py +++ b/raven/base.py @@ -231,6 +231,8 @@ class Client(object): >>> # Specify a scheme to use (http or https) >>> print client.get_public_dsn('https') """ + if not self.is_enabled(): + return url = self._get_public_dsn() if not scheme: return url diff --git a/raven/contrib/django/templatetags/raven.py b/raven/contrib/django/templatetags/raven.py index <HASH>..<HASH> 100644 --- a/raven/contrib/django/templatetags/raven.py +++ b/raven/contrib/django/templatetags/raven.py @@ -16,4 +16,4 @@ register = template.Library() @register.simple_tag def sentry_public_dsn(scheme=None): from raven.contrib.django.models import client - return client.get_public_dsn(scheme) + return client.get_public_dsn(scheme) or ''
Dont try to return a public_dsn if Raven is disabled
getsentry_raven-python
train
py,py
338998a09eceb71145485264f6a99713706fc613
diff --git a/ella/articles/models.py b/ella/articles/models.py index <HASH>..<HASH> 100644 --- a/ella/articles/models.py +++ b/ella/articles/models.py @@ -121,10 +121,9 @@ class ArticleOptions(admin.ModelAdmin): fields = ( (_("Article heading"), {'fields': ('title', 'upper_title', 'updated', 'slug')}), (_("Article contents"), {'fields': ('perex',)}), - (_("Metadata"), {'fields': ('category', 'authors', 'source')}) -# (_("Metadata"), {'fields': ('category', 'authors', 'source', 'photo')}) + (_("Metadata"), {'fields': ('category', 'authors', 'source', 'photo')}) ) -# raw_id_fields = ('photo',) + raw_id_fields = ('photo',) list_filter = ('created',) search_fields = ('title', 'perex',) inlines = (ArticleContentInlineOptions(ArticleContents, extra=3),)
Article has editable photo in admin git-svn-id: <URL>
ella_ella
train
py
b7f5b999e244473c2c51cf728eba68a271ddc3c1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( license='GPLv3', packages=find_packages(exclude=['doc', 'test']), include_package_data=True, - install_requires=['numpy','pyomo','scipy','pandas>=0.19.0','networkx>=1.10'], + install_requires=['numpy','pyomo>=5.3','scipy','pandas>=0.19.0','networkx>=1.10'], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console',
setup: Add dependency on PYOMO version <I>
PyPSA_PyPSA
train
py
46ba42767023da205b87150cf6d6e7f06facbce4
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -67,8 +67,17 @@ function runTests(filter) { var args = m[2], kind = m[1]; ++tests; if (kind == "+") { - for (var pos = m.index; /\s/.test(text.charAt(pos - 1)); --pos) {} - var query = {type: "completions", end: pos, file: fname}; + var query, columnInfo = /\s*@(\d+)$/.exec(args); + if (columnInfo) { + var line = acorn.getLineInfo(server.files[0].text, m.index).line; + var endInfo = {line: line - 1, ch: parseInt(columnInfo[1]) - 1}; + query = {type: "completions", lineCharPositions: true, end: endInfo, file: fname}; + args = args.slice(0, columnInfo.index); + } + else { + for (var pos = m.index; /\s/.test(text.charAt(pos - 1)); --pos) {} + query = {type: "completions", end: pos, file: fname}; + } var andOthers = /,\s*\.\.\.$/.test(args); if (andOthers) args = args.slice(0, args.lastIndexOf(",")); var parts = args.split(/\s*,\s*/);
Add custom @columnNumber suffix for completion hint tests to allow intra-line testing
ternjs_tern
train
js
7cb9d8dd916533125e990bd4464aec803d2aadbe
diff --git a/core/cb.files.sync/environment.js b/core/cb.files.sync/environment.js index <HASH>..<HASH> 100644 --- a/core/cb.files.sync/environment.js +++ b/core/cb.files.sync/environment.js @@ -55,10 +55,18 @@ Environment.prototype.userExit = function(user) { // Remove user from environment this.removeUser(user); - // Close the file - // then notify other users of departure - return Q(this.pingOthers(user)); + var base = Q(); + if (this.doc.path != null) { + // Close the file + base = user.close(this.doc.path) + } + + var that = this; + // then notify other users of departure + return base.then(function() { + return that.pingOthers(user); + }); }; Environment.prototype.removeUser = function(user) { @@ -144,7 +152,8 @@ Environment.prototype.getSyncData = function() { return { content: this.doc.getContent(), participants: this.usersInfo(), - state: this.modified + state: this.modified, + path: this.doc.path }; };
Add exit for user from sync environment
CodeboxIDE_codebox
train
js
23e6a55c3f5fde52d4ec5562ca0bbc7067801883
diff --git a/lib/fluent-query/connection.rb b/lib/fluent-query/connection.rb index <HASH>..<HASH> 100755 --- a/lib/fluent-query/connection.rb +++ b/lib/fluent-query/connection.rb @@ -256,7 +256,12 @@ module FluentQuery public def transaction(&block) self.begin - block.call + begin + block.call + rescue ::Exception => e + self.rollback + raise e + end self.commit end
bug: transactions must correctly rollback in case of exception
martinpoljak_fluent-query
train
rb
4d1f38932588c6248beef63f362e9bfae85090a6
diff --git a/src/Access/Asset.php b/src/Access/Asset.php index <HASH>..<HASH> 100644 --- a/src/Access/Asset.php +++ b/src/Access/Asset.php @@ -99,6 +99,22 @@ class Asset extends Nested } /** + * Generates automatic parent_id field value + * + * @param array $data the data being saved + * @return string + */ + public function automaticParentId($data) + { + if (!isset($data['parent_id']) || $data['parent_id'] == 0) + { + $data['parent_id'] = self::getRootId(); + } + + return $data['parent_id']; + } + + /** * Method to load an asset by it's name. * * @param string $name
[fix] Adding missing method (#<I>)
hubzero_framework
train
php
8fba6cf02d5e1baa039a0a37e68f41afb200bfea
diff --git a/pyphi/utils.py b/pyphi/utils.py index <HASH>..<HASH> 100644 --- a/pyphi/utils.py +++ b/pyphi/utils.py @@ -543,10 +543,13 @@ def block_cm(cm): outputs = list(range(cm.shape[1])) # CM helpers: - # All nodes that `nodes` connect (output) to - outputs_of = lambda nodes: np.where(cm[nodes, :].sum(0))[0] - # All nodes which connect (input) to `nodes` - inputs_to = lambda nodes: np.where(cm[:, nodes].sum(1))[0] + def outputs_of(nodes): + # All nodes that `nodes` connect to (output to) + return np.where(cm[nodes, :].sum(0))[0] + + def inputs_to(nodes): + # All nodes which connect to (input to) `nodes` + return np.where(cm[:, nodes].sum(1))[0] # Start: source node with most outputs sources = [np.argmax(cm.sum(1))]
Make `block_cm` lambdas conform to PEP8
wmayner_pyphi
train
py
bc45e71c55f02ece4b448da21b94e7c5b719ea4b
diff --git a/docker/models/containers.py b/docker/models/containers.py index <HASH>..<HASH> 100644 --- a/docker/models/containers.py +++ b/docker/models/containers.py @@ -15,7 +15,12 @@ from .resource import Collection, Model class Container(Model): - + """ Local representation of a container object. Detailed configuration may + be accessed through the :py:attr:`attrs` attribute. Note that local + attributes are cached; users may call :py:meth:`reload` to + query the Docker daemon for the current properties, causing + :py:attr:`attrs` to be refreshed. + """ @property def name(self): """
Document attr caching for Container objects
docker_docker-py
train
py
698efdc1a387706ebfb36178677e539280e8abc4
diff --git a/test/unit-test.js b/test/unit-test.js index <HASH>..<HASH> 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -766,6 +766,10 @@ title']", "@import url('https://pro.goalsmashers.com/test.css');", "@import url(https://pro.goalsmashers.com/test.css);" ], + 'of a url starting with //': [ + "@import url(//fonts.googleapis.com/css?family=Lato:400,700,400italic|Merriweather:400,700);", + "@import url(//fonts.googleapis.com/css?family=Lato:400,700,400italic|Merriweather:400,700);" + ], 'of a directory': [ "@import url(test/data/partials);", ""
test for:fixed import of remote font file starting with //
jakubpawlowicz_clean-css
train
js
66718069960d720cf6e1ec502aac541dead912be
diff --git a/Kwc/Basic/ImageParent/Component.php b/Kwc/Basic/ImageParent/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Basic/ImageParent/Component.php +++ b/Kwc/Basic/ImageParent/Component.php @@ -36,8 +36,11 @@ class Kwc_Basic_ImageParent_Component extends Kwc_Abstract ); } $ret['baseUrl'] = $this->_getBaseImageUrl(); - $ret['lazyLoadOutOfViewport'] = $this->_getSetting('lazyLoadOutOfViewport'); $ret['defineWidth'] = $this->_getSetting('defineWidth'); + $ret['lazyLoadOutOfViewport'] = $this->_getSetting('lazyLoadOutOfViewport'); + + $ret['style'] = 'max-width:'.$ret['width'].'px;'; + if ($this->_getSetting('defineWidth')) $ret['style'] .= 'width:'.$ret['width'].'px;'; $ret['containerClass'] = 'container'; if (isset($ret['width']) && $ret['width'] > 100) $ret['containerClass'] .= ' webResponsiveImgLoading';
Fix ImageParent, add missing style style moved from tpl to getTemplateVars in Image component, also do that in ImageParent
koala-framework_koala-framework
train
php
d5b1aba8a56e2bddbc486fe857200e835f8efa3c
diff --git a/spec/integration/request_spec.rb b/spec/integration/request_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/request_spec.rb +++ b/spec/integration/request_spec.rb @@ -4,8 +4,8 @@ describe "Integration" do subject(:client) { client = Savon.client(service_endpoint) - client.http.open_timeout = 10 - client.http.read_timeout = 10 + client.http.open_timeout = 3 + client.http.read_timeout = 3 client }
lowered request spec timeouts
savonrb_savon
train
rb
f2dde7dc49e8ec5e932c2d1b5777d04e2b3f8b05
diff --git a/lib/slack-ruby-bot-server/app.rb b/lib/slack-ruby-bot-server/app.rb index <HASH>..<HASH> 100644 --- a/lib/slack-ruby-bot-server/app.rb +++ b/lib/slack-ruby-bot-server/app.rb @@ -4,7 +4,6 @@ module SlackRubyBotServer check_database! init_database! mark_teams_active! - update_team_name_and_id! purge_inactive_teams! configure_global_aliases! end @@ -34,18 +33,6 @@ module SlackRubyBotServer Team.where(active: nil).update_all(active: true) end - def update_team_name_and_id! - Team.active.where(team_id: nil).each do |team| - begin - auth = team.ping![:auth] - team.update_attributes!(team_id: auth['team_id'], name: auth['team']) - rescue StandardError => e - logger.warn "Error pinging team #{team.id}: #{e.message}." - team.set(active: false) - end - end - end - def purge_inactive_teams! Team.purge! end
Removed legacy migration that updated team name and ID.
slack-ruby_slack-ruby-bot-server
train
rb
309835f2fee10727d5c5fb52cfa33729e20403ea
diff --git a/Clipper/joplin-webclipper/content_scripts/index.js b/Clipper/joplin-webclipper/content_scripts/index.js index <HASH>..<HASH> 100644 --- a/Clipper/joplin-webclipper/content_scripts/index.js +++ b/Clipper/joplin-webclipper/content_scripts/index.js @@ -134,11 +134,17 @@ const src = absoluteUrl(imageSrc(node)); node.setAttribute('src', src); if (!(src in imageIndexes)) imageIndexes[src] = 0; - const imageSize = imageSizes[src][imageIndexes[src]]; - imageIndexes[src]++; - if (imageSize && convertToMarkup === 'markdown') { - node.width = imageSize.width; - node.height = imageSize.height; + + if (!imageSizes[src]) { + // This seems to concern dynamic images that don't really such as Gravatar, etc. + console.warn('Found an image for which the size had not been fetched:', src); + } else { + const imageSize = imageSizes[src][imageIndexes[src]]; + imageIndexes[src]++; + if (imageSize && convertToMarkup === 'markdown') { + node.width = imageSize.width; + node.height = imageSize.height; + } } }
Clipper: Fixes #<I>: Some pages could not be clipped in Firefox due to an issue with dynamic images
laurent22_joplin
train
js
f1c8b2e2a2837e77f188e4e6cbadaae0749d5628
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -228,7 +228,7 @@ module.exports = function(grunt) { grunt.task.loadTasks('tasks'); grunt.registerTask('bench', ['metrics']); - grunt.registerTask('sauce', process.env.SAUCE_USERNAME ? ['tests', 'connect', 'saucelabs-mocha'] : []); + grunt.registerTask('sauce', [] /* process.env.SAUCE_USERNAME ? ['tests', 'connect', 'saucelabs-mocha'] : [] */); grunt.registerTask('travis', process.env.PUBLISH ? ['default', 'sauce', 'metrics', 'publish:latest'] : ['default']);
chore: disable sauce-labs Related to #<I>
wycats_handlebars.js
train
js
7f8693c49a0eaaa54b8f9407369947bcd76c3862
diff --git a/pycbc/filter/zpk.py b/pycbc/filter/zpk.py index <HASH>..<HASH> 100644 --- a/pycbc/filter/zpk.py +++ b/pycbc/filter/zpk.py @@ -70,7 +70,7 @@ def filter_zpk(timeseries, z, p, k): Examples -------- - To apply a 5 zeroes at 1Hz, 5 poles at 1Hz, and a gain of 1e-10 filter + To apply a 5 zeroes at 100Hz, 5 poles at 1Hz, and a gain of 1e-10 filter to a TimeSeries instance, do: >>> filtered_data = zpk_filter(timeseries, [100]*5, [1]*5, 1e-10) """
Fix typo in zpk_filter docstring.
gwastro_pycbc
train
py
e2c44ae894555a447ab254d01e9277733d8a6d0f
diff --git a/src/Meta.php b/src/Meta.php index <HASH>..<HASH> 100644 --- a/src/Meta.php +++ b/src/Meta.php @@ -41,7 +41,18 @@ class Meta return $this->allFields; } - + + /** + * Get a list of fields for this class + * + * The field list is a hash of 2-tuples keyed by property name. + * The first 2-tuple element contains either an explicit field + * name that the property maps to, or boolean "false" if the field + * name should be inferred. + * The second element contains the field's "type", for the purpose + * of looking up a type handler. This may be false if the type handler + * should be either inferred or ignored. + */ function getField($field) { if (!$this->allFields) @@ -70,7 +81,7 @@ class Meta if (!$this->primary) { $pos = strrpos($class, '\\'); $name = $pos ? substr($class, $pos+1) : $class; - $this->primary = lcfirst($name).'Id'; + $this->primary = lcfirst($name.'Id'); } return $this->primary;
tweaked lcfirst primary call
shabbyrobe_amiss
train
php
a2dbe2c4747b25a40d3205e3413a3a10daf2ddd1
diff --git a/lib/restclient.rb b/lib/restclient.rb index <HASH>..<HASH> 100644 --- a/lib/restclient.rb +++ b/lib/restclient.rb @@ -166,6 +166,7 @@ module RestClient # Add a Proc to be called before each request in executed. # The proc parameters will be the http request and the request params. def self.add_before_execution_proc &proc + raise ArgumentError.new('block is required') unless proc @@before_execution_procs << proc end
Validate that proc passed to add_before_exec... Previously, you could call RestClient.add_before_execution_proc() with no arguments or block, and it would add `nil` to the list of procs. This would cause a nil NoMethodError down the line. Instead, immediately raise an ArgumentError.
rest-client_rest-client
train
rb
ef313efbbc7da6771e87a0d6b728f89f594ac9c4
diff --git a/lib/deferrable_gratification/combinators.rb b/lib/deferrable_gratification/combinators.rb index <HASH>..<HASH> 100644 --- a/lib/deferrable_gratification/combinators.rb +++ b/lib/deferrable_gratification/combinators.rb @@ -182,11 +182,11 @@ module DeferrableGratification # returns falsy, and subsequent callbacks will fire only if all the # predicates pass. # - # @param [String] message optional description of the reason for the guard: - # specifying this will both serve as code - # documentation, and be included in the - # {GuardFailed} exception for error handling - # purposes. + # @param [String] reason optional description of the reason for the guard: + # specifying this will both serve as code + # documentation, and be included in the + # {GuardFailed} exception for error handling + # purposes. # # @yieldparam *args the arguments passed to callbacks if this Deferrable # succeeds. @@ -195,10 +195,10 @@ module DeferrableGratification # should fire. # # @raise [ArgumentError] if called without a predicate - def guard(message = nil) + def guard(reason = nil) raise ArgumentError, 'must be called with a block' unless block_given? callback do |*callback_args| - fail(::DeferrableGratification::GuardFailed.new(message)) unless yield(*callback_args) + fail(::DeferrableGratification::GuardFailed.new(reason)) unless yield(*callback_args) end self end
Rename #guard argument to 'reason' for clarity
samstokes_deferrable_gratification
train
rb
f08894408f595c3770dcb0aad8a35fca2386485a
diff --git a/vyper/parser/context.py b/vyper/parser/context.py index <HASH>..<HASH> 100644 --- a/vyper/parser/context.py +++ b/vyper/parser/context.py @@ -42,7 +42,7 @@ class Context: # Global variables, in the form (name, storage location, type) self.globals = global_ctx._globals # ABI objects, in the form {classname: ABI JSON} - self.sigs = sigs or {} + self.sigs = sigs or {'self': {}} # Variables defined in for loops, e.g. for i in range(6): ... self.forvars = forvars or {} # Return type of the function
fix 'self' keyerror when attempting to assign a function to a constant
ethereum_vyper
train
py
3070971977e70c6bb32a3fd776b061f313ddd8d7
diff --git a/src/vendor/erdiko/core/Response.php b/src/vendor/erdiko/core/Response.php index <HASH>..<HASH> 100755 --- a/src/vendor/erdiko/core/Response.php +++ b/src/vendor/erdiko/core/Response.php @@ -67,7 +67,8 @@ class Response */ public function getThemeName() { - return $this->_themeName; + $name = (empty($this->_themeName)) ? $this->_theme->getName() : $this->_themeName; + return $name; } /** diff --git a/src/vendor/erdiko/core/Theme.php b/src/vendor/erdiko/core/Theme.php index <HASH>..<HASH> 100755 --- a/src/vendor/erdiko/core/Theme.php +++ b/src/vendor/erdiko/core/Theme.php @@ -147,6 +147,11 @@ class Theme extends Container $this->_name = $name; } + public function getName() + { + return $this->_name; + } + /** * Get template file populated by the config * e.g. get header/footer
Updated response class and theme class.
Erdiko_core
train
php,php
a45f90a843eb96f9a01b2b49658b83124c4b173a
diff --git a/keanu-python/keanu/plots/traceplot.py b/keanu-python/keanu/plots/traceplot.py index <HASH>..<HASH> 100644 --- a/keanu-python/keanu/plots/traceplot.py +++ b/keanu-python/keanu/plots/traceplot.py @@ -1,7 +1,7 @@ try: import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator -except ImportError: # mpl is optional +except ImportError: # mpl is optional pass import numpy as np
Apply gradlew formatApply.
improbable-research_keanu
train
py
5e3cff503d9a31e960362e9b4695220e0ff5a066
diff --git a/app/controllers/api/DashboardsApiController.java b/app/controllers/api/DashboardsApiController.java index <HASH>..<HASH> 100644 --- a/app/controllers/api/DashboardsApiController.java +++ b/app/controllers/api/DashboardsApiController.java @@ -136,7 +136,7 @@ public class DashboardsApiController extends AuthenticatedController { DashboardWidget widget = dashboard.getWidget(widgetId); DashboardWidgetValueResponse widgetValue = widget.getValue(api()); - Object resultValue = filterValuesByResolution(resolution, widgetValue.result); + Object resultValue = (widget instanceof SearchResultChartWidget) ? filterValuesByResolution(resolution, widgetValue.result) : widgetValue.result; Map<String, Object> result = Maps.newHashMap(); result.put("result", resultValue); result.put("took_ms", widgetValue.tookMs);
Possible fix for issue #<I> - added additional check to ensure sampling of data only applies to search result chart widgets
Graylog2_graylog2-server
train
java
1ad472a335b0baa6e1d1afac1e6fe4cbd0cd84b4
diff --git a/core/src/main/java/io/undertow/server/session/InMemorySessionManager.java b/core/src/main/java/io/undertow/server/session/InMemorySessionManager.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/server/session/InMemorySessionManager.java +++ b/core/src/main/java/io/undertow/server/session/InMemorySessionManager.java @@ -115,8 +115,11 @@ public class InMemorySessionManager implements SessionManager { throw UndertowMessages.MESSAGES.couldNotFindSessionCookieConfig(); } String sessionID = config.findSessionId(serverExchange); - if(sessionID == null) { + while (sessionID == null) { sessionID = sessionIdGenerator.createSessionId(); + if(sessions.containsKey(sessionID)) { + sessionID = null; + } } Object evictionToken; if (evictionQueue != null) {
Guard against session ID conflicts The chances of this happening should be quite small, but add an explicit check anyway
undertow-io_undertow
train
java
a35fff4b9fd93b82ebf948f35166b715be9e64c5
diff --git a/Pragma/DB/DB.php b/Pragma/DB/DB.php index <HASH>..<HASH> 100644 --- a/Pragma/DB/DB.php +++ b/Pragma/DB/DB.php @@ -142,4 +142,25 @@ class DB{ return $description; } + + public static function getPDOParamsFor($tab, &$params){ + if(is_array($tab)){ + if(!empty($tab)){ + $subparams = []; + $counter_params = count($params) + 1; + foreach($tab as $val){ + $subparams[':param'.$counter_params] = $val; + $counter_params++; + } + $params = array_merge($params, $subparams); + return implode(',',array_keys($subparams)); + } + else{ + throw new \Exception("getPDOParamsFor : Tryin to get PDO Params on an empty array"); + } + } + else{ + throw new \Exception("getPDOParamsFor : Params should be an array"); + } + } }
DB - helpers to parse params from an array
pragma-framework_core
train
php
35b1ff980579eabf9b6f4c2d7907ee92cfaf0b3c
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java index <HASH>..<HASH> 100644 --- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java +++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java @@ -157,7 +157,7 @@ public class FeatureCoverageTest { MeanTest.class, MinTest.class, OrderTest.class, - PageRankTest.class, + //PageRankTest.class, PathTest.class, // PeerPressureTest.class, // ProfileTest.class,
TINKERPOP-<I> PageRank tests aren't currently part of the required tests
apache_tinkerpop
train
java
1b718da182c7a40a510f521134f42f9e532b7b31
diff --git a/pysat/utils/time.py b/pysat/utils/time.py index <HASH>..<HASH> 100644 --- a/pysat/utils/time.py +++ b/pysat/utils/time.py @@ -12,6 +12,7 @@ import numpy as np import pandas as pds import re + def getyrdoy(date): """Return a tuple of year, day of year for a supplied datetime object.
STY: added missing whitespace Added an extra line before the first routine.
rstoneback_pysat
train
py