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
8004d99248e03ccca9530973135ad4cbb56be944
diff --git a/geotweet/mapreduce/state_county_wordcount.py b/geotweet/mapreduce/state_county_wordcount.py index <HASH>..<HASH> 100644 --- a/geotweet/mapreduce/state_county_wordcount.py +++ b/geotweet/mapreduce/state_county_wordcount.py @@ -62,7 +62,7 @@ class MRStateCountyWordCount(MRJob): def mapper_init(self): """ Download counties geojson from S3 and build spatial index and cache """ - self.counties = CachedCountyLookup() + self.counties = CachedCountyLookup(precision=GEOHASH_PRECISION) self.extractor = WordExtractor() def mapper(self, _, line): @@ -71,10 +71,10 @@ class MRStateCountyWordCount(MRJob): if data['description'] and self.hr_filter(data['description']): return # project coordinates to ESRI:102005 and encode as geohash - lon, lat = project(data['lonlat']) - geohash = Geohash.encode(lat, lon, precision=GEOHASH_PRECISION) + lonlat = data['lonlat'] + #geohash = Geohash.encode(lat, lon, precision=GEOHASH_PRECISION) # spatial lookup for state and county - state, county = self.counties.get(geohash) + state, county = self.counties.get(lonlat) if not state or not county: return # count words
don't project coordinates inside mapreduce job
meyersj_geotweet
train
py
a06f443f04029d9dc341cf6c37b7658c3d9ad0c7
diff --git a/h2o-core/src/main/java/water/rapids/ASTOp.java b/h2o-core/src/main/java/water/rapids/ASTOp.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/rapids/ASTOp.java +++ b/h2o-core/src/main/java/water/rapids/ASTOp.java @@ -176,7 +176,7 @@ public abstract class ASTOp extends AST { putPrefix(new ASTIfElse()); putPrefix(new ASTApply ()); putPrefix(new ASTSApply()); -// putPrefix(new ASTddply2()); + putPrefix(new ASTddply()); putPrefix(new ASTMerge ()); // putPrefix(new ASTUnique()); putPrefix(new ASTXorSum());
put back ddply in clinit
h2oai_h2o-3
train
java
a8e8ff31d2a00981a4eb604d88f4892c47fb387d
diff --git a/src/models/StyleSheetManager.js b/src/models/StyleSheetManager.js index <HASH>..<HASH> 100644 --- a/src/models/StyleSheetManager.js +++ b/src/models/StyleSheetManager.js @@ -46,7 +46,7 @@ StyleSheetManager.propTypes = { sheet: PropTypes.oneOfType([ PropTypes.instanceOf(StyleSheet), PropTypes.instanceOf(ServerStyleSheet), - ]).isRequired, + ]), target: PropTypes.shape({ appendChild: PropTypes.func.isRequired, }),
suppress warnings for StyleSheetManager
styled-components_styled-components
train
js
e3611daebcc6a63b5a8b118b20c649ddfabde988
diff --git a/src/Http/Authenticator.php b/src/Http/Authenticator.php index <HASH>..<HASH> 100644 --- a/src/Http/Authenticator.php +++ b/src/Http/Authenticator.php @@ -209,6 +209,14 @@ class Authenticator $this->refreshToken = $tokens['refresh_token'] ?? null; } + /** + * This conversion helper is provided as a developer convenience while + * transitioning from v1 to v2 of the API. On June 6, 2019, we will sunset + * v1 of the API. At that time, this method will no longer function and we + * will remove it from the SDK. + * + * @deprecated + */ public function convertLegacyToken(): void { $tokens = $this->requestAuthTokens(
Flagging the legacy token conversion method as deprecated (#<I>) * Flagging the legacy token conversion method as deprecated * Reworked phrasing
helpscout_helpscout-api-php
train
php
d98b70005f40240604b68c8c261c13083ec75e31
diff --git a/tenant_schemas/test/cases.py b/tenant_schemas/test/cases.py index <HASH>..<HASH> 100644 --- a/tenant_schemas/test/cases.py +++ b/tenant_schemas/test/cases.py @@ -1,6 +1,10 @@ +import django +from django.core.management import call_command from django.db import connection from django.test import TestCase + from tenant_schemas.utils import get_tenant_model +from tenant_schemas.utils import get_public_schema_name class TenantTestCase(TestCase): @@ -20,3 +24,20 @@ class TenantTestCase(TestCase): cursor = connection.cursor() cursor.execute('DROP SCHEMA test CASCADE') + + @classmethod + def sync_shared(cls): + if django.VERSION >= (1, 7, 0): + call_command('migrate_schemas', + schema_name=get_public_schema_name(), + interactive=False, + verbosity=0) + else: + call_command('sync_schemas', + schema_name=get_public_schema_name(), + tenant=False, + public=True, + interactive=False, + migrate_all=True, + verbosity=0, + )
Added missing method to TenantTestCase. Fixes #<I>.
bernardopires_django-tenant-schemas
train
py
235139bced5a9a080a692ce774b5121eaccde820
diff --git a/robotgo.go b/robotgo.go index <HASH>..<HASH> 100644 --- a/robotgo.go +++ b/robotgo.go @@ -700,12 +700,12 @@ func CharCodeAt(s string, n int) rune { func toUC(text string) []string { var uc []string - textQuoted := strconv.QuoteToASCII(text) - textUnquoted := textQuoted[1 : len(textQuoted)-1] + for _, r := range text { + textQ := strconv.QuoteToASCII(string(r)) + textUnQ := textQ[1 : len(textQ)-1] - strUnicodev := strings.Split(textUnquoted, "\\u") - for i := 1; i < len(strUnicodev); i++ { - uc = append(uc, "U"+strUnicodev[i]) + st := strings.Replace(textUnQ, "\\u", "U", -1) + uc = append(uc, st) } return uc
Update to utf-code function Fixed #<I>
go-vgo_robotgo
train
go
3066f90f41d1d7e11a0251a2422911d654467484
diff --git a/aci/layout_test.go b/aci/layout_test.go index <HASH>..<HASH> 100644 --- a/aci/layout_test.go +++ b/aci/layout_test.go @@ -1,10 +1,13 @@ package aci import ( + "fmt" "io/ioutil" "os" "path" "testing" + + "github.com/appc/spec/schema" ) func newValidateLayoutTest() (string, error) { @@ -22,7 +25,7 @@ func newValidateLayoutTest() (string, error) { } evilManifestBody := "malformedManifest" - manifestBody := `{"acKind":"ImageManifest","acVersion":"0.3.0","name":"example.com/app"}` + manifestBody := fmt.Sprintf(`{"acKind":"ImageManifest","acVersion":"%s","name":"example.com/app"}`, schema.AppContainerVersion) evilManifestPath := "rootfs/manifest" evilManifestPath = path.Join(td, evilManifestPath)
aci/layout: fix test Use the current appc version in the test manifest body.
appc_spec
train
go
6afe38d15ac3a0eeac62ee9a1d1a345ab57d726c
diff --git a/test/blog.rb b/test/blog.rb index <HASH>..<HASH> 100644 --- a/test/blog.rb +++ b/test/blog.rb @@ -29,9 +29,12 @@ end require 'active_record' ActiveRecord::Base.logger = Blog.logger +dbpath = Pathname.new('tmp/blog.sqlite3') +FileUtils.mkdir_p(dbpath.dirname) +dbpath.unlink if dbpath.exist? ActiveRecord::Base.establish_connection( :adapter => "sqlite3", - :database => ":memory:" + :database => dbpath ) ActiveRecord::Schema.define do
change sqlite from memory to file database for multithreading this is supposed to work but doesn't, just creates a file with that name. oh well. :database => "file:memdb1?mode=memory&cache=shared"
notEthan_jsi
train
rb
a9d00c1310609779ab98c0bab2db3242bb2e6502
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -30,18 +30,18 @@ def find_version(*parts): return str(version_match.group(1)) raise RuntimeError("Unable to find version string.") +install_requires=[ + 'django-crispy-forms>=1.1.1', +] if sys.version_info[0] >= 3: # Akismet 0.2 does not support Python 3. - install_requires=[ - 'django-crispy-forms>=1.1.1', - ] - if 'install' in sys.argv: + if 'install' in sys.argv or 'develop' in sys.argv: print("\nwarning: skipped Akismet as dependency because it does not have a Python 3 version.") else: - install_requires=[ - 'django-crispy-forms>=1.1.1', + install_requires += [ 'akismet>=0.2', + 'django-contrib-comments>=1.5', ] setup(
setup: install django-contrib-comments by default This provides a nice out-of-the-box experience that Just Works (TM)
django-fluent_django-fluent-comments
train
py
9dbf3068b9ad04137bcf7317153ff6f85d047513
diff --git a/estnltk_core/estnltk_core/converters/dict_importer.py b/estnltk_core/estnltk_core/converters/dict_importer.py index <HASH>..<HASH> 100644 --- a/estnltk_core/estnltk_core/converters/dict_importer.py +++ b/estnltk_core/estnltk_core/converters/dict_importer.py @@ -27,7 +27,10 @@ def records_to_layer(layer: 'Layer', records: List[Dict[str, Any]], rewriting: b 'end' marking the location of the span. If rewriting==True, existing annotations of the layer will be overwritten, otherwise new annotations will be appended to the layer. + TODO: this conversion does not work on enveloping layers ''' + if layer.enveloping is not None: + raise NotImplementedError('(!) records_to_layer has not been implemented for enveloping layers!') if rewriting: layer._span_list = SpanList()
Added error msg: records_to_layer does not support enveloping layers
estnltk_estnltk
train
py
ca09167bd7ab40f60c0adb31fe225d9f0620dd79
diff --git a/dual/dual.go b/dual/dual.go index <HASH>..<HASH> 100644 --- a/dual/dual.go +++ b/dual/dual.go @@ -95,13 +95,14 @@ func (dht *DHT) FindProvidersAsync(ctx context.Context, key cid.Cid, count int) outCh := make(chan peer.AddrInfo) wanCh := dht.WAN.FindProvidersAsync(reqCtx, key, count) lanCh := dht.LAN.FindProvidersAsync(reqCtx, key, count) + zeroCount := (count == 0) go func() { defer cancel() defer close(outCh) found := make(map[peer.ID]struct{}, count) var pi peer.AddrInfo - for count > 0 && (wanCh != nil || lanCh != nil) { + for (zeroCount || count > 0) && (wanCh != nil || lanCh != nil) { var ok bool select { case pi, ok = <-wanCh:
fix bug in count=0 findProviders
libp2p_go-libp2p-kad-dht
train
go
c5be50392355de784a23d3beefea0a1fab0be839
diff --git a/src/dna-create.js b/src/dna-create.js index <HASH>..<HASH> 100644 --- a/src/dna-create.js +++ b/src/dna-create.js @@ -35,10 +35,19 @@ function extend(superScope, subScope) { let _subScope = (typeof subScope !== 'function') ? createFunctionClass(subScope) : subScope; - let Ctr = createFunctionClass({}); + let Ctr = function() {}; inherit(Ctr, _superScope); - define(Ctr, _subScope.prototype); - _subScope.prototype = Ctr.prototype; + define( + Ctr, + _subScope.prototype, + Object.getOwnPropertyNames(_subScope) + .map((key) => { + let desc = Object.getOwnPropertyDescriptor(_subScope, key); + desc.key = key; + return desc; + }) + ); + return Ctr; } /** @@ -68,7 +77,7 @@ See https://github.com/Chialab/dna/wiki/Deprecating-%60DNA.create%60.` if (typeof scope === 'undefined') { throw new Error('Missing prototype'); } - extend(baseComponent, scope); + scope = extend(baseComponent, scope); for (let k in scope.prototype) { if (scope.prototype.hasOwnProperty(k)) { let callbacks = [
fix: better es6-classes integration in deprecated `create` method
chialab_dna
train
js
39d7ab46761abca85ab392cfb24aa9032363aff7
diff --git a/lib/thinking_sphinx/capistrano/v3.rb b/lib/thinking_sphinx/capistrano/v3.rb index <HASH>..<HASH> 100644 --- a/lib/thinking_sphinx/capistrano/v3.rb +++ b/lib/thinking_sphinx/capistrano/v3.rb @@ -1,7 +1,7 @@ namespace :load do task :defaults do set :thinking_sphinx_roles, :db - set :thinking_sphinx_rails_env, -> { fetch(:stage) } + set :thinking_sphinx_rails_env, -> { fetch(:rails_env) || fetch(:stage) } end end
Default the Capistrano TS Rails environment to rails_env, fall back to stage.
pat_thinking-sphinx
train
rb
b534e9cf9a7befaeedddb5aae16dbdd23edebb97
diff --git a/views/mdc/assets/js/config.js b/views/mdc/assets/js/config.js index <HASH>..<HASH> 100644 --- a/views/mdc/assets/js/config.js +++ b/views/mdc/assets/js/config.js @@ -6,6 +6,7 @@ export default new VConfig({ flatpickr: { altInput: true, disableMobile: true, + clickOpens: false, }, }, },
Add missing configuration option It seems that the addition of this flatpicker configuration option got accidentally discarded during a merge/rebase
rx_presenters
train
js
6cb4ec2f17a580491450741fe2c1987d73deafe4
diff --git a/config/routes.rb b/config/routes.rb index <HASH>..<HASH> 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,12 +25,6 @@ Spree::Core::Engine.add_routes do get '/checkout/registration' => 'checkout#registration', :as => :checkout_registration put '/checkout/registration' => 'checkout#update_registration', :as => :update_checkout_registration - resource :session do - member do - get :nav_bar - end - end - resource :account, :controller => 'users' namespace :admin do diff --git a/lib/controllers/frontend/spree/user_sessions_controller.rb b/lib/controllers/frontend/spree/user_sessions_controller.rb index <HASH>..<HASH> 100644 --- a/lib/controllers/frontend/spree/user_sessions_controller.rb +++ b/lib/controllers/frontend/spree/user_sessions_controller.rb @@ -41,10 +41,6 @@ class Spree::UserSessionsController < Devise::SessionsController end end - def nav_bar - render :partial => 'spree/shared/nav_bar' - end - private def accurate_title Spree.t(:login)
Remove unsued and broken route. There is no Spree::SessionsController anywhere. This does not currently work at all. #legacycode Fixes #<I>
spree_spree_auth_devise
train
rb,rb
872e3e5547982918ee2e3b0c536580a30434b86b
diff --git a/http/json.go b/http/json.go index <HASH>..<HASH> 100644 --- a/http/json.go +++ b/http/json.go @@ -30,6 +30,16 @@ const ( StatusUnprocessableEntity = 422 ) +// A JsonError represents an error returned by JSON-based API. +type JsonError struct { + // Error code. + Code int `json:"code,omitempty"` + // The fields which generated this error. + Fields string `json:"fields,omitempty"` + // A message with error details. + Message string `json:"message,omitempty"` +} + // JsonWrite sets response content type to JSON, sets HTTP status and serializes // defined content to JSON format. func JsonWrite(w http.ResponseWriter, status int, content interface{}) {
New type to represent a JSON error
skarllot_raiqub
train
go
2b95606f1d12b39b1701fea99e4d5aee723c9cf9
diff --git a/search.go b/search.go index <HASH>..<HASH> 100644 --- a/search.go +++ b/search.go @@ -40,6 +40,9 @@ func (c *Client) SearchBoards(query string, args Arguments) (boards []*Board, er res := SearchResult{} err = c.Get("search", args, &res) boards = res.Boards + for _, board := range boards { + board.client = c + } return }
re-add client on search endpoint
adlio_trello
train
go
d33c05aa2ff0869b78ae1ab3e3a6664daad7d205
diff --git a/sh.py b/sh.py index <HASH>..<HASH> 100644 --- a/sh.py +++ b/sh.py @@ -398,7 +398,7 @@ class TimeoutException(Exception): self.exit_code = exit_code super(Exception, self).__init__() -SIGNALS_THAT_SHOULD_THROW_EXCEPTION = ( +SIGNALS_THAT_SHOULD_THROW_EXCEPTION = set(( signal.SIGABRT, signal.SIGBUS, signal.SIGFPE, @@ -410,7 +410,7 @@ SIGNALS_THAT_SHOULD_THROW_EXCEPTION = ( signal.SIGSEGV, signal.SIGTERM, signal.SIGSYS, -) +)) # we subclass AttributeError because:
use a set for faster error signal lookups
amoffat_sh
train
py
e5e56f46c1acefb5863d770a2eace05caf4748b9
diff --git a/extra/io-filetransfer.js b/extra/io-filetransfer.js index <HASH>..<HASH> 100644 --- a/extra/io-filetransfer.js +++ b/extra/io-filetransfer.js @@ -178,7 +178,7 @@ module.exports = function (window) { if (!blob instanceof window.Blob) { return Promise.reject('No proper fileobject'); } - if (!url || !url.validateURL()) { + if ((typeof url!=='string') || (url.length===0)) { return Promise.reject('No valid url specified'); }
changed check for valid url: enabled relative urls
itsa_itsa-io
train
js
521b4e40cdeec89463e2a08600ed47c6ac84717e
diff --git a/core/constraints/constraints.go b/core/constraints/constraints.go index <HASH>..<HASH> 100644 --- a/core/constraints/constraints.go +++ b/core/constraints/constraints.go @@ -346,9 +346,9 @@ func ParseWithAliases(args ...string) (cons Value, aliases map[string]string, er if current_name != "" { name = current_name val = current_val - if canonical, ok := rawAliases[current_name]; ok { - aliases[current_name] = canonical - current_name = canonical + if canonical, ok := rawAliases[name]; ok { + aliases[name] = canonical + name = canonical } } else if name != "" { val += " " + current_val
Ensure constraint aliases with spaces are properly expanded This fixes a small typo that triggers an ineffassign linter warning
juju_juju
train
go
7a441301ba21b5e1bda5f0b4bfd041e87efe6548
diff --git a/fitsio/fitslib.py b/fitsio/fitslib.py index <HASH>..<HASH> 100644 --- a/fitsio/fitslib.py +++ b/fitsio/fitslib.py @@ -910,6 +910,7 @@ class FITSHDU: text.append("%sdims: [%s]" % (cspacing,dimstr)) else: + text.append('%srows: %d' % (spacing,self.info['numrows'])) text.append('%scolumn info:' % spacing) cspacing = ' '*4
added number of rows to repr for table columns
esheldon_fitsio
train
py
3ef12dba24f89ceeb06a16d4dfd21a1081f626e2
diff --git a/src/Responses/ResponseService.php b/src/Responses/ResponseService.php index <HASH>..<HASH> 100644 --- a/src/Responses/ResponseService.php +++ b/src/Responses/ResponseService.php @@ -70,8 +70,8 @@ class ResponseService { // Headers foreach ( $response->getHeaders() as $name => $values ) { - foreach ( $values as $value ) { - header( sprintf( '%s: %s', $name, $value ), false ); + foreach ( $values as $i => $value ) { + header( sprintf( '%s: %s', $name, $value ), $i === 0 ); } } }
Override any headers that may have been set by WP that have also been set in the WP Emerge response instead of merging them to avoid duplicate headers like Content-Type
htmlburger_wpemerge
train
php
67f815af058cf0a4dbf1dcea50eec2585cd7ee3a
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -658,8 +658,8 @@ module ActionDispatch recall = options.delete(:_recall) - original_script_name = options.delete(:original_script_name).presence - script_name = options.delete(:script_name).presence || _generate_prefix(options) + original_script_name = options.delete(:original_script_name) + script_name = options.delete(:script_name) || _generate_prefix(options) if script_name && original_script_name script_name = original_script_name + script_name
no need to check for presence, script names can be blank
rails_rails
train
rb
ec50cd493de1d21c62450daba9d9c1c7c8948e37
diff --git a/tests/test-rest-users-controller.php b/tests/test-rest-users-controller.php index <HASH>..<HASH> 100644 --- a/tests/test-rest-users-controller.php +++ b/tests/test-rest-users-controller.php @@ -359,6 +359,13 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { $data = $response->get_data(); $this->assertEquals( 1, count( $data ) ); $this->assertEquals( $lolz, $data[0]['id'] ); + $request = new WP_REST_Request( 'GET', '/wp/v2/users' ); + $request->set_param( 'roles', 'steakisgood' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); + //echo var_dump($data); + $this->assertEquals( 0, count( $data ) ); + $this->assertEquals( array(), $data ); } public function test_get_item() {
Add another test. Adds another test to reflect what happens when a non existent role is searched currently returns empty set.
WP-API_WP-API
train
php
e3815d528ed20b63b90933fd268bb28a76e45411
diff --git a/pkg/crypto/certloader/fswatcher/fswatcher.go b/pkg/crypto/certloader/fswatcher/fswatcher.go index <HASH>..<HASH> 100644 --- a/pkg/crypto/certloader/fswatcher/fswatcher.go +++ b/pkg/crypto/certloader/fswatcher/fswatcher.go @@ -343,11 +343,13 @@ func (w *Watcher) loop() { } } case err := <-w.watcher.Errors: - log.WithError(err).Debug("Received fsnotify error") + log.WithError(err).Debug("Received fsnotify error while watching") w.Errors <- err case <-w.stop: err := w.watcher.Close() - log.WithError(err).Debug("Received fsnotify error on close") + if err != nil { + log.WithError(err).Warn("Received fsnotify error on close") + } close(w.Events) close(w.Errors) return
certloader/fswatcher: fsnotify log refactoring Only log fsnotify error on close when there is one, and at the warn level rather than debug.
cilium_cilium
train
go
a6ddc92235adb2f4353dfec1286850ebbe48a800
diff --git a/lib/rubycritic/cli/options.rb b/lib/rubycritic/cli/options.rb index <HASH>..<HASH> 100644 --- a/lib/rubycritic/cli/options.rb +++ b/lib/rubycritic/cli/options.rb @@ -24,9 +24,9 @@ module RubyCritic file_hash = file_options.to_h argv_hash = argv_options.to_h - file_hash.merge(argv_hash) { |_, file_option, argv_option| + file_hash.merge(argv_hash) do |_, file_option, argv_option| argv_option.nil? ? file_option : argv_option - } + end end end end
Switch to do-end style block to make rubocop happy.
whitesmith_rubycritic
train
rb
033bf7d535000e24b348116381ed54a9098c8df1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -80,7 +80,6 @@ function Hyperdrive (storage, key, opts) { } function update () { - self.version = self.tree.version self.emit('update') }
remove legacy version setter (#<I>)
mafintosh_hyperdrive
train
js
4f1c49965455e6231bf58c985c1b9dc395d6e9ef
diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/LiteralInterpreter.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/LiteralInterpreter.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/sql/planner/LiteralInterpreter.java +++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/LiteralInterpreter.java @@ -20,6 +20,7 @@ import com.facebook.presto.metadata.Signature; import com.facebook.presto.operator.scalar.VarbinaryFunctions; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.block.Block; +import com.facebook.presto.spi.type.CharType; import com.facebook.presto.spi.type.Decimals; import com.facebook.presto.spi.type.StandardTypes; import com.facebook.presto.spi.type.Type; @@ -180,6 +181,11 @@ public final class LiteralInterpreter return new Cast(new StringLiteral(value.toStringUtf8()), type.getDisplayName(), false, true); } + if (type instanceof CharType) { + StringLiteral stringLiteral = new StringLiteral(((Slice) object).toStringUtf8()); + return new Cast(stringLiteral, type.getDisplayName(), false, true); + } + if (type.equals(BOOLEAN)) { return new BooleanLiteral(object.toString()); }
Construct "proper literal" for CHAR in LiteralInterpreter.toExpression "proper literal" means just a literal or a literal wrapped with a CAST. Previously, `toExpression(..., CHAR(x))` would return a "magic literal function call" which is hard to analyze.
prestodb_presto
train
java
38010c9f644a805410953f503e7aca99ecca34c8
diff --git a/lib/embiggen/http_client.rb b/lib/embiggen/http_client.rb index <HASH>..<HASH> 100644 --- a/lib/embiggen/http_client.rb +++ b/lib/embiggen/http_client.rb @@ -2,7 +2,7 @@ require 'embiggen/error' require 'net/http' module Embiggen - class GetWithoutResponse < ::Net::HTTPRequest + class GetWithoutBody < ::Net::HTTPRequest METHOD = 'GET'.freeze REQUEST_HAS_BODY = false RESPONSE_HAS_BODY = false @@ -30,7 +30,7 @@ module Embiggen private def request(timeout) - request = GetWithoutResponse.new(uri.request_uri) + request = GetWithoutBody.new(uri.request_uri) http.open_timeout = timeout http.read_timeout = timeout
Use clearer class name in HTTP client We create our own special HTTP request subclass in order to send a GET request without reading the body but the class name misleadingly says it is without response (which isn't true). Rename the class to GetWithoutBody which hopefully makes this a little clearer.
altmetric_embiggen
train
rb
1c0f7f552c56ab5af0ce572abcaee9a43c28dcd8
diff --git a/lexer.go b/lexer.go index <HASH>..<HASH> 100644 --- a/lexer.go +++ b/lexer.go @@ -70,7 +70,7 @@ func isAlphanumeric(r rune) bool { func isKeyChar(r rune) bool { // "Keys start with the first non-whitespace character and end with the last // non-whitespace character before the equals sign." - return !(isSpace(r) || r == '\n' || r == eof || r == '=') + return !(isSpace(r) || r == '\r' || r == '\n' || r == eof || r == '=') } func isDigit(r rune) bool {
\r is not a keychar on Windows
pelletier_go-toml
train
go
ec06acb5831675fb0a8e4320b70298ae5cb187dd
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -8,7 +8,9 @@ use Cake\Log\Log; require_once 'vendor/autoload.php'; // Path constants to a few helpful things. -define('DS', DIRECTORY_SEPARATOR); +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} define('ROOT', dirname(__DIR__) . DS); define('CAKE_CORE_INCLUDE_PATH', ROOT . 'vendor' . DS . 'cakephp' . DS . 'cakephp'); define('CORE_PATH', ROOT . 'vendor' . DS . 'cakephp' . DS . 'cakephp' . DS);
Don't define DS unless it's undefined
davidyell_CakePHP3-Proffer
train
php
d8ec75d90f2eed8a11373e4e79c0355476d1d4fe
diff --git a/ezp/Persistence/Storage/Legacy/RepositoryHandler.php b/ezp/Persistence/Storage/Legacy/RepositoryHandler.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Storage/Legacy/RepositoryHandler.php +++ b/ezp/Persistence/Storage/Legacy/RepositoryHandler.php @@ -277,6 +277,7 @@ class RepositoryHandler implements HandlerInterface $this->contentGateway = new Content\Gateway\EzcDatabase( $this->getDatabase(), new Content\Gateway\EzcDatabase\QueryBuilder( $this->getDatabase() ), + $this->contentLanguageHandler(), $this->getLanguageMaskGenerator() ); }
Adapted repository to inject language handler in content gateway
ezsystems_ezpublish-kernel
train
php
b0870b0df527dd058e13671c23bde8b4534ccc2b
diff --git a/app/jobs/change_manager/begin_change.rb b/app/jobs/change_manager/begin_change.rb index <HASH>..<HASH> 100644 --- a/app/jobs/change_manager/begin_change.rb +++ b/app/jobs/change_manager/begin_change.rb @@ -1,11 +1,9 @@ require 'yaml' module ChangeManager - class BeginChange - def self.queue - :change - end + class ProcessChangeJob < ActiveJob::Base + queue_as :default - def self.perform(change_id) + def perform(change_id) config ||= YAML.load_file(File.join(Rails.root, 'config/change_manager_config.yml')) config['manager_class'].constantize.process_change(change_id) end diff --git a/app/services/change_manager/manager.rb b/app/services/change_manager/manager.rb index <HASH>..<HASH> 100644 --- a/app/services/change_manager/manager.rb +++ b/app/services/change_manager/manager.rb @@ -3,7 +3,7 @@ module ChangeManager def queue_change(owner, change_type, context, target) change_id = Change.new_change(owner, change_type, context, target) - Resque.enqueue_in(15.minutes, ChangeManager::BeginChange, change_id) + Resque.enqueue_in(15.minutes, ChangeManager::ProcessChangeJob, change_id) end def process_change(change_id)
refactor begin_change job to use ActiveJob framework
lawhorkl_change_manager
train
rb,rb
8c07a662ebee43021e05442e26aea12ac70795fe
diff --git a/src/main/java/net/theblackchamber/crypto/util/KeystoreUtils2.java b/src/main/java/net/theblackchamber/crypto/util/KeystoreUtils2.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/theblackchamber/crypto/util/KeystoreUtils2.java +++ b/src/main/java/net/theblackchamber/crypto/util/KeystoreUtils2.java @@ -53,6 +53,7 @@ import com.google.crypto.tink.JsonKeysetReader; import com.google.crypto.tink.JsonKeysetWriter; import com.google.crypto.tink.KeysetHandle; import com.google.crypto.tink.aead.AeadKeyTemplates; +import com.google.crypto.tink.aead.AesGcmKeyManager; import com.google.crypto.tink.config.TinkConfig; /** @@ -82,7 +83,7 @@ public class KeystoreUtils2 { } TinkConfig.register(); KeysetHandle keysetHandle = KeysetHandle.generateNew( - AeadKeyTemplates.AES256_GCM); + AesGcmKeyManager.aes256GcmTemplate()); CleartextKeysetHandle.write(keysetHandle, JsonKeysetWriter.withFile(config.getKeyStoreFile()));
stopped using deprecated method of keygen
TheBlackChamber_commons-encryption
train
java
2a0fa94fcac63f754f6b58e03b090d6a0d1fdd28
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,12 @@ from distutils.core import setup -version = '0.2.2' + +exec(open('mocpy/version.py').read()) + setup(name='MOCPy', - version=version, + version=__version__, description='MOC parsing and manipulation in Python', author='Thomas Boch', author_email='thomas.boch@astro.unistra.fr',
version is read from version.py
cds-astro_mocpy
train
py
5c9725aaa3e46804b48cd34eabd8edd0b110923c
diff --git a/juju/unit.py b/juju/unit.py index <HASH>..<HASH> 100644 --- a/juju/unit.py +++ b/juju/unit.py @@ -119,7 +119,7 @@ class Unit(model.ModelEntity): if self.public_address is None: await self.model.block_until( lambda: self.public_address, - timeout=60) + timeout=timeout) except jasyncio.TimeoutError: return None return self.public_address
Small patch to thread the timeout arg
juju_python-libjuju
train
py
39a709038e8cca8cc022283ff3d8483ca9914bab
diff --git a/library/CM/Model/Location/City.php b/library/CM/Model/Location/City.php index <HASH>..<HASH> 100644 --- a/library/CM/Model/Location/City.php +++ b/library/CM/Model/Location/City.php @@ -116,7 +116,7 @@ class CM_Model_Location_City extends CM_Model_Location_Abstract { 'name' => array('type' => 'string'), 'lat' => array('type' => 'float', 'optional' => true), 'lon' => array('type' => 'float', 'optional' => true), - '_maxmind' => array('type' => 'string', 'optional' => true), + '_maxmind' => array('type' => 'int', 'optional' => true), )); }
Fixed city model schema - _maxmind is an integer for cities, not a string like for states.
cargomedia_cm
train
php
0e8ddc5ef2980189e1fed5df32117f25afee3b36
diff --git a/server/webapp/WEB-INF/rails.new/app/assets/javascripts/dashboard_global.js b/server/webapp/WEB-INF/rails.new/app/assets/javascripts/dashboard_global.js index <HASH>..<HASH> 100644 --- a/server/webapp/WEB-INF/rails.new/app/assets/javascripts/dashboard_global.js +++ b/server/webapp/WEB-INF/rails.new/app/assets/javascripts/dashboard_global.js @@ -2,7 +2,7 @@ function context_path(path_info) { if (path_info && path_info.startsWith(contextPath)) { return path_info; } - const pathSeparator = (contextPath.endsWith("/") || path_info.startsWith("/") ? "" : "/"); + var pathSeparator = (contextPath.endsWith("/") || path_info.startsWith("/") ? "" : "/"); return contextPath + pathSeparator + path_info; }
Changing const to var as it is not supported in old js
gocd_gocd
train
js
30c4dd020a06b00d96ca3fc6c58915a8ba537f1e
diff --git a/lib/rack-cas/configuration.rb b/lib/rack-cas/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/rack-cas/configuration.rb +++ b/lib/rack-cas/configuration.rb @@ -1,6 +1,6 @@ module RackCAS class Configuration - SETTINGS = [:server_url, :session_store, :exclude_path, :exclude_paths, :extra_attributes_filter, :verify_ssl_cert, :renew, :use_saml_validation] + SETTINGS = [:fake, :server_url, :session_store, :exclude_path, :exclude_paths, :extra_attributes_filter, :verify_ssl_cert, :renew, :use_saml_validation] SETTINGS.each do |setting| attr_accessor setting diff --git a/spec/rack/cas_spec.rb b/spec/rack/cas_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rack/cas_spec.rb +++ b/spec/rack/cas_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Rack::CAS do let(:server_url) { 'http://example.com/cas' } - let(:app_options) { {} } + let(:app_options) { {'fake' => false} } let(:ticket) { 'ST-0123456789ABCDEFGHIJKLMNOPQRS' } def app
Allow for explicit passing of 'config.rack_cas.fake = false' when setting up Rails environment.
biola_rack-cas
train
rb,rb
5f51ed1c2cc0a7e56c1e458bc475584ad127ce7b
diff --git a/tomodachi/importer.py b/tomodachi/importer.py index <HASH>..<HASH> 100644 --- a/tomodachi/importer.py +++ b/tomodachi/importer.py @@ -17,6 +17,10 @@ class ServiceImporter(object): try: sys.path.insert(0, cwd) sys.path.insert(0, os.path.dirname(os.path.dirname(file_path))) + if file_path.endswith('.py') and not os.path.isfile(file_path): + raise OSError('No such service file') + elif not file_path.endswith('.py') and not os.path.isfile('{}.py'.format(file_path)): + raise OSError('No such service file') try: spec = importlib.util.find_spec('.{}'.format(file_path.rsplit('/', 1)[1])[:-3], package=os.path.dirname(file_path).rsplit('/', 1)[1]) # type: Any if not spec:
More explainable error if tomodachi tries to import directory as a service
kalaspuff_tomodachi
train
py
98b0c0ffc2c1d6407d349db6f4b1cfcfa0172a5a
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java index <HASH>..<HASH> 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java @@ -47,11 +47,13 @@ public interface IssueQueryResult { /** * Returns the rule associated to the given issue. */ + @Deprecated Rule rule(Issue issue); /** * The rules involved in the paginated {@link #issues()}. */ + @Deprecated Collection<Rule> rules(); Component component(Issue issue); @@ -69,23 +71,27 @@ public interface IssueQueryResult { Collection<Component> projects(); @CheckForNull + @Deprecated ActionPlan actionPlan(Issue issue); /** * The action plans involved in the paginated {@link #issues()}. */ + @Deprecated Collection<ActionPlan> actionPlans(); /** * The users involved in the paginated {@link #issues()}, for example people who added a comment, reported an issue * or are assigned to issues. */ + @Deprecated Collection<User> users(); /** * Returns the user with the given login. Users that are not returned by {@link #users()} are ignored. */ @CheckForNull + @Deprecated User user(String login); /**
SONAR-<I> - Deprecated methods not used in Issue page anymore
SonarSource_sonarqube
train
java
b3381d6daece94a7e20cbc6168e39f17fa488e91
diff --git a/django_q/tests/test_cluster.py b/django_q/tests/test_cluster.py index <HASH>..<HASH> 100644 --- a/django_q/tests/test_cluster.py +++ b/django_q/tests/test_cluster.py @@ -229,7 +229,7 @@ def test_async(broker, admin_user): deleted_group = delete_group('test_j', tasks=True) assert deleted_group is None or deleted_group[0] == 0 # Django 1.9 deleted_group = result_j.group_delete(tasks=True) - assert delete_group is None or deleted_group[0] == 0 # Django 1.9 + assert deleted_group is None or deleted_group[0] == 0 # Django 1.9 # task k should not have been saved assert fetch(k) is None assert fetch(k, 100) is None
removes root imports for django <I> typo in test
Koed00_django-q
train
py
5f92fc02f603ff8895da8d49008b283121738f1c
diff --git a/src/raven.js b/src/raven.js index <HASH>..<HASH> 100644 --- a/src/raven.js +++ b/src/raven.js @@ -302,7 +302,7 @@ function normalizeFrame(frame) { while (i--) normalized[keys[i]] = context[i]; } - normalized.in_app = !/(Raven|TraceKit)\./.test(normalized['function']); + // normalized.in_app = !/(Raven|TraceKit)\./.test(normalized['function']); return normalized; } diff --git a/test/raven.test.js b/test/raven.test.js index <HASH>..<HASH> 100644 --- a/test/raven.test.js +++ b/test/raven.test.js @@ -158,7 +158,7 @@ describe('globals', function() { pre_context: ['line1'], context_line: 'line2', post_context: ['line3'], - in_app: true + // in_app: true }); }); @@ -179,7 +179,7 @@ describe('globals', function() { lineno: 10, colno: 11, 'function': 'lol', - in_app: true + // in_app: true }); }); });
Bail on the in_app checking for now. It was terrible
getsentry_sentry-javascript
train
js,js
6db71242fd35ae9589e04957544e89ff3e904e91
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -3092,7 +3092,7 @@ function get_component_string($component, $contextlevel) { break; case CONTEXT_BLOCK: - $string = get_string('blockname', 'block_'.$component.'.php'); + $string = get_string('blockname', 'block_'.basename($component)); break; default:
MDL-<I> fixed block get_string, patch by Mark Nielsen
moodle_moodle
train
php
2745c0ba2027d2f7db04e8fa041a828c14ed7cb1
diff --git a/django_tablib/admin.py b/django_tablib/admin.py index <HASH>..<HASH> 100644 --- a/django_tablib/admin.py +++ b/django_tablib/admin.py @@ -11,6 +11,7 @@ from .base import mimetype_map class TablibAdmin(admin.ModelAdmin): change_list_template = 'tablib/change_list.html' formats = [] + headers = None export_filename = 'export' def __init__(self, *args, **kwargs): @@ -47,7 +48,7 @@ class TablibAdmin(admin.ModelAdmin): raise Http404 queryset = self.get_tablib_queryset(request) filename = datetime.datetime.now().strftime(self.export_filename) - return export(request, queryset=queryset, model=self.model, format=format, filename=filename) + return export(request, queryset=queryset, model=self.model, headers=self.headers, format=format, filename=filename) def get_tablib_queryset(self, request): cl = ChangeList(request,
allow customiztion of headers in TablibAdmin
joshourisman_django-tablib
train
py
5f340482d004f123f8cb704fb1b2295e93921bb2
diff --git a/README.rst b/README.rst index <HASH>..<HASH> 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Python Monero module A comprehensive Python module for handling Monero cryptocurrency. -* release 0.5 +* release 0.5.1 * open source: https://github.com/monero-ecosystem/monero-python * works with Monero 0.12.x and `the latest source`_ (at least we try to keep up) * Python 2.x and 3.x compatible diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,9 +55,9 @@ author = 'Michal Salaban' # built documents. # # The short X.Y version. -version = '0.5' +version = '0.5.1' # The full version, including alpha/beta/rc tags. -release = '0.5' +release = '0.5.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/monero/__init__.py b/monero/__init__.py index <HASH>..<HASH> 100644 --- a/monero/__init__.py +++ b/monero/__init__.py @@ -1,3 +1,3 @@ from . import address, account, daemon, wallet, numbers, prio, wordlists, seed -__version__ = '0.5' +__version__ = '0.5.1'
Bump up to <I>
monero-ecosystem_monero-python
train
rst,py,py
5f540e9ac7b9ea4f5b6115d2e71e45f5b348ee24
diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index <HASH>..<HASH> 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -56,12 +56,6 @@ class Chip: raise RuntimeError('BLINKA_MCP2221 environment variable ' + \ 'set, but no MCP2221 device found') if os.environ.get('BLINKA_NOVA'): - # Check for Nova connection - from adafruit_blinka.microcontroller.nova import Connection - binho = Connection.getInstance() - if binho is None: - raise RuntimeError('BLINKA_NOVA environment variable ' + \ - 'set, but no NOVA device found') return BINHO platform = sys.platform
Remove circular dependency with Blinka. Connection will be checked in blinka code already.
adafruit_Adafruit_Python_PlatformDetect
train
py
e37420899bb18e258eaabf10900c3a3cd4b96523
diff --git a/txmongo/connection.py b/txmongo/connection.py index <HASH>..<HASH> 100755 --- a/txmongo/connection.py +++ b/txmongo/connection.py @@ -283,7 +283,7 @@ class ConnectionPool(object): return df @defer.inlineCallbacks - def authenticate(self, database, username, password, mechanism='DEFAULT'): + def authenticate(self, database, username, password, mechanism="DEFAULT"): try: yield defer.gatherResults( [connection.authenticate(database, username, password, mechanism) diff --git a/txmongo/protocol.py b/txmongo/protocol.py index <HASH>..<HASH> 100644 --- a/txmongo/protocol.py +++ b/txmongo/protocol.py @@ -495,11 +495,11 @@ class MongoProtocol(MongoServerProtocol, MongoClientProtocol): yield self.__auth_lock.acquire() try: - if mechanism == 'MONGODB-CR': + if mechanism == "MONGODB-CR": auth_func = self.authenticate_mongo_cr - elif mechanism == 'SCRAM-SHA-1': + elif mechanism == "SCRAM-SHA-1": auth_func = self.authenticate_scram_sha1 - elif mechanism == 'DEFAULT': + elif mechanism == "DEFAULT": if self.max_wire_version >= 3: auth_func = self.authenticate_scram_sha1 else:
Quotes changed to double ones for multichar strings
twisted_txmongo
train
py,py
10f20597d6ef3a7dad9f8eb7a819a88c2d4752d9
diff --git a/conan/test/packager_test.py b/conan/test/packager_test.py index <HASH>..<HASH> 100644 --- a/conan/test/packager_test.py +++ b/conan/test/packager_test.py @@ -1,4 +1,5 @@ import os +import sys import unittest from collections import defaultdict @@ -203,6 +204,7 @@ class AppTest(unittest.TestCase): self.assertIn('os=os4', self.runner.calls[20]) self.assertIn('os=os6', self.runner.calls[21]) + @unittest.skipUnless(sys.platform.startswith("win"), "Requires Windows") def test_msvc(self): self.packager = ConanMultiPackager("--build missing -r conan.io", "lasote", "mychannel", @@ -210,10 +212,11 @@ class AppTest(unittest.TestCase): visual_versions=[15]) self.packager.add_common_builds() self.packager.run() - + self.assertIn("vcvarsall.bat", self.runner.calls[1]) self.assertIn("vcvarsall.bat", self.runner.calls[2]) + @unittest.skipUnless(sys.platform.startswith("win"), "Requires Windows") def test_msvc_no_precommand(self): self.packager = ConanMultiPackager("--build missing -r conan.io", "lasote", "mychannel",
Skipping new tests if not running on Windows. vcvars_command function throws an exception on non-Windows platforms.
conan-io_conan-package-tools
train
py
7a5fabf59d838c3e70cc24b38ddc41db773504ce
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java index <HASH>..<HASH> 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -200,7 +200,7 @@ public class EmbeddedMongoAutoConfiguration { * {@code embeddedMongoServer} bean. */ @Configuration - @ConditionalOnClass({MongoClient.class, MongoClientFactoryBean.class}) + @ConditionalOnClass({ MongoClient.class, MongoClientFactoryBean.class }) protected static class EmbeddedMongoDependencyConfiguration extends MongoClientDependsOnBeanFactoryPostProcessor {
Polish "Add condition on MongoClientFactoryBean" Closes gh-<I>
spring-projects_spring-boot
train
java
449863fcfefee64f86b033d1b50665447edac14c
diff --git a/pymc/database/sqlite.py b/pymc/database/sqlite.py index <HASH>..<HASH> 100644 --- a/pymc/database/sqlite.py +++ b/pymc/database/sqlite.py @@ -57,17 +57,15 @@ class Trace(object): pass try: - value = self._obj.value.copy() # I changed str(x) to '%f'%x to solve a bug appearing due to # locale settings. In french for instance, str prints a comma # instead of a colon to indicate the decimal, which confuses # the database into thinking that there are more values than there # is. A better solution would be to use another delimiter than the # comma. -DH - valstring = ', '.join(['%f'%x for x in value]) - except AttributeError: - value = self._obj.value - valstring = str(value) + valstring = ', '.join(['%f'%x for x in self._obj.value]) + except: + valstring = str(self._obj.value) # Add value to database self.db.cur.execute("INSERT INTO %s (recid, trace, %s) values (NULL, %s, %s)" % (self.name, ' ,'.join(['v%s' % (x+1) for x in range(size)]), self.current_trace, valstring))
tentatively fixed ticket #<I> but testing is needed to make sure it works. git-svn-id: <URL>
pymc-devs_pymc
train
py
b3e17aa67b6ca8d4054de25c8468289a10749271
diff --git a/contractcourt/contract_resolvers.go b/contractcourt/contract_resolvers.go index <HASH>..<HASH> 100644 --- a/contractcourt/contract_resolvers.go +++ b/contractcourt/contract_resolvers.go @@ -580,7 +580,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) { // To wrap this up, we'll wait until the second-level transaction has // been spent, then fully resolve the contract. spendNtfn, err := h.Notifier.RegisterSpendNtfn( - &h.htlcResolution.ClaimOutpoint, h.broadcastHeight, true, + &h.htlcResolution.ClaimOutpoint, h.broadcastHeight, false, ) if err != nil { return nil, err
contractcourt/contract_resolvers: make second level htlcSuccessResolver wait for conf
lightningnetwork_lnd
train
go
b7ee92210624d62b40f98cea566614522b9f61ff
diff --git a/console/demos.py b/console/demos.py index <HASH>..<HASH> 100644 --- a/console/demos.py +++ b/console/demos.py @@ -223,7 +223,7 @@ if __name__ == '__main__': print(' FG t_deadbf: ', fgall.t_deadbf('▉▉▉▉▉'), fge.t_deadbf('▉▉▉▉▉'), - fgb.t_deadbf('▉▉▉▉▉'), + fgb.t_deadbf('▉▉▉▉▉'), fx.end, # win bug sep='') else: print(' Term support not available.')
fix issue on windows with colorama.
mixmastamyk_console
train
py
0cf9887fa07ba5158a2087fcad356e9f4838cc72
diff --git a/taxtastic/subcommands/taxtable.py b/taxtastic/subcommands/taxtable.py index <HASH>..<HASH> 100644 --- a/taxtastic/subcommands/taxtable.py +++ b/taxtastic/subcommands/taxtable.py @@ -63,13 +63,15 @@ def replace_no_rank(ranks): return ranks -def as_taxtable_rows(rows): +def as_taxtable_rows(rows, seen=None): + seen = seen or {} + __, __, tids, pids, ranks, names = [list(tup) for tup in zip(*rows)] ranks = replace_no_rank(ranks) ranks_out = ranks[:] tax_rows = [] - while tids: + while tids and tids[-1] not in seen: d = dict(zip(ranks, tids)) d['tax_id'] = tids.pop(-1) d['parent_id'] = pids.pop(-1) @@ -177,7 +179,7 @@ def action(args): all_ranks = set() taxtable = {} for tax_id, grp in groupby(rows, lambda row: row[0]): - ranks, tax_rows = as_taxtable_rows(grp) + ranks, tax_rows = as_taxtable_rows(grp, seen=taxtable) taxtable.update(dict(tax_rows)) all_ranks |= set(ranks)
as_taxtable_rows skips tax_ids that have been seen
fhcrc_taxtastic
train
py
3bbde1977a3d53224c02898bced98f84a355e445
diff --git a/lib/devise_cas_authenticatable/model.rb b/lib/devise_cas_authenticatable/model.rb index <HASH>..<HASH> 100644 --- a/lib/devise_cas_authenticatable/model.rb +++ b/lib/devise_cas_authenticatable/model.rb @@ -27,7 +27,7 @@ module Devise find(:first, :conditions => conditions) end - resource = new(conditions) if (resource.nil? and ( resource.respond_to? :cas_create_user? ? resource.cas_create_user? : ::Devise.cas_create_user? ) ) + resource = new(conditions) if (resource.nil? and should_create_cas_users?) return nil unless resource if resource.respond_to? :cas_extra_attributes= @@ -37,6 +37,11 @@ module Devise resource end end + + private + def should_create_cas_users? + respond_to?(:cas_create_user?) ? cas_create_user? : ::Devise.cas_create_user? + end end end end
Refactor a little, fix a parenthesis ambiguity bug
nbudin_devise_cas_authenticatable
train
rb
b79b3aac339fa81eab2ec8d6c3b2477ed529a3cb
diff --git a/lib/ronin/database/migrations/create_arch_table.rb b/lib/ronin/database/migrations/create_arch_table.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/database/migrations/create_arch_table.rb +++ b/lib/ronin/database/migrations/create_arch_table.rb @@ -27,9 +27,9 @@ module Ronin up do create_table :ronin_arches do column :id, Integer, :serial => true - column :name, String, :required => true - column :endian, String, :required => true - column :address_length, Integer, :required => true + column :name, String, :not_null => true + column :endian, String, :not_null => true + column :address_length, Integer, :not_null => true end create_index :ronin_arches, :name, :unique => true
Use :not_null instead of :required (for now atleast).
ronin-ruby_ronin
train
rb
ab3972549b34d20803ea62e9030fd1b2502bc1fe
diff --git a/tests/test_binding.py b/tests/test_binding.py index <HASH>..<HASH> 100755 --- a/tests/test_binding.py +++ b/tests/test_binding.py @@ -111,6 +111,9 @@ class TestResponseReader(BindingTestCase): self.assertTrue(response.empty) def test_readinto_memoryview(self): + import sys + if sys.version_info < (2, 7, 0): + return # memoryview is new to Python 2.7 txt = "Checking readinto works as expected" response = binding.ResponseReader(StringIO(txt)) arr = bytearray(10)
Fixed bug in test_binding.py: TestResponseReader.test_readinto_memoryview This test no longer runs under Python <I> because the builtin type memoryview was introduced in Python <I>.
splunk_splunk-sdk-python
train
py
7f52caf0a3e5d347bdb1ffc8a0c4c665d1f04b2d
diff --git a/lib/specinfra/command/freebsd.rb b/lib/specinfra/command/freebsd.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/command/freebsd.rb +++ b/lib/specinfra/command/freebsd.rb @@ -6,7 +6,11 @@ module SpecInfra end def check_installed(package, version=nil) - "pkg_info -Ix #{escape(package)}" + if version + "pkg_info -I #{escape(package)}-#{escape(version)}" + else + "pkg_info -Ix #{escape(package)}" + end end def check_listening(port)
Add version check to `check_installed` command
mizzy_specinfra
train
rb
a88432cc2831736a897ce5374734f80e5ad3c8fc
diff --git a/authority/admin.py b/authority/admin.py index <HASH>..<HASH> 100644 --- a/authority/admin.py +++ b/authority/admin.py @@ -135,6 +135,7 @@ class PermissionAdmin(admin.ModelAdmin): if gfk.fk_field == db_field.name: kwargs['widget'] = GenericForeignKeyRawIdWidget( gfk.ct_field, self.admin_site._registry.keys()) + break return super(PermissionAdmin, self).formfield_for_dbfield(db_field, **kwargs) def queryset(self, request):
Break out of for-loop when field found Matching the `return` statement that the previous commit replaced.
jazzband_django-authority
train
py
2d3664f71188d3156b9be75c2e6f689348faa069
diff --git a/benchexec/model.py b/benchexec/model.py index <HASH>..<HASH> 100644 --- a/benchexec/model.py +++ b/benchexec/model.py @@ -183,6 +183,18 @@ class Benchmark(object): else: self.rlimits[TIMELIMIT] = hardtimelimit + # Check allowed values of limits + def check_limit_is_positive(key, name): + if key in self.rlimits and self.rlimits[key] <= 0: + sys.exit('{} limit {} is invalid, it needs to be a positive number ' + 'or -1 for disabling it.'.format(name, self.rlimits[key])) + + check_limit_is_positive(TIMELIMIT, 'Time') + check_limit_is_positive(SOFTTIMELIMIT, 'Soft time') + check_limit_is_positive(MEMLIMIT, 'Memory') + check_limit_is_positive(CORELIMIT, 'Core') + + # get number of threads, default value is 1 self.num_of_threads = int(rootTag.get("threads")) if ("threads" in keys) else 1 if config.num_of_threads != None:
Reject invalid limit values in benchxec (thanks to Evgeny Novikov for finding and reporting this).
sosy-lab_benchexec
train
py
8157363256b5a2416380c3e572358c6dcba847ea
diff --git a/app/controllers/tuttle/ruby_controller.rb b/app/controllers/tuttle/ruby_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/tuttle/ruby_controller.rb +++ b/app/controllers/tuttle/ruby_controller.rb @@ -4,8 +4,8 @@ module Tuttle class RubyController < ApplicationController def index - # TODO: need better filter for sensitive values. this covers DB-style URLs with passwords. - @filtered_env = ENV.to_hash.tap{ |h| h.each{ |k,_v| h[k] = '--FILTERED--' if /.*_URL$/ =~ k } } + # TODO: need better filter for sensitive values. this covers DB-style URLs with passwords, passwords, and keys + @filtered_env = ENV.to_hash.tap{ |h| h.each{ |k,_v| h[k] = '--FILTERED--' if /.*_(URL|PASSWORD|KEY|KEY_BASE)$/ =~ k } } end end
add some more exclusions to ENV reporting
dgynn_tuttle
train
rb
62e7341c7f6cc1cbbcb8e31bd88311b8b8a903fb
diff --git a/bootstrap.py b/bootstrap.py index <HASH>..<HASH> 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -30,7 +30,7 @@ options.""") parser.add_option('--gui', default=None, help="GUI toolkit: pyqt (for PyQt4) or pyside (for PySide)") parser.add_option('--hide-console', action='store_true', - default=False, help="Hide parent console (Windows only)") + default=False, help="Hide parent console window (Windows only)") parser.add_option('--debug', action='store_true', default=False, help="Run Spyder in debug mode") options, args = parser.parse_args() diff --git a/spyderlib/cli_options.py b/spyderlib/cli_options.py index <HASH>..<HASH> 100644 --- a/spyderlib/cli_options.py +++ b/spyderlib/cli_options.py @@ -31,7 +31,7 @@ def get_options(): parser.add_option('-w', '--workdir', dest="working_directory", default=None, help="Default working directory") parser.add_option('--show-console', action='store_true', default=False, - help="Show parent console (Windows only)") + help="Do not hide parent console window (Windows)") parser.add_option('--multithread', dest="multithreaded", action='store_true', default=False, help="Internal console is executed in another thread "
Improve command line help for Windows parent console This makes it more clear that it is not some Spyder's console, but standard windows console window.
spyder-ide_spyder
train
py,py
6d8e91bf4fff712a6664f7cc64d6329de57ba2e4
diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -289,8 +289,8 @@ class Process * * @return Process The new process * - * @throws \RuntimeException When process can't be launch or is stopped - * @throws \RuntimeException When process is already running + * @throws RuntimeException When process can't be launch or is stopped + * @throws RuntimeException When process is already running * * @see start() */ @@ -317,8 +317,8 @@ class Process * * @return integer The exitcode of the process * - * @throws \RuntimeException When process timed out - * @throws \RuntimeException When process stopped after receiving signal + * @throws RuntimeException When process timed out + * @throws RuntimeException When process stopped after receiving signal */ public function wait($callback = null) {
Fixed PHPDoc Blocks These ```RunTimeExceptions``` are NOT the native ones, therefor the should not be ```\``` in front of them.
symfony_symfony
train
php
bb545f8f269dbfbb19e381a7085efeeada4b173d
diff --git a/lib/veewee/provider/virtualbox/box/helper/version.rb b/lib/veewee/provider/virtualbox/box/helper/version.rb index <HASH>..<HASH> 100644 --- a/lib/veewee/provider/virtualbox/box/helper/version.rb +++ b/lib/veewee/provider/virtualbox/box/helper/version.rb @@ -3,10 +3,12 @@ module Veewee module Virtualbox module BoxCommand + # Return the major/minor/incremental version of VirtualBox. + # For example: 4.1.8_Debianr75467 -> 4.1.8 def vbox_version command="#{@vboxcmd} --version" shell_results=shell_exec("#{command}",{:mute => true}) - version=shell_results.stdout.strip.split('r')[0] + version=shell_results.stdout.strip.split(/[^0-9\.]/)[0] return version end
Fix download of VirtualBox Guest Additions on Debian. `VBoxManage -v` on Debian reports a version number of the form: <I>_Debianr<I> The URL from which to download the VBoxGuestAdditions ISO is derived from the major/minor/incrmemental version numbers, but this was not being correctly parsed from the version reported by VBoxManage.
jedi4ever_veewee
train
rb
011b3d49cbd4d9fad1dd2f6236d5b36fe9c961c5
diff --git a/lib/chef/dsl/recipe.rb b/lib/chef/dsl/recipe.rb index <HASH>..<HASH> 100644 --- a/lib/chef/dsl/recipe.rb +++ b/lib/chef/dsl/recipe.rb @@ -20,6 +20,7 @@ require 'chef/mixin/convert_to_class_name' require 'chef/exceptions' require 'chef/resource_builder' +require 'chef/mixin/shell_out' class Chef module DSL
Missing require - causes missing Constant when files are loaded in unexpected order
chef_chef
train
rb
4100de07c1a054769d11773622ea7ad74809481b
diff --git a/mozilla/gcli/promise.js b/mozilla/gcli/promise.js index <HASH>..<HASH> 100644 --- a/mozilla/gcli/promise.js +++ b/mozilla/gcli/promise.js @@ -17,7 +17,7 @@ define(function(require, exports, module) { var imported = {}; - Components.utils.import("resource://gre/modules/commonjs/promise/core.js", + Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js", imported); exports.defer = imported.Promise.defer;
landjetpack-<I>: Move promise library in moz-central Catchup with change to mozilla-central: Switch users of the promise library to the new location and move tests files.
joewalker_gcli
train
js
3da8ec7e62b060e908899a0c3713f8dc9f228a89
diff --git a/spec/binary/template_spec.rb b/spec/binary/template_spec.rb index <HASH>..<HASH> 100644 --- a/spec/binary/template_spec.rb +++ b/spec/binary/template_spec.rb @@ -1,3 +1,5 @@ +# encoding: US-ASCII + require 'spec_helper' require 'ronin/binary/template' diff --git a/spec/formatting/binary/float_spec.rb b/spec/formatting/binary/float_spec.rb index <HASH>..<HASH> 100644 --- a/spec/formatting/binary/float_spec.rb +++ b/spec/formatting/binary/float_spec.rb @@ -1,3 +1,5 @@ +# encoding: US-ASCII + require 'spec_helper' require 'ronin/formatting/extensions/binary/float' diff --git a/spec/formatting/binary/string_spec.rb b/spec/formatting/binary/string_spec.rb index <HASH>..<HASH> 100644 --- a/spec/formatting/binary/string_spec.rb +++ b/spec/formatting/binary/string_spec.rb @@ -1,3 +1,5 @@ +# encoding: US-ASCII + require 'spec_helper' require 'ronin/formatting/extensions/binary/string'
Add magic encoding comments for any ASCII hex strings.
ronin-ruby_ronin-support
train
rb,rb,rb
32f324db696f62e4fe4b3ab362c33571adfe7d0d
diff --git a/salt/engines/__init__.py b/salt/engines/__init__.py index <HASH>..<HASH> 100644 --- a/salt/engines/__init__.py +++ b/salt/engines/__init__.py @@ -48,6 +48,8 @@ def start_engines(opts, proc_mgr): engine_opts = None fun = '{0}.start'.format(engine) if fun in engines: + start_func = engines[fun] + name = '{0}.Engine({1})'.format(__name__, start_func.__module__) proc_mgr.add_process( Engine, args=( @@ -56,7 +58,8 @@ def start_engines(opts, proc_mgr): engine_opts, funcs, runners - ) + ), + name=name )
Pass a name to allow which engine is being started
saltstack_salt
train
py
80ce61e3f5f187b37e0039d5c6ba4e6afde7a1c2
diff --git a/includes/modules/searchandreplace/class-pb-search.php b/includes/modules/searchandreplace/class-pb-search.php index <HASH>..<HASH> 100644 --- a/includes/modules/searchandreplace/class-pb-search.php +++ b/includes/modules/searchandreplace/class-pb-search.php @@ -52,6 +52,7 @@ class Search { if ( $this->regex ) { // First test that the search and replace strings are valid regex set_error_handler( array( &$this, 'regex_error' ) ); + // @codingStandardsIgnoreLine $valid = @preg_match( $search, '', $matches ); restore_error_handler(); if ( false === $valid ) {
Ignore future coding standards violation
pressbooks_pressbooks
train
php
66394634f51f3e91b0b37dabf04bac73d9f20f37
diff --git a/lib/fog/bluebox/models/blb/lb_applications.rb b/lib/fog/bluebox/models/blb/lb_applications.rb index <HASH>..<HASH> 100644 --- a/lib/fog/bluebox/models/blb/lb_applications.rb +++ b/lib/fog/bluebox/models/blb/lb_applications.rb @@ -1,4 +1,5 @@ require 'fog/core/collection' +require 'fog/bluebox/models/blb/lb_application' module Fog module Bluebox
[bluebox|blb] require model
fog_fog
train
rb
846ae565f974e27033b46860650f8c1fa5f0c04d
diff --git a/chainlet_unittests/test_dataflow/test_iteration.py b/chainlet_unittests/test_dataflow/test_iteration.py index <HASH>..<HASH> 100644 --- a/chainlet_unittests/test_dataflow/test_iteration.py +++ b/chainlet_unittests/test_dataflow/test_iteration.py @@ -99,7 +99,6 @@ class ChainIteration(unittest.TestCase): for _ in range(len(expected)): self.assertEqual(next(chain_next), next(expect_next)) - @unittest.expectedFailure def test_fork_join(self): """Fork and join as `source >> (child_a, child_b) >> join` => [1, 2, ...]""" elements = [Adder(val) for val in (0, -2, 2, 1E6, -1E6)]
flattening of forked chains is now required
maxfischer2781_chainlet
train
py
b4d9d8064adab82aed188ca92dd0240811885ff0
diff --git a/test/unit/remote_partial/builder_test.rb b/test/unit/remote_partial/builder_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/remote_partial/builder_test.rb +++ b/test/unit/remote_partial/builder_test.rb @@ -80,6 +80,12 @@ module RemotePartial end end + def test_stale_at_not_modified_if_unable_to_retrieve + expected = @partial.stale_at + test_build_with_http_error + assert_equal(expected, @partial.reload.stale_at) + end + def assert_expected_file_created(&test) remove_file expected_output_file_name test.call diff --git a/test/unit/remote_partial/partial_test.rb b/test/unit/remote_partial/partial_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/remote_partial/partial_test.rb +++ b/test/unit/remote_partial/partial_test.rb @@ -35,7 +35,7 @@ module RemotePartial def test_stale_at_not_updated_unless_stale test_update_stale_at before = @partial.stale_at - @partial.save + @partial.update_stale_at assert_equal before, @partial.stale_at end
Adds tests to ensure stale_at is not updated if connection fails
warwickshire_remote_partial
train
rb,rb
3a744951f1b86b86662d29cbc29df211d3ecd901
diff --git a/lxd/cluster/connect.go b/lxd/cluster/connect.go index <HASH>..<HASH> 100644 --- a/lxd/cluster/connect.go +++ b/lxd/cluster/connect.go @@ -1,6 +1,7 @@ package cluster import ( + "context" "crypto/tls" "encoding/base64" "encoding/pem" @@ -36,21 +37,10 @@ var ErrCertificateExists error = fmt.Errorf("Certificate already in trust store" func Connect(address string, networkCert *shared.CertInfo, serverCert *shared.CertInfo, r *http.Request, notify bool) (lxd.InstanceServer, error) { // Wait for a connection to the events API first for non-notify connections. if !notify { - connected := false - for i := 0; i < 20; i++ { - listenersLock.Lock() - _, ok := listeners[address] - listenersLock.Unlock() - - if ok { - connected = true - break - } - - time.Sleep(500 * time.Millisecond) - } - - if !connected { + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(10)*time.Second) + defer cancel() + _, err := EventListenerWait(ctx, address) + if err != nil { return nil, fmt.Errorf("Missing event connection with target cluster member") } }
lxd/cluster/connect: Switch Connect to use EventListenerWait
lxc_lxd
train
go
c3a59bee4adbc470fed885aed421bcb275fd64a7
diff --git a/jumeaux/addons/final/aws.py b/jumeaux/addons/final/aws.py index <HASH>..<HASH> 100644 --- a/jumeaux/addons/final/aws.py +++ b/jumeaux/addons/final/aws.py @@ -44,7 +44,8 @@ class Executor(FinalExecutor): "failure_count": Decimal(report.summary.status.failure), "begin_time": report.summary.time.start, "end_time": report.summary.time.end, - "with_zip": self.config.with_zip + "with_zip": self.config.with_zip, + "retry_hash": report.retry_hash } table.put_item(Item=item)
:new: Send retry_hash [aws add-on]
tadashi-aikawa_jumeaux
train
py
ac7c4387ee278d21f39cd8ea9593133a12bda51b
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 @@ -13,7 +13,7 @@ require "factory_girl" require 'webmock/rspec' FactoryGirl.find_definitions - +WebMock.enable! ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), "../") # Requires supporting ruby files with custom matchers and macros, etc, diff --git a/test/lib/generators/abstractor/templates/environments/development.rb b/test/lib/generators/abstractor/templates/environments/development.rb index <HASH>..<HASH> 100644 --- a/test/lib/generators/abstractor/templates/environments/development.rb +++ b/test/lib/generators/abstractor/templates/environments/development.rb @@ -34,4 +34,5 @@ Dummy::Application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + WebMock.disable! end \ No newline at end of file
References #<I> Make sure WebMock does not break the testbed setup.
NUBIC_abstractor
train
rb,rb
6713b1bb191014a7bd7e513cf3f4be20773af771
diff --git a/src/Purekid/Mongodm/MongoDB.php b/src/Purekid/Mongodm/MongoDB.php index <HASH>..<HASH> 100644 --- a/src/Purekid/Mongodm/MongoDB.php +++ b/src/Purekid/Mongodm/MongoDB.php @@ -143,20 +143,15 @@ class MongoDB $config['hostnames'] = 'mongodb://' . $config['hostnames']; } - if (!isset($options)) - { - $options = array(); - } - /* Create connection object, attempt to connect */ - $options['connect'] = false; + $config['connect'] = false; $class = '\MongoClient'; if(!class_exists($class)){ $class = '\MongoDB'; } - $this->_connection = new $class($config['hostnames'], $options); + $this->_connection = new $class($config['hostnames'], $config); /* Try connect */ try {
Ability to pass config to MongoClient
purekid_mongodm
train
php
bc46a7190b4674e8a8c37e4c5d75a7d2407b09b0
diff --git a/lib/metro/scene.rb b/lib/metro/scene.rb index <HASH>..<HASH> 100644 --- a/lib/metro/scene.rb +++ b/lib/metro/scene.rb @@ -394,6 +394,7 @@ module Metro def base_draw drawers.each { |drawer| drawer.draw } draw + drawers.reject! { |updater| drawers.completed? } end # This provides the functionality for view handling.
Drawers are removed when drawing is complete
burtlo_metro
train
rb
70cc6d74c6aac47a71526335e693a5cfe10f1d35
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup requires = [ 'Django>=1.6', - 'psutil==4.0.0', + 'psutil==5.7.0', ] if sys.version_info < (3, 3, 0):
Upgrade to a secure psutil
pbs_django-heartbeat
train
py
989430ea196459710413d8909f1982f18c461141
diff --git a/DataFixtures/ORM/LoadCountriesData.php b/DataFixtures/ORM/LoadCountriesData.php index <HASH>..<HASH> 100644 --- a/DataFixtures/ORM/LoadCountriesData.php +++ b/DataFixtures/ORM/LoadCountriesData.php @@ -84,7 +84,12 @@ class LoadCountriesData extends DataFixture { $countryRepository = $this->getCountryRepository(); $countries = Intl::getRegionBundle()->getCountryNames($this->defaultLocale); - $localisedCountries = array('es' => Intl::getRegionBundle()->getCountryNames('es')); + + if (Intl::isExtensionLoaded()) { + $localisedCountries = array('es' => Intl::getRegionBundle()->getCountryNames('es')); + } else { + $localisedCountries = array(); + } foreach ($countries as $isoName => $name) { $country = $countryRepository->createNew();
[Fixtures] Don't force to use `intl` extension for fixtures
Sylius_SyliusFixturesBundle
train
php
625ab1d366c305d30f99846e5e7c0ccf2f8a09ea
diff --git a/gremlin-core/src/main/java/com/tinkerpop/gremlin/process/Traversal.java b/gremlin-core/src/main/java/com/tinkerpop/gremlin/process/Traversal.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/com/tinkerpop/gremlin/process/Traversal.java +++ b/gremlin-core/src/main/java/com/tinkerpop/gremlin/process/Traversal.java @@ -92,7 +92,7 @@ public interface Traversal<S, E> extends Iterator<E>, Cloneable { public interface SideEffects { - public static final String DISTRIBUTED_SIDE_EFFECTS_VERTEX_PROPERTY_KEY = Graph.Key.hide("gremlin.traversalVertexProgram.sideEffects"); + public static final String DISTRIBUTED_SIDE_EFFECTS_VERTEX_PROPERTY_KEY = Graph.Key.hide("gremlin.sideEffects"); public static final String GRAPH_KEY = Graph.System.system("g"); public default boolean exists(final String key) {
made the distributed sideEffects key shorter so its more attractive looking.
apache_tinkerpop
train
java
a9bd9d562dc96ffe942d101bce1943d047c65cee
diff --git a/lib/generators/nocms/blocks/templates/config/initializers/nocms/blocks/layout.rb b/lib/generators/nocms/blocks/templates/config/initializers/nocms/blocks/layout.rb index <HASH>..<HASH> 100644 --- a/lib/generators/nocms/blocks/templates/config/initializers/nocms/blocks/layout.rb +++ b/lib/generators/nocms/blocks/templates/config/initializers/nocms/blocks/layout.rb @@ -8,6 +8,14 @@ NoCms::Blocks.configure do |config| text: :string, # long_text: :text, # image: Image, # You may use another ActiveRecord classes of your own + # column: { # You can configure the block with more options than just + # # the type of the field. If you use the "quick" configuration + # # all other settings will get the default value + # type: :text, # The type of the field, just as explained before + # translated: true # If the field must store different values for + # # each translation. By default every field is + # # translated + # } }, allow_nested_blocks: true, # A block with this layout may include a list of nested blocks # This setting is actually used by nocms-admin gem to show
Added the verbose way to define a field in the block layout generator
simplelogica_nocms-blocks
train
rb
39134455def97eb8a80abc58136cca02a689733a
diff --git a/tests/Kaloa/Tests/Util/ArrayObjectTest.php b/tests/Kaloa/Tests/Util/ArrayObjectTest.php index <HASH>..<HASH> 100644 --- a/tests/Kaloa/Tests/Util/ArrayObjectTest.php +++ b/tests/Kaloa/Tests/Util/ArrayObjectTest.php @@ -153,7 +153,16 @@ EOT array( null, // Skip first and second dimensions, only realign third null, // (descending by length of an entry's title) - function ($a, $b) { return strlen($a['title']) < strlen($b['title']); } + function ($a, $b) { + $diff = strlen($a['title']) < strlen($b['title']); + + if (0 !== $diff) { + return $diff; + } + + // Tie-breaker + return strcmp($a['title'], $b['title']); + } ) );
Add tie-breaker to sorting function in ArrayObjectTest.
mermshaus_kaloa-util
train
php
37fcfbed7969988f685d931f5b4453f85e699c7c
diff --git a/app/concepts/socializer/activity/services/like.rb b/app/concepts/socializer/activity/services/like.rb index <HASH>..<HASH> 100644 --- a/app/concepts/socializer/activity/services/like.rb +++ b/app/concepts/socializer/activity/services/like.rb @@ -49,8 +49,8 @@ module Socializer def create_activity Socializer::CreateActivity - .new(actor_id: @actor.guid, - activity_object_id: @activity_object.id, + .new(actor_id: actor.guid, + activity_object_id: activity_object.id, verb: verb, object_ids: PUBLIC).call end @@ -60,14 +60,14 @@ module Socializer # @return [TrueClass, FalseClass] returns true if the record could # be saved def change_like_count - @activity_object.increment!(:like_count) + activity_object.increment!(:like_count) end # Return true if creating the [Socializer::Activity] shoud not proceed # # @return [TrueClass, FalseClass] def blocked? - @actor.likes?(@activity_object) + actor.likes?(activity_object) end # The verb to use when liking an [Socializer::ActivityObject]
use the reader for @actor and @activity_object
socializer_socializer
train
rb
a2875d6ab14b27fdf28f38eaf127a4f271db9f16
diff --git a/make.js b/make.js index <HASH>..<HASH> 100644 --- a/make.js +++ b/make.js @@ -24,7 +24,10 @@ b.task('server', function() { b.js('./index.es.js', { // necessary for nodejs 4 buble: true, - commonjs: { include: ['node_modules/**', require.resolve('substance-cheerio')] }, + commonjs: { include: [ + '/**/lodash/**', + '/**/substance-cheerio/**' + ] }, targets: [{ dest: './dist/substance.cjs.js', format: 'cjs', sourceMapRoot: __dirname, sourceMapPrefix: 'substance' @@ -60,8 +63,8 @@ b.task('test:server', function() { external: ['substance-test'], commonjs: { include: [ - 'node_modules/lodash/**', - 'node_modules/substance-cheerio/**' + '/**/lodash/**', + '/**/substance-cheerio/**' ] }, targets: [
Trying to fix make configuration for server bundle.
substance_substance
train
js
228895f377c3fd01bbe10fd2104febc023c9e0b2
diff --git a/geopy/geocoders/base.py b/geopy/geocoders/base.py index <HASH>..<HASH> 100644 --- a/geopy/geocoders/base.py +++ b/geopy/geocoders/base.py @@ -368,14 +368,8 @@ class Geocoder: exc_info=True) return None - def geocode(self, query, *, exactly_one=True, timeout=DEFAULT_SENTINEL): - """ - Implemented in subclasses. - """ - raise NotImplementedError() + # def geocode(self, query, *, exactly_one=True, timeout=DEFAULT_SENTINEL): + # raise NotImplementedError() - def reverse(self, query, *, exactly_one=True, timeout=DEFAULT_SENTINEL): - """ - Implemented in subclasses. - """ - raise NotImplementedError() + # def reverse(self, query, *, exactly_one=True, timeout=DEFAULT_SENTINEL): + # raise NotImplementedError()
Base Geocoder: remove the abstract `geocode` and `reverse` methods There's little point in their existence. 1. The specific `geocode`/`reverse` methods almost always have a different signature 2. Some geocoders don't even have a `reverse` method. 3. Some have other methods, such as `reverse_timezone`.
geopy_geopy
train
py
b81c64f8791cc05fb590885a1e043cd57f675f79
diff --git a/js/stringProcessing/stripNumbers.js b/js/stringProcessing/stripNumbers.js index <HASH>..<HASH> 100644 --- a/js/stringProcessing/stripNumbers.js +++ b/js/stringProcessing/stripNumbers.js @@ -3,7 +3,7 @@ var stripSpaces = require( "../stringProcessing/stripSpaces.js" ); /** - * removes all words comprised only of numbers. + * Removes all words comprised only of numbers. * * @param {string} text to remove words * @returns {string} The text with numberonly words removed.
Fixed a typo (missing capitalization) in the docblock.
Yoast_YoastSEO.js
train
js
4a815cd382c8c148bf4a72ae5b2ef583f41975f9
diff --git a/src/CMS/urls/content.php b/src/CMS/urls/content.php index <HASH>..<HASH> 100644 --- a/src/CMS/urls/content.php +++ b/src/CMS/urls/content.php @@ -83,7 +83,7 @@ return array( 'http-method' => 'GET', // Cache apram 'cacheable' => true, - 'revalidate' => true, + 'revalidate' => false, 'intermediate_cache' => true, 'max_age' => 25000 ), @@ -103,7 +103,7 @@ return array( 'http-method' => 'GET', // Cache apram 'cacheable' => true, - 'revalidate' => true, + 'revalidate' => false, 'intermediate_cache' => true, 'max_age' => 25000 ),
set revaliedate option as false for RESTs to download contents
pluf_cms
train
php
eefd545fdc5f656ce6fa7054a4a33f5919d3b723
diff --git a/src/engine/currencyEngine.js b/src/engine/currencyEngine.js index <HASH>..<HASH> 100644 --- a/src/engine/currencyEngine.js +++ b/src/engine/currencyEngine.js @@ -476,6 +476,7 @@ export class CurrencyEngine { abcTransaction.signedTx = abcTransaction.otherParams.bcoinTx .toRaw() .toString('hex') + abcTransaction.txid = abcTransaction.otherParams.bcoinTx.rhash() return abcTransaction }
get the txid after signing
EdgeApp_edge-currency-bitcoin
train
js
8487ca13ec98ff6b62a303add0823ca03a16fc53
diff --git a/abstract.js b/abstract.js index <HASH>..<HASH> 100644 --- a/abstract.js +++ b/abstract.js @@ -940,7 +940,7 @@ function abstractPersistence (opts) { instance.outgoingUpdate(client, updated, function (err, reclient, repacket) { t.error(err) t.equal(reclient, client, 'client matches') - t.equal(repacket, repacket, 'packet matches') + t.equal(repacket, updated, 'packet matches') callback(updated) }) }) @@ -1054,7 +1054,7 @@ function abstractPersistence (opts) { instance.outgoingUpdate(client, updated, function (err, reclient, repacket) { t.error(err) t.equal(reclient, client, 'client matches') - t.equal(repacket, repacket, 'packet matches') + t.equal(repacket, updated, 'packet matches') var pubrel = { cmd: 'pubrel', @@ -1217,7 +1217,7 @@ function abstractPersistence (opts) { t.error(err, 'no error') t.equal(c, anotherClient, 'client matches') instance.streamWill({ - 'anotherBroker': Date.now() + anotherBroker: Date.now() }) .pipe(through.obj(function (chunk, enc, cb) { t.deepEqual(chunk, {
Fixed typo & standardize (#<I>) * Update README.md * Fixed typo & standardize
mcollina_aedes-persistence
train
js
cf11cda84611f27d2da82d191f8b5db509b847df
diff --git a/dvc/command/diff.py b/dvc/command/diff.py index <HASH>..<HASH> 100644 --- a/dvc/command/diff.py +++ b/dvc/command/diff.py @@ -39,7 +39,7 @@ class CmdDiff(CmdBase): def _get_dir_changes(cls, dct): engine = inflect.engine() changes_msg = ( - "{} {} changed, {} {} modified, {} {} added, " + "{} {} untouched, {} {} modified, {} {} added, " "{} {} deleted, size was {}" ) changes_msg = changes_msg.format(
fix wording for 'diff' cmd
iterative_dvc
train
py
ae32b56a082ea95932439fd34e5e01bbc5b9bcd0
diff --git a/src/main/python/rlbot/agents/hivemind/python_hivemind.py b/src/main/python/rlbot/agents/hivemind/python_hivemind.py index <HASH>..<HASH> 100644 --- a/src/main/python/rlbot/agents/hivemind/python_hivemind.py +++ b/src/main/python/rlbot/agents/hivemind/python_hivemind.py @@ -80,14 +80,16 @@ class PythonHivemind(BotHelperProcess): self._ball_prediction = BallPrediction() self._field_info = FieldInfoPacket() self.game_interface.update_field_info_packet(self._field_info) - # Wrapper for renderer. - self.renderer: RenderingManager = self.game_interface.renderer # Create packet object. packet = GameTickPacket() # Uses one of the drone indices as a key. - key = next(iter(self.drone_indices)) - self.game_interface.fresh_live_data_packet(packet, 20, key) + first_index = next(iter(self.drone_indices)) + self.game_interface.fresh_live_data_packet(packet, 20, first_index) + + # Get a rendering manager for the hivemind. + self.team = packet.game_cars[first_index].team + self.renderer = self.game_interface.renderer.get_rendering_manager(bot_index=first_index, bot_team=self.team) # Initialization step for your hivemind. self.initialize_hive(packet)
Set self.team, properly get a rendering manager (#<I>)
RLBot_RLBot
train
py
d51334b7fc75f7089033f3158da168603da7dfbb
diff --git a/lib/measurable/jaccard.rb b/lib/measurable/jaccard.rb index <HASH>..<HASH> 100644 --- a/lib/measurable/jaccard.rb +++ b/lib/measurable/jaccard.rb @@ -1,6 +1,8 @@ # http://en.wikipedia.org/wiki/Jaccard_coefficient module Measurable def jaccard(u, v) + raise ArgumentError if u.size != v.size + 1 - jaccard_index(u, v) end @@ -12,6 +14,8 @@ module Measurable end def binary_jaccard(u, v) + raise ArgumentError if u.size != v.size + 1 - binary_jaccard_index(u, v) end diff --git a/spec/jaccard_spec.rb b/spec/jaccard_spec.rb index <HASH>..<HASH> 100644 --- a/spec/jaccard_spec.rb +++ b/spec/jaccard_spec.rb @@ -21,7 +21,9 @@ describe "Jaccard" do it "should return the correct value" - it "shouldn't work with vectors of different length" + it "shouldn't work with vectors of different length" do + expect { Measurable.jaccard(@u, [1, 2, 3, 4]) }.to raise_error + end end context "Binary Distance" do @@ -45,6 +47,8 @@ describe "Jaccard" do it "should return the correct value" - it "shouldn't work with vectors of different length" + it "shouldn't work with vectors of different length" do + expect { Measurable.binary_jaccard(@u, [1, 2, 3, 4]) }.to raise_error + end end end \ No newline at end of file
Added specs for jaccard distance
agarie_measurable
train
rb,rb
aa97e24b029a3915c6293cd8f796246ef58db453
diff --git a/consul/fsm_test.go b/consul/fsm_test.go index <HASH>..<HASH> 100644 --- a/consul/fsm_test.go +++ b/consul/fsm_test.go @@ -326,6 +326,8 @@ func TestFSM_SnapshotRestore(t *testing.T) { Key: "/test", Value: []byte("foo"), }) + session := &structs.Session{Node: "foo"} + fsm.state.SessionCreate(9, session) // Snapshot snap, err := fsm.Snapshot() @@ -383,6 +385,15 @@ func TestFSM_SnapshotRestore(t *testing.T) { if string(d.Value) != "foo" { t.Fatalf("bad: %v", d) } + + // Verify session is restored + _, s, err := fsm.state.SessionGet(session.ID) + if err != nil { + t.Fatalf("err: %v", err) + } + if s.Node != "foo" { + t.Fatalf("bad: %v", d) + } } func TestFSM_KVSSet(t *testing.T) {
consul: Testing FSM snapshot of sessions
hashicorp_consul
train
go
09b2e26a5802753779c8679a98f59752489c542d
diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index <HASH>..<HASH> 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -501,16 +501,16 @@ if (aa === undefined || aa === null) { aa = ''; } - if (aa === undefined || bb === null) { + if (bb === undefined || bb === null) { bb = ''; } if (aa === bb) { return 0; } - if (aa < bb) { + if (aa.localeCompare(bb) == -1) return order * -1; - } + return order; }); }
Update bootstrap-table.js the sorting process has been localized
wenzhixin_bootstrap-table
train
js
5ae55a59742cd2da1bac83d0c915a666c3145b6a
diff --git a/lib/steps/add-license.js b/lib/steps/add-license.js index <HASH>..<HASH> 100644 --- a/lib/steps/add-license.js +++ b/lib/steps/add-license.js @@ -37,13 +37,11 @@ module.exports = function(ctx, done){ debug('writing', ctx.path('./LICENSE')); - var buf = data.toString(); - buf.replace('{{year}}', new Date().getFullYear()); + var buf = data.toString() + .replace('{{year}}', new Date().getFullYear()) + .replace('{{name}}', (packageData.author || 'YOURNAMEHERE')); - if(packageData.author){ - buf.replace('{{name}}', packageData.author); - } - else { + if(!packageData.author){ debug.warn('you\'ll need to add you name to', ctx.path('./LICENSE')); } ctx.writeFile(ctx.path('./LICENSE'), buf, done);
yeah that just wasn't working...
imlucas_mott
train
js
fea29337c8ee81c1d11a8e46157cbe8abdbe78c5
diff --git a/juicer/tests/TestJuicer.py b/juicer/tests/TestJuicer.py index <HASH>..<HASH> 100644 --- a/juicer/tests/TestJuicer.py +++ b/juicer/tests/TestJuicer.py @@ -20,6 +20,17 @@ class TestJuicer(unittest.TestCase): pulp = j(self.args) mute()(pulp.search_rpm)(name=self.args.rpmname) + def test_create(self): + rpm_path = './share/juicer/empty-0.0.1-1.fc17.x86_64.rpm' + self.args = self.parser.parser.parse_args(('create CRQ0DAY -r %s %s' % ('hats', rpm_path)).split()) + pulp = j(self.args) + mute()(pulp.create)(cart_name=self.args.cartname, cart_description=self.args.r) + + def test_promotion(self): + self.args = self.parser.parser.parse_args('promote CRQ0DAY'.split()) + pulp = j(self.args) + mute()(pulp.promote)(name=self.args.cartname) + if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(TestJuicer) unittest.TextTestRunner(verbosity=2).run(suite)
add tests for creating and promoting carts
juicer_juicer
train
py
0d9bb773ff44f5f1575a7f646f8439efb2fe7aa3
diff --git a/SmartIRC.php b/SmartIRC.php index <HASH>..<HASH> 100644 --- a/SmartIRC.php +++ b/SmartIRC.php @@ -833,7 +833,12 @@ class Net_SmartIRC break; case SMARTIRC_FILE: if (!is_resource($this->_logfilefp)) { - $this->_logfilefp = @fopen($this->_logfile,'w+'); + if ($this->_logfilefp === null) { + // we reconncted and don't want to destroy the old log entries + $this->_logfilefp = @fopen($this->_logfile,'a'); + } else { + $this->_logfilefp = @fopen($this->_logfile,'w'); + } } @fwrite($this->_logfilefp, $formatedentry); fflush($this->_logfilefp);
- on a reconnect, the logfile won't be overwritten anymore. git-svn-id: <URL>
pear_Net_SmartIRC
train
php
4bd15f4b986033543405ccddf274976394b7d8db
diff --git a/lib/less/data/colors.js b/lib/less/data/colors.js index <HASH>..<HASH> 100644 --- a/lib/less/data/colors.js +++ b/lib/less/data/colors.js @@ -118,6 +118,7 @@ module.exports = { 'plum':'#dda0dd', 'powderblue':'#b0e0e6', 'purple':'#800080', + 'rebeccapurple':'#663399', 'red':'#ff0000', 'rosybrown':'#bc8f8f', 'royalblue':'#4169e1',
Add rebeccapurple (#<I>)
less_less.js
train
js
4f76188a3b014069f3bd3726f2f75d4154b79ed7
diff --git a/PyMI/src/wmi/__init__.py b/PyMI/src/wmi/__init__.py index <HASH>..<HASH> 100644 --- a/PyMI/src/wmi/__init__.py +++ b/PyMI/src/wmi/__init__.py @@ -673,9 +673,12 @@ def _parse_moniker(moniker): @mi_to_wmi_exception -def WMI(moniker="root/cimv2", privileges=None, locale_name=None): +def WMI(moniker="root/cimv2", privileges=None, locale_name=None, computer="", + user="", password=""): computer_name, ns, class_name, key = _parse_moniker( moniker.replace("\\", "/")) + if computer_name == '.': + computer_name = computer or '.' conn = _Connection(computer_name=computer_name, ns=ns, locale_name=locale_name) if not class_name:
Adds computer, user, password arguments to WMI constructor The mentioned arguments are not present in the the WMI constructor, but are passed by monasca. The computer_name found in the moniker is prioritized over the given computer argument, which is consistent with the old WMI.
cloudbase_PyMI
train
py
e877507d25121880b8e4f21e73b853ea0329893b
diff --git a/lib/wechat.rb b/lib/wechat.rb index <HASH>..<HASH> 100644 --- a/lib/wechat.rb +++ b/lib/wechat.rb @@ -2,6 +2,7 @@ require 'zeitwerk' loader = Zeitwerk::Loader.for_gem +loader.ignore("#{__dir__}/action_controller") loader.ignore("#{__dir__}/generators/**/*.rb") loader.setup
Fix WARNING: Zeitwerk defines the constant ActionController after the directory
Eric-Guo_wechat
train
rb