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
c04cc35613e65f7dd0ec9db1d0fa5ace0544dc4b
diff --git a/lib/cocoapods-developing-folder/folder_DSL.rb b/lib/cocoapods-developing-folder/folder_DSL.rb index <HASH>..<HASH> 100644 --- a/lib/cocoapods-developing-folder/folder_DSL.rb +++ b/lib/cocoapods-developing-folder/folder_DSL.rb @@ -9,12 +9,14 @@ module Pod basePath = Pathname.new path def import_pod(path, *requirements) podspec = path.children.find do |p| - !p.directory? and p.extname == ".podspec" + !p.directory? and (p.extname == ".podspec" or p.basename.to_s.end_with? ".podspec.json") end if podspec != nil options = (requirements.last || {}).clone options[:path] = unify_path(path).to_path - pod(podspec.basename(".podspec").to_s, options) + name = podspec.basename(".json") + name = name.basename(".podspec") + pod(name.to_s, options) end path.children.each do |p| if p.directory?
support .podspec.json for folder dsl
leavez_cocoapods-developing-folder
train
rb
fddfbf0b8eddd292d44c9b0f84d8ffe322972dd7
diff --git a/src/discoursegraphs/readwrite/mmax2.py b/src/discoursegraphs/readwrite/mmax2.py index <HASH>..<HASH> 100755 --- a/src/discoursegraphs/readwrite/mmax2.py +++ b/src/discoursegraphs/readwrite/mmax2.py @@ -4,8 +4,7 @@ import os from lxml import etree -from networkx import MultiDiGraph - +from discoursegraphs import DiscourseDocumentGraph from discoursegraphs.readwrite.generic import generic_converter_cli class MMAXProject(object): @@ -65,7 +64,7 @@ class MMAXProject(object): return paths, annotations, stylesheet -class MMAXDocumentGraph(MultiDiGraph): +class MMAXDocumentGraph(DiscourseDocumentGraph): """ """ def __init__(self, mmax_rootdir, mmax_base_file):
based MMAX docgraph on discourse docgraph class
arne-cl_discoursegraphs
train
py
cde8cddb5993ff87c06d0990b8534a419f2f0d6a
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -37,7 +37,7 @@ function getClientSettings(options){ var parts = req.path.split('/'); var meta = { host : req.protocol + '//' + req.hostname + ':' + req.port, - index : index, + index : options.index, type : parts[2] || '', response : status, queryString : parts[parts.length-1],
fx undefined index in dev mode
zackiles_elasticsearch-odm
train
js
a7f3253945ef94bb7925e3e960bf660c9c0ac10e
diff --git a/lib/aruba/platforms/unix_environment_variables.rb b/lib/aruba/platforms/unix_environment_variables.rb index <HASH>..<HASH> 100644 --- a/lib/aruba/platforms/unix_environment_variables.rb +++ b/lib/aruba/platforms/unix_environment_variables.rb @@ -10,8 +10,8 @@ module Aruba public - def initialize - @env = ENV.to_hash.dup + def initialize(env = ENV.to_hash) + @env = Marshal.load(Marshal.dump(env)) end # Update environment with other en
Real copy of unix environment as well
cucumber_aruba
train
rb
ece704b103eaa8a8adcb44aeab25d4018f158d71
diff --git a/src/CacheMiddleware.php b/src/CacheMiddleware.php index <HASH>..<HASH> 100644 --- a/src/CacheMiddleware.php +++ b/src/CacheMiddleware.php @@ -135,6 +135,11 @@ class CacheMiddleware // If cache => return new FulfilledPromise(...) with response $cacheEntry = $this->cacheStorage->fetch($request); if ($cacheEntry instanceof CacheEntry) { + $body = $cacheEntry->getResponse()->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + if ($cacheEntry->isFresh() && ($minFreshCache === null || $cacheEntry->getStaleAge() + (int)$minFreshCache <= 0) ) {
#<I> Rewind the body (of a cached response)
Kevinrob_guzzle-cache-middleware
train
php
197611c5ad602ee9954cd59816fb6f153e0e2a3c
diff --git a/pyrc/bots.py b/pyrc/bots.py index <HASH>..<HASH> 100644 --- a/pyrc/bots.py +++ b/pyrc/bots.py @@ -126,8 +126,9 @@ class Bot(object): _,_,message = message.partition(name_used) command = re.match(r'^[,:]?\s+(.*)', message).group(1) for command_func in self._commands: - if command_func._matcher.search(command): - command_func(self, channel) + match = command_func._matcher.search(command) + if match: + command_func(self, channel, *match.groups(), **match.groupdict()) def cmd(self, raw_line): self.socket.send(raw_line + "\r\n")
@hooks.command() regex matches are passed along to the decorated function.
sarenji_pyrc
train
py
a5229fd6dff9b0ee090d3d49f64cf1e826ec1bcc
diff --git a/visidata/mainloop.py b/visidata/mainloop.py index <HASH>..<HASH> 100644 --- a/visidata/mainloop.py +++ b/visidata/mainloop.py @@ -340,5 +340,7 @@ def run(vd, *sheetlist): if scr: curses.endwin() + vd.cancelThread(*[t for t in vd.unfinishedThreads if not t.name.startswith('save_')]) + if ret: print(ret)
[main] cancel unfinished non-saver threads at end of vd.run() #<I>
saulpw_visidata
train
py
bf2cf333e41d953d2eea1fdcd1ad63ca14f0614a
diff --git a/py3status/parse_config.py b/py3status/parse_config.py index <HASH>..<HASH> 100644 --- a/py3status/parse_config.py +++ b/py3status/parse_config.py @@ -31,7 +31,7 @@ class ParseException(Exception): self.line = line self.line_no = line_no self.position = position - self.token = token + self.token = token.replace('\n', '\\n') def one_line(self): return 'CONFIG ERROR: {} saw `{}` at line {} position {}'.format( @@ -116,6 +116,7 @@ class ConfigParser: self.current_module = [] self.current_token = 0 self.line = 0 + self.line_start = 0 self.raw = config.split('\n') self.container_modules = [] @@ -443,6 +444,8 @@ def process_config(config_path, py3_wrapper=None): def notify_user(error): if py3_wrapper: py3_wrapper.notify_user(error) + else: + print(error) def module_names(): # get list of all module names
fix bug if error occurs on first line and minor cleans
ultrabug_py3status
train
py
390d8fdfdca83559e24e1e5dc27a9b5917ae4e52
diff --git a/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java b/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java index <HASH>..<HASH> 100644 --- a/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java +++ b/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/jms/AzureServiceBusJMSProperties.java @@ -50,7 +50,7 @@ public class AzureServiceBusJMSProperties { public void validate() { if (!StringUtils.hasText(connectionString)) { - throw new IllegalArgumentException("'azure.servicebus.jms.connection-string' " + + throw new IllegalArgumentException("'spring.jms.servicebus.connection-string' " + "should be provided"); }
Fixes #<I> (#<I>)
Microsoft_azure-spring-boot
train
java
a96da50f8cae5fc413e261a247ac10992246edbc
diff --git a/python/mxnet/module/bucketing_module.py b/python/mxnet/module/bucketing_module.py index <HASH>..<HASH> 100644 --- a/python/mxnet/module/bucketing_module.py +++ b/python/mxnet/module/bucketing_module.py @@ -164,6 +164,10 @@ class BucketingModule(BaseModule): self.logger.warning('Already binded, ignoring bind()') return + # in case we already initialized params, keep it + if self.params_initialized: + arg_params, aux_params = self.get_params() + assert shared_module is None, 'shared_module for BucketingModule is not supported' self.for_training = for_training @@ -178,6 +182,10 @@ class BucketingModule(BaseModule): self._curr_module = module self._buckets[self._default_bucket_key] = module + # copy back saved params, if already initialized + if self.params_initialized: + self.set_params(arg_params, aux_params) + def switch_bucket(self, bucket_key, data_shapes, label_shapes=None): """Switch to a different bucket. This will change `self.curr_module`.
keep params if rebind after params_initialized
apache_incubator-mxnet
train
py
f8b5c11b7eadd42b0fb651199d0f3314adbc1489
diff --git a/Services/FileManagementModel.php b/Services/FileManagementModel.php index <HASH>..<HASH> 100644 --- a/Services/FileManagementModel.php +++ b/Services/FileManagementModel.php @@ -703,7 +703,7 @@ class FileManagementModel extends CoreModel { $response = $this->listFiles($filter, $sortOrder, $limit); $response->stats->execution->start = $timeStamp; - $response->stats->Execution->end = microtime(true); + $response->stats->execution->end = microtime(true); return $response; }
listFilesWithType modified to accept c as a key
biberltd_FileManagementBundle
train
php
bf679dbea126b69bf12aac2459fbaf72beb8f654
diff --git a/src/paperwork/backend/docsearch.py b/src/paperwork/backend/docsearch.py index <HASH>..<HASH> 100644 --- a/src/paperwork/backend/docsearch.py +++ b/src/paperwork/backend/docsearch.py @@ -677,6 +677,10 @@ class DocSearch(object): docs = property(__get_all_docs) + @property + def nb_docs(self): + return len(self._docs_by_id) + def get(self, obj_id): """ Get a document or a page using its ID
DocSearch: Add a method to get the total number of documents without converting the whole document list into a Python list
openpaperwork_paperwork-backend
train
py
dbc780dce73e22cf3b5f0447ca35e161be31ea45
diff --git a/modelx/tests/core/cells/test_node_repr.py b/modelx/tests/core/cells/test_node_repr.py index <HASH>..<HASH> 100644 --- a/modelx/tests/core/cells/test_node_repr.py +++ b/modelx/tests/core/cells/test_node_repr.py @@ -22,7 +22,8 @@ def no_values(): def param2(x, y): return x * y - return space + yield space + model.close() @pytest.fixture
TST: Add teardown code in fixture
fumitoh_modelx
train
py
9a70ee088955f6c8e54a3a88f1e2a0ba1b6165c5
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,21 +1,19 @@ /** * Pon task to bundle browser script * @module pon-task-browser - * @version 4.0.0 + * @version 4.0.1 */ 'use strict' const define = require('./define') const transforms = require('./transforms') -const plugins = require('./plugins') -let lib = define.bind(this) +const lib = define.bind(this) Object.assign(lib, define, { define, - transforms, - plugins + transforms }) module.exports = lib
[ci skip] Travis CI committed after build
realglobe-Inc_pon-task-browser
train
js
50a80d8e49fefe876016637379e1db61d95f25e1
diff --git a/tests/HttpExceptionTest.php b/tests/HttpExceptionTest.php index <HASH>..<HASH> 100644 --- a/tests/HttpExceptionTest.php +++ b/tests/HttpExceptionTest.php @@ -28,4 +28,10 @@ class HttpExceptionTest extends \PHPUnit_Framework_TestCase { $httpException = new HttpException('', HttpCode::BAD_REQUEST); $this->assertSame(HttpCode::BAD_REQUEST, $httpException->getCode()); } + + public function testFailsIfProvidedCodeIsInvalid() + { + $this->setExpectedException('\Exception'); + new HttpException('', 9999); + } }
Added test for failing in case of invalid code in HttpException.
kiler129_CherryHttp
train
php
1ef726071dd6aa8ae6c620596d6b829e1716bf56
diff --git a/mimesis/schema.py b/mimesis/schema.py index <HASH>..<HASH> 100755 --- a/mimesis/schema.py +++ b/mimesis/schema.py @@ -2,20 +2,18 @@ import json from mimesis.decorators import type_to from mimesis.exceptions import UndefinedSchema -from mimesis.providers import Generic +from mimesis.providers import BaseProvider, Generic -class Schema(object): +class Schema(BaseProvider): """Class which helps generate data by schema using any providers which supported by mimesis. """ - def __init__(self, locale=None): - self.schema = {} - if locale is None: - self.locale = 'en' - else: - self.locale = locale + schema = {} + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) self.generic = Generic(self.locale) def __generate(self, schema):
Refactoring in Schema()
lk-geimfari_mimesis
train
py
34b094543c57af7a5a61c7ca5f6928745c9c598d
diff --git a/alignak/http_daemon.py b/alignak/http_daemon.py index <HASH>..<HASH> 100644 --- a/alignak/http_daemon.py +++ b/alignak/http_daemon.py @@ -213,6 +213,15 @@ class WSGIREFBackend(object): server=WSGIREFAdapter, quiet=True, use_ssl=use_ssl, ca_cert=ca_cert, ssl_key=ssl_key, ssl_cert=ssl_cert, daemon_thread_pool_size=daemon_thread_pool_size) + # small workaround: + # if a bad client connect to us and doesn't send anything, + # then the client thread that handle that connection will stay + # infinitely blocked.. in : + # self.handle_one_request_thread() -> + # SocketServer.py:BaseServer.handle_request() -> + # fd_sets = select.select([self], [], [], timeout) + # with timeout == None .. + self.srv.timeout = 10 except socket.error, exp: msg = "Error: Sorry, the port %d is not free: %s" % (port, str(exp)) raise PortNotFree(msg)
Enh: use a timeout for client http Given requests coming from clients should come directly once the connection is established, use an hardcoded timeout for the client socket. <I> secs is rather conservative actually, should be safe. A more agressive timeout (like 5 secs) could also be safely used. This prevents bad clients from blocking http threads.
Alignak-monitoring_alignak
train
py
1f54054e1f2834f21ce727e1976d65574dc71fe7
diff --git a/source/application/views/admin/de/lang.php b/source/application/views/admin/de/lang.php index <HASH>..<HASH> 100755 --- a/source/application/views/admin/de/lang.php +++ b/source/application/views/admin/de/lang.php @@ -346,7 +346,7 @@ $aLang = array( 'ARTICLE_ATTRIBUTE_NOATTRIBUTE' => 'Nicht ben. Attribute', 'ARTICLE_ATTRIBUTE_SELECTONEATTR' => 'Bitte w�hlen Sie ein Attribut:', 'ARTICLE_ATTRIBUTE_SAVE' => 'Speichern', -'ARTICLE_ATTRIBUTE_OPENINNEWWINDOW' => '', +'ARTICLE_ATTRIBUTE_OPENINNEWWINDOW' => 'Neues Attribut in neuem Fenster �ffnen', 'ARTICLE_ATTRIBUTE_NOSELLIST' => 'Nicht ben. Ausw.listen', 'ARTICLE_ATTRIBUTE_ITEMSATTRIBUTE' => 'Artikel hat diese Attrib.', 'ARTICLE_ATTRIBUTE_ITEMSSELLIST' => 'Artikel hat diese Ausw.listen',
fixed #<I> (cherry picked from commit <I>b)
OXID-eSales_oxideshop_ce
train
php
915d6365f1e5da05f542262e70bad1165c7e7f30
diff --git a/test/e2e/storage/external/external.go b/test/e2e/storage/external/external.go index <HASH>..<HASH> 100644 --- a/test/e2e/storage/external/external.go +++ b/test/e2e/storage/external/external.go @@ -253,7 +253,7 @@ func (d *driverDefinition) GetSnapshotClass(config *testsuites.PerTestConfig) *u framework.Skipf("Driver %q does not support snapshotting - skipping", d.DriverInfo.Name) } - snapshotter := config.GetUniqueDriverName() + snapshotter := d.DriverInfo.Name parameters := map[string]string{} ns := config.Framework.Namespace.Name suffix := snapshotter + "-vsc"
e2e/storage: fix snapshot support in external driver testing When using an already installed driver, the snapshot name is the original driver name. Renaming was incorrectly copied from the in-tree CSI hostpath driver.
kubernetes_kubernetes
train
go
ef5765d9c2925dcfaf06303d55bfb4cced55b7c8
diff --git a/src/com/opera/core/systems/OperaPaths.java b/src/com/opera/core/systems/OperaPaths.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/OperaPaths.java +++ b/src/com/opera/core/systems/OperaPaths.java @@ -73,7 +73,7 @@ public class OperaPaths { if (path == null) return null; File file = new File(path); - if (file.exists() && file.canExecute()) return path; + if (file.exists()) return path; return null; } @@ -83,8 +83,7 @@ public class OperaPaths { try { Process process = Runtime.getRuntime().exec(cmd); - BufferedReader out= new BufferedReader(new InputStreamReader(process - .getInputStream())); + BufferedReader out= new BufferedReader(new InputStreamReader(process.getInputStream())); String line = null;
Removed Java6 specific API (we aim to be Java5 comp)
operasoftware_operaprestodriver
train
java
e3eb079679274b7f24146cf7524c579308a2b100
diff --git a/lib/prerender_rails.rb b/lib/prerender_rails.rb index <HASH>..<HASH> 100644 --- a/lib/prerender_rails.rb +++ b/lib/prerender_rails.rb @@ -148,6 +148,7 @@ module Rack headers['X-Prerender-Token'] = ENV['PRERENDER_TOKEN'] if ENV['PRERENDER_TOKEN'] headers['X-Prerender-Token'] = @options[:prerender_token] if @options[:prerender_token] req = Net::HTTP::Get.new(url.request_uri, headers) + req.basic_auth(ENV['PRERENDER_USERNAME'], ENV['PRERENDER_PASSWORD']) if @options[:basic_auth] response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) } if response['Content-Encoding'] == 'gzip' response.body = ActiveSupport::Gzip.decompress(response.body) @@ -199,7 +200,6 @@ module Rack response end - def before_render(env) return nil unless @options[:before_render]
Added support for HTTP Basic Auth
prerender_prerender_rails
train
rb
57e4ce0abe06659c91cb0e158dec146ea1251e51
diff --git a/openquake/calculators/getters.py b/openquake/calculators/getters.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/getters.py +++ b/openquake/calculators/getters.py @@ -355,7 +355,9 @@ class GmfGetter(object): """ Yield a GmfComputer instance for each non-discarded rupture """ - for ebr in self.rupgetter.get_ruptures(): + with mon: + ebrs = self.rupgetter.get_ruptures() + for ebr in ebrs: with mon: sitecol = self.sitecol.filtered(ebr.sids) try:
Changed monitoring of get_ruptures [skip CI]
gem_oq-engine
train
py
d93bd1e119c902c197c93605da0a8b4e5f42374e
diff --git a/lib/fluent/agent.rb b/lib/fluent/agent.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/agent.rb +++ b/lib/fluent/agent.rb @@ -126,7 +126,7 @@ module Fluent output.router = @event_router if output.respond_to?(:router=) output.configure(conf) @outputs << output - if output.respond_to?(:outputs) && (output.respond_to?(:multi_output?) && output.multi_output? || output.is_a?(Fluent::MultiOutput)) + if output.respond_to?(:outputs) && output.respond_to?(:multi_output?) && output.multi_output? # TODO: ruby 2.3 or later: replace `output.respond_to?(:multi_output?) && output.multi_output?` with output&.multi_output? outputs = if output.respond_to?(:static_outputs) output.static_outputs
<I> MultiOutput plugins call lifecycle methods by themselves
fluent_fluentd
train
rb
cfe311f86ebed49b522abe269beb20531a1e6e90
diff --git a/sregistry/database/sqlite.py b/sregistry/database/sqlite.py index <HASH>..<HASH> 100644 --- a/sregistry/database/sqlite.py +++ b/sregistry/database/sqlite.py @@ -167,7 +167,7 @@ def inspect(self, name): del fields['_sa_instance_state'] fields['created_at'] = str(fields['created_at']) print(json.dumps(fields, indent=4, sort_keys=True)) - + return fields def rename(self, image_name, path): '''rename performs a move, but ensures the path is maintained in storage
returning fields for inspect to close #<I>
singularityhub_sregistry-cli
train
py
932a03d842c0cf9aca82fd44a3b31214103da0aa
diff --git a/Command/GenerateProjectCommand.php b/Command/GenerateProjectCommand.php index <HASH>..<HASH> 100644 --- a/Command/GenerateProjectCommand.php +++ b/Command/GenerateProjectCommand.php @@ -319,9 +319,11 @@ class GenerateProjectCommand extends GeneratorCommand $input->setOption( 'database-port', $databasePort ); - $databaseUser = $dialog->ask( + $databaseUser = $dialog->askAndValidate( $output, $dialog->getQuestion( 'Database user', $input->getOption( 'database-user' ) ), + array( 'Netgen\Bundle\GeneratorBundle\Command\Validators', 'validateNotEmpty' ), + false, $input->getOption( 'database-user' ) );
Validate that database user is not empty
netgen_site-generator-bundle
train
php
83644ecb3bd48d0cc641913c6ca06f2bcac2619f
diff --git a/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java b/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java index <HASH>..<HASH> 100644 --- a/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java +++ b/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java @@ -35,9 +35,9 @@ public class PersonHBaseTest extends BaseTest @Before public void setUp() throws Exception { - cli = new HBaseCli(); - // cli.init(); - cli.startCluster(); +// cli = new HBaseCli(); +// // cli.init(); +// cli.startCluster(); emf = Persistence.createEntityManagerFactory("hbaseTest"); em = emf.createEntityManager(); col = new java.util.HashMap<Object, Object>(); @@ -111,7 +111,7 @@ public class PersonHBaseTest extends BaseTest } em.close(); emf.close(); - cli.stopCluster("PERSON"); +// cli.stopCluster("PERSON"); LuceneCleanupUtilities.cleanLuceneDirectory("hbaseTest"); // if (cli.isStarted)
commented out call to HbaseCli
Impetus_Kundera
train
java
06eb116d501c5c0f4d945d88c4fb2f1d03d6fc70
diff --git a/lib/argon2.rb b/lib/argon2.rb index <HASH>..<HASH> 100644 --- a/lib/argon2.rb +++ b/lib/argon2.rb @@ -32,7 +32,9 @@ module Argon2 raise ArgonHashFail, "Invalid hash" unless /^\$argon2i\$.{,112}/ =~ hash - hash.gsub! "argon2$", "argon2$v=19$" + hash.gsub! "argon2$", "argon2$v=19$" unless + /^\$argon2i\$v=/ =~ hash + Argon2::Engine.argon2i_verify(pass, hash, secret) end end
Fix issue that introduced version number twice.
technion_ruby-argon2
train
rb
43d359b1d7e083c9c7cb9afb5ad7995d2aea1641
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -970,7 +970,7 @@ class Controller extends Object implements CakeEventListener { $referer = $this->request->referer($local); if ($referer === '/' && $default) { - return Router::url($default, true); + return Router::url($default, !$local); } return $referer; }
Make referer() behave as expected.
cakephp_cakephp
train
php
7ed5e93940d4971b697e2cb260e0bec9d51f8d89
diff --git a/src/components/text-fields/VTextField.js b/src/components/text-fields/VTextField.js index <HASH>..<HASH> 100644 --- a/src/components/text-fields/VTextField.js +++ b/src/components/text-fields/VTextField.js @@ -169,7 +169,7 @@ export default { 'height': this.inputHeight && `${this.inputHeight}px` }, domProps: { - autofucus: this.autofocus, + autofocus: this.autofocus, disabled: this.disabled, required: this.required, value: this.lazyValue
fixes <I> (#<I>)
vuetifyjs_vuetify
train
js
dbc0cf81ff6f57b99f584d5a861f7e8befb861be
diff --git a/test/launch.js b/test/launch.js index <HASH>..<HASH> 100755 --- a/test/launch.js +++ b/test/launch.js @@ -20,11 +20,10 @@ let browser = { return process.env.NODE_ENV === 'testing' }, open () { - if (this.silent) { - chromeOpts.chromeFlags = chromeOpts.chromeFlags || [] - chromeOpts.chromeFlags.push('--headless') - } - launcher.launch(chromeOpts).then(chrome => this.inst = chrome) + launcher.launch(chromeOpts).then(chrome => { + // promise not resolve in headless mode + this.inst = chrome + }) }, close () { if (this.silent) {
Find promise resolve problem in headless mode So disable it. ref: <URL>
skylerlee_wavebell
train
js
69d8b73c55083e027e9adfeaa58a3d4c87f03a21
diff --git a/hrv/rri.py b/hrv/rri.py index <HASH>..<HASH> 100644 --- a/hrv/rri.py +++ b/hrv/rri.py @@ -4,7 +4,10 @@ import numpy as np class RRi: def __init__(self, rri, time=None): self.rri = _validate_rri(rri) - self.time = _create_time_array(self.rri) + if time is None: + self.time = _create_time_array(self.rri) + else: + self.time = np.array(time) @property def values(self): diff --git a/tests/test_rri.py b/tests/test_rri.py index <HASH>..<HASH> 100644 --- a/tests/test_rri.py +++ b/tests/test_rri.py @@ -42,8 +42,8 @@ def test_rri_time_auto_creation(): def test_rri_time_passed_as_argument(): - rri_time = np.cumsum(FAKE_RRI) / 1000.0 + rri_time = [1, 2, 3, 4] rri = RRi(FAKE_RRI, rri_time) assert isinstance(rri.time, np.ndarray) - np.testing.assert_array_equal(rri.time, np.cumsum(FAKE_RRI) / 1000.0) + np.testing.assert_array_equal(rri.time, np.array([1, 2, 3, 4]))
Creates time array only if not passed as argument
rhenanbartels_hrv
train
py,py
070292fb3bf5ef7fcb87569b8b48b87f33297699
diff --git a/lib/vagrant/plugin/remote/manager.rb b/lib/vagrant/plugin/remote/manager.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/plugin/remote/manager.rb +++ b/lib/vagrant/plugin/remote/manager.rb @@ -7,6 +7,10 @@ module Vagrant # as provides methods that allow querying all registered components of # those plugins as a single unit. class Manager + class << self + attr_accessor :client + end + WRAPPER_CLASS = proc do |klass| class << klass attr_accessor :plugin_name, :type @@ -66,8 +70,7 @@ module Vagrant end def plugin_manager - info = Thread.current.thread_variable_get(:service_info) - info.plugin_manager if info + self.class.client end # Synced folder plugins are registered with an integer priority, but in
Add class level storage for remote manager client
hashicorp_vagrant
train
rb
ac64456cae34558407f5fa44a1c19e492bf77ef0
diff --git a/lib/ldapter/dn.rb b/lib/ldapter/dn.rb index <HASH>..<HASH> 100644 --- a/lib/ldapter/dn.rb +++ b/lib/ldapter/dn.rb @@ -165,7 +165,7 @@ module Ldapter # # Ldapter::DN(:dc => "com")/{:dc => "foobar"} #=> "DC=foobar,DC=com" def /(*args) - Ldapter::DN(args.reverse + to_a, source) + Ldapter::DN(args.reverse + rdns, source) end # With a Hash (and only with a Hash), prepends a RDN to the DN, modifying
Abstain from invoking DN#to_a
tpope_ldaptic
train
rb
bae05bb2f723f7ad9b090d513eedb3464d63cdf5
diff --git a/lib/node_modules/@stdlib/_tools/bundle/pkg-list/examples/multiple-bundles/index.js b/lib/node_modules/@stdlib/_tools/bundle/pkg-list/examples/multiple-bundles/index.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/_tools/bundle/pkg-list/examples/multiple-bundles/index.js +++ b/lib/node_modules/@stdlib/_tools/bundle/pkg-list/examples/multiple-bundles/index.js @@ -57,7 +57,7 @@ var bopts1 = { }; var bopts2 = { - 'namespace': 'flat', + 'namespace': 'none', 'exportName': '@stdlib/datasets', 'transforms': [ [ uglifyify, uopts ] // minify modules individually
Expose all datasets packages via `require`
stdlib-js_stdlib
train
js
6dafaf01b4254122d92ffa940ede552808bcd9d3
diff --git a/src/Http/Requests/TagFormRequest.php b/src/Http/Requests/TagFormRequest.php index <HASH>..<HASH> 100644 --- a/src/Http/Requests/TagFormRequest.php +++ b/src/Http/Requests/TagFormRequest.php @@ -20,23 +20,6 @@ class TagFormRequest extends FormRequest } /** - * Process given request data before validation. - * - * @param array $data - * - * @return array - */ - public function process($data) - { - // Sync categories - if (! empty($data['categoryList'])) { - $data['categories'] = $data['categoryList']; - } - - return $data; - } - - /** * Get the validation rules that apply to the request. * * @return array
Remove useless code (mistakenly inserted)
rinvex_cortex-tags
train
php
e7efc4720e2946a6b0f63c4a8d4d5376201b4518
diff --git a/src/tile_manager.js b/src/tile_manager.js index <HASH>..<HASH> 100644 --- a/src/tile_manager.js +++ b/src/tile_manager.js @@ -40,6 +40,9 @@ export default TileManager = { let tile = this.tiles[key]; if (this.coord_tiles[tile.coords.key]) { this.coord_tiles[tile.coords.key].delete(tile); + if (this.coord_tiles[tile.coords.key].size === 0) { + delete this.coord_tiles[tile.coords.key]; + } } }
tile manager: remove coord from current set when no more tiles
tangrams_tangram
train
js
6e1a7238f896578200bfecc2cb20528661ba8498
diff --git a/packages/node_modules/@webex/internal-plugin-mercury/test/unit/spec/mercury.js b/packages/node_modules/@webex/internal-plugin-mercury/test/unit/spec/mercury.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/internal-plugin-mercury/test/unit/spec/mercury.js +++ b/packages/node_modules/@webex/internal-plugin-mercury/test/unit/spec/mercury.js @@ -68,7 +68,6 @@ describe('plugin-mercury', () => { webex.internal.device = { register: sinon.stub().returns(Promise.resolve()), refresh: sinon.stub().returns(Promise.resolve()), - markUrlFailedAndGetNew: sinon.stub().returns(Promise.resolve()), webSocketUrl: 'ws://example.com', getWebSocketUrl: sinon.stub().returns(Promise.resolve('ws://example-2.com')), useServiceCatalogUrl: sinon.stub().returns(Promise.resolve('https://service-catalog-url.com'))
test(internal-plugin-mercury): update stubs Update the stubs in the mercury plugin tests to no longer target device#markUrlFailedAndGetNew().
webex_spark-js-sdk
train
js
d98bc677ac15fae0e1fcb3a10527ff9994b569d4
diff --git a/lib/excon/ssl_socket.rb b/lib/excon/ssl_socket.rb index <HASH>..<HASH> 100644 --- a/lib/excon/ssl_socket.rb +++ b/lib/excon/ssl_socket.rb @@ -9,7 +9,6 @@ module Excon # create ssl context ssl_context = OpenSSL::SSL::SSLContext.new - ssl_context.ssl_version = 'SSLv3' if params[:ssl_verify_peer] # turn verification on
loosen ssl version requirement, leave it up to server to negotiate closes #<I>
excon_excon
train
rb
9d1963ccb2eea287df5a79c7b7005c8f6f51ca45
diff --git a/lib/serf/command.rb b/lib/serf/command.rb index <HASH>..<HASH> 100644 --- a/lib/serf/command.rb +++ b/lib/serf/command.rb @@ -15,10 +15,12 @@ module Serf # end # class Command + attr_reader :request + attr_reader :options def initialize(request, *args) @args = args - @opts = @args.last.is_a?(::Hash) ? pop : {} + @options = @args.last.is_a?(::Hash) ? pop : {} @request = request.is_a?(Hash) ? request_parser.parse(request) : request @@ -38,6 +40,14 @@ module Serf protected + def opts(key, default=nil) + if default.nil? + return @options.fetch key + else + return @options.fetch(key) { default } + end + end + def request_parser raise ArgumentError, 'Parsing Hash request is Not Supported' end
Adds helpers for syntactic sugar for getting @options.
byu_serf
train
rb
73aef13ff012720b1bca3cff46ec6a7b5f2b0d38
diff --git a/byte-buddy-gradle-plugin/src/test/java/net/bytebuddy/build/gradle/TransformationActionTest.java b/byte-buddy-gradle-plugin/src/test/java/net/bytebuddy/build/gradle/TransformationActionTest.java index <HASH>..<HASH> 100644 --- a/byte-buddy-gradle-plugin/src/test/java/net/bytebuddy/build/gradle/TransformationActionTest.java +++ b/byte-buddy-gradle-plugin/src/test/java/net/bytebuddy/build/gradle/TransformationActionTest.java @@ -86,7 +86,7 @@ public class TransformationActionTest { when(byteBuddyExtension.getTransformations()).thenReturn(Collections.singletonList(transformation)); when(byteBuddyExtension.getInitialization()).thenReturn(initialization); when(parent.getDestinationDir()).thenReturn(target); - when(transformation.getClassPath(any(File.class), any(Iterable.class))).thenReturn(Collections.emptySet()); + when(transformation.getClassPath(any(File.class), any(Iterable.class))).thenReturn(Collections.<File>emptySet()); when(parent.getClasspath()).thenReturn(fileCollection); when(fileCollection.iterator()).then(new Answer<Iterator<File>>() { @Override
Fixed type inference that does not apply before Java 8.
raphw_byte-buddy
train
java
954caf7e649eebf840a3185db2ba382da70a45a0
diff --git a/tasks/sg_release.js b/tasks/sg_release.js index <HASH>..<HASH> 100644 --- a/tasks/sg_release.js +++ b/tasks/sg_release.js @@ -99,8 +99,16 @@ module.exports = function (grunt) { grunt.registerTask('finish_sg_release', function () { var done = this.async(); + var options = this.options({ + developVersionCommitMsg: 'Increased version for development' + }); + + function commitDevelopmentVersion() { + gitHelper.commit(grunt, process.cwd(), options.developVersionCommitMsg, done); + } (function start() { + commitDevelopmentVersion(); })(); });
Added commit new version into develop branch step
SunGard-Labs_grunt-sg-release
train
js
6d485dc1cc8184c4f25f1c25576c7ea88ef80a91
diff --git a/static/vendor/js/handlebars.js b/static/vendor/js/handlebars.js index <HASH>..<HASH> 100644 --- a/static/vendor/js/handlebars.js +++ b/static/vendor/js/handlebars.js @@ -1,3 +1,25 @@ +/* +Copyright (C) 2011 by Yehuda Katz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + // lib/handlebars/base.js /*jshint eqnull:true*/
Add license to handlebars.js file.
prometheus_prometheus
train
js
9a5ce9fe37ba4b2cca1058e8108debddf711b516
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 @@ -380,11 +380,11 @@ def spec_helper_count_database_calls_in( &block ) return count end -# In Ruby 2.5.0 the Ruby team removed access to standard library "tmpnam": +# In Ruby 2.5.0 the Ruby team removed <tt>Dir::Tmpname.make_tmpname</tt>: # # https://github.com/ruby/ruby/commit/25d56ea7b7b52dc81af30c92a9a0e2d2dab6ff27 # -# Instead we must make our best attempt in plain Ruby, e.g.: +# Instead we must make our best attempt in plain Ruby ourselves, e.g.: # # https://github.com/rails/rails/issues/31458 # https://github.com/rails/rails/pull/31462/files
Clarified misleading comment after PR feedback. The use of "tmpnam" not "tmpname" was intentional as I just assumed that Ruby's implementation would use the C/C++ "tmpnam" function for the implementation. Surprisingly, the diff for the Ruby core change set shows it never did and the Rails solution is basically a copy of the Ruby core stuff.
LoyaltyNZ_hoodoo
train
rb
c18e0fdd2cd518aefd6be3b111c51fca3617742e
diff --git a/src/main/resources/META-INF/resources/primefaces/sticky/sticky.js b/src/main/resources/META-INF/resources/primefaces/sticky/sticky.js index <HASH>..<HASH> 100644 --- a/src/main/resources/META-INF/resources/primefaces/sticky/sticky.js +++ b/src/main/resources/META-INF/resources/primefaces/sticky/sticky.js @@ -33,7 +33,7 @@ PrimeFaces.widget.Sticky = PrimeFaces.widget.BaseWidget.extend({ resizeNS = 'resize.' + this.cfg.id; win.off(scrollNS).on(scrollNS, function() { - if(win.scrollTop() > $this.initialState.top) + if(win.scrollTop() > $this.initialState.top - $this.cfg.margin) $this.fix(); else $this.restore(); @@ -78,4 +78,4 @@ PrimeFaces.widget.Sticky = PrimeFaces.widget.BaseWidget.extend({ } } -}); \ No newline at end of file +});
#<I> fix scroll behaviour of sticky with margin > 0
primefaces_primefaces
train
js
707b95a38e6c86abffe6b4078510dd3cc67e055c
diff --git a/action/adapter/helper/FormLoader.php b/action/adapter/helper/FormLoader.php index <HASH>..<HASH> 100644 --- a/action/adapter/helper/FormLoader.php +++ b/action/adapter/helper/FormLoader.php @@ -44,7 +44,7 @@ class FormLoader extends Helper public function getFilteredData($data = null) { if (is_string($data)) { - if (empty($data)) { + if ($data === '') { return null; } else { return $data;
Fixed bug with search by boolean column
execut_yii2-actions
train
php
f595b3dab72f3a213d7744fe750c64844a1eb97e
diff --git a/spans/__init__.py b/spans/__init__.py index <HASH>..<HASH> 100644 --- a/spans/__init__.py +++ b/spans/__init__.py @@ -11,7 +11,7 @@ together. """ -__version__ = "0.1.1" +__version__ = "0.1.2" __all__ = [ "intrange", "floatrange", diff --git a/spans/_compat.py b/spans/_compat.py index <HASH>..<HASH> 100644 --- a/spans/_compat.py +++ b/spans/_compat.py @@ -4,13 +4,13 @@ import sys __all__ = ["python3", "version", "bstr", "ustr", "uchr", "u_doctest"] -version = tuple(map(int, sys.version.split(" ")[0].split("."))) +version = tuple(map(int, sys.version.split(".")[0:2])) python3 = False -if version >= (3, 0, 0): +if version >= (3, 0): python3 = True - if version < (3, 3, 0): + if version < (3, 3): raise ImportError("Module is only compatible with Python (<=2.7, >=3.3)") bstr, ustr, uchr = bytes, str, chr
Fixed version check for python distributions with + in version number. Bumped version number
runfalk_spans
train
py,py
27e8b645033ae176c768566b794d65c98c6802e5
diff --git a/packages/workflow/webpack.config.production.js b/packages/workflow/webpack.config.production.js index <HASH>..<HASH> 100644 --- a/packages/workflow/webpack.config.production.js +++ b/packages/workflow/webpack.config.production.js @@ -69,6 +69,12 @@ const plugin = (settings) => { idHint: 'vendors', chunks: 'all', priority: 1 + }, + moment: { + test: /[/\\]node_modules[/\\](moment)[/\\]/, + idHint: 'vendors', + chunks: 'all', + priority: 2 } // TODO: re-implement cacheGroups for styles? // TODO: Add cacheGroup for Availity packages in node_modules ? diff --git a/packages/workflow/webpack.config.profile.js b/packages/workflow/webpack.config.profile.js index <HASH>..<HASH> 100644 --- a/packages/workflow/webpack.config.profile.js +++ b/packages/workflow/webpack.config.profile.js @@ -56,6 +56,12 @@ const plugin = (settings) => { idHint: 'vendors', chunks: 'all', priority: 1 + }, + moment: { + test: /[/\\]node_modules[/\\](moment)[/\\]/, + idHint: 'vendors', + chunks: 'all', + priority: 2 } // TODO: re-implement cacheGroups for styles? // TODO: Add cacheGroup for Availity packages in node_modules ?
feat(workflow): add a cacheGroup for moment
Availity_availity-workflow
train
js,js
48da6bbdb77923a33f0860df735ea82bb17c3289
diff --git a/greenwich/raster.py b/greenwich/raster.py index <HASH>..<HASH> 100644 --- a/greenwich/raster.py +++ b/greenwich/raster.py @@ -241,20 +241,25 @@ class ImageDriver(object): # File does not even exist return True - def raster(self, path, shape, bandtype=gdal.GDT_Byte): + def raster(self, path, size, bandtype=gdal.GDT_Byte): """Returns a new Raster instance. gdal.Driver.Create() does not support all formats. Arguments: path -- file object or path as str - shape -- two or three-tuple of (xsize, ysize, bandcount) + size -- two or three-tuple of (xsize, ysize, bandcount) bandtype -- GDAL pixel data type """ path = getattr(path, 'name', path) - if len(shape) == 2: - shape += (1,) - nx, ny, bandcount = shape + if len(size) == 2: + size += (1,) + try: + nx, ny, bandcount = size + except ValueError as exc: + exc.args = ( + 'Must be sequence of length 2 or 3, not %s' % len(size),) + raise if nx < 0 or ny < 0: raise ValueError('Size cannot be negative') # Do not write to a non-empty file.
Provide more descriptive error for incorrect size arg
bkg_greenwich
train
py
ed3284b44cf756e21ee16944b61d70baf92f07dd
diff --git a/src/js/form.js b/src/js/form.js index <HASH>..<HASH> 100644 --- a/src/js/form.js +++ b/src/js/form.js @@ -222,7 +222,7 @@ ch.form = function(conf){ }); // Bind the reset - that.$element.find(":reset, .resetForm").bind("click", function(event){ clear(event); }); + that.$element.find(":reset, .resetForm").bind("click", function(event){ reset(event); }); return that; -}; \ No newline at end of file +};
GH-<I> Reset input didn't clean the form
mercadolibre_chico
train
js
4fc044273e6c9b77340e0fe53fd49f616420dc84
diff --git a/routing/zipkin_tracing.go b/routing/zipkin_tracing.go index <HASH>..<HASH> 100644 --- a/routing/zipkin_tracing.go +++ b/routing/zipkin_tracing.go @@ -66,7 +66,7 @@ var _ = ZipkinDescribe("Zipkin Tracing", func() { appLogsSession = cf.Cf("logs", "--recent", hostname) - Eventually(appLogsSession.Out).Should(gbytes.Say("x_b3_traceid:\"fee1f7ba6aeec41c")) + Expect(appLogsSession.Out).Should(gbytes.Say("x_b3_traceid:\"fee1f7ba6aeec41c")) _, appLogSpanId, _ := grabIDs(string(appLogsSession.Out.Contents()), traceId) Expect(curlOutput).To(ContainSubstring(traceId))
Remove Evenutally in favor of Expect - this test has been extremely flakey due to gbytes say not showing up in the requisite amount of time. - no reason to actually use an eventually as all of the logs have already been fetched on the line above and we are not waiting for them to "Eventually" come in.
cloudfoundry_cf-acceptance-tests
train
go
25aa3705f9a090216e6d92b9c5fdcb334695af60
diff --git a/test/test_tecplot.py b/test/test_tecplot.py index <HASH>..<HASH> 100644 --- a/test/test_tecplot.py +++ b/test/test_tecplot.py @@ -10,7 +10,13 @@ import meshio @pytest.mark.parametrize( "mesh", - [helpers.tri_mesh, helpers.quad_mesh, helpers.tet_mesh, helpers.hex_mesh], + [ + helpers.tri_mesh, helpers.quad_mesh, + # Those two tests suddenly started failing on gh-actions. No idea why. + # TODO reinstate + # helpers.tet_mesh, + # helpers.hex_mesh + ], ) def test(mesh): helpers.write_read(meshio.tecplot.write, meshio.tecplot.read, mesh, 1.0e-15)
comment out two tecplot tests
nschloe_meshio
train
py
cf6e98f3df4ba844cd2ed8666f878a8676b26f79
diff --git a/model/network.js b/model/network.js index <HASH>..<HASH> 100644 --- a/model/network.js +++ b/model/network.js @@ -168,7 +168,7 @@ exports.Network = BaseModel.extend({ .set('log level', this.get('socketLogLevel')); //// Load the shared state plugin. - if ($$config.sharedState) { + if ($$config.sharedState && $$sharedState.shared) { var peers = this.get('peers'); var myName = os.hostname(); if (!this.isMaster) {
don't freak out if there's no shared state
stimulant_ampm
train
js
dd6687ec4606680253cab2cb94aa3c41d3f0e450
diff --git a/Classes/Finishers/EmailFinisher.php b/Classes/Finishers/EmailFinisher.php index <HASH>..<HASH> 100644 --- a/Classes/Finishers/EmailFinisher.php +++ b/Classes/Finishers/EmailFinisher.php @@ -24,6 +24,8 @@ use Neos\Form\Exception\FinisherException; * - partialRootPath: root path for the partials * - variables: associative array of variables which are available inside the Fluid template * + * - referrer: The referrer of the form is available in the Fluid template + * * The following options control the mail sending. In all of them, placeholders in the form * of {...} are replaced with the corresponding form value; i.e. {email} as recipientAddress * makes the recipient address configurable. @@ -66,6 +68,8 @@ class EmailFinisher extends AbstractFinisher $formRuntime = $this->finisherContext->getFormRuntime(); $standaloneView = $this->initializeStandaloneView(); $standaloneView->assign('form', $formRuntime); + $referrer = $formRuntime->getRequest()->getHttpRequest()->getUri(); + $standaloneView->assign('referrer', $referrer); $message = $standaloneView->render(); $subject = $this->parseOption('subject');
[FEATURE] Make the referrer of the form available in Fluid template Sometimes it is handy to know from which URL a form email was sent, especially if no external tracking like GA or Piwik is in place. The referrer can be inserted into the Fluid template using the following notation: {referrer}.
neos_form
train
php
5522a28dce0b839e131ce832074378488dc99e27
diff --git a/lib/wlang/mustang.rb b/lib/wlang/mustang.rb index <HASH>..<HASH> 100644 --- a/lib/wlang/mustang.rb +++ b/lib/wlang/mustang.rb @@ -1,3 +1,4 @@ +require 'wlang' module WLang class Mustang < WLang::Dialect include Temple::Utils
Require wlang at start
blambeau_wlang
train
rb
1862b30f202071a6f60f54cf87676b52aeb74419
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/ImportTag.java @@ -219,6 +219,13 @@ public class ImportTag implements Tag { JinjavaInterpreter interpreter ) { String path = StringUtils.trimToEmpty(helper.get(0)); + String templateFile = interpreter.resolveString( + path, + tagToken.getLineNumber(), + tagToken.getStartPosition() + ); + templateFile = interpreter.resolveResourceLocation(templateFile); + interpreter.getContext().addDependency("coded_files", templateFile); try { interpreter .getContext() @@ -241,14 +248,6 @@ public class ImportTag implements Tag { ); return Optional.empty(); } - - String templateFile = interpreter.resolveString( - path, - tagToken.getLineNumber(), - tagToken.getStartPosition() - ); - templateFile = interpreter.resolveResourceLocation(templateFile); - interpreter.getContext().addDependency("coded_files", templateFile); return Optional.of(templateFile); }
Resolve import path before adding it to the path stack
HubSpot_jinjava
train
java
be74604074c076ec3120a4a1b981acd40cf4176d
diff --git a/lib/database/domain.js b/lib/database/domain.js index <HASH>..<HASH> 100644 --- a/lib/database/domain.js +++ b/lib/database/domain.js @@ -578,6 +578,7 @@ Domain.prototype = { }, addDocumentSync: function(document) { + // this.storeDocument(document); => it should be another class DocumentStore implemented in database/document.js this.indexDocumentSync(document); return this; }, @@ -592,7 +593,7 @@ Domain.prototype = { } }, this); - grnDumpRecord = this.toGrnDumpRecord(record); + var grnDumpRecord = this.toGrnDumpRecord(record); this.context.commandSync('load', { table: this.tableName, values: JSON.stringify([grnDumpRecord])
Define variable locally (to avoid global leak)
groonga_gcs
train
js
64523b37c81e3f5bb15b06522cbed95f59ae9ab9
diff --git a/lib/jazzy/doc_builder.rb b/lib/jazzy/doc_builder.rb index <HASH>..<HASH> 100644 --- a/lib/jazzy/doc_builder.rb +++ b/lib/jazzy/doc_builder.rb @@ -189,7 +189,7 @@ module Jazzy warnings: warnings, source_directory: options.source_directory } - f.write(lint_report.to_json) + f.write(JSON.pretty_generate(lint_report)) end end
Pretty printing in undocumented.json
realm_jazzy
train
rb
2b77ca014e2484908b8bddad1115111a1e0e8daf
diff --git a/src/phpDocumentor/Plugin/Core/Transformer/Writer/Twig.php b/src/phpDocumentor/Plugin/Core/Transformer/Writer/Twig.php index <HASH>..<HASH> 100644 --- a/src/phpDocumentor/Plugin/Core/Transformer/Writer/Twig.php +++ b/src/phpDocumentor/Plugin/Core/Transformer/Writer/Twig.php @@ -85,9 +85,6 @@ class Twig extends WriterAbstract implements Routable /** @var Translator $translator */ protected $translator; - /** @var string $partials */ - protected $partials; - /** * This method combines the ProjectDescriptor and the given target template * and creates a static html page at the artifact location.
remove property - not needed in here
phpDocumentor_phpDocumentor2
train
php
f8a8ad4836d4b79c546910b418c398eb2b752d11
diff --git a/app/AppKernel.php b/app/AppKernel.php index <HASH>..<HASH> 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -121,7 +121,7 @@ class AppKernel extends Kernel */ public function getCacheDir() { - if (isset($_SERVER['VAGRANT']) && in_array($this->environment, array('dev', 'test')) && is_dir('/dev/shm')) { + if ($this->isVagrantEnvironment()) { return '/dev/shm/sylius/cache/'.$this->environment; } @@ -133,10 +133,18 @@ class AppKernel extends Kernel */ public function getLogDir() { - if (isset($_SERVER['VAGRANT']) && in_array($this->environment, array('dev', 'test')) && is_dir('/dev/shm')) { + if ($this->isVagrantEnvironment()) { return '/dev/shm/sylius/logs'; } return parent::getLogDir(); } + + /** + * @return bool + */ + private function isVagrantEnvironment() + { + return isset($_SERVER['HOME']) && $_SERVER['HOME'] === '/home/vagrant' && is_dir('/dev/shm'); + } }
Detect vagrant virtual machine environment
Sylius_Sylius
train
php
1ca784901743792726e3896ed4d4809a66d6a213
diff --git a/lib/Launcher.js b/lib/Launcher.js index <HASH>..<HASH> 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -58,7 +58,8 @@ class Launcher { chromeArguments.push( `--headless`, `--disable-gpu`, - `--hide-scrollbars` + `--hide-scrollbars`, + '--mute-audio' ); } let chromeExecutable = options.executablePath;
Mute audio in headless, closes #<I> (#<I>) This patch adds the `--mute-audio` flag if chromium is launched in headless mode.
GoogleChrome_puppeteer
train
js
82f1502ba5f96284c48c6587b594bf49aa41ab78
diff --git a/scripts/release.js b/scripts/release.js index <HASH>..<HASH> 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -66,9 +66,6 @@ function updateLockfile(opts = {}) { // Merge the "yarn.lock" changes into the version commit. exec(`git add yarn.lock`) exec(`git commit --amend --no-edit`) - - // Ensure the "dist" directories are in good condition. - exec(`yarn prepare`) } function exec(cmd, { silent } = {}) {
chore: remove extraneous "yarn prepare" call
react-spring_react-spring
train
js
51321c1899483098d8ca77d8a083e7cf95241cfe
diff --git a/csrf.go b/csrf.go index <HASH>..<HASH> 100644 --- a/csrf.go +++ b/csrf.go @@ -72,7 +72,7 @@ import ( "strings" "time" - "code.google.com/p/xsrftoken" + "github.com/adg/xsrftoken" "github.com/go-martini/martini" "github.com/martini-contrib/sessions" )
- Fixing the import of xsrftoken lib after it has been moved to github.
martini-contrib_csrf
train
go
eda2e26e4e94b538c2b0b687f19c3fc0be2daed1
diff --git a/tests/test_new.py b/tests/test_new.py index <HASH>..<HASH> 100644 --- a/tests/test_new.py +++ b/tests/test_new.py @@ -3770,3 +3770,14 @@ def test_new_add_file_hard_link_rm_file(): do_a_test(iso, check_nofiles) iso.close() + +def test_new_file_mode_not_rock_ridge(): + iso = pycdlib.PyCdlib() + iso.new() + + foostr = b"foo\n" + + with pytest.raises(pycdlib.pycdlibexception.PyCdlibInvalidInput): + iso.add_fp(BytesIO(foostr), len(foostr), "/FOO.;1", file_mode=0o0100444) + + iso.close()
Add a test for file mode without Rock Ridge.
clalancette_pycdlib
train
py
6c34c83a3ea82bd0c3d4f0e7bdff6f54c2f7bdbc
diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index <HASH>..<HASH> 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. -__version__ = "2.0.37" +__version__ = "2.0.38" __license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)" __copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"
Update Pyrogram to <I>
pyrogram_pyrogram
train
py
7fbbca719dccc1d13cb21a4a9bb0993a7c9a3c4a
diff --git a/lib/licensed/sources/gradle.rb b/lib/licensed/sources/gradle.rb index <HASH>..<HASH> 100644 --- a/lib/licensed/sources/gradle.rb +++ b/lib/licensed/sources/gradle.rb @@ -121,7 +121,7 @@ module Licensed def self.gradle_command(*args, path:, executable:, configurations:) Dir.chdir(path) do - Tempfile.open(["license-", ".gradle"], path) do |f| + Tempfile.create(["license-", ".gradle"], path) do |f| f.write gradle_file(configurations) f.close Licensed::Shell.execute(executable, "-q", "-b", f.path, *args)
opt for create over open create deletes the file at block completion open is somewhat non-deterministic
github_licensed
train
rb
1bcfd2e5f39b3fd9d1e034fcc2d69979f6de76f5
diff --git a/src/Repositories/PostRepository.php b/src/Repositories/PostRepository.php index <HASH>..<HASH> 100644 --- a/src/Repositories/PostRepository.php +++ b/src/Repositories/PostRepository.php @@ -142,7 +142,7 @@ class PostRepository extends BaseRepository { return DB::table('posts') ->join('post_category', 'posts.id', '=', 'post_category.post_id') - ->select('posts.slug') + ->select('posts.slug', 'posts.title') ->where('post_category.category_id', '=', $categoryId) ->where('posts.enabled', '=', 1) ->where('posts.publish_on', '>', $publish_on) @@ -162,7 +162,7 @@ class PostRepository extends BaseRepository { return DB::table('posts') ->join('post_category', 'posts.id', '=', 'post_category.post_id') - ->select('posts.slug') + ->select('posts.slug', 'posts.title') ->where('post_category.category_id', '=', $categoryId) ->where('posts.enabled', '=', 1) ->where('posts.publish_on', '<', $publish_on)
Add the post title to the single post navigation. #<I>
lasallecms_lasallecms-l5-lasallecmsapi-pkg
train
php
1b3977f03e202d53a0f40eeb399957d0537111a9
diff --git a/lib/ancestry/materialized_path.rb b/lib/ancestry/materialized_path.rb index <HASH>..<HASH> 100644 --- a/lib/ancestry/materialized_path.rb +++ b/lib/ancestry/materialized_path.rb @@ -78,7 +78,7 @@ module Ancestry if %w(mysql mysql2 sqlite sqlite3).include?(connection.adapter_name.downcase) reorder(arel_table[ancestry_column], order) elsif %w(postgresql).include?(connection.adapter_name.downcase) && ActiveRecord::VERSION::STRING >= "6.1" - reorder(Arel::Nodes.new(arel_table[ancestry_column]).nulls_first) + reorder(Arel::Nodes::Ascending.new(arel_table[ancestry_column]).nulls_first) else reorder( Arel::Nodes::Ascending.new(Arel::Nodes::NamedFunction.new('COALESCE', [arel_table[ancestry_column], Arel.sql("''")])),
For newer versions of rails and postgres, fix sorting
stefankroes_ancestry
train
rb
75d4c79a167df4ba431fdb4fbf93654efed04a8e
diff --git a/telescope-sample/src/main/java/com/mattprecious/telescope/sample/SampleActivity.java b/telescope-sample/src/main/java/com/mattprecious/telescope/sample/SampleActivity.java index <HASH>..<HASH> 100644 --- a/telescope-sample/src/main/java/com/mattprecious/telescope/sample/SampleActivity.java +++ b/telescope-sample/src/main/java/com/mattprecious/telescope/sample/SampleActivity.java @@ -11,6 +11,7 @@ import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; @@ -34,6 +35,8 @@ public class SampleActivity extends AppCompatActivity { setContentView(R.layout.sample_activity); ButterKnife.bind(this); + setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); + Adapter adapter = new Adapter(this); adapter.addView(R.layout.default_view, R.string.tab_default); adapter.addView(R.layout.device_info_view, R.string.tab_device_info);
Fix missing attributions menu item in sample
mattprecious_telescope
train
java
a929910800588f1cbd210c6e81bdd176fa65208f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,14 +4,20 @@ """ Setup for yasi """ import yasi +import io import sys import setuptools +readme = '' +with io.open('README.rst') as f: + readme = f.read() + setuptools.setup( name='yasi', version=yasi.__version__, description='A dialect aware s-expression indenter', - author='Mathew Ngetich', + long_description=readme, + author="Mathew Ng'etich", author_email='kipkoechmathew@gmail.com', download_url="https://github.com/nkmathew/yasi-sexp-indenter/zipball/master", url='https://github.com/nkmathew/yasi-sexp-indenter',
Include generated readme.rst text as long description
nkmathew_yasi-sexp-indenter
train
py
1bab4e0b43bb2efa2e227a1f506064d08e5ab723
diff --git a/plugins/prism/index.js b/plugins/prism/index.js index <HASH>..<HASH> 100644 --- a/plugins/prism/index.js +++ b/plugins/prism/index.js @@ -1,3 +1,9 @@ +// Only run this when PIMD gets executed in a browser: +if (typeof window !== "undefined") { + // Use PrismJS without changing the existing HTML in the browser: + window.Prism = { manual: true } +} + const Prism = require("prismjs") const loadLanguages = require("prismjs/components/")
Prevent PrismJS from modifying the document PrismJS is not a Node module that can be used properly when needed. As soon as it’s running in the browser, it starts to highlight everything automatically. This is not the use case for the PIMD PrismJS plugin. So far the only way to prevent such side-effects is defining a `Prism` object in the browser in case PIMD is running in a browser.
hagenburger_pimd
train
js
9d91d32d823fe0002e92408c0d07574be8b2b845
diff --git a/internal/logger/message/audit/entry.go b/internal/logger/message/audit/entry.go index <HASH>..<HASH> 100644 --- a/internal/logger/message/audit/entry.go +++ b/internal/logger/message/audit/entry.go @@ -32,7 +32,7 @@ const Version = "1" // ObjectVersion object version key/versionId type ObjectVersion struct { ObjectName string `json:"objectName"` - VersionID string `json:"VersionId,omitempty"` + VersionID string `json:"versionId,omitempty"` } // Entry - audit entry logs. diff --git a/internal/logger/message/log/entry.go b/internal/logger/message/log/entry.go index <HASH>..<HASH> 100644 --- a/internal/logger/message/log/entry.go +++ b/internal/logger/message/log/entry.go @@ -25,7 +25,7 @@ import ( // ObjectVersion object version key/versionId type ObjectVersion struct { ObjectName string `json:"objectName"` - VersionID string `json:"VersionId,omitempty"` + VersionID string `json:"versionId,omitempty"` } // Args - defines the arguments for the API.
typo: Low capital in some JSON field names in log/audit output (#<I>) Use a low capital in some fields in JSON log/audit output to follow other fields names.
minio_minio
train
go,go
6148a63017d9068afc7cbd581637bf03788e3fb0
diff --git a/root_numpy/tmva/__init__.py b/root_numpy/tmva/__init__.py index <HASH>..<HASH> 100644 --- a/root_numpy/tmva/__init__.py +++ b/root_numpy/tmva/__init__.py @@ -1,7 +1,7 @@ try: from . import _libtmvanumpy -except ImportError: +except ImportError: # pragma: no cover import warnings warnings.warn( "root_numpy.tmva requires that you install root_numpy with "
missing # pragma: no cover
scikit-hep_root_numpy
train
py
70a9bf32d8c9f3bdaaba4047f7203a803480c8f4
diff --git a/test/integration-test.py b/test/integration-test.py index <HASH>..<HASH> 100644 --- a/test/integration-test.py +++ b/test/integration-test.py @@ -316,8 +316,15 @@ def check_slow_queries(): This depends on flags set on mysqld in docker-compose.yml. """ - output = run("mysql -h boulder-mysql -D boulder_sa_integration -e " + - "'select * from mysql.slow_log where user_host not like \"test_setup%\" \G'") + query = """ + SELECT * FROM mysql.slow_log + WHERE user_host NOT LIKE "test_setup%" + AND sql_text != 'SELECT 1 FROM (SELECT SLEEP(5)) as subselect' + \G + """ + output = subprocess.check_output( + ["mysql", "-h", "boulder-mysql", "-D", "boulder_sa_integration", "-e", query], + stderr=subprocess.STDOUT) if len(output) > 0: print(output) raise Exception("Found slow queries in the slow query log")
integration: allow-list a known-slow SQL query. (#<I>) We intentionally use a SLEEP in a SQL query to trigger timeout behavior. This caused integration tests failures locally (where unittests are run in the same session as integration tests).
letsencrypt_boulder
train
py
f5013a31e91e3a43b301a90d4ce92c41f2d58c19
diff --git a/lib/ohai/plugins/linux/virtualization.rb b/lib/ohai/plugins/linux/virtualization.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/plugins/linux/virtualization.rb +++ b/lib/ohai/plugins/linux/virtualization.rb @@ -56,6 +56,9 @@ Ohai.plugin(:Virtualization) do elsif modules =~ /^vboxdrv/ virtualization[:system] = "vbox" virtualization[:role] = "host" + elsif modules =~ /^vboxguest/ + virtualization[:system] = "vbox" + virtualization[:role] = "guest" end end
OHAI-<I>: reverting part of OHAI-<I> dmidecode isn't necessarily installed by default (fedora <I>), while the existing /proc/modules detection works fine. i don't see why we only need one mechanism, so try both and use which one works.
chef_ohai
train
rb
70c06aca1636b525b51ec5d26a7e4e4297c4ee05
diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index <HASH>..<HASH> 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -262,7 +262,7 @@ func runAgent(ctx context.Context, log.Printf("I! Loaded aggregators: %s", strings.Join(c.AggregatorNames(), " ")) log.Printf("I! Loaded processors: %s", strings.Join(c.ProcessorNames(), " ")) if !*fRunOnce && (*fTest || *fTestWait != 0) { - log.Print(color.RedString("W! Outputs are not used in testing mode!")) + log.Print("W! " + color.RedString("Outputs are not used in testing mode!")) } else { log.Printf("I! Loaded outputs: %s", strings.Join(c.OutputNames(), " ")) }
fix: warning output when running with --test (#<I>)
influxdata_telegraf
train
go
efaceaa3570666de89f9f2fa2452d9e72cd9f106
diff --git a/tests/integration/modules/environment.php b/tests/integration/modules/environment.php index <HASH>..<HASH> 100644 --- a/tests/integration/modules/environment.php +++ b/tests/integration/modules/environment.php @@ -25,6 +25,33 @@ class Environment { /** + * Shop Id in which will be prepared environment. + * + * @var int + */ + private $_iShopId; + + /** + * Sets shop Id. + * + * @param int $iShopId + */ + public function setShopId( $iShopId ) + { + $this->_iShopId = $iShopId; + } + + /** + * Returns shop Id. + * + * @return int + */ + public function getShopId() + { + return $this->_iShopId; + } + + /** * Loads and activates modules by given IDs. * * @param null $aModules @@ -33,6 +60,7 @@ class Environment public function prepare( $aModules = null ) { $oConfig = oxRegistry::getConfig(); + $oConfig->setShopId( $this->getShopId() ); $oConfig->setConfigParam( 'sShopDir', $this->_getPathToTestDataDirectory() ); if ( is_null( $aModules ) ) {
ESDEV-<I> test case: different subshop; Added functionality in environment class to set shop id.
OXID-eSales_oxideshop_ce
train
php
aaff6184144e243d36be537d6fe8de9e77745d03
diff --git a/src/Entity/SubMerchantInfo.php b/src/Entity/SubMerchantInfo.php index <HASH>..<HASH> 100644 --- a/src/Entity/SubMerchantInfo.php +++ b/src/Entity/SubMerchantInfo.php @@ -36,6 +36,8 @@ namespace Wirecard\PaymentSdk\Entity; * @package Wirecard\PaymentSdk\Entity * * An immutable entity representing a SubMerchant. + * + * @since 2.3.0 */ class SubMerchantInfo implements MappableEntity { diff --git a/src/Transaction/WeChatTransaction.php b/src/Transaction/WeChatTransaction.php index <HASH>..<HASH> 100644 --- a/src/Transaction/WeChatTransaction.php +++ b/src/Transaction/WeChatTransaction.php @@ -35,6 +35,11 @@ use Wirecard\PaymentSdk\Entity\SubMerchantInfo; use Wirecard\PaymentSdk\Exception\MandatoryFieldMissingException; use Wirecard\PaymentSdk\Exception\UnsupportedOperationException; +/** + * Class WeChatTransaction + * @package Wirecard\PaymentSdk\Transaction + * @since 2.3.0 + */ class WeChatTransaction extends Transaction implements Reservable { const NAME = 'wechat-qrpay';
#<I> add since annotations to class headers
wirecard_paymentSDK-php
train
php,php
3f11253af0c7ad6cd67d44b50a0bca9fa8d69e08
diff --git a/activesupport/lib/active_support/core_ext/string/filters.rb b/activesupport/lib/active_support/core_ext/string/filters.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/string/filters.rb +++ b/activesupport/lib/active_support/core_ext/string/filters.rb @@ -15,7 +15,7 @@ class String # Performs a destructive squish. See String#squish. def squish! gsub!(/\A[[:space:]]+/, '') - gsub!(/[[:space:]]+\Z/, '') + gsub!(/[[:space:]]+\z/, '') gsub!(/[[:space:]]+/, ' ') self end
no need for \Z, \z is more concise
rails_rails
train
rb
437dc7dd65f07a6c8770f4c63202cade5cb62db9
diff --git a/click_shell/version.py b/click_shell/version.py index <HASH>..<HASH> 100644 --- a/click_shell/version.py +++ b/click_shell/version.py @@ -9,7 +9,7 @@ import os import subprocess -VERSION = (0, 4, 0, 'final', 0) +VERSION = (0, 5, 0, 'dev', 0) def get_version(version):
Updating version for <I> development
clarkperkins_click-shell
train
py
fdf7e6424993b965cc70f4c70c3bbfffbe045b71
diff --git a/lib/shipit.rb b/lib/shipit.rb index <HASH>..<HASH> 100644 --- a/lib/shipit.rb +++ b/lib/shipit.rb @@ -118,7 +118,7 @@ module Shipit end def github_oauth_options - return unless github_enterprise? + return {} unless github_enterprise? { site: github_api_endpoint, authorize_url: github_url('/login/oauth/authorize'), diff --git a/test/unit/shipit_test.rb b/test/unit/shipit_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/shipit_test.rb +++ b/test/unit/shipit_test.rb @@ -38,4 +38,9 @@ class ShipitTest < ActiveSupport::TestCase Rails.application.secrets.stubs(:github_domain).returns('github.example.com') assert_equal 'https://github.example.com/api/v3/', Shipit.github_api_endpoint end + + test ".github_oauth_options returns an empty hash if not enterprise" do + refute Shipit.github_enterprise? + assert_equal({}, Shipit.github_oauth_options) + end end
Fix: Non Github Enterprise omniauth issue If using a non-Github Enterprise, omniauth was expecting a hash to be set in its `client_options`, instead it got nil. This fixes that.
Shopify_shipit-engine
train
rb,rb
00a631b197268dfdc0896c70199026779cf1c518
diff --git a/invenio_previewer/extensions/ipynb.py b/invenio_previewer/extensions/ipynb.py index <HASH>..<HASH> 100644 --- a/invenio_previewer/extensions/ipynb.py +++ b/invenio_previewer/extensions/ipynb.py @@ -28,7 +28,7 @@ def render(file): notebook = nbformat.reads(content.decode("utf-8"), as_version=4) html_exporter = HTMLExporter() - html_exporter.template_file = "basic" + html_exporter.template_file = "base" (body, resources) = html_exporter.from_notebook_node(notebook) return body, resources @@ -41,7 +41,7 @@ def can_preview(file): def preview(file): """Render the IPython Notebook.""" body, resources = render(file) - default_jupyter_nb_style = resources["inlining"]["css"][1] + default_jupyter_nb_style = resources["inlining"]["css"][0] return render_template( "invenio_previewer/ipynb.html", file=file,
jupyter: fixed previewer for jpynb
inveniosoftware_invenio-previewer
train
py
bf17301ae35c89d5ef4ea1dfe2047630c7fb5579
diff --git a/lib/message/message-parser.js b/lib/message/message-parser.js index <HASH>..<HASH> 100644 --- a/lib/message/message-parser.js +++ b/lib/message/message-parser.js @@ -44,7 +44,7 @@ MessageParser.prototype.parse = function(message) { if(logger.isDebugEnabled()) { logger.debug('Rpc-Result for request %s', message.req_msg_id) } - this.emit(message.typeName, message.req_msg_id); + this.emit(message.typeName, message); break; default : if(logger.isDebugEnabled()) {
Send the complete result on the rpc_result event
enricostara_telegram-mt-node
train
js
f08e57927e902c696770730c3ff79c5604a4ffef
diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index <HASH>..<HASH> 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -113,7 +113,7 @@ def cut( An array-like object representing the respective bin for each value of `x`. The type depends on the value of `labels`. - * True (default) : returns a Series for Series `x` or a + * None (default) : returns a Series for Series `x` or a Categorical for all other inputs. The values stored within are Interval dtype.
Fix mistake in cut() docstring (#<I>)
pandas-dev_pandas
train
py
f78c1bedee78e0b321264158f65b3b34ba1b68d5
diff --git a/lib/jsi/base.rb b/lib/jsi/base.rb index <HASH>..<HASH> 100644 --- a/lib/jsi/base.rb +++ b/lib/jsi/base.rb @@ -261,7 +261,7 @@ module JSI # @return [Object] an opaque fingerprint of this JSI for FingerprintHash. JSIs are equal # if their instances are equal, and if the JSIs are of the same JSI class or subclass. def fingerprint - {class: jsi_class, instance: instance} + {class: jsi_class, jsi_document: jsi_document, jsi_ptr: jsi_ptr} end include FingerprintHash
dev JSI::Base#fingerprint
notEthan_jsi
train
rb
46410f5038a9ac7b9b0cdbb16a0a26bead337a2e
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -238,7 +238,7 @@ describe('Raw Body', function () { done() }) - // you have to call resume() probably breaks in 0.8 (req, res) + // you have to call resume() for through stream.resume() })
remove streams1 breaking comment. works in <I>
stream-utils_raw-body
train
js
7005db81bc5422f1a823bc580eac8f30883f4389
diff --git a/lib/thredded/email_transformer.rb b/lib/thredded/email_transformer.rb index <HASH>..<HASH> 100644 --- a/lib/thredded/email_transformer.rb +++ b/lib/thredded/email_transformer.rb @@ -17,8 +17,8 @@ module Thredded end @transformers = [Onebox, Spoiler] - # @param doc [Nokogiri::HTML::Document] - def self.call(doc) + # @param dom [Nokogiri::HTML::Document] + def self.call(doc, *) transformers.each { |transformer| transformer.call(doc) } end end
fix an issue with the latest roadie a change to roadie **seems to** enforce an extra param to the before_transformation callback. This was always documented so not a breaking change. It is causing test failures
thredded_thredded
train
rb
0f5d526a66f180f441a6c408348228054a97476b
diff --git a/hawtio-system/src/main/java/io/hawt/web/proxy/ProxyDetails.java b/hawtio-system/src/main/java/io/hawt/web/proxy/ProxyDetails.java index <HASH>..<HASH> 100644 --- a/hawtio-system/src/main/java/io/hawt/web/proxy/ProxyDetails.java +++ b/hawtio-system/src/main/java/io/hawt/web/proxy/ProxyDetails.java @@ -32,7 +32,7 @@ public class ProxyDetails implements ProxyAddress { public static final String USER_PARAM = "_user"; public static final String PWD_PARAM = "_pwd"; - private static Set<String> ignoreHeaderNames = new HashSet<String>(Arrays.asList(USER_PARAM, PWD_PARAM, "_url", "url")); + private static final Set<String> ignoreHeaderNames = new HashSet<>(Arrays.asList(USER_PARAM, PWD_PARAM, "_url", "url")); public ProxyDetails(HttpServletRequest httpServletRequest) { this(httpServletRequest.getPathInfo()); @@ -66,10 +66,6 @@ public class ProxyDetails implements ProxyAddress { public ProxyDetails(String pathInfo) { hostAndPort = pathInfo.replace(" ", "%20"); - if (hostAndPort == null) { - return; - } - while (hostAndPort.startsWith("/")) { hostAndPort = hostAndPort.substring(1); }
refactor(hawtio-system): small refactoring
hawtio_hawtio
train
java
6c9aef4bb3a3596408d703c03f8d26bf91c08689
diff --git a/select2.js b/select2.js index <HASH>..<HASH> 100644 --- a/select2.js +++ b/select2.js @@ -1846,13 +1846,14 @@ the specific language governing permissions and limitations under the Apache Lic this.opts.element.val(this.id(data)); this.updateSelection(data); + + this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); + this.close(); if (!options || !options.noFocus) this.selection.focus(); - this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); - if (!equal(old, this.id(data))) { this.triggerChange(); } }, @@ -2233,6 +2234,8 @@ the specific language governing permissions and limitations under the Apache Lic onSelect: function (data, options) { this.addSelectedChoice(data); + this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); + if (this.select || !this.opts.closeOnSelect) this.postprocessResults(); if (this.opts.closeOnSelect) { @@ -2255,8 +2258,6 @@ the specific language governing permissions and limitations under the Apache Lic } } - this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); - // since its not possible to select an element that has already been // added we do not need to check if this is a new element before firing change this.triggerChange({ added: data });
fire selected before close. #<I>
select2_select2
train
js
1c50e56b7ac74287531142f7ecf55183a7ca8b66
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index <HASH>..<HASH> 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -2951,6 +2951,16 @@ func (p *FlowSpecUnknown) String() string { return fmt.Sprintf("[unknown:%v]", p.Value) } +func (p *FlowSpecUnknown) MarshalJSON() ([]byte, error) { + return json.Marshal(struct { + Type BGPFlowSpecType `json:"type"` + Value string `json:"value"` + }{ + Type: p.Type(), + Value: string(p.Value), + }) +} + type FlowSpecNLRI struct { Value []FlowSpecComponentInterface rf RouteFamily
packet: add MarshalJSON method for FlowSpecUnknown struct
osrg_gobgp
train
go
ec7de6dd22c24d70ffc60a6ac2bff9890013842e
diff --git a/aeron-archiver/src/main/java/io/aeron/archiver/SessionWorkerDedicated.java b/aeron-archiver/src/main/java/io/aeron/archiver/SessionWorkerDedicated.java index <HASH>..<HASH> 100644 --- a/aeron-archiver/src/main/java/io/aeron/archiver/SessionWorkerDedicated.java +++ b/aeron-archiver/src/main/java/io/aeron/archiver/SessionWorkerDedicated.java @@ -49,4 +49,9 @@ class SessionWorkerDedicated<T extends Session> extends SessionWorker<T> Thread.yield(); } } + + protected void preSessionsClose() + { + commandQueue.drain(Runnable::run); + } }
[Java] ensure queue is drained before close
real-logic_aeron
train
java
ef4aa0d3f9a0ad4152a5a80eaa83d47556932ec9
diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index <HASH>..<HASH> 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -18,6 +18,8 @@ var ( downloadDir = flag.String("downloadDir", "", "directory to store download torrent data") testPeer = flag.String("testPeer", "", "bootstrap peer address") profAddr = flag.String("profAddr", "", "http serve address") + // TODO: Check the default torrent listen port. + listenAddr = flag.String("listenAddr", ":6882", "incoming connection address") ) func init() { @@ -25,12 +27,21 @@ func init() { flag.Parse() } +func makeListener() net.Listener { + l, err := net.Listen("tcp", *listenAddr) + if err != nil { + log.Fatal(err) + } + return l +} + func main() { if *profAddr != "" { go http.ListenAndServe(*profAddr, nil) } client := torrent.Client{ - DataDir: *downloadDir, + DataDir: *downloadDir, + Listener: makeListener(), } client.Start() defer client.Stop()
Add -listenAddr and actually listen in ./cmd/torrent
anacrolix_torrent
train
go
c988b48c6972858ea96ab9fbe9da752ab35e5152
diff --git a/openquake/engine/performance.py b/openquake/engine/performance.py index <HASH>..<HASH> 100644 --- a/openquake/engine/performance.py +++ b/openquake/engine/performance.py @@ -46,7 +46,7 @@ class PerformanceMonitor(object): 2) there is an attribute self.job.id """ def newmeth(self): - with cls(method.__name__, self.job.id): + with cls(method.__name__, self.job.id, flush=True): return method(self) newmeth.__name__ = method.__name__ return newmeth
A small improvement to the .monitor decorator Former-commit-id: b1f9d<I>c0d<I>e2a8ab4e2a0a<I>a
gem_oq-engine
train
py
aa86ebe6f22842c23f1b9590ee95021084748d74
diff --git a/uriutils/storages.py b/uriutils/storages.py index <HASH>..<HASH> 100644 --- a/uriutils/storages.py +++ b/uriutils/storages.py @@ -77,10 +77,13 @@ class BaseURI(object): """ :param dict storage_args: Arguments that will be applied to the storage system for read/write operations """ - self.storage_args = storage_args + self.storage_args = {} for k in storage_args.keys(): - if k not in self.VALID_STORAGE_ARGS: + if k in self.VALID_STORAGE_ARGS: + self.storage_args[k] = storage_args[k] + else: warnings.warn('"{}" is not a valid storage argument.'.format(k), category=UserWarning, stacklevel=2) + #end for #end def def get_content(self): @@ -197,6 +200,9 @@ class FileURI(BaseURI): SUPPORTED_SCHEMES = set(['file', '']) """Supported schemes for :class:`FileURI`.""" + VALID_STORAGE_ARGS = ['mode', 'buffering', 'encoding', 'errors', 'newline', 'closefd', 'opener'] + """Storage arguments allowed to pass to :meth:`open` methods.""" + @classmethod def parse_uri(cls, uri, storage_args={}): if uri.scheme not in cls.SUPPORTED_SCHEMES: return None
Fix issues with `storage_args` in file
skylander86_uriutils
train
py
bfad3039d55f5e35f7a3f29786db06642e26e223
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -531,13 +531,10 @@ function isHelperGroup(helpers) { return true; } if (typeof helpers === 'function' || isObject(helpers)) { - var keys = Object.keys(helpers); - for (var i = 0; i < keys.length; i++) { - var name = keys[i]; - if (name !== 'async' && name !== 'sync' && name !== 'displayName') { - return true; - } - } + var keys = Object.keys(helpers).filter(function(name) { + return ['async', 'sync', 'displayName'].indexOf(name) === -1; + }); + return keys.length > 1; } return false; }
revert `isHelperGroup` change since it's counting for "more than one" not "one or more"
doowb_async-helpers
train
js
8c67e709d0b2946473af84959deaac0ced962d5e
diff --git a/activerecord/test/cases/inclusion_test.rb b/activerecord/test/cases/inclusion_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/inclusion_test.rb +++ b/activerecord/test/cases/inclusion_test.rb @@ -6,6 +6,14 @@ class BasicInclusionModelTest < ActiveRecord::TestCase Teapot.create!(:name => "Ronnie Kemper") assert_equal "Ronnie Kemper", Teapot.find(1).name end + + def test_inherited_model + teapot = CoolTeapot.create!(:name => "Bob") + teapot.reload + + assert_equal "Bob", teapot.name + assert_equal "mmm", teapot.aaahhh + end end class InclusionUnitTest < ActiveRecord::TestCase diff --git a/activerecord/test/models/teapot.rb b/activerecord/test/models/teapot.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/models/teapot.rb +++ b/activerecord/test/models/teapot.rb @@ -11,3 +11,14 @@ class Teapot include ActiveRecord::Model end + +class OMFGIMATEAPOT + def aaahhh + "mmm" + end +end + +class CoolTeapot < OMFGIMATEAPOT + include ActiveRecord::Model + self.table_name = "teapots" +end
Add test for inheritance from a non-AR superclass
rails_rails
train
rb,rb
a5ef1437e6501dc596911aeea5057a0a55191fc9
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java @@ -105,7 +105,6 @@ import java.util.NoSuchElementException; import java.util.Optional; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.Executors; @@ -357,7 +356,7 @@ public class ExecutionGraph implements AccessExecutionGraph { this.verticesInCreationOrder = new ArrayList<>(16); this.currentExecutions = new HashMap<>(16); - this.jobStatusListeners = new CopyOnWriteArrayList<>(); + this.jobStatusListeners = new ArrayList<>(); this.stateTimestamps = new long[JobStatus.values().length]; this.stateTimestamps[JobStatus.CREATED.ordinal()] = System.currentTimeMillis();
[FLINK-<I>][runtime] Change type of field jobStatusListeners from CopyOnWriteArrayList to ArrayList This closes #<I>.
apache_flink
train
java
15fc1f0f4698125fb65be3a66906d80a92807a55
diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -4,7 +4,7 @@ module Oxidized class Oxidized::NotSupported < OxidizedError; end class Oxidized::NodeNotFound < OxidizedError; end class Nodes < Array - attr_accessor :source + attr_accessor :source, :jobs alias :put :unshift def load node_want=nil with_lock do @@ -73,6 +73,7 @@ module Oxidized # set last job to nil so that the node is picked for immediate update n.last = nil put n + jobs.want += 1 end end end diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/worker.rb +++ b/lib/oxidized/worker.rb @@ -3,8 +3,9 @@ module Oxidized require 'oxidized/jobs' class Worker def initialize nodes - @nodes = nodes - @jobs = Jobs.new(Oxidized.config.threads, Oxidized.config.interval, @nodes) + @nodes = nodes + @jobs = Jobs.new(Oxidized.config.threads, Oxidized.config.interval, @nodes) + @nodes.jobs = @jobs Thread.abort_on_exception = true end
add one thread when requesting next via API
ytti_oxidized
train
rb,rb
a7423a304de31b1d839ad352f2300e608190257a
diff --git a/pyqode/core/modes/code_completion.py b/pyqode/core/modes/code_completion.py index <HASH>..<HASH> 100644 --- a/pyqode/core/modes/code_completion.py +++ b/pyqode/core/modes/code_completion.py @@ -23,6 +23,7 @@ This module contains the code completion mode and the related classes. """ import re import sys +import os from pyqode.core import constants from pyqode.core.editor import QCodeEdit from pyqode.core.mode import Mode @@ -207,10 +208,12 @@ class CodeCompletionMode(Mode, QtCore.QObject): self.__preload(code, self.editor.filePath, self.editor.fileEncoding) def _onInstall(self, editor): - if CodeCompletionMode.SERVER is None: + if (CodeCompletionMode.SERVER is None and + not os.environ.has_key("PYQODE_NO_COMPLETION_SERVER")): s = SubprocessServer() s.start() CodeCompletionMode.SERVER = s + print("Start server") CodeCompletionMode.SERVER.signals.workCompleted.connect(self.__onWorkFinished) self.__completer = QtGui.QCompleter([""], editor) self.__completer.setCompletionMode(self.__completer.PopupCompletion)
Add PYQODE_NO_COMPLETION_SERVER env var to disable code completion server when started from Qt Designer (cause a bug where multiprocessing was forking the qt designer process infinitely, untill windows crashed)
pyQode_pyqode.core
train
py
3887cd870ca16e6be1f720b3a59cbbb43795aae0
diff --git a/src/MetaModels/BackendIntegration/InputScreen/InputScreen.php b/src/MetaModels/BackendIntegration/InputScreen/InputScreen.php index <HASH>..<HASH> 100644 --- a/src/MetaModels/BackendIntegration/InputScreen/InputScreen.php +++ b/src/MetaModels/BackendIntegration/InputScreen/InputScreen.php @@ -444,6 +444,12 @@ class InputScreen implements IInputScreen */ public function getMetaModel() { + if (null === $this->data) { + throw new \RuntimeException( + 'No input screen data available, did you forget to define the view combinations?' + ); + } + $factory = $this->container->getFactory(); $metaModel = $factory->getMetaModel($factory->translateIdToMetaModelName($this->data['pid']));
Fix #<I> - hint when no input screen has been assigned.
MetaModels_core
train
php
9f9c1f683e708a9abe5735590a97b227f936d975
diff --git a/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/BTCChinaResponse.java b/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/BTCChinaResponse.java index <HASH>..<HASH> 100644 --- a/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/BTCChinaResponse.java +++ b/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/BTCChinaResponse.java @@ -45,7 +45,7 @@ public class BTCChinaResponse<V> { this.result = result; this.error = error; - if (error != null) { + if (error != null || result == null) { throw new ExchangeException(error); } }
Added Null checking for BTCChinaResponse
knowm_XChange
train
java