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
d7e99673e9aba10447fb2fb5ae7cb5f9ccaec7e3
diff --git a/lib/crypto.js b/lib/crypto.js index <HASH>..<HASH> 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -2,7 +2,8 @@ module.exports = function BlastCrypto(Blast, Collection) { 'use strict'; - var libcrypto; + var libcrypto, + instance; /** * The Crypto class @@ -18,6 +19,25 @@ module.exports = function BlastCrypto(Blast, Collection) { }); /** + * Get a UID + * + * @author Jelle De Loecker <jelle@codedor.be> + * @since 0.1.4 + * @version 0.1.4 + * + * @return {String} + */ + Crypto.setStatic(function uid() { + + if (instance == null) { + instance = new Crypto(); + instance.populate(10); + } + + return instance.uid(); + }); + + /** * Generate a pseudorandom hex string * * @author Jelle De Loecker <jelle@codedor.be> @@ -228,4 +248,6 @@ module.exports = function BlastCrypto(Blast, Collection) { }); }); } + + Blast.defineClass('Crypto', Crypto); }; \ No newline at end of file
feat: Expose Crypto class & allow user to create uid without instancing manually
skerit_protoblast
train
js
9724bbbd43a893e5c93b37efb075f4d5c23d1508
diff --git a/router_test.go b/router_test.go index <HASH>..<HASH> 100644 --- a/router_test.go +++ b/router_test.go @@ -108,17 +108,20 @@ func TestIncorrectPath(t *testing.T) { } func TestPathNotFound(t *testing.T) { - path := map[string]string { - "/users/name/": "/users/name/dinever/", + path := []struct { + method, path, incomingMethod, incomingPath string + } { + {"GET", "/users/name/", "GET", "/users/name/dinever/"}, + {"GET", "/dinever/repo/", "POST", "/dinever/repo/"}, } defer func() { if err := recover(); err != nil { } }() router := newRouter() - for route, wrongPath := range path { - router.AddRoute("GET", route, handler) - h, p, err := router.FindRoute("GET", wrongPath) + for _, path := range path { + router.AddRoute(path.method, path.path, handler) + h, p, err := router.FindRoute(path.incomingMethod, path.incomingPath) if h != nil { t.Errorf("Should return nil handler when path not found.") }
[test] Improve test coverage when method is not found
dinever_golf
train
go
8439bbf117eb5270d6a6cc9888bfc16d90cb29a8
diff --git a/headers.js b/headers.js index <HASH>..<HASH> 100644 --- a/headers.js +++ b/headers.js @@ -166,7 +166,7 @@ exports.encode = function(opts) { if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null buf.write(name) - buf.write(encodeOct(opts.mode & 07777, 6), 100) + buf.write(encodeOct(opts.mode & parseInt('07777', 8), 6), 100) buf.write(encodeOct(opts.uid, 6), 108) buf.write(encodeOct(opts.gid, 6), 116) buf.write(encodeOct(opts.size, 11), 124) diff --git a/pack.js b/pack.js index <HASH>..<HASH> 100644 --- a/pack.js +++ b/pack.js @@ -118,7 +118,7 @@ Pack.prototype.entry = function(header, buffer, callback) { if (!header.size) header.size = 0 if (!header.type) header.type = modeToType(header.mode) - if (!header.mode) header.mode = header.type === 'directory' ? 0755 : 0644 + if (!header.mode) header.mode = parseInt(header.type === 'directory' ? '0755' : '0644') if (!header.uid) header.uid = 0 if (!header.gid) header.gid = 0 if (!header.mtime) header.mtime = new Date()
Don't use octal numbers When run with the "--use_strict" flag, NodeJS raises an error citing: SyntaxError: Octal literals are not allowed in strict mode. when parsing files which contain Octal numbers (or numbers which look like octals - usually because they have leading zeros). This commit replaces two instances of this with strings. See [this Stack Overflow answer](<URL>) for more info.
mafintosh_tar-stream
train
js,js
2c855ebf46de103dae26a27940da6b3008966ecf
diff --git a/packages/components/bolt-share/src/share.standalone.js b/packages/components/bolt-share/src/share.standalone.js index <HASH>..<HASH> 100644 --- a/packages/components/bolt-share/src/share.standalone.js +++ b/packages/components/bolt-share/src/share.standalone.js @@ -7,6 +7,7 @@ class BoltShare extends withHyperHtml { constructor(self) { self = super(self); + this.useShadow = false; return self; }
fix: manually opt out of shadow DOM encapsulation of the share component for the time being (until ongoing refactor work is wrapped up)
bolt-design-system_bolt
train
js
dec1b2d74f49b618c8db36ff4fc066d8f7f962da
diff --git a/src/Cli/Kahlan.php b/src/Cli/Kahlan.php index <HASH>..<HASH> 100644 --- a/src/Cli/Kahlan.php +++ b/src/Cli/Kahlan.php @@ -450,6 +450,7 @@ EOD; return Filter::on($this, 'load', [], function($chain) { $files = Dir::scan($this->args()->get('spec'), [ 'include' => $this->args()->get('pattern'), + 'exclude' => '*/.*', 'type' => 'file' ]); foreach($files as $file) {
Exclude dot-hidden folders inside the spec folder
kahlan_kahlan
train
php
78e6dcf1deedc4cf16c00a94c360e7efd6f8fd64
diff --git a/lib/action_kit_api/event_campaign.rb b/lib/action_kit_api/event_campaign.rb index <HASH>..<HASH> 100644 --- a/lib/action_kit_api/event_campaign.rb +++ b/lib/action_kit_api/event_campaign.rb @@ -1,4 +1,5 @@ require 'action_kit_api' +require 'pry' module ActionKitApi class EventCampaign < ApiDataModel @@ -64,6 +65,7 @@ module ActionKitApi (args[0]).merge(:campaign_id => self.id) event = ActionKitApi::Event.new(*args) + binding.pry event.save result = ActionKitApi.connection.call("EventCreate.create", {:event_id => event.id})
Temporarily added pry for debugging
Democracy-for-America_ActionKitApi
train
rb
792b684e758f93e8bff409fb0a1dfd3e4d6de6af
diff --git a/src/Database/index.js b/src/Database/index.js index <HASH>..<HASH> 100644 --- a/src/Database/index.js +++ b/src/Database/index.js @@ -50,8 +50,10 @@ export type DataFactory<T> = () => T; export type DataSerializer<T: Object, S: Object> = (data: T) => S; +export opaque type RecordId = number; + export type Record<T> = { - +id: number, + +id: RecordId, +data: T, save(): void, delete(): void
refactor: add record id flow type
devlucky_Kakapo.js
train
js
e2af3c0fa73938b2d36b31f3b804f9895cc5e8d6
diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go index <HASH>..<HASH> 100644 --- a/lnrpc/routerrpc/router_server.go +++ b/lnrpc/routerrpc/router_server.go @@ -445,7 +445,10 @@ func (s *Server) QueryMissionControl(ctx context.Context, snapshot := s.cfg.RouterBackend.MissionControl.GetHistorySnapshot() rpcNodes := make([]*NodeHistory, len(snapshot.Nodes)) - for i, node := range snapshot.Nodes { + for i, n := range snapshot.Nodes { + // Copy node struct to prevent loop variable binding bugs. + node := n + channels := make([]*ChannelHistory, len(node.Channels)) for j, channel := range node.Channels { channels[j] = &ChannelHistory{
routerrpc: fix loop variable binding bug in querymc This bug caused all node pubkey to be the same.
lightningnetwork_lnd
train
go
51877a5bb276932a17a0828c5503f4713c51b666
diff --git a/src/Picqer/Financials/Exact/Connection.php b/src/Picqer/Financials/Exact/Connection.php index <HASH>..<HASH> 100644 --- a/src/Picqer/Financials/Exact/Connection.php +++ b/src/Picqer/Financials/Exact/Connection.php @@ -526,9 +526,13 @@ class Connection Psr7\Message::rewindBody($response); $simpleXml = new \SimpleXMLElement($response->getBody()->getContents()); - foreach ($simpleXml->Messages as $message) { - $keyAlt = (string) $message->Message->Topic->Data->attributes()['keyAlt']; - $answer[$keyAlt] = (string) $message->Message->Description; + foreach ($simpleXml->Messages->Message as $message) { + if (null === $message->Topic->Data->attributes()) { + $answer[] = (string) $message->Description; + } else { + $keyAlt = (string) $message->Topic->Data->attributes()['keyAlt']; + $answer[$keyAlt] = (string) $message->Description; + } } return $answer;
Fixed parsing of messages after XML upload
picqer_exact-php-client
train
php
5b4e92920af11e58314c450e340b26fa24c62fca
diff --git a/leancloud/engine/https_redirect.py b/leancloud/engine/https_redirect.py index <HASH>..<HASH> 100644 --- a/leancloud/engine/https_redirect.py +++ b/leancloud/engine/https_redirect.py @@ -1,18 +1,23 @@ # coding: utf-8 +import os + from werkzeug.wrappers import Request from werkzeug.utils import redirect __author__ = 'asaka <lan@leancloud.rocks>' +is_prod = int(os.environ.get('LC_APP_PROD', '0')) + + class HttpsRedirectMiddleware(object): def __init__(self, wsgi_app): self.origin_app = wsgi_app def __call__(self, environ, start_response): request = Request(environ) - if request.headers.get('X-Forwarded-Proto') == 'http': + if is_prod and request.headers.get('X-Forwarded-Proto') != 'https': url = 'https://{0}{1}'.format(request.host, request.path) if request.query_string: url += '?{}'.format(request.query_string)
https redirect only works on production env
leancloud_python-sdk
train
py
5cd8fa9a86b182657394e4d28c2d9ce7f8e95077
diff --git a/core/src/main/java/hudson/scm/SubversionSCM.java b/core/src/main/java/hudson/scm/SubversionSCM.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/scm/SubversionSCM.java +++ b/core/src/main/java/hudson/scm/SubversionSCM.java @@ -657,15 +657,15 @@ public class SubversionSCM extends SCM implements Serializable { rsp.forward(Hudson.getInstance(),"error",req); } } + + static { + DAVRepositoryFactory.setup(); // http, https + SVNRepositoryFactoryImpl.setup(); // svn, svn+xxx + FSRepositoryFactory.setup(); // file + } } private static final long serialVersionUID = 1L; private static final Logger logger = Logger.getLogger(SubversionSCM.class.getName()); - - static { - DAVRepositoryFactory.setup(); // http, https - SVNRepositoryFactoryImpl.setup(); // svn, svn+xxx - FSRepositoryFactory.setup(); // file - } }
perhaps this is why? Maybe static initializer in SubversionSCM doesn't run early enough? git-svn-id: <URL>
jenkinsci_jenkins
train
java
6cfb6c11b1cacfa27d7690bb98cac4cd9c63123a
diff --git a/builtin/providers/aws/resource_aws_s3_bucket_object_test.go b/builtin/providers/aws/resource_aws_s3_bucket_object_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket_object_test.go +++ b/builtin/providers/aws/resource_aws_s3_bucket_object_test.go @@ -354,7 +354,7 @@ resource "aws_s3_bucket_object" "object" { bucket = "${aws_s3_bucket.object_bucket_2.bucket}" key = "test-key" content = "stuff" - kms_key_id = "${aws_kms_key.kms_key_1.key_id}" + kms_key_id = "${aws_kms_key.kms_key_1.arn}" } `, randInt) }
provider/aws: Use KMS ARN in S3 Bucket test
hashicorp_terraform
train
go
a39dc59b0f633b6d03315dc18c4a157f61b2c577
diff --git a/src/test/java/com/opentok/test/OpenTokTest.java b/src/test/java/com/opentok/test/OpenTokTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/opentok/test/OpenTokTest.java +++ b/src/test/java/com/opentok/test/OpenTokTest.java @@ -544,6 +544,9 @@ public class OpenTokTest { } } + /* TODO: find a way to match JSON without caring about spacing + .withRequestBody(matching("."+".")) in the following archive tests */ + @Test public void testGetArchive() throws OpenTokException { String archiveId = "ARCHIVEID";
Bringing back TODO comment and putting it in one place with reminder to do the work in all archive tests
opentok_Opentok-Java-SDK
train
java
a8638c39bbb963dddcb723820828da588bd31e15
diff --git a/src/Illuminate/Foundation/Testing/CrawlerTrait.php b/src/Illuminate/Foundation/Testing/CrawlerTrait.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Testing/CrawlerTrait.php +++ b/src/Illuminate/Foundation/Testing/CrawlerTrait.php @@ -461,7 +461,7 @@ trait CrawlerTrait */ public function seeIsSelected($selector, $expected) { - $this->assertSame( + $this->assertEquals( $expected, $this->getSelectedValue($selector), "The field [{$selector}] does not contain the selected value [{$expected}]." ); @@ -478,7 +478,7 @@ trait CrawlerTrait */ public function dontSeeIsSelected($selector, $value) { - $this->assertNotSame( + $this->assertNotEquals( $value, $this->getSelectedValue($selector), "The field [{$selector}] contains the selected value [{$value}]." );
CrawlerTrait:seeisSelected doesn't need to be so strict
laravel_framework
train
php
561cc389b0631ec89b780f2aa5ff5e06a82e9537
diff --git a/lib/archive/support/zlib.rb b/lib/archive/support/zlib.rb index <HASH>..<HASH> 100644 --- a/lib/archive/support/zlib.rb +++ b/lib/archive/support/zlib.rb @@ -5,17 +5,20 @@ require 'zlib' require 'archive/support/io-like' module Zlib # :nodoc: - if ! const_defined?(:MAX_WBITS) then - MAX_WBITS = Deflate::MAX_WBITS - end + # The maximum size of the zlib history buffer. Note that zlib allows larger + # values to enable different inflate modes. See Zlib::Inflate.new for details. + # Provided here only for Ruby versions that do not provide it. + MAX_WBITS = Deflate::MAX_WBITS unless const_defined?(:MAX_WBITS) # A deflate strategy which limits match distances to 1, also known as - # run-length encoding. - RLE = 3 + # run-length encoding. Provided here only for Ruby versions that do not + # provide it. + RLE = 3 unless const_defined?(:RLE) # A deflate strategy which does not use dynamic Huffman codes, allowing for a - # simpler decoder to be used to inflate. - FIXED = 4 + # simpler decoder to be used to inflate. Provided here only for Ruby versions + # that do not provide it. + FIXED = 4 unless const_defined?(:FIXED) # Zlib::ZWriter is a writable, IO-like object (includes IO::Like) which wraps # other writable, IO-like objects in order to facilitate writing data to those
Only define Zlib constants if they are not already defined * Fixes constant redefinition warnings under MRI <I>-p0
javanthropus_archive-zip
train
rb
1c79a78fac9c1a732b0b8e2d570bbd4f16c371ba
diff --git a/packages/core/plugins/scoping.js b/packages/core/plugins/scoping.js index <HASH>..<HASH> 100644 --- a/packages/core/plugins/scoping.js +++ b/packages/core/plugins/scoping.js @@ -60,9 +60,11 @@ module.exports = (css, result) => { } globals[key] = true; - if (result.opts.exportGlobals !== false) { + + if(result.opts.exportGlobals !== false) { lookup[key] = [ child.value ]; } + child.ignore = true; }); }); diff --git a/packages/core/test/plugin.scoping.test.js b/packages/core/test/plugin.scoping.test.js index <HASH>..<HASH> 100644 --- a/packages/core/test/plugin.scoping.test.js +++ b/packages/core/test/plugin.scoping.test.js @@ -201,7 +201,7 @@ describe("/plugins", function() { 100% { color: black; } } `), { - exportGlobals: false + exportGlobals : false }).messages ) .toMatchSnapshot();
chore: fix some linting warnings
tivac_modular-css
train
js,js
90b6b50c07cb95ed713227e89faf6936e27a0d93
diff --git a/src/nmi/builds/remote_post.py b/src/nmi/builds/remote_post.py index <HASH>..<HASH> 100755 --- a/src/nmi/builds/remote_post.py +++ b/src/nmi/builds/remote_post.py @@ -32,7 +32,7 @@ if os.getenv("_NMI_STEP_FAILED") is not None: debugging_files = [ "src" ] tar = tarfile.open("results.tar.gz", "w:gz") -for name in [ "head" ] + debugging_files: +for name in [ "opt" ] + debugging_files: tar.add(name) if options.verbose:
lalsuite is now installed under ./opt in the build dir, not ./head
gwastro_pycbc-glue
train
py
914069bc5b65d3a6c3fd15e40f81b6a2f9b60606
diff --git a/lib/Archives.php b/lib/Archives.php index <HASH>..<HASH> 100644 --- a/lib/Archives.php +++ b/lib/Archives.php @@ -87,7 +87,7 @@ class Archives extends Core { $ret = array(); $ret['text'] = $ret['title'] = $ret['name'] = wptexturize($text); $ret['url'] = $ret['link'] = esc_url(URLHelper::prepend_to_url($url, $this->base)); - $ret['post_count'] = $post_count; + $ret['post_count'] = (int) $post_count; return $ret; }
Convert post_count to int
timber_timber
train
php
c10a6410698ff1b20c7971642e090685d9df5c04
diff --git a/lib/Patch.php b/lib/Patch.php index <HASH>..<HASH> 100644 --- a/lib/Patch.php +++ b/lib/Patch.php @@ -41,11 +41,11 @@ class Patch implements JsonSerializable return $this->assign('diffMatchPatch', $props); } - public function unsetButWeCantNameItThatSoDontUseItUntilWeDecideOnAlternativeName($attrs) + public function remove($attrs) { if (!is_array($attrs)) { throw new Exception\InvalidArgumentException( - 'unset(attrs) takes an array of attributes to unset, non-array given' + 'remove(attrs) takes an array of attributes to unset, non-array given' ); }
Rename 'unset' to 'remove' to prevent syntax errors on PHP<7
sanity-io_sanity-php
train
php
4c7b30eff72645dff98eb0323076abcfde7bc00e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def long_desc(): setup( name='shellish', - version='3', + version='3.1', description='A framework for CLI/shell programs.', author='Justin Mayfield', author_email='tooker@gmail.com',
Rev to <I> (dev)
mayfield_shellish
train
py
5cef8eda55ed55da61396dd01f58da72626ba469
diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index <HASH>..<HASH> 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -4,7 +4,6 @@ require 'active_model/railtie' require 'action_controller/railtie' require 'action_mailer/railtie' require 'action_view/railtie' -require 'active_job/railtie' require 'sprockets/railtie' require 'rails/test_unit/railtie'
Fix rails <I> and <I> compatibility
mmontossi_cronjobs
train
rb
44cdb800452106321fb17a0f5352bd85127e78cc
diff --git a/extension/Extension.php b/extension/Extension.php index <HASH>..<HASH> 100644 --- a/extension/Extension.php +++ b/extension/Extension.php @@ -84,9 +84,10 @@ abstract class Extension extends \yii\base\Component /** * Search, according to the keywords. * @param mixed $keywords + * @param mixed $config * @return string search result. */ - abstract public function search($keywords); + abstract public function search($keywords, $config = []); /** * Get module configuration array.
Update Extension.php Enable to pass search configuration to search() method.
rhoone_yii2-rhoone
train
php
c762befa54ccde749f5853d0f5107a7cd7e59412
diff --git a/symphony/content/content.ajaxquery.php b/symphony/content/content.ajaxquery.php index <HASH>..<HASH> 100644 --- a/symphony/content/content.ajaxquery.php +++ b/symphony/content/content.ajaxquery.php @@ -1,7 +1,5 @@ <?php -require_once(TOOLKIT . '/class.jsonpage.php'); - class contentAjaxQuery extends JSONPage { public function view()
remove require_once call Picked from <I>a<I>b2
symphonycms_symphony-2
train
php
c7c35331ede42f4d6bdd81c5ab6c95edc162c1a2
diff --git a/version/version_base.go b/version/version_base.go index <HASH>..<HASH> 100644 --- a/version/version_base.go +++ b/version/version_base.go @@ -12,5 +12,5 @@ func init() { // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. - VersionPrerelease = "dev" + VersionPrerelease = "" }
Puts the tree in <I> release mode.
hashicorp_consul
train
go
f251700eb4df6157204e407a500438eb2da03739
diff --git a/spyder/plugins/editor/widgets/base.py b/spyder/plugins/editor/widgets/base.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor/widgets/base.py +++ b/spyder/plugins/editor/widgets/base.py @@ -617,6 +617,7 @@ class TextEditBaseWidget(QPlainTextEdit, BaseEditMixin): """Duplicate current line or selected text""" cursor = self.textCursor() cursor.beginEditBlock() + cur_pos = cursor.position() start_pos, end_pos = self.__save_selection() end_pos_orig = end_pos if to_text_string(cursor.selectedText()): @@ -648,11 +649,15 @@ class TextEditBaseWidget(QPlainTextEdit, BaseEditMixin): cursor.movePosition(QTextCursor.StartOfBlock) start_pos += len(text) end_pos_orig += len(text) + cur_pos += len(text) cursor.insertText(text) cursor.endEditBlock() self.setTextCursor(cursor) - self.__restore_selection(start_pos, end_pos_orig) + if cur_pos == start_pos: + self.__restore_selection(end_pos_orig, start_pos) + else: + self.__restore_selection(start_pos, end_pos_orig) def duplicate_line(self): """
Preserve cursor pos in duplicate line
spyder-ide_spyder
train
py
e625cf647bf8a53833dab86f1fe1ae15f419f669
diff --git a/lib/foreman_discovery/engine.rb b/lib/foreman_discovery/engine.rb index <HASH>..<HASH> 100644 --- a/lib/foreman_discovery/engine.rb +++ b/lib/foreman_discovery/engine.rb @@ -42,7 +42,7 @@ module ForemanDiscovery initializer 'foreman_discovery.register_plugin', :before => :finisher_hook do |app| Foreman::Plugin.register :foreman_discovery do - requires_foreman '>= 1.15.0' + requires_foreman '>= 1.16.0' # discovered hosts permissions security_block :discovery do
Refs #<I> - mark compatible with Foreman <I>+ required after 3c6f9bd
theforeman_foreman_discovery
train
rb
38abbcbdd6c8f3e46897b9ba17ca3789a2ac1ba6
diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index <HASH>..<HASH> 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -317,9 +317,6 @@ class TileSource extends Source { this.tileCache.clear(); } - /** - * @inheritDoc - */ refresh() { this.clear(); super.refresh();
Remove inheritDoc to work around JSDoc issue
openlayers_openlayers
train
js
3dfbb693bd21c168addfca4575b059f95cb5d9be
diff --git a/lib/active_scaffold/helpers/id_helpers.rb b/lib/active_scaffold/helpers/id_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/helpers/id_helpers.rb +++ b/lib/active_scaffold/helpers/id_helpers.rb @@ -3,7 +3,7 @@ module ActiveScaffold # A bunch of helper methods to produce the common view ids module IdHelpers def controller_id - @controller_id ||= (params[:parent_controller] || params[:controller] || params[:eid]).gsub("/", "__") + @controller_id ||= (params[:eid] || params[:parent_controller] || params[:controller]).gsub("/", "__") end def active_scaffold_id
Fix duplicate ids, and fix 'RJS Error when using a 1:N -> N:1 in nested scaffolds' reported in ActiveScaffold Google Group.
activescaffold_active_scaffold
train
rb
03d49c50c6c1d2517a52023a1ca504651b7d7784
diff --git a/whizzer/__init__.py b/whizzer/__init__.py index <HASH>..<HASH> 100644 --- a/whizzer/__init__.py +++ b/whizzer/__init__.py @@ -19,10 +19,17 @@ def signal_handler(loop): return watcher def _perform_call(watcher, events): - (method, args, kwargs) = watcher.data + print("performing call") + (d, method, args, kwargs) = watcher.data + try: + d.callback(method(*args, **kwargs)) + except Exception as e: + d.errback(e) -def call_later(loop, delay, method, *args, **kwargs): +def call_later(loop, logger, delay, method, *args, **kwargs): """Convienence method to create a timed function call.""" - t = pyev.Timer(delay, 0.0, loop, _perform_call, (method, args, kwargs)) + d = Deferred(loop, logger=logger) + t = pyev.Timer(delay, 0.0, loop, _perform_call, (d, method, args, kwargs)) t.start() - return t + d.timer = t + return d
call_later now correctly returns a deferred, the caller MUST HOLD on to the deferred at the moment
bfrog_whizzer
train
py
ebfb6465fd984482121adbbb448d18ea59e75b36
diff --git a/src/Proxy/ClassProxy.php b/src/Proxy/ClassProxy.php index <HASH>..<HASH> 100644 --- a/src/Proxy/ClassProxy.php +++ b/src/Proxy/ClassProxy.php @@ -599,7 +599,7 @@ SETTER; } $assocProperties = $this->indent(join(',' . PHP_EOL, $assocProperties)); $listProperties = $this->indent(join(',' . PHP_EOL, $listProperties)); - if ($constructor) { + if (isset($this->methodsCode['__construct'])) { $parentCall = $this->getJoinpointInvocationBody($constructor); } elseif ($isCallParent) { $parentCall = '\call_user_func_array(["parent", __FUNCTION__], \func_get_args());';
Fix calling of parent constructor with property interception, resolves #<I>
goaop_framework
train
php
2a9692044b7575e9cb1d4c562020f8605ce56f47
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ with open('HISTORY.md') as history_file: install_requires = [ - 'Keras>=2.1.6,<3', + 'Keras>=2.1.6,<2.4', 'featuretools>=0.6.1,<0.12', 'iso639>=0.1.4,<0.2', 'langdetect>=1.0.7,<2',
Making sure that keras version is below <I> in order to avoid incompatibilities with tensorflow.
HDI-Project_MLPrimitives
train
py
b37ddfc94788fa7373a26870048cc38d204f1b72
diff --git a/src/Open/Client.php b/src/Open/Client.php index <HASH>..<HASH> 100644 --- a/src/Open/Client.php +++ b/src/Open/Client.php @@ -16,11 +16,20 @@ class Client $this->accessToken = $accessToken; } - public function get($method, $apiVersion, $params = [], $files = [], $config = []) + /** + * 调用接口 GET + * + * @deprecated 已废弃, 请使用 post 方法 + * @see self::post + */ + public function get($method, $apiVersion, $params = [], $files = []) { - return $this->post($method, $apiVersion, $params, $files, $config); + return $this->post($method, $apiVersion, $params, $files); } + /** + * 调用接口 POST + */ public function post($method, $apiVersion, $params = [], $files = [], $config = []) { return $this->parseResponse(
add client get deprecated and document
youzan_open-sdk-php
train
php
155e15251b3eb8a9533bf19ec505970894a4df4b
diff --git a/fileupload.go b/fileupload.go index <HASH>..<HASH> 100644 --- a/fileupload.go +++ b/fileupload.go @@ -36,7 +36,7 @@ type FileUpload struct { Size int64 `json:"size"` Purpose FileUploadPurpose `json:"purpose"` URL string `json:"url"` - Mime string `json:"mimetype"` + Type string `json:"type"` } // AppendDetails adds the file upload details to an io.ReadWriter. It returns diff --git a/fileupload/client_test.go b/fileupload/client_test.go index <HASH>..<HASH> 100644 --- a/fileupload/client_test.go +++ b/fileupload/client_test.go @@ -10,7 +10,7 @@ import ( const ( expectedSize = 734 - expectedMime = "application/pdf" + expectedType = "pdf" ) func init() { @@ -41,8 +41,8 @@ func TestFileUploadNewThenGet(t *testing.T) { t.Errorf("(POST) Purpose %v does not match expected purpose %v\n", target.Purpose, uploadParams.Purpose) } - if target.Mime != expectedMime { - t.Errorf("(POST) Mime %v does not match expected mime %v\n", target.Mime, expectedMime) + if target.Type != expectedType { + t.Errorf("(POST) Type %v does not match expected type %v\n", target.Type, expectedType) } res, err := Get(target.ID, nil)
Mime -> Type on FileUploads to stay consistent with main api.
stripe_stripe-go
train
go,go
f9e62be7e864a9e6ac56a5ae8a120ae63b79fa27
diff --git a/zvmsdk/database.py b/zvmsdk/database.py index <HASH>..<HASH> 100644 --- a/zvmsdk/database.py +++ b/zvmsdk/database.py @@ -647,7 +647,7 @@ class GuestDbOperator(object): def get_migrated_guest_list(self): with get_guest_conn() as conn: res = conn.execute("SELECT * FROM guests " - "WHERE comments LIKE '\%\"migrated\"\:\"1\"\%'") + "WHERE comments LIKE '%\"migrated\": 1%'") guests = res.fetchall() return guests @@ -656,13 +656,14 @@ class GuestDbOperator(object): output should be like: {'k1': 'v1', 'k2': 'v2'}' """ userid = userid - comments = {} with get_guest_conn() as conn: res = conn.execute("SELECT comments FROM guests " "WHERE userid=?", (userid,)) result = res.fetchall() - if result != []: + if result == []: + comments = {} + else: comments = json.loads(result) return comments
Update database operation for guest comments. Change-Id: I2d0de1d<I>d0ca<I>f7ce6c<I>eb3aa1b<I>dc<I>
mfcloud_python-zvm-sdk
train
py
a2e3fd92b0e5fb20b70a0ab0db1d00bc81cc77c1
diff --git a/sqlite3/sqlite.go b/sqlite3/sqlite.go index <HASH>..<HASH> 100644 --- a/sqlite3/sqlite.go +++ b/sqlite3/sqlite.go @@ -64,7 +64,7 @@ var txqueries []string = []string{ txtmpFetchLocationByShaStmt: "SELECT blockid, txoff, txlen FROM txtmp WHERE key = ?;", txMigrateCopy: "INSERT INTO tx (key, blockid, txoff, txlen, data) SELECT key, blockid, txoff, txlen, data FROM txtmp;", txMigrateClear: "DELETE from txtmp;", - txMigratePrep: "DROP index uniquetx;", + txMigratePrep: "DROP index IF EXISTS uniquetx;", txMigrateFinish: "CREATE UNIQUE INDEX IF NOT EXISTS uniquetx ON tx (key);", txMigrateCount: "SELECT COUNT(*) FROM txtmp;", txPragmaVacuumOn: "PRAGMA auto_vacuum = FULL;",
Only try to drop the uniquetx index if it exists. Solves a corner case after a crash.
btcsuite_btcd
train
go
c6d75aa8ab07e215beb8c1315155e55d3ca830c6
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -267,18 +267,29 @@ func (s *Server) handleQuestion(q dns.Question) (multicastRecs, unicastRecs []dn // sendResponse is used to send a response packet func (s *Server) sendResponse(resp *dns.Msg, from net.Addr, unicast bool) error { - // TODO(reddaly): Respect the unicast argument, and allow sending responses - // over multicast. buf, err := resp.Pack() if err != nil { return err } addr := from.(*net.UDPAddr) - if addr.IP.To4() != nil { - _, err = s.ipv4List.WriteToUDP(buf, addr) - return err - } else { - _, err = s.ipv6List.WriteToUDP(buf, addr) - return err + ipv4 := addr.IP.To4() != nil + conn := s.ipv4List + + switch ipv4 { + case true: // ipv4 + if unicast == false { + addr = ipv4Addr + } + case false: // ipv6 + if unicast == false { + addr = ipv6Addr + } + + conn = s.ipv6List + default: + break } + + _, err = conn.WriteToUDP(buf, addr) + return err }
Send response to multicast address if requested
hashicorp_mdns
train
go
641740649ff0dc5f9365b56710a446f4ac6b8ccf
diff --git a/docroot/modules/custom/ymca_retention/src/Form/MemberTrackActivityLoginForm.php b/docroot/modules/custom/ymca_retention/src/Form/MemberTrackActivityLoginForm.php index <HASH>..<HASH> 100644 --- a/docroot/modules/custom/ymca_retention/src/Form/MemberTrackActivityLoginForm.php +++ b/docroot/modules/custom/ymca_retention/src/Form/MemberTrackActivityLoginForm.php @@ -28,7 +28,7 @@ class MemberTrackActivityLoginForm extends FormBase { */ public function buildForm(array $form, FormStateInterface $form_state) { $verify_membership_id = $form_state->getTemporaryValue('verify_membership_id'); - $validate = ['::elementValidateRequired']; + $validate = [get_class($this), 'elementValidateRequired']; if (empty($verify_membership_id)) { $form['mail'] = [ '#type' => 'email', @@ -39,7 +39,10 @@ class MemberTrackActivityLoginForm extends FormBase { ], ], '#element_required_error' => $this->t('Email is required.'), - '#element_validate' => $validate, + '#element_validate' => [ + ['\Drupal\Core\Render\Element\Email', 'validateEmail'], + $validate, + ], ]; } else {
[YSR-<I>] email validation
ymcatwincities_openy
train
php
859d2337f8b832ab095cab0566d78055d1b06fdf
diff --git a/webpack.client.config.base.js b/webpack.client.config.base.js index <HASH>..<HASH> 100644 --- a/webpack.client.config.base.js +++ b/webpack.client.config.base.js @@ -16,13 +16,18 @@ const { } = util; const plugins = [ - new MiniCssExtractPlugin(), - new BundleAnalyzerPlugin({ - analyzerMode: "static", - openAnalyzer: false - }) + new MiniCssExtractPlugin() ]; +if (!process.env.CI) { + plugins.push( + new BundleAnalyzerPlugin({ + analyzerMode: "static", + openAnalyzer: false + }) + ); +} + if (process.env.DEPLOY && process.env.SENTRY_AUTH_TOKEN) { plugins.push( new SentryPlugin({
chore: Don't run the webpack analyzer plugin in CI environments. See if this saves us anything over time.
randytarampi_me
train
js
ff9426924533e7b6d1f7e3b1ff807ef8d802207e
diff --git a/build/copy-jsbeautify.js b/build/copy-jsbeautify.js index <HASH>..<HASH> 100644 --- a/build/copy-jsbeautify.js +++ b/build/copy-jsbeautify.js @@ -16,14 +16,6 @@ function copy(from, to) { } } -if (!fs.existsSync(path.join(__dirname, '..', 'lib', 'umd'))) { - fs.mkdirSync(path.join(__dirname, '..', 'lib', 'umd')); -} - -if (!fs.existsSync(path.join(__dirname, '..', 'lib', 'esm'))) { - fs.mkdirSync(path.join(__dirname, '..', 'lib', 'esm')); -} - const umdDir = path.join(__dirname, '..', 'lib', 'umd', 'beautify'); copy(path.join(__dirname, '..', 'src', 'beautify'), umdDir);
Update copy-jsbeautify.js
Microsoft_vscode-css-languageservice
train
js
9972093373362d44b94ad2b8287a1e6c6ecaee2f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ dirs.extend(numpy_include_dirs) dirs.append('.') print dirs -ext_cplfit = Extension("plfit", +ext_cplfit = Extension("plfit.cplfit", ["plfit/cplfit.pyx"], include_dirs=dirs, extra_compile_args=['-O3']) @@ -66,7 +66,7 @@ if __name__=="__main__": # therefore, run this command separately # gfortran = OK. g77, g95 NOT ok # also, this is kind of a ridiculous hack... - if any([x in sys.argv for x in ['build','install']]): + if any([x in sys.argv for x in ['build','install','develop']]): fortran_compile_command = "cd plfit && f2py -c fplfit.f -m fplfit --fcompiler=gfortran && cd .." os.system(fortran_compile_command) # do this first so it gets copied (in principle...)
fix setup.py: compilation actually works now!
keflavich_plfit
train
py
62b0c52788a93a426699e616fd8dc3fe1db00124
diff --git a/oceansdb/utils.py b/oceansdb/utils.py index <HASH>..<HASH> 100644 --- a/oceansdb/utils.py +++ b/oceansdb/utils.py @@ -19,9 +19,6 @@ else: from urlparse import urlparse -def oceansdb_dir(): - return os.path.expanduser(os.getenv('OCEANSDB_DIR', '~/.config/oceansdb')) - """ http://data.nodc.noaa.gov/thredds/dodsC/woa/WOA13/DATAv2/temperature/netcdf/decav/0.25/woa13_decav_t00_04v2.nc.html @@ -41,6 +38,13 @@ http://data.nodc.noaa.gov/thredds/fileServer/woa/WOA13/DATAv2/temperature/netcdf """ +def oceansdb_dir(): + """Path where oceansDB databases files are saved + """ + dbpath = os.getenv('OCEANSDB_DIR', '~/.config/oceansdb') + return os.path.expanduser(dbpath).replace('/', os.path.sep) + + class Dataset_flex(object): def __init__(self, filename, **kwargs): self.ds = Dataset(filename, mode='r')
Generalizing oceansdb_dir() path to include Windows. Linux and Windows use opposite directory separators.
castelao_oceansdb
train
py
56b27570d3b89c37b7ef4ab9396d0069881f1b98
diff --git a/src/test/java/net/emaze/dysfunctional/equality/EqualsBuilderTest.java b/src/test/java/net/emaze/dysfunctional/equality/EqualsBuilderTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/net/emaze/dysfunctional/equality/EqualsBuilderTest.java +++ b/src/test/java/net/emaze/dysfunctional/equality/EqualsBuilderTest.java @@ -21,7 +21,7 @@ import org.junit.runners.Suite.SuiteClasses; TestArrays.class, TestIgnoreParamsWhenAlreadyDifferent.class, TestIgnoreArrayParamsWhenAlreadyDifferent.class, - TestIntrospectsArrays.class, + TestIntrospectsArrays.class }) public class EqualsBuilderTest {
fix: spurious comma
cybazeitalia_emaze-dysfunctional
train
java
ebcde31c2fe8d81d575ac6d8944ed76d83ce3dd7
diff --git a/imghash/__init__.py b/imghash/__init__.py index <HASH>..<HASH> 100644 --- a/imghash/__init__.py +++ b/imghash/__init__.py @@ -36,7 +36,7 @@ def get_hash(path): def main(): import sys for path in sys.argv[1:]: - print get_hash(path).hexdigest(), path + print(get_hash(path).hexdigest(), path) if __name__ == '__main__': main()
porting to python3
FlorianLudwig_imghash
train
py
38547956cb9af39550f1e642401ecd87c0941807
diff --git a/bin/determine-basal.js b/bin/determine-basal.js index <HASH>..<HASH> 100644 --- a/bin/determine-basal.js +++ b/bin/determine-basal.js @@ -99,7 +99,7 @@ if (!module.parent) { console.error("No action required (" + bg + "<" + threshold + ", and no high-temp to cancel)") } } - else { // if (glucose_status.delta <= 0) { // BG is not yet rising + else { // BG is not yet rising setTempBasal(0, 30); } @@ -148,7 +148,7 @@ if (!module.parent) { setTempBasal(rate, 30); } - } else { // if (profile_data.min_bg < eventualBG < profile_data.max_bg) { + } else { console.error(eventualBG + " is in range. No action required.") } }
remove { from comments to unconfuse vi
openaps_oref0
train
js
038a8ef02b66198d4db78da3e9830fde52a7e072
diff --git a/meddler.go b/meddler.go index <HASH>..<HASH> 100644 --- a/meddler.go +++ b/meddler.go @@ -225,6 +225,7 @@ func (elt ZeroIsNullMeddler) PreWrite(field interface{}) (saveValue interface{}, return field, nil } +// JSONMeddler encodes or decodes the field value to or from JSON type JSONMeddler bool // PreRead is called before a Scan operation for fields that have the JSONMeddler @@ -295,6 +296,7 @@ func (zip JSONMeddler) PreWrite(field interface{}) (saveValue interface{}, err e return buffer.Bytes(), nil } +// GobMeddler encodes or decodes the field value to or from gob type GobMeddler bool // PreRead is called before a Scan operation for fields that have the GobMeddler
add comments to JSONMeddler & GobMeddler
russross_meddler
train
go
9a7327f062aa678408dfe4f4c3c7f479db16f187
diff --git a/lib/Logger.php b/lib/Logger.php index <HASH>..<HASH> 100644 --- a/lib/Logger.php +++ b/lib/Logger.php @@ -76,6 +76,16 @@ abstract class Logger implements PsrLogger { $level = isset(self::LEVELS[$level]) ? $level : "unknown"; $level = $this->ansify ? $this->ansify($level) : $level; + foreach ($context as $key => $replacement) { + // avoid invalid casts to string + if (!is_array($replacement) && (!is_object($replacement) || method_exists($replacement, '__toString'))) { + $replacements["{{$key}}"] = $replacement; + } + } + if (isset($replacements)) { + $message = strtr($message, $replacements); + } + return "[{$time}] {$level} {$message}"; }
Implement #<I> (Placeholder support for PSR-3)
amphp_http-server
train
php
13f831337805c56ba27d34021126fffb4cdb4c7f
diff --git a/lib/vagrant/systems/debian.rb b/lib/vagrant/systems/debian.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/systems/debian.rb +++ b/lib/vagrant/systems/debian.rb @@ -26,6 +26,7 @@ module Vagrant vm.ssh.execute do |ssh| if !ssh.test?("sudo hostname | grep '#{name}'") ssh.exec!("sudo sed -i 's/.*$/#{name}/' /etc/hostname") + ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts") ssh.exec!("sudo service hostname start") end end
Changes to fix the fqdn
hashicorp_vagrant
train
rb
14b8a81875edb1595d489df23fad27ce93e01e9b
diff --git a/django_measurement/models.py b/django_measurement/models.py index <HASH>..<HASH> 100644 --- a/django_measurement/models.py +++ b/django_measurement/models.py @@ -32,7 +32,7 @@ class MeasurementField(six.with_metaclass(models.SubfieldBase, Field)): min_value=None, max_value=None, *args, **kwargs): if not measurement and measurement_class: - measurement = getattr(measures, measurement_class) + measurement = getattr(measures, six.text_type(measurement_class)) if not measurement: raise TypeError('MeasurementField() takes a measurement' @@ -45,7 +45,7 @@ class MeasurementField(six.with_metaclass(models.SubfieldBase, Field)): ) self.measurement = measurement - self.measurement_class = measurement.__name__ + self.measurement_class = six.text_type(measurement.__name__) self.widget_args = { 'measurement': measurement, 'unit_choices': unit_choices, diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ class PyTest(Command): setup( name='django-measurement', - version='2.0.0', + version='2.0.1', url='http://github.com/coddingtonbear/django-measurement/', description='Convenient fields and classes for handling measurements', author='Adam Coddington',
fixes bytes/string error when upgrading to python3 Closed #3
coddingtonbear_django-measurement
train
py,py
e25cf9708bd770ffc531d827ba27ebc81df94130
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,9 @@ 'use strict'; const plugins = require('./lib/input-plugins'); +const fixtures = require('./tests/fixtures'); -module.exports.plugins = plugins; +module.exports = { + fixtures, + plugins +};
:new: export fixtures tooooo
punchcard-cms_shared-tests
train
js
60eca8f516d477662e59bfff5802515e14e85c10
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,9 @@ const isConnected = conn => isConnection(conn) && conn.readyState === 1; */ mongoose.oldConnect = function() { const conn = mongoose.connection; - return conn.openUri(arguments[0], arguments[1], arguments[2]).then(() => mongoose); + return conn + .openUri(arguments[0], arguments[1], arguments[2]) + .then(() => mongoose); }; /* set global mongoose promise */ @@ -642,7 +644,11 @@ exports.connect = (url, done) => { const _done = _.isFunction(url) ? url : done; // connection options - const _options = { useNewUrlParser: true, useCreateIndex: true }; + const _options = { + useNewUrlParser: true, + useCreateIndex: true, + useUnifiedTopology: true, + }; // establish mongoose connection uri = _.trim(uri) || MONGODB_URI;
fix: add support for new server discover & monitoring engine
lykmapipo_mongoose-common
train
js
dbaa4d7fd132281633042e405f182cfd05e75de8
diff --git a/src/Components/Logo/stubs/logo.php b/src/Components/Logo/stubs/logo.php index <HASH>..<HASH> 100644 --- a/src/Components/Logo/stubs/logo.php +++ b/src/Components/Logo/stubs/logo.php @@ -20,7 +20,9 @@ return [ | Logo Name |-------------------------------------------------------------------------- | - | This value is your logo. + | This value determines the text that is rendered for the logo. + | It defaults to the app name, but it can be any other text + | value if the logo should be different to the app name. | */ 'name' => config('app.name'),
Update src/Components/Logo/stubs/logo.php
laravel-zero_framework
train
php
e33ebc58d599ff92e9937baa20889401d9b057f7
diff --git a/kirki.php b/kirki.php index <HASH>..<HASH> 100644 --- a/kirki.php +++ b/kirki.php @@ -5,7 +5,7 @@ * Description: The Ultimate WordPress Customizer Framework * Author: Ari Stathopoulos (@aristath) * Author URI: https://aristath.github.io - * Version: 3.0.45 + * Version: 4.0-dev * Text Domain: kirki * Requires WP: 4.9 * Requires PHP: 5.3 @@ -47,7 +47,7 @@ require_once __DIR__ . '/inc/bootstrap.php'; // phpcs:ignore WPThemeReview.CoreF // Define the KIRKI_VERSION constant. if ( ! defined( 'KIRKI_VERSION' ) ) { - define( 'KIRKI_VERSION', '3.0.45' ); + define( 'KIRKI_VERSION', '4.0-dev' ); } if ( ! function_exists( 'Kirki' ) ) {
change version to <I>-dev
aristath_kirki
train
php
88c28747f9e28c099ee05768188377fd7b16ee7d
diff --git a/blueprints/ember-cli-typescript/index.js b/blueprints/ember-cli-typescript/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-cli-typescript/index.js +++ b/blueprints/ember-cli-typescript/index.js @@ -31,7 +31,8 @@ module.exports = { afterInstall: function() { return this.addPackagesToProject([ { name: 'typescript', target: '^2.1' }, - { name: '@types/ember', target: '^2.7.34' } + { name: '@types/ember', target: '^2.7.41' }, + { name: '@types/rsvp', target: '^3.3.0' } ]); } }
Include `@types/rsvp` in blueprint. (#<I>)
typed-ember_ember-cli-typescript
train
js
5ee79778df42b948f7aa1628a1d2448f8998edcf
diff --git a/lib/rocket_chat/gem_version.rb b/lib/rocket_chat/gem_version.rb index <HASH>..<HASH> 100644 --- a/lib/rocket_chat/gem_version.rb +++ b/lib/rocket_chat/gem_version.rb @@ -1,3 +1,3 @@ module RocketChat - VERSION = '0.1.9'.freeze + VERSION = '0.1.10'.freeze end
Bumped version to <I>
abrom_rocketchat-ruby
train
rb
9c13202f6dde58fc4194a609317741bb624046a6
diff --git a/lib/triagens/ArangoDb/ConnectionOptions.php b/lib/triagens/ArangoDb/ConnectionOptions.php index <HASH>..<HASH> 100644 --- a/lib/triagens/ArangoDb/ConnectionOptions.php +++ b/lib/triagens/ArangoDb/ConnectionOptions.php @@ -246,7 +246,7 @@ class ConnectionOptions implements \ArrayAccess { assert(isset($this->_values[self::OPTION_ENDPOINT])); // set up a new endpoint, this will also validate it $this->getEndpoint(); - if (Endpoint::getType(self::OPTION_ENDPOINT) === Endpoint::TYPE_UNIX) { + if (Endpoint::getType($this->_values[self::OPTION_ENDPOINT]) === Endpoint::TYPE_UNIX) { // must set port to 0 for UNIX sockets $this->_values[self::OPTION_PORT] = 0; }
fixed bug when handling unix socket-based connections
arangodb_arangodb-php
train
php
3cf19a841969e70f97c3f709ef506e77c4bc4df9
diff --git a/ck/kernel.py b/ck/kernel.py index <HASH>..<HASH> 100644 --- a/ck/kernel.py +++ b/ck/kernel.py @@ -5144,7 +5144,9 @@ def list_data(i): import time start_time = time.time() - ls=int(i.get('limit_size','0')) + xls=i.get('limit_size','') + if xls=='': xls='0' + ls=int(xls) ils=0 lst=[]
bug fix with limitation of returned entries during search
ctuning_ck
train
py
ffa4382798655555789cd107e843966b53109d6d
diff --git a/backbone.chromestorage.js b/backbone.chromestorage.js index <HASH>..<HASH> 100644 --- a/backbone.chromestorage.js +++ b/backbone.chromestorage.js @@ -117,9 +117,32 @@ pipe(this._parseRecords). done((function(records) { this.records = records; + chrome.storage.onChanged.addListener(_update_records.bind(this)); }).bind(this)); } + function _update_records(changes, type){ + var records_change = changes[this.name]; + if(_our_store_records_changed(records_change, type)){ + _set_records_from_string(records_change.newValue); + } + } + + function _our_store_records_changed(records_change, type){ + return + type === this.type && + records_change && + records_change.newValue !== _get_records_string(); + } + + function _set_records_from_string(records_string){ + this.records = records_string.split(','); + } + + function _get_records_string(){ + return this.records.join(','); + } + // `Backbone.ChromeStorage.defaultType` can be overridden globally if desired. // // The current options are `'local'` or `'sync'`.
Now listen for changes in the records string and update accordingly. This is so if another page / tab etc updates the same store the current page will know about the changes.
scryptmouse_Backbone.ChromeStorage
train
js
e5fb025a70806d7645eabdfb4d03ae027f889c57
diff --git a/scripts/listPackagesWithTests.js b/scripts/listPackagesWithTests.js index <HASH>..<HASH> 100644 --- a/scripts/listPackagesWithTests.js +++ b/scripts/listPackagesWithTests.js @@ -20,8 +20,8 @@ const CUSTOM_HANDLERS = { // Split "api-headless-cms" tests into batches of "api-headless-cms": () => { return [ - "packages/api-page-builder/* --keyword=cms:ddb --keyword=cms:base", - "packages/api-page-builder/* --keyword=cms:ddb-es --keyword=cms:base" + "packages/api-headless-cms/* --keyword=cms:ddb --keyword=cms:base", + "packages/api-headless-cms/* --keyword=cms:ddb-es --keyword=cms:base" ]; } };
ci: split PB and CMS Jest tests into two separate runs (ddb, ddb+es)
Webiny_webiny-js
train
js
5e4d8cb404305128f7667a1e77d284b9685c3d6a
diff --git a/question/qbank.js b/question/qbank.js index <HASH>..<HASH> 100644 --- a/question/qbank.js +++ b/question/qbank.js @@ -85,7 +85,10 @@ qtype_chooser = { if (!document.getElementById('qtypechoicecontainer')) { return; } - qtype_chooser.container = new YAHOO.widget.Dialog('qtypechoicecontainer', { + var qtypechoicecontainer = document.getElementById('qtypechoicecontainer'); + qtypechoicecontainer.parentNode.removeChild(qtypechoicecontainer); + document.body.appendChild(qtypechoicecontainer); + qtype_chooser.container = new YAHOO.widget.Dialog(qtypechoicecontainer, { constraintoviewport: true, visible: false, modal: true,
question bank: MDL-<I> Add question button did not work when the question bank was hidden.
moodle_moodle
train
js
33f6ccfc7ffec20b172405706679c7acfe3a65e9
diff --git a/pyGeno/importation/Genomes.py b/pyGeno/importation/Genomes.py index <HASH>..<HASH> 100644 --- a/pyGeno/importation/Genomes.py +++ b/pyGeno/importation/Genomes.py @@ -337,7 +337,18 @@ def _importGenomeObjects(gtfFilePath, chroSet, genome, batchSize, verbose = 0) : protId = None if verbose > 2 : printf('Warning: no protein_id found in line %s' % gtf[i]) - + + # Store selenocysteine positions in transcript + if regionType == 'Selenocysteine': + + if store.transcripts[transId].selenocysteine is None: + positions = list() + else: + positions = store.transcripts[transId].selenocysteine + + positions.append(start) + store.transcripts[transId].set(selenocysteine=positions) + if protId is not None and protId not in store.proteins : if verbose > 1 : printf('\t\tProtein %s...' % (protId))
Stores selenocysteine positions in transcript
tariqdaouda_pyGeno
train
py
4723c690926abea1dc7148aca97b0635fd18e1de
diff --git a/tests/unit/fileserver/test_gitfs.py b/tests/unit/fileserver/test_gitfs.py index <HASH>..<HASH> 100644 --- a/tests/unit/fileserver/test_gitfs.py +++ b/tests/unit/fileserver/test_gitfs.py @@ -424,7 +424,9 @@ class GitFSTestBase(object): # Add a tag repo.create_tag(TAG_NAME, 'HEAD') - repo.close() + # Older GitPython versions do not have a close method. + if hasattr(repo, 'close'): + repo.close() finally: if orig_username is not None: os.environ[username_key] = orig_username @@ -443,8 +445,6 @@ class GitFSTestBase(object): except OSError as exc: if exc.errno != errno.EEXIST: raise - except Exception: - log.exception("Exception encountered durring recursive remove: %s", path) def setUp(self): '''
Older GitPython version do not have a close method
saltstack_salt
train
py
e437076aca2e76526f30493772e82ba2c9dbdbb8
diff --git a/src/Cluster.js b/src/Cluster.js index <HASH>..<HASH> 100644 --- a/src/Cluster.js +++ b/src/Cluster.js @@ -34,7 +34,7 @@ Cluster.prototype.cut = function (threshold) { /** * Merge the leaves in the minimum way to have 'minGroups' number of clusters - * @param {number} minGroups + * @param {number} minGroups - Them minimum number of children the first level of the tree should have * @return {Cluster} */ Cluster.prototype.group = function (minGroups) { @@ -61,4 +61,21 @@ Cluster.prototype.group = function (minGroups) { return root; }; +/** + * Traverses the tree depth-first and provide callback to be called on each individual node + * @param {function} cb - The callback to be called on each node encounter + * @type {Cluster} + */ +Cluster.prototype.traverse = function (cb) { + function visit(root, callback) { + callback(root); + if (root.children) { + for (var i = root.children.length - 1; i >= 0; i--) { + visit(root.children[i], callback); + } + } + } + visit(this, cb); +}; + module.exports = Cluster;
feat(cluster): add traverse method Traverses all the nodes of the tree and calls provided callback on each of them
mljs_hclust
train
js
95774518a35100bb88309fcaa7f474187d6f9884
diff --git a/packages/form/src/react/divider.js b/packages/form/src/react/divider.js index <HASH>..<HASH> 100644 --- a/packages/form/src/react/divider.js +++ b/packages/form/src/react/divider.js @@ -1,5 +1,4 @@ import * as glamor from 'glamor' -import PropTypes from 'prop-types' import React from 'react' import { useTheme } from '@pluralsight/ps-design-system-theme/react' @@ -26,8 +25,5 @@ const Divider = props => { ) } Divider.displayName = 'Divider' -Divider.contextTypes = { - themeName: PropTypes.string -} export default Divider
refactor(form): remove unneed contexttype declaration
pluralsight_design-system
train
js
f0adae5b73b338672c4d0924c887d565ed40c2ce
diff --git a/test/test_rpc.py b/test/test_rpc.py index <HASH>..<HASH> 100644 --- a/test/test_rpc.py +++ b/test/test_rpc.py @@ -500,6 +500,26 @@ def test_rpc_unknown_service_standalone(rabbit_config, rabbit_manager): assert exc_info.value._service_name == 'unknown_service' +def test_rpc_container_being_killed_retries( + container_factory, rabbit_config, rabbit_manager): + + container = container_factory(ExampleService, rabbit_config) + container.start() + + with RpcProxy("exampleservice", rabbit_config) as proxy: + assert proxy.task_a() + + container._being_killed = True + + with pytest.raises(eventlet.Timeout): + with eventlet.Timeout(.1): + proxy.task_a() + + container._being_killed = False + + assert proxy.task_a() + + def test_rpc_responder_auto_retries(container_factory, rabbit_config, rabbit_manager):
test for rpc ConsumerBeingKilled
nameko_nameko
train
py
43ade826a1b51a0e95f45a814e66fa1b36dcebcf
diff --git a/datatableview/views/legacy.py b/datatableview/views/legacy.py index <HASH>..<HASH> 100644 --- a/datatableview/views/legacy.py +++ b/datatableview/views/legacy.py @@ -522,6 +522,16 @@ class LegacyConfigurationDatatableMixin(DatatableMixin): """ Helps to keep the promise that we only run ``get_datatable_options()`` once. """ if not hasattr(self, '_datatable_options'): self._datatable_options = self.get_datatable_options() + + # Convert sources from list to tuple, so that modern Column tracking dicts can hold the + # field definitions as keys. + columns = self._datatable_options.get('columns', []) + for i, column in enumerate(columns): + if len(column) >= 2 and isinstance(column[1], list): + column = list(column) + column[1] = tuple(column[1]) + columns[i] = tuple(column) + return self._datatable_options def get_datatable_kwargs(self, **kwargs):
Fix issue with lists being used as dict keys
pivotal-energy-solutions_django-datatable-view
train
py
66347a7140bc3f61dd5bc96b6201576955b9f55b
diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index <HASH>..<HASH> 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -26,10 +26,10 @@ __license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)" __version__ = "0.6.5" from .api.errors import Error +from .api.types.pyrogram import * from .client import ChatAction from .client import Client from .client import ParseMode from .client.input_media import InputMedia from .client.input_phone_contact import InputPhoneContact from .client import Emoji -from .api.types.pyrogram import *
Move pyrogram types import on the top
pyrogram_pyrogram
train
py
af4ed5fd7af9bb858a6c295b97769a65264b7391
diff --git a/upload/catalog/controller/account/download.php b/upload/catalog/controller/account/download.php index <HASH>..<HASH> 100644 --- a/upload/catalog/controller/account/download.php +++ b/upload/catalog/controller/account/download.php @@ -31,7 +31,7 @@ class ControllerAccountDownload extends Controller { $this->load->model('account/download'); if (isset($this->request->get['page'])) { - $page = $this->request->get['page']; + $page = (int)$this->request->get['page']; } else { $page = 1; } @@ -145,4 +145,4 @@ class ControllerAccountDownload extends Controller { $this->response->redirect($this->url->link('account/download', 'language=' . $this->config->get('config_language'))); } } -} \ No newline at end of file +}
Non well formed numeric page download fix #<I>
opencart_opencart
train
php
e6f6791a2976e64e2a38dfe3bca5e08fb98db68a
diff --git a/Controller/Box/ProducerProductsBoxController.php b/Controller/Box/ProducerProductsBoxController.php index <HASH>..<HASH> 100755 --- a/Controller/Box/ProducerProductsBoxController.php +++ b/Controller/Box/ProducerProductsBoxController.php @@ -12,7 +12,6 @@ namespace WellCommerce\Bundle\ProducerBundle\Controller\Box; -use WellCommerce\Bundle\AppBundle\Conditions\LayeredNavigationConditions; use WellCommerce\Bundle\CoreBundle\Controller\Box\AbstractBoxController; use WellCommerce\Bundle\LayoutBundle\Collection\LayoutBoxSettingsCollection; @@ -24,7 +23,7 @@ use WellCommerce\Bundle\LayoutBundle\Collection\LayoutBoxSettingsCollection; class ProducerProductsBoxController extends AbstractBoxController { /** - * @var \WellCommerce\Bundle\AppBundle\Manager\Front\ProducerManager + * @var \WellCommerce\Bundle\ProducerBundle\Manager\Front\ProducerManager */ protected $manager;
Removed unused use statements (cherry picked from commit fe<I>e8e<I>c0ee<I>de<I>a5cb4deb<I>f<I>c<I>)
WellCommerce_WishlistBundle
train
php
7ea13f688907af4a1d93d1903a065299a002dc6e
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100644 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -10404,8 +10404,10 @@ return; } + if ( ! $this->is_ajax() ) { // Inject license activation dialog UI and client side code. add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) ); + } $link_text = __fs( $this->is_free_plan() ? 'activate-license' : 'change-license',
[license-activation] [link] Only add license activation dialog HTML with the plugin link when it’s not an AJAX request.
Freemius_wordpress-sdk
train
php
5ff98cace45cc9f3e466a22e3d0772c1c4df7cf5
diff --git a/src/model.py b/src/model.py index <HASH>..<HASH> 100644 --- a/src/model.py +++ b/src/model.py @@ -43,7 +43,7 @@ class Model: """ saver = tf.train.Saver() - with tf.Session() as sess: + with tf.Session(config=allow_growth_config) as sess: if restore_model_path: saver.restore(sess, restore_model_path) else: @@ -100,7 +100,7 @@ class Model: lattices can ultimately be extracted.""" saver = tf.train.Saver() - with tf.Session() as sess: + with tf.Session(config=allow_growth_config) as sess: if restore_model_path: saver.restore(sess, restore_model_path) else: @@ -184,7 +184,7 @@ class Model: """ Evaluates the model on a test set.""" saver = tf.train.Saver() - with tf.Session() as sess: + with tf.Session(config=allow_growth_config) as sess: if restore_model_path: saver.restore(sess, restore_model_path) else:
Added allow_growth_config to other sessions in model.py
persephone-tools_persephone
train
py
0855401498919742a680714bf1f83b4ba5a0e5c6
diff --git a/src/Distill/Distill.php b/src/Distill/Distill.php index <HASH>..<HASH> 100644 --- a/src/Distill/Distill.php +++ b/src/Distill/Distill.php @@ -86,7 +86,7 @@ class Distill public function extractWithoutRootDirectory($file, $path, FormatInterface $format = null) { // extract to a temporary place - $tempDirectory = sys_get_temp_dir() . uniqid(time()) . DIRECTORY_SEPARATOR; + $tempDirectory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(time()) . DIRECTORY_SEPARATOR; $this->extract($file, $tempDirectory, $format); // move directory
Added missing directory separator for tmp directories
raulfraile_distill
train
php
ff521aa279dab3f94c333d8390a217892150a3f0
diff --git a/dummyserver.js b/dummyserver.js index <HASH>..<HASH> 100644 --- a/dummyserver.js +++ b/dummyserver.js @@ -275,7 +275,11 @@ var listen = function (req, res) { output(200, hello, false, 'text/plain; charset=UTF-8'); }, 1000); } else { - fs.realpath(__dirname + req.url.substr(req.proxyPath.length), function(err, path) { + var url = req.url.substr(req.proxyPath.length); + if(url.lastIndexOf('?') >= 0) { + url = url.substr(0, url.lastIndexOf('?')); + } + fs.realpath(__dirname + url, function(err, path) { if(err || path.substr(0, __dirname.length) !== __dirname) { return output(404, null, false); }
dummyserver.js: static file serving: drop query string from filename
jakutis_httpinvoke
train
js
2dcc4bfd832e49fbac083ccf96b4dcfa4bf68b11
diff --git a/library/src/com/twotoasters/jazzylistview/JazzyListView.java b/library/src/com/twotoasters/jazzylistview/JazzyListView.java index <HASH>..<HASH> 100644 --- a/library/src/com/twotoasters/jazzylistview/JazzyListView.java +++ b/library/src/com/twotoasters/jazzylistview/JazzyListView.java @@ -64,8 +64,10 @@ public class JazzyListView extends ListView implements OnScrollListener { String strEffect = null; try { strEffect = a.getString(R.styleable.JazzyListView_effect); + if(strEffect != null) { TransitionEffect effect = TransitionEffect.valueOf(strEffect); setTransitionEffect(effect); + } } catch (IllegalArgumentException e) { Log.w(TAG, "Invalid jazzy list view transition effect: " + strEffect); }
Fix NPE if effect is not defined in the XML
twotoasters_JazzyListView
train
java
0dffba4e9f635c2d22f0036dd617135396e6726d
diff --git a/spec/slack-ruby-bot/hooks/message_spec.rb b/spec/slack-ruby-bot/hooks/message_spec.rb index <HASH>..<HASH> 100644 --- a/spec/slack-ruby-bot/hooks/message_spec.rb +++ b/spec/slack-ruby-bot/hooks/message_spec.rb @@ -5,10 +5,12 @@ describe SlackRubyBot::Hooks::Message do describe '#call' do it 'doesn\'t raise an error when message is a frozen string' do - message_hook.call( - SlackRubyBot::Client.new, - Hashie::Mash.new(text: 'message') - ) + expect do + message_hook.call( + SlackRubyBot::Client.new, + Hashie::Mash.new(text: 'message'.freeze) # rubocop:disable Style/RedundantFreeze + ) + end.to_not raise_error end end
Freeze string as expected by spec.
slack-ruby_slack-ruby-bot
train
rb
b3c7766df71938ca05e026d1cb78b12158fd49dc
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -1,4 +1,5 @@ require 'active_record/connection_adapters/sqlite_adapter' +require 'sqlite3' module ActiveRecord class Base @@ -20,10 +21,6 @@ module ActiveRecord raise ArgumentError, 'adapter name should be "sqlite3"' end - unless self.class.const_defined?(:SQLite3) - require_library_or_gem(config[:adapter]) - end - db = SQLite3::Database.new( config[:database], :results_as_hash => true
just require sqlite3 when the database adapter is required
rails_rails
train
rb
856bf0456bff18fe115f073a4fe3575584328827
diff --git a/admin/maintenance.php b/admin/maintenance.php index <HASH>..<HASH> 100644 --- a/admin/maintenance.php +++ b/admin/maintenance.php @@ -12,6 +12,11 @@ error('You need to be admin to use this page'); } + //Check folder exists + if (! make_upload_directory(SITEID)) { // Site folder + error("Could not create site folder. The site administrator needs to fix the file permissions"); + } + $filename = $CFG->dataroot.'/1/maintenance.html'; if ($form = data_submitted()) {
Now SITEID folder is created if it doesn't exist. Bug <I> (<URL>)
moodle_moodle
train
php
d4f83166a0f9127240cefc8516ff663b0a929f47
diff --git a/pandas/tests/test_nanops.py b/pandas/tests/test_nanops.py index <HASH>..<HASH> 100644 --- a/pandas/tests/test_nanops.py +++ b/pandas/tests/test_nanops.py @@ -237,10 +237,20 @@ class TestnanopsDataFrame(tm.TestCase): self.arr_utf.astype('O')] if allow_date: - self.check_fun(testfunc, targfunc, 'arr_date', **kwargs) - self.check_fun(testfunc, targfunc, 'arr_tdelta', **kwargs) - objs += [self.arr_date.astype('O'), - self.arr_tdelta.astype('O')] + try: + targfunc(self.arr_date) + except TypeError: + pass + else: + self.check_fun(testfunc, targfunc, 'arr_date', **kwargs) + objs += [self.arr_date.astype('O')] + try: + targfunc(self.arr_tdelta) + except TypeError: + pass + else: + self.check_fun(testfunc, targfunc, 'arr_tdelta', **kwargs) + objs += [self.arr_tdelta.astype('O')] if allow_obj: self.arr_obj = np.vstack(objs)
should fix issue #<I>, test_nanargmin fails with datetime<I> objects
pandas-dev_pandas
train
py
69fe01ff11422ffd9a0e68d91eaffa6fa8e4c321
diff --git a/src/bindings/dom.js b/src/bindings/dom.js index <HASH>..<HASH> 100644 --- a/src/bindings/dom.js +++ b/src/bindings/dom.js @@ -282,17 +282,15 @@ export default class LocalizationObserver { } translateRootContent(root) { - markStart(); - const anonChildren = document.getAnonymousNodes ? document.getAnonymousNodes(root) : null; if (!anonChildren) { - return this.translateFragment(root).then(markEnd); + return this.translateFragment(root); } return Promise.all( [root, ...anonChildren].map(node => this.translateFragment(node)) - ).then(markEnd); + ); } translateMutations(mutations) { @@ -409,16 +407,3 @@ export default class LocalizationObserver { ]; } } - -function markStart() { - performance.mark('l20n: start translateRootContent'); -} - -function markEnd() { - performance.mark('l20n: end translateRootContent'); - performance.measure( - 'l20n: translateRootContent', - 'l20n: start translateRootContent', - 'l20n: end translateRootContent' - ); -}
Bug <I> - Remove performance.marks from the bindings and l<I>n-perf-monitor from browser.xul. r=stas
l20n_l20n.js
train
js
040e60b77f3b9d54b7e2b2d286ce4305f2fdb998
diff --git a/src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasView.java b/src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasView.java index <HASH>..<HASH> 100644 --- a/src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasView.java +++ b/src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasView.java @@ -195,7 +195,7 @@ public class CmsAliasView extends Composite { m_countLabel.setText(message); } }); - setWidth("1150px"); //$NON-NLS-1$ + setWidth("100%"); //$NON-NLS-1$ } /**
Fixed broken layout in alias editor dialog.
alkacon_opencms-core
train
java
df86c7c517252287bab508ff86973ecaba388ed2
diff --git a/provision/juju/queue_test.go b/provision/juju/queue_test.go index <HASH>..<HASH> 100644 --- a/provision/juju/queue_test.go +++ b/provision/juju/queue_test.go @@ -75,7 +75,9 @@ func (s *ELBSuite) TestHandleMessageWithUnits(c *C) { c.Assert(instances, HasLen, 2) ids := []string{instances[0].InstanceId, instances[1].InstanceId} sort.Strings(ids) - c.Assert(ids, DeepEquals, []string{id1, id2}) + want := []string{id1, id2} + sort.Strings(want) + c.Assert(ids, DeepEquals, want) c.Assert(commandmocker.Ran(tmpdir), Equals, true) }
provision/juju: make test more reliable String sorting, i-<I> < i-9 :-)
tsuru_tsuru
train
go
aadcbc46f988686397c862d703162984a802993f
diff --git a/tests/LoaderTest.php b/tests/LoaderTest.php index <HASH>..<HASH> 100644 --- a/tests/LoaderTest.php +++ b/tests/LoaderTest.php @@ -32,8 +32,6 @@ namespace Dwoo\Tests $tpl = new TemplateString('{loaderTest}'); $tpl->forceCompilation(); $this->assertEquals('Moo', $this->dwoo->get($tpl, array(), $this->compiler)); - - $tpl = new TemplateString('{blockTest}moo{/blockTest}'); } public function testPluginLoadBlock()
Remove leftover line in LoaderTest.php (cherry picked from commit bc<I>bdc)
dwoo-project_dwoo
train
php
bee50ba9e15c674e3be0ffb3b77a2f6ee91cdddb
diff --git a/public/absync.js b/public/absync.js index <HASH>..<HASH> 100644 --- a/public/absync.js +++ b/public/absync.js @@ -114,12 +114,11 @@ //noinspection JSUnusedGlobalSymbols /** * Register the service factory. - * @param {angular.IRootScopeService|Object} $rootScope * @returns {AbsyncService} * @ngInject */ - AbsyncProvider.prototype.$get = function AbsyncProvider$$get( $rootScope ) { - return new AbsyncService( this, $rootScope ); + AbsyncProvider.prototype.$get = function AbsyncProvider$$get() { + return new AbsyncService( this ); };
[TASK] Remove $rootScope from $get
oliversalzburg_absync
train
js
5bd5d8aabbaed2b522b6eff838ff1c5031dfe1f1
diff --git a/internal/version_autogenerated.go b/internal/version_autogenerated.go index <HASH>..<HASH> 100755 --- a/internal/version_autogenerated.go +++ b/internal/version_autogenerated.go @@ -4,5 +4,5 @@ package internal const ( // Version is the current version of the plaid-go library - Version = "2.6.0" + Version = "2.7.0" )
<I> (#<I>)
plaid_plaid-go
train
go
45892f8514e7ec8bc111430b6f3a21d8ca56126d
diff --git a/jest.config.js b/jest.config.js index <HASH>..<HASH> 100644 --- a/jest.config.js +++ b/jest.config.js @@ -26,5 +26,6 @@ module.exports = { '<rootDir>/src/**/*.{js,jsx,ts,tsx}', '!**/demos/**', '!**/tests/**', + '!**/.umi/**', ], }
chore: update coverage config to exclude `.umi` (#<I>)
ant-design_ant-design-mobile
train
js
719464339afd1a9af84e6e5b4671529f494a1dc0
diff --git a/src/Collector.php b/src/Collector.php index <HASH>..<HASH> 100644 --- a/src/Collector.php +++ b/src/Collector.php @@ -163,7 +163,12 @@ class Collector $group = []; foreach ($mutants as $mutant) { - $group[] = $mutant->toArray(); + $mutantData = $mutant->toArray(); + + $stderr = explode(PHP_EOL, $mutantData['stderr'], 2); + $mutantData['stderr'] = $stderr[0]; + + $group[] = $mutantData; } return $group;
Remove stacktrace from stderr in errored results
humbug_humbug
train
php
701c06f8271cb63c49fa5f6057dd6fbf4ed2cb65
diff --git a/lib/markaby/builder.rb b/lib/markaby/builder.rb index <HASH>..<HASH> 100644 --- a/lib/markaby/builder.rb +++ b/lib/markaby/builder.rb @@ -106,9 +106,6 @@ module Markaby alias_method :<<, :text alias_method :concat, :text - # Emulate ERB to satisfy helpers like <tt>form_for</tt>. - def _erbout; self end - # Captures the HTML code built inside the +block+. This is done by creating a new # stream for the builder object, running the block and passing back its stream as a string. #
* lib/markaby/builder.rb: remove _erbout method - it's in rails.rb
markaby_markaby
train
rb
939d95bcfed0733e82099aa5d7180073ede92168
diff --git a/lib/fog/storage/models/aws/file.rb b/lib/fog/storage/models/aws/file.rb index <HASH>..<HASH> 100644 --- a/lib/fog/storage/models/aws/file.rb +++ b/lib/fog/storage/models/aws/file.rb @@ -118,6 +118,7 @@ module Fog data = connection.put_object(directory.key, key, body, options) data.headers.delete('Content-Length') + data.headers['ETag'].gsub!('"','') merge_attributes(data.headers) self.content_length = connection.get_body_size(body) true
[aws|storage] Remove etag quotes for File#save
fog_fog
train
rb
3ebba90a6b1d1c8fa7ac0004650291f732b8fe50
diff --git a/lang/en/admin.php b/lang/en/admin.php index <HASH>..<HASH> 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -383,7 +383,7 @@ $string['country'] = 'Default country'; $string['coursecontact'] = 'Course contacts'; $string['coursecontact_desc'] = 'This setting allows you to control who appears on the course description. Users need to have at least one of these roles in a course to be shown on the course description for that course.'; $string['coursecontactduplicates'] = 'Display all course contact roles'; -$string['coursecontactduplicates_desc'] = 'If enabled, users with more than one of the selected course contact roles will be shown with each of their roles in the course description. Otherwise, only the role which is listed highest in \'Define roles\' in the Site administration will be shown.'; +$string['coursecontactduplicates_desc'] = 'If enabled, users with more than one of the selected course contact roles will be displayed in the course description with each of their roles. Otherwise, they will be displayed with only one role (whichever is listed highest in \'Define roles\' in the Site administration).'; $string['coursegraceperiodafter'] = 'Grace period for past courses'; $string['coursegraceperiodbefore'] = 'Grace period for future courses'; $string['courselistshortnames'] = 'Display extended course names';
MDL-<I> course: Refine strings
moodle_moodle
train
php
249e1c46bafc31eb2fdd1f3911f71372dc075611
diff --git a/internal/graphicsdriver/metal/view.go b/internal/graphicsdriver/metal/view.go index <HASH>..<HASH> 100644 --- a/internal/graphicsdriver/metal/view.go +++ b/internal/graphicsdriver/metal/view.go @@ -44,9 +44,6 @@ func (v *view) getMTLDevice() mtl.Device { } func (v *view) setDisplaySyncEnabled(enabled bool) { - // TODO: Now SetVsyncEnabled is called only from the main thread, and d.t.Run is not available since - // recursive function call via Run is forbidden. - // Fix this to use d.t.Run to avoid confusion. v.ml.SetDisplaySyncEnabled(enabled) }
graphicsdriver/metal: Remove an old comment Updates #<I>
hajimehoshi_ebiten
train
go
8d2c027089f4d1ddc07a1e19d1ccf06c356a5f11
diff --git a/lib/webrat/core/locators/link_locator.rb b/lib/webrat/core/locators/link_locator.rb index <HASH>..<HASH> 100644 --- a/lib/webrat/core/locators/link_locator.rb +++ b/lib/webrat/core/locators/link_locator.rb @@ -45,10 +45,14 @@ module Webrat end def replace_nbsp(str) - if str.respond_to?(:force_encoding) - str.force_encoding('UTF-8').gsub(/\xc2\xa0/u, ' ') + if str.respond_to?(:valid_encoding?) + if str.valid_encoding? + str.gsub(/\xc2\xa0/u, ' ') + else + str.force_encoding('UTF-8').gsub(/\xc2\xa0/u, ' ') + end else - str.gsub("\xc2\xa0", ' ') + str.gsub(/\xc2\xa0/u, ' ') end end
Fix replacing of &nbsp;, aka &#<I>; so it works on <I>
brynary_webrat
train
rb
99f9a4bf2053c7ad1e17fc6af715767313b6a34a
diff --git a/src/Models/Model.php b/src/Models/Model.php index <HASH>..<HASH> 100644 --- a/src/Models/Model.php +++ b/src/Models/Model.php @@ -125,6 +125,9 @@ class Model return $value; } + /** + * @return string + */ public function toJson() { return json_encode($this->toArray()); diff --git a/src/Resources/QueriableResource.php b/src/Resources/QueriableResource.php index <HASH>..<HASH> 100644 --- a/src/Resources/QueriableResource.php +++ b/src/Resources/QueriableResource.php @@ -76,8 +76,8 @@ class QueriableResource extends JsonResource implements QueriableResourceInterfa */ protected function transform(stdClass $data, $className = null) { - $data = !empty($className) ? $data : $this->getFirstProperty($data); $name = !empty($className) ? $className : $this->getFirstPropertyName($data); + $data = !empty($className) ? $data : $this->getFirstProperty($data); $class = '\\Pokemon\\Models\\' . ucfirst(Inflector::singularize($name)); if (class_exists($class)) { /** @var Model $model */
Fixed a bug wine querying a card or set by identifier
PokemonTCG_pokemon-tcg-sdk-php
train
php,php
62573d917a9b5dadf6e0343b568846effdfa2d79
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -658,7 +658,7 @@ class Config // Make indexed arrays into associative for select fields // e.g.: [ 'yes', 'no' ] => { 'yes': 'yes', 'no': 'no' } - if ($field['type'] === 'select' && isset($field['values']) && is_array($field['values']) && Arr::isIndexedArray($field['values'])) { + if ($field['type'] === 'select' && isset($field['values']) && Arr::isIndexed($field['values'])) { $field['values'] = array_combine($field['values'], $field['values']); }
Replaced a usage of isIndexedArray with isIndexed
bolt_bolt
train
php
278c85693e62d211c672ce33a671634448e4ff67
diff --git a/lib/statsd.js b/lib/statsd.js index <HASH>..<HASH> 100644 --- a/lib/statsd.js +++ b/lib/statsd.js @@ -389,7 +389,7 @@ Client.prototype.close = function (callback) { console.log('hot-shots could not clear out messages in flight but closing anyways'); this.messagesInFlight = 0; } - if (this.messagesInFlight <= 10000) { + if (this.messagesInFlight <= 0) { clearInterval(waitForMessages); this._close(callback); }
Oops, take out debugging change
brightcove_hot-shots
train
js
a2ad30ae9ea66157b7e21f441e9adbbf9085d9b2
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -179,7 +179,7 @@ class HtmlWebpackChildCompiler { */ function extractHelperFilesFromCompilation (mainCompilation, childCompilation, filename, childEntryChunks) { const helperAssetNames = childEntryChunks.map((entryChunk, index) => { - return mainCompilation.mainTemplate.hooks.assetPath.call(filename, { + return mainCompilation.mainTemplate.getAssetPath(filename, { hash: childCompilation.hash, chunk: entryChunk, name: `HtmlWebpackPlugin_${index}` @@ -261,7 +261,7 @@ function compileTemplate (templatePath, outputFilename, mainCompilation) { if (!compiledTemplates[templatePath]) console.log(Object.keys(compiledTemplates), templatePath); const compiledTemplate = compiledTemplates[templatePath]; // Replace [hash] placeholders in filename - const outputName = mainCompilation.mainTemplate.hooks.assetPath.call(outputFilename, { + const outputName = mainCompilation.mainTemplate.getAssetPath(outputFilename, { hash: compiledTemplate.hash, chunk: compiledTemplate.entry });
refactor: Use getAssetPath instead of calling the hook directly
jantimon_html-webpack-plugin
train
js
070ccef8251639385631867d5cbb34049267a8d0
diff --git a/tacl/constants.py b/tacl/constants.py index <HASH>..<HASH> 100644 --- a/tacl/constants.py +++ b/tacl/constants.py @@ -284,9 +284,9 @@ HIGHLIGHT_TEMPLATE = '''<!DOCTYPE html> var n = 10; var xr = 0; var xg = 0; - var xb = 0; - var yr = 0; - var yg = 128; + var xb = 255; + var yr = 255; + var yg = 0; var yb = 0; var max = $("input").length;
Changed colour scheme for highlighting to hopefully be clearer.
ajenhl_tacl
train
py
16647c978967987ddf4fb21a8ad92b63062cd2b1
diff --git a/src/Resque/Redis.php b/src/Resque/Redis.php index <HASH>..<HASH> 100644 --- a/src/Resque/Redis.php +++ b/src/Resque/Redis.php @@ -223,7 +223,7 @@ class Redis } // create Predis client - $this->redis = new Predis\Client($params, $options); + $this->initializePredisClient($params, $options); // setup namespace if (!empty($config['namespace'])) { @@ -237,6 +237,17 @@ class Redis } /** + * initialize the redis member with a predis client. + * isolated call for testability + * @param array $config predis config parameters + * @param array $options predis optional parameters + * @return null + */ + private function initializePredisClient($config, $options) { + $this->redis = new Predis\Client($config, $options); + } + + /** * Set Redis namespace * * @param string $namespace New namespace
Externalize foreign object construction fro testability
mjphaynes_php-resque
train
php
da185c7d1c4a9d4b133b5b91b64277d2b0dc4c89
diff --git a/aioboto3/s3/inject.py b/aioboto3/s3/inject.py index <HASH>..<HASH> 100644 --- a/aioboto3/s3/inject.py +++ b/aioboto3/s3/inject.py @@ -77,6 +77,8 @@ async def download_fileobj(self, Bucket, Key, Fileobj, ExtraArgs=None, """ try: + if ExtraArgs is None: + ExtraArgs = {} resp = await self.get_object(Bucket=Bucket, Key=Key, **ExtraArgs) except ClientError as err: if err.response['Error']['Code'] == 'NoSuchKey':
[noref] Default ExtraArgs to {} if None before expanding
terrycain_aioboto3
train
py
1b2e93890620aab6471e5797a6bd04a08f3591ff
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,7 @@ function expose () { Object.defineProperty(window.choo, 'debug', debug(state, emitter, app, localEmitter)) - window.choo.log = log(state, emitter, app, localEmitter) + log(state, emitter, app, localEmitter) window.choo.copy = copy window.choo.routes = Object.keys(getAllRoutes(app.router.router))
Fix bug: log works on the global directly. (#<I>)
choojs_choo-devtools
train
js
346037a5588ec9cf3b988edd5e2c872b94f03a12
diff --git a/src/main/java/net/dv8tion/jda/core/JDA.java b/src/main/java/net/dv8tion/jda/core/JDA.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/dv8tion/jda/core/JDA.java +++ b/src/main/java/net/dv8tion/jda/core/JDA.java @@ -149,8 +149,8 @@ public interface JDA * The time in milliseconds that discord took to respond to our last heartbeat * <br>This roughly represents the WebSocket ping of this session * - * <p>{@link net.dv8tion.jda.core.requests.RestAction RestAction} request times do not - * correlate to this value! + * <p><b>{@link net.dv8tion.jda.core.requests.RestAction RestAction} request times do not + * correlate to this value!</b> * * @return time in milliseconds between heartbeat and the heartbeat ack response */
Bolded jdoc for getPing warning about its lack of relation to RestAction
DV8FromTheWorld_JDA
train
java
968e793f8a6547f514a19438df5f1b0ca7315347
diff --git a/src/lib/runner.js b/src/lib/runner.js index <HASH>..<HASH> 100644 --- a/src/lib/runner.js +++ b/src/lib/runner.js @@ -265,7 +265,7 @@ export default { }, notifyRunningSpec (specFile) { - channel.emit('running:spec', specFile) + channel.emit('spec:changed', specFile) }, focusTests () {
rename to spec:changed event
cypress-io_cypress
train
js