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
24e6750794f1ba7b600b7c97db0bceed09cffc49
diff --git a/umap/umap_.py b/umap/umap_.py index <HASH>..<HASH> 100644 --- a/umap/umap_.py +++ b/umap/umap_.py @@ -1709,7 +1709,7 @@ class UMAP(BaseEstimator): embedding = optimize_layout( embedding, - self.embedding_, + self.embedding_.astype(np.float32, copy=False), # Fix #179 head, tail, n_epochs,
Fix #<I> This meets the expectation that the embeddings passed to optimize_layout are float<I>. In the typical case, where they are float<I>, this should be no cost. When the stored embedding is not float<I>, this is a pretty cheap operation.
lmcinnes_umap
train
py
465962354b20165a2529a78428bdb8ae32f32315
diff --git a/lib/workerholic/starter.rb b/lib/workerholic/starter.rb index <HASH>..<HASH> 100644 --- a/lib/workerholic/starter.rb +++ b/lib/workerholic/starter.rb @@ -11,6 +11,10 @@ module Workerholic launch end + def self.kill_memory_tracker_thread + @thread.kill + end + private def self.options @@ -78,10 +82,6 @@ module Workerholic StatsStorage.delete_memory_stats end - def self.kill_memory_tracker_thread - @thread.kill - end - def self.launch if options[:processes] && options[:processes] > 1 begin
make method to kill memory tracker public
workerholic_workerholic
train
rb
49e9d642f4a6f783fe41267571887e4500ad49ae
diff --git a/metrics-guice/src/main/java/com/yammer/metrics/guice/JmxReporterProvider.java b/metrics-guice/src/main/java/com/yammer/metrics/guice/JmxReporterProvider.java index <HASH>..<HASH> 100644 --- a/metrics-guice/src/main/java/com/yammer/metrics/guice/JmxReporterProvider.java +++ b/metrics-guice/src/main/java/com/yammer/metrics/guice/JmxReporterProvider.java @@ -16,6 +16,8 @@ public class JmxReporterProvider implements Provider<JmxReporter> @Override public JmxReporter get() { - return new JmxReporter(metricsRegistry); + JmxReporter reporter = new JmxReporter(metricsRegistry); + reporter.start(); + return reporter; } }
Also need to start the jmx reporter ...
dropwizard_metrics
train
java
7396e36faef6ead726f118eff9552856ef0d068b
diff --git a/lib/pulsar/task.js b/lib/pulsar/task.js index <HASH>..<HASH> 100644 --- a/lib/pulsar/task.js +++ b/lib/pulsar/task.js @@ -42,13 +42,21 @@ module.exports = (function() { self.status.set(PulsarStatus.STATUS_RUNNING); var args = [ - '--conf-repo', this._config.repo || '$(echo $PULSAR_CONF_REPO)', - '--conf-branch', this._config.branch || 'master', self.app, self.env, self.action ]; + if(this._config.repo) { + args.unshift(this._config.repo); + args.unshift('--conf-repo'); + } + + if(this._config.branch) { + args.unshift(this._config.branch); + args.unshift('--conf-branch'); + } + this._taskProcess = spawn('pulsar', args); this.pid = this._taskProcess.pid; this.command = 'pulsar ' + args.join(' ');
Pulsar repo and branch as optional
cargomedia_pulsar-rest-api
train
js
0c13aa3d92a6744146e27429ad532b8b89f5d6eb
diff --git a/spec/indico_batch_spec.rb b/spec/indico_batch_spec.rb index <HASH>..<HASH> 100644 --- a/spec/indico_batch_spec.rb +++ b/spec/indico_batch_spec.rb @@ -121,4 +121,13 @@ describe Indico do expect(response[1].length).to eql(2048) end + # Uncomment when frontend updated to accept image urls + # it "should accept image urls" do + # test_image = "http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/48/Emotes-face-smile-icon.png" + # response = Indico.batch_image_features([test_image, test_image], $username, $password) + + # expect(response[0].length).to eql(2048) + # expect(response[1].length).to eql(2048) + # end + end diff --git a/spec/indico_spec.rb b/spec/indico_spec.rb index <HASH>..<HASH> 100644 --- a/spec/indico_spec.rb +++ b/spec/indico_spec.rb @@ -110,4 +110,11 @@ describe Indico do expect(response.length).to eql(2048) end + # Uncomment when frontend updated to accept image urls + # it "should accept image urls" do + # response = Indico.image_features("http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/48/Emotes-face-smile-icon.png") + + # expect(response.length).to eql(2048) + # end + end
now updated to accept image_urls
IndicoDataSolutions_IndicoIo-ruby
train
rb,rb
15ecd10dbd228bf8376b3c715db2955ab06e7538
diff --git a/provider/local/config.go b/provider/local/config.go index <HASH>..<HASH> 100644 --- a/provider/local/config.go +++ b/provider/local/config.go @@ -19,6 +19,8 @@ var checkIfRoot = func() bool { } const ( + // These constants are defined here, and used in environprovider.go + // to explicitly get from the config unknown params. containerConfigKey = "container" containerDefault = "lxc" ) @@ -82,7 +84,7 @@ func (c *environConfig) rootDir() string { } func (c *environConfig) container() instance.ContainerType { - return instance.ContainerType(c.attrs["container"].(string)) + return instance.ContainerType(c.attrs[containerConfigKey].(string)) } func (c *environConfig) networkBridge() string {
Add comment for the config keys as they are different from others.
juju_juju
train
go
d34134f1dbdc5fa54e399381d350c1ee27add05c
diff --git a/src/test/java/com/yahoo/sketches/theta/TestPerformanceTheta.java b/src/test/java/com/yahoo/sketches/theta/TestPerformanceTheta.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/yahoo/sketches/theta/TestPerformanceTheta.java +++ b/src/test/java/com/yahoo/sketches/theta/TestPerformanceTheta.java @@ -6,7 +6,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.testng.annotations.Test; import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.Family; @@ -25,7 +24,7 @@ public class TestPerformanceTheta { private UpdateSketch gadget_; public final Logger LOG = LoggerFactory.getLogger(TestPerformanceTheta.class); - @Test //enable to allow running from TestNG manually + //@Test //enable to allow running from TestNG manually public static void startTest() throws Exception { TestPerformanceTheta.main(new String[] {"CONCURRENT", "QUICKSELECT", "4", "4", "30", "true"}); }
Disable TestPeformanceTheta ... not suitable for Unit Tests.
DataSketches_sketches-core
train
java
17db8d4f9d9b821755d17ba908a2ba4956bcf605
diff --git a/changes/changelog.py b/changes/changelog.py index <HASH>..<HASH> 100644 --- a/changes/changelog.py +++ b/changes/changelog.py @@ -62,14 +62,14 @@ def generate_changelog(context): ] git_log_content = None + git_log = 'log --oneline --no-merges --no-color'.split(' ') try: - git_log = 'log --oneline --no-merges --no-color'.split(' ') git_log.append('%s..master' % context.current_version) git_log_content = git(git_log) log.debug('content: %s' % git_log_content) except: log.warn('Error diffing previous version, initial release') - git_log_content = git(git_log.split(' ')) + git_log_content = git(git_log) git_log_content = replace_sha_with_commit_link(context.repo_url, git_log_content)
The git log command has already been split
michaeljoseph_changes
train
py
8f0186b0f9ca44a9d39b0ba9a5a876296084f608
diff --git a/tests/FeedIo/Parser/Rule/TitleTest.php b/tests/FeedIo/Parser/Rule/TitleTest.php index <HASH>..<HASH> 100644 --- a/tests/FeedIo/Parser/Rule/TitleTest.php +++ b/tests/FeedIo/Parser/Rule/TitleTest.php @@ -11,6 +11,8 @@ namespace FeedIo\Parser\Rule; +use FeedIo\Feed\Item; + class TitleTest extends \PHPUnit_Framework_TestCase { /** @@ -30,7 +32,10 @@ class TitleTest extends \PHPUnit_Framework_TestCase public function testSet() { - + $item = new Item(); + + $this->object->set($item, new \DOMElement('title', 'feed-io title')); + $this->assertEquals('feed-io title', $item->getTitle()); } }
Implement TitleTest::testSet
alexdebril_feed-io
train
php
4e43b67a558be25e54fffa36da84fa8b18b13a22
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index <HASH>..<HASH> 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -125,7 +125,7 @@ module.exports = { ] } ], - "copyright": "Copyright © 2021 Developer Express, Inc", + "copyright": "Copyright © 2021 Devsoft Baltic OÜ", "logo": { "src": "img/resolve.svg" }
Update copyright (#<I>)
reimagined_resolve
train
js
2ef7546567187ecf07c857a460ae15a192445832
diff --git a/lib/fog/aws/models/s3/bucket.rb b/lib/fog/aws/models/s3/bucket.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/models/s3/bucket.rb +++ b/lib/fog/aws/models/s3/bucket.rb @@ -16,7 +16,9 @@ module Fog end def delete + return false if new_record? connection.delete_bucket(name) + @new_record = true true end @@ -45,6 +47,7 @@ module Fog options['LocationConstraint'] = @location end connection.put_bucket(name, options) + @new_record = false true end diff --git a/lib/fog/model.rb b/lib/fog/model.rb index <HASH>..<HASH> 100644 --- a/lib/fog/model.rb +++ b/lib/fog/model.rb @@ -25,6 +25,10 @@ module Fog @connection end + def new_record? + !defined?(@new_record) || @new_record + end + def remap_attributes(attributes, mapping) for key, value in mapping if attributes[key]
new_record stuff to track if something has been persisted to aws
fog_fog
train
rb,rb
678e90a3fafc2bbe6db2ac3a9ecc8a7c239b376f
diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index <HASH>..<HASH> 100755 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -217,9 +217,6 @@ def _set_chrome_options( # Headless Chrome doesn't support extensions, which are required # for disabling the Content Security Policy on Chrome chrome_options = _add_chrome_disable_csp_extension(chrome_options) - elif not extension_zip and not extension_dir: - if servername == "localhost" or servername == "127.0.0.1": - chrome_options.add_argument("--disable-extensions") if proxy_string: if proxy_auth: chrome_options = _add_chrome_proxy_extension(
Do not use "--disable-extensions" (it breaks proxy auth)
seleniumbase_SeleniumBase
train
py
2c886e222ab71fbcb189437089eeca501e8845dd
diff --git a/fuzz_test.go b/fuzz_test.go index <HASH>..<HASH> 100644 --- a/fuzz_test.go +++ b/fuzz_test.go @@ -39,6 +39,7 @@ func testFuzz(crasher string) error { return nil } +/* // This is where we put anything that just caused a panic and wasn't solved by returning an error func TestFuzz_Panics(t *testing.T) { var crashers = []string{ @@ -77,6 +78,7 @@ func TestFuzz_Panics(t *testing.T) { } } } +*/ func TestFuzz_UnboundedAllocation(t *testing.T) { var crashers = []string{
Remove test TestFuzz_Panics because it always fails
linkedin_goavro
train
go
4b018e8796d0b16d41c87faf52e9489f9557c5a8
diff --git a/test/60.strftime.js b/test/60.strftime.js index <HASH>..<HASH> 100755 --- a/test/60.strftime.js +++ b/test/60.strftime.js @@ -61,11 +61,11 @@ describe(TITLE, function() { describe("strftime compatibility", function() { var YEARS = [2017, 2018, 2019, 2020]; - var MONTHS = [1, 2, 12]; - var DAYS = [1, 2, 28]; - var HOURS = [0, 11, 12, 13, 23]; - var MINUTES = [0, 1, 59]; - var SECONDS = [0, 1, 59]; + var MONTHS = [1, 12]; + var DAYS = [1, 31]; + var HOURS = [0, 12, 23]; + var MINUTES = [0, 59]; + var SECONDS = [0, 59]; // not all patterns supported at Timestamp#toString var PATTERNS = [ @@ -120,6 +120,9 @@ describe(TITLE, function() { YEARS.forEach(function(year) { it("" + year, function() { + // this may take longer seconds at some environment + this.timeout(10000); + var cnt = 0; MONTHS.forEach(function(month) { DAYS.forEach(function(day) {
test timeout <I> seconds Error: timeout of <I>ms exceeded. Ensure the done() callback is being called in this test.
kawanet_timestamp-nano
train
js
f8dd905a24b964aca33a36bb150150374d857177
diff --git a/spacy/_ml.py b/spacy/_ml.py index <HASH>..<HASH> 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -243,8 +243,9 @@ class PrecomputableAffine(Model): def link_vectors_to_models(vocab): vectors = vocab.vectors if vectors.name is None: - raise ValueError( - "Unnamed vectors -- this won't allow multiple vectors " + vectors.name = VECTORS_KEY + print( + "Warning: Unnamed vectors -- this won't allow multiple vectors " "models to be loaded. (Shape: (%d, %d))" % vectors.data.shape) ops = Model.ops for word in vocab:
Warn and fallback if vectors have no name
explosion_spaCy
train
py
58c41924a3752a9b3e3b9ef5de741c1aad2cc71a
diff --git a/src/Response.php b/src/Response.php index <HASH>..<HASH> 100755 --- a/src/Response.php +++ b/src/Response.php @@ -32,7 +32,6 @@ class Response extends \Swlib\Http\Response */ public $statusCode = 0; public $reasonPhrase = 'Failed'; - public $uri; public $time; /** @var \Swlib\Http\StreamInterface */ public $body; @@ -145,11 +144,6 @@ class Response extends \Swlib\Http\Response return $this->success; } - public function getUri(): ?UriInterface - { - return $this->uri; - } - public function getTime(): float { return $this->time;
Move Uri to Message. (cherry picked from commit b4d4eca<I>e<I>a5a<I>d6dc<I>e<I>cbdcec6d<I>)
swlib_saber
train
php
a3883428b9656ea7e3a837c826662e746cbecc16
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() -required = ['path.py>=2.2', 'envoy>=0.0.2'] +required = ['path.py>=2.2', 'envoy>=0.0.2', 'nose>=1.1'] packages = ['pub', 'pub.shortcuts'] setup(
adding nose to required in setup.py
llimllib_pub
train
py
498874a48fcab9cdf2d8ab6f1243ebf8dc14e08b
diff --git a/lib/jeff.rb b/lib/jeff.rb index <HASH>..<HASH> 100644 --- a/lib/jeff.rb +++ b/lib/jeff.rb @@ -96,13 +96,20 @@ module Jeff private + def connection_host + [connection.connection[:host], connection.connection[:port]].join ':' + end + def connection_path + connection.connection[:path] + end + def sign(opts) query = build_query opts[:query] || {} string_to_sign = [ opts[:method].upcase, - opts[:host] || connection.connection[:host], - opts[:path] || connection.connection[:path], + connection_host, + opts[:path] || connection_path, query ].join "\n" signature = secret.sign string_to_sign
Include port in string to sign This quirk took me a few hours to debug! Excon, unlike other HTTP libraries, includes the port number in ALL requests, even when the port number is standard. <URL>
hakanensari_jeff
train
rb
a22ea76fa2453bcd401feebce92a0a102dd00fb8
diff --git a/resources/assets/js/modules/datetimepicker.js b/resources/assets/js/modules/datetimepicker.js index <HASH>..<HASH> 100644 --- a/resources/assets/js/modules/datetimepicker.js +++ b/resources/assets/js/modules/datetimepicker.js @@ -13,8 +13,7 @@ document.addEventListener('turbolinks:load', function() { next: 'icon-arrow-right', today: 'icon-target', clear: 'icon-trash', - close: 'icon-close' - + close: 'icon-close', }, }); }); diff --git a/src/Platform/Fields/Types/CheckBoxField.php b/src/Platform/Fields/Types/CheckBoxField.php index <HASH>..<HASH> 100644 --- a/src/Platform/Fields/Types/CheckBoxField.php +++ b/src/Platform/Fields/Types/CheckBoxField.php @@ -62,6 +62,6 @@ class CheckBoxField extends Field 'step', 'tabindex', 'value', - 'type' + 'type', ]; }
Apply fixes from StyleCI (#<I>) [ci skip] [skip ci]
orchidsoftware_platform
train
js,php
4bce971bdac6907037e034f61c5c1d199d578620
diff --git a/jsonresponse.go b/jsonresponse.go index <HASH>..<HASH> 100644 --- a/jsonresponse.go +++ b/jsonresponse.go @@ -80,11 +80,6 @@ func NonAuthoritativeInfo(w http.ResponseWriter, response interface{}) { Respond(w, http.StatusNonAuthoritativeInfo, response) } -// NoContent writes a response with status code 204. -func NoContent(w http.ResponseWriter, response interface{}) { - Respond(w, http.StatusNoContent, response) -} - // ResetContent writes a response with status code 205. func ResetContent(w http.ResponseWriter, response interface{}) { Respond(w, http.StatusResetContent, response)
Remove NoContent function as it should not be used
janos_jsonresponse
train
go
8c713ef1bd0ca9f83e1b1b8560190245c80b688e
diff --git a/lib/BrowserFetcher.js b/lib/BrowserFetcher.js index <HASH>..<HASH> 100644 --- a/lib/BrowserFetcher.js +++ b/lib/BrowserFetcher.js @@ -233,7 +233,12 @@ function downloadFile(url, destinationPath, progressCallback) { * @return {!Promise<?Error>} */ function extractZip(zipPath, folderPath) { - return new Promise(fulfill => extract(zipPath, {dir: folderPath}, fulfill)); + return new Promise((fulfill, reject) => extract(zipPath, {dir: folderPath}, err => { + if (err) + reject(err); + else + fulfill(); + })); } function httpRequest(url, method, response) {
fix(browserfetcher): handle extract-zip errors (#<I>)
GoogleChrome_puppeteer
train
js
d918ae38e7a665ee0261fc003da514f5822ae580
diff --git a/lib/Segment/Client.php b/lib/Segment/Client.php index <HASH>..<HASH> 100644 --- a/lib/Segment/Client.php +++ b/lib/Segment/Client.php @@ -139,11 +139,17 @@ class Segment_Client { */ private function formatTime($ts) { // time() - if ($ts == null) $ts = time(); - if (is_integer($ts)) return date("c", $ts); - - // anything else return a new date. - if (!is_float($ts)) return date("c"); + if ($ts == null || !$ts) $ts = time(); + if (filter_var($ts, FILTER_VALIDATE_INT) !== false) return date("c", (int) $ts); + + // anything else try to strtotime the date. + if (filter_var($ts, FILTER_VALIDATE_FLOAT) === false) { + if (is_string($ts)) { + return date("c", strtotime($ts)); + } else { + return date("c"); + } + } // fix for floatval casting in send.php $parts = explode(".", (string)$ts);
- fixes #<I> - instead of using just is_int and is_float for checking timestamp, use filter_var since that can detect string ints and floats - if its not a string or float, consider it might be a ISO<I> or some other string, so use strtotime() to support other strings
segmentio_analytics-php
train
php
03d756cdb3996a92bf5e584af2048f8b927469dd
diff --git a/angr/analyses/decompiler/clinic.py b/angr/analyses/decompiler/clinic.py index <HASH>..<HASH> 100644 --- a/angr/analyses/decompiler/clinic.py +++ b/angr/analyses/decompiler/clinic.py @@ -563,6 +563,7 @@ class Clinic(Analysis): if block is not None \ and not stmt.ret_exprs \ and self.function.prototype is not None \ + and self.function.prototype.returnty is not None \ and type(self.function.prototype.returnty) is not SimTypeBottom: new_stmt = stmt.copy() ret_val = self.function.calling_convention.return_val(self.function.prototype.returnty)
Clinic: Resilience against returnty being None in function prototypes.
angr_angr
train
py
b4dcafc011cfb708499364f185900bbafbdddbba
diff --git a/ospd/command/command.py b/ospd/command/command.py index <HASH>..<HASH> 100644 --- a/ospd/command/command.py +++ b/ospd/command/command.py @@ -312,6 +312,8 @@ class GetVts(BaseCommand): @return: Response string for <get_vts> command on fail. """ + self._daemon.vts.is_cache_available = False + xml_helper = XmlStringHelper() vt_id = xml.get('vt_id') @@ -353,6 +355,8 @@ class GetVts(BaseCommand): yield xml_helper.create_element('vts', end=True) yield xml_helper.create_response('get_vts', end=True) + self._daemon.vts.is_cache_available = True + class StopScan(BaseCommand): name = 'stop_scan' diff --git a/ospd/vts.py b/ospd/vts.py index <HASH>..<HASH> 100644 --- a/ospd/vts.py +++ b/ospd/vts.py @@ -49,6 +49,8 @@ class Vts: self._vts = None self.sha256_hash = None + self.is_cache_available = True + def __contains__(self, key: str) -> bool: return key in self._vts
Add flag to advice that the cache is being used for a process. This allows to block the use of the cache by one process and avoid other process to do an action on the cache. Eg. update vts cache during response of get_vts cmd.
greenbone_ospd
train
py,py
e7ba976ba390a8801c3a3fad69db6bd07ebef0a3
diff --git a/bin/cli.js b/bin/cli.js index <HASH>..<HASH> 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -15,7 +15,7 @@ function cliMain () { return new Installer(parseArgs()).run().then(details => { console.error(`added ${details.pkgCount} packages in ${ details.runTime / 1000 - }s.`) + }s`) }, err => { console.error(`Error!\n${err.message}\n${err.stack}`) })
fix(output): npm does not punctuate this
zkat_cipm
train
js
077c8caa795225158e2a3b20c65bca0e5c02789b
diff --git a/lib/Thelia/Form/AdminLogin.php b/lib/Thelia/Form/AdminLogin.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Form/AdminLogin.php +++ b/lib/Thelia/Form/AdminLogin.php @@ -16,7 +16,7 @@ use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Core\Translation\Translator; -class AdminLogin extends BaseForm +class AdminLogin extends FirewallForm { protected function buildForm() { diff --git a/lib/Thelia/Form/CustomerLogin.php b/lib/Thelia/Form/CustomerLogin.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Form/CustomerLogin.php +++ b/lib/Thelia/Form/CustomerLogin.php @@ -24,7 +24,7 @@ use Thelia\Model\CustomerQuery; * @package Thelia\Form * @author Manuel Raynaud <mraynaud@openstudio.fr> */ -class CustomerLogin extends BaseForm +class CustomerLogin extends FirewallForm { protected function buildForm() {
Add firewall on login forms modified: core/lib/Thelia/Form/AdminLogin.php modified: core/lib/Thelia/Form/CustomerLogin.php
thelia_core
train
php,php
f2b0531c53f01812139668456694b402d429a450
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/ipythonconsole.py +++ b/spyder/plugins/ipythonconsole.py @@ -1249,8 +1249,12 @@ class IPythonConsole(SpyderPluginWidget): if index is not None: client = self.tabwidget.widget(index) - # Close client - client.stop_button_click_handler() + # Needed to handle a RuntimeError. See issue 5568. + try: + # Close client + client.stop_button_click_handler() + except RuntimeError: + pass # Check if related clients or kernels are opened # and eventually ask before closing them
Add handling for RuntimeError while closing an IPython console instance.
spyder-ide_spyder
train
py
d9c8dfafe8ed36bdbdfa6b76d7ab5406c9cfabcf
diff --git a/emma2/msm/util.py b/emma2/msm/util.py index <HASH>..<HASH> 100644 --- a/emma2/msm/util.py +++ b/emma2/msm/util.py @@ -1,37 +1,4 @@ """ -Utility functions +MSM related utility functions """ -from numpy import allclose -def allclose_sparse(A, B, rtol=1e-5, atol=1e-9): - """ - Compares two sparse matrices in the same matter like numpy.allclose() - Parameters - ---------- - A : scipy.sparse matrix - first matrix to compare - B : scipy.sparse matrix - second matrix to compare - rtol : float - relative tolerance - atol : float - absolute tolerance - - Returns - ------- - True, if given matrices are equal in bounds of rtol and atol - False, otherwise - - Notes - ----- - If the following equation is element-wise True, then allclose returns - True. - - absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`)) - - The above equation is not symmetric in `a` and `b`, so that - `allclose(a, b)` might be different from `allclose(b, a)` in - some rare cases. - """ - diff = (A - B).data - return allclose(diff, 0.0, rtol=rtol, atol=atol)
removed function all_close sparse, which is now contained in emma2.util.numeric
markovmodel_PyEMMA
train
py
46e552e9eefd7ec52f2df3f1a8c9cca60e36105d
diff --git a/authomatic/providers/openid.py b/authomatic/providers/openid.py index <HASH>..<HASH> 100644 --- a/authomatic/providers/openid.py +++ b/authomatic/providers/openid.py @@ -95,6 +95,7 @@ class SessionWrapper(object): val = self.session.get(key) if val and val.startswith(self.prefix): split = val.split(self.prefix)[1] + split = str(split) unpickled = pickle.loads(split) return unpickled
fix an error i was getting with yahoo openid
authomatic_authomatic
train
py
7bbbe8f420a1d52652eca080b3302f2fa64d9c30
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -30,7 +30,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "17.1.2" +DEFAULT_VERSION = "18.0" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" DEFAULT_SAVE_DIR = os.curdir diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '17.1.2' +__version__ = '18.0'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py,py
bd802c0aaf49d47ae1698ced54686b04abf7de0b
diff --git a/src/utils/to-path-components.js b/src/utils/to-path-components.js index <HASH>..<HASH> 100644 --- a/src/utils/to-path-components.js +++ b/src/utils/to-path-components.js @@ -4,7 +4,7 @@ const toPathComponents = (path = '') => { // split on / unless escaped with \ return (path .trim() - .match(/([^\\\^/]|\\\/)+/g) || []) + .match(/([^\\^/]|\\\/)+/g) || []) .filter(Boolean) }
chore: fix up linting errors
ipfs_js-ipfs-unixfs
train
js
596c48a3ea36dd53a61ce5ad43deb6c05298c907
diff --git a/src/googleclouddebugger/python_breakpoint.py b/src/googleclouddebugger/python_breakpoint.py index <HASH>..<HASH> 100644 --- a/src/googleclouddebugger/python_breakpoint.py +++ b/src/googleclouddebugger/python_breakpoint.py @@ -208,6 +208,7 @@ class PythonBreakpoint(object): condition, self._BreakpointEvent) + self._RemoveImportHook() return True def _FindCodeObject(self):
Remove the import hook after successfully setting a breakpoint, instead of waiting until it is completed. ------------- Created by MOE: <URL>
GoogleCloudPlatform_cloud-debug-python
train
py
bdaff7b64d8437f4af82f6aa0f69fabba27ea20e
diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js index <HASH>..<HASH> 100644 --- a/lib/workers/pr/index.js +++ b/lib/workers/pr/index.js @@ -237,7 +237,7 @@ async function ensurePr(prConfig) { logger.debug( { prTitle, - oldPrBody: existingPr.body, + oldPrBody: existingPrBody, newPrBody: prBody, }, 'PR body changed'
refactor: fix oldPrBody log
renovatebot_renovate
train
js
f9848a99579321879dbb10fbb69ca054b3221291
diff --git a/Entity/Tweet.php b/Entity/Tweet.php index <HASH>..<HASH> 100644 --- a/Entity/Tweet.php +++ b/Entity/Tweet.php @@ -35,7 +35,7 @@ class Tweet private $favorite_count; /** - * @var integer + * @var User */ private $user;
Fixed issues reported by Scrutinizer
alexislefebvre_AsyncTweetsBundle
train
php
f86d3538f6063c34c7562cad58f3f3780b3d26ec
diff --git a/cmd/data-crawler.go b/cmd/data-crawler.go index <HASH>..<HASH> 100644 --- a/cmd/data-crawler.go +++ b/cmd/data-crawler.go @@ -775,13 +775,16 @@ func (i *crawlItem) objectPath() string { return path.Join(i.prefix, i.objectName) } -// sleepDuration multiplies the duration d by x and sleeps if is more than 100 micro seconds. -// sleep is limited to max 1 second. +// sleepDuration multiplies the duration d by x +// and sleeps if is more than 100 micro seconds. +// Sleep is limited to max 15 seconds. func sleepDuration(d time.Duration, x float64) { + const maxWait = 15 * time.Second + const minWait = 100 * time.Microsecond // Don't sleep for really small amount of time - if d := time.Duration(float64(d) * x); d > time.Microsecond*100 { - if d > time.Second { - d = time.Second + if d := time.Duration(float64(d) * x); d > minWait { + if d > maxWait { + d = maxWait } time.Sleep(d) }
Allow deeper sleep (#<I>) Allow each crawler operation to sleep up to <I> seconds on very heavily loaded systems. This will of course make minimum crawler speed less, but should be more effective at stopping.
minio_minio
train
go
08b8925e7da13acac6b377fce721af939b41d0bd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -26,12 +26,12 @@ module.exports = function(array, haltCallback) { if(i >= len) return resolve(results); var method = array[i]; - if(!(method instanceof Function)) { + if(typeof method !== 'function') { return processPromise(method); } var p = method(); - if((p instanceof Promise)) { + if(typeof p.then === 'function' && typeof p.catch === 'function') { p.then(processPromise).catch(reject); } else { processPromise(p);
Allow more liberal promise detection, es5 compat
CacheControl_promise-series
train
js
e3a79dbec70751d5412f406875d00ac904550d1c
diff --git a/spec/rack/test/utils_spec.rb b/spec/rack/test/utils_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rack/test/utils_spec.rb +++ b/spec/rack/test/utils_spec.rb @@ -17,7 +17,8 @@ describe Rack::Test::Utils do end it "converts hashes with multiple keys" do - requestify(:a => 1, :b => 2).should == "a=1&b=2" + hash = { :a => 1, :b => 2 } + ["a=1&b=2", "b=2&a=1"].should include(requestify(hash)) end it "converts arrays with one element" do
Account for unordered hash in specs
rack-test_rack-test
train
rb
b8f407efdf50c71bd6163d695253d31779b9dbe5
diff --git a/core/unit.js b/core/unit.js index <HASH>..<HASH> 100644 --- a/core/unit.js +++ b/core/unit.js @@ -1,7 +1,7 @@ 'use strict'; var uniqueId = require('unique-id'); -var S_SEPARATOR = '\u0000'; +var S_SEPARATOR = '-'; var EventEmitter = /** @type EventEmitter */ require('events').EventEmitter; var Skip = /** @type Skip */ require('./skip/skip');
make cache key token separator normal character
fistlabs_fist
train
js
4e259988864ebc02867a3f757e38deae25a6961e
diff --git a/lib/rubocop/cop/lint/duplicate_methods.rb b/lib/rubocop/cop/lint/duplicate_methods.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/lint/duplicate_methods.rb +++ b/lib/rubocop/cop/lint/duplicate_methods.rb @@ -41,18 +41,28 @@ module RuboCop receiver, name, = *node if receiver.const_type? _, const_name = *receiver - if (qualified = lookup_constant(node, const_name)) - found_method(node, "#{qualified}.#{name}") - end + check_const_receiver(node, name, const_name) elsif receiver.self_type? - if (enclosing = node.parent_module_name) - found_method(node, "#{enclosing}.#{name}") - end + check_self_receiver(node, name) end end private + def check_const_receiver(node, name, const_name) + qualified = lookup_constant(node, const_name) + return unless qualified + + found_method(node, "#{qualified}.#{name}") + end + + def check_self_receiver(node, name) + enclosing = node.parent_module_name + return unless enclosing + + found_method(node, "#{enclosing}.#{name}") + end + def message_for_dup(node, method_name) format(MSG, method_name, @definitions[method_name], source_location(node))
Reduce complexity in DuplicateMethods Split `on_defs` into smaller methods.
rubocop-hq_rubocop
train
rb
9f41694fb5c669f31aedf512e2696482b562c463
diff --git a/citrination_client/tests/test_client.py b/citrination_client/tests/test_client.py index <HASH>..<HASH> 100644 --- a/citrination_client/tests/test_client.py +++ b/citrination_client/tests/test_client.py @@ -2,7 +2,6 @@ from citrination_client import CitrinationClient from os import environ from json import loads from pypif.obj.system import System -from tempfile import TemporaryDirectory from pypif.pif import dump from os.path import join @@ -16,9 +15,7 @@ def test_upload_pif(): pif = System() pif.id = 0 - with TemporaryDirectory() as tmpdir: - tempname = join(tmpdir, "pif.json") - with open(tempname, "w") as fp: - dump(pif, fp) - response = loads(client.upload_file(tempname, dataset)) + with open("tmp.json", "w") as fp: + dump(pif, fp) + response = loads(client.upload_file("tmp.json", dataset)) assert response["message"] == "Upload is complete."
Removing TemporaryDirectory, which isn't in python2
CitrineInformatics_python-citrination-client
train
py
f9468481911c31673378b38e63872f57a1163f38
diff --git a/lib/resolver.js b/lib/resolver.js index <HASH>..<HASH> 100644 --- a/lib/resolver.js +++ b/lib/resolver.js @@ -127,7 +127,9 @@ resolver.getNpmPaths = function () { paths.push(path.join(__dirname, '../..')); // adds support for generator resolving when yeoman-generator has been linked - paths.push(path.join(path.dirname(process.argv[1]), '../..')); + if (process.argv[1]) { + paths.push(path.join(path.dirname(process.argv[1]), '../..')); + } // Default paths for each system if (win32) {
Fixed bug where getNpmPaths fails when process.argv[1] is not provided (#<I>)
yeoman_environment
train
js
c91db6ae170f2e162bfb1114e71dc2a955a0cf10
diff --git a/pkg/services/alerting/rule.go b/pkg/services/alerting/rule.go index <HASH>..<HASH> 100644 --- a/pkg/services/alerting/rule.go +++ b/pkg/services/alerting/rule.go @@ -141,7 +141,7 @@ func NewRuleFromDBAlert(ruleDef *models.Alert, logTranslationFailures bool) (*Ru uid, err := translateNotificationIDToUID(id, ruleDef.OrgId) if err != nil { if !errors.Is(err, models.ErrAlertNotificationFailedTranslateUniqueID) { - logger.Error("Failed to tranlate notification id to uid", "error", err.Error(), "dashboardId", model.DashboardID, "alert", model.Name, "panelId", model.PanelID, "notificationId", id) + logger.Error("Failed to translate notification id to uid", "error", err.Error(), "dashboardId", model.DashboardID, "alert", model.Name, "panelId", model.PanelID, "notificationId", id) } if logTranslationFailures {
Chore: fix spelling mistake (#<I>)
grafana_grafana
train
go
7b3bda983db2a7cb420f316bb2435ebfa0e7cd5d
diff --git a/src/main/java/gwt/material/design/addins/client/ui/MaterialTimePicker.java b/src/main/java/gwt/material/design/addins/client/ui/MaterialTimePicker.java index <HASH>..<HASH> 100644 --- a/src/main/java/gwt/material/design/addins/client/ui/MaterialTimePicker.java +++ b/src/main/java/gwt/material/design/addins/client/ui/MaterialTimePicker.java @@ -71,9 +71,9 @@ public class MaterialTimePicker extends MaterialWidget implements HasError, HasP public MaterialTimePicker() { super(Document.get().createElement("div")); - panel.add(lblError); input.setType(InputType.TEXT); panel.add(input); + panel.add(lblError); add(panel); }
Time Picker : Fixed the location of Error Label
GwtMaterialDesign_gwt-material-addins
train
java
fb5d243dc1a922be38963567bdddedefa5052e5a
diff --git a/test/hamlit/line_number_test.rb b/test/hamlit/line_number_test.rb index <HASH>..<HASH> 100644 --- a/test/hamlit/line_number_test.rb +++ b/test/hamlit/line_number_test.rb @@ -147,7 +147,7 @@ describe Hamlit::Engine do = __LINE__ HAML end - end + end unless /java/ === RUBY_PLATFORM # execjs is not working with Travis JRuby environment describe 'css filter' do it 'renders static filter' do
Skip one more block on JRuby
haml_haml
train
rb
311cc52d38b1bbd38ca2d4898e0c56ff42c85085
diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.couchDbPerspective.js b/nunaliit2-js/src/main/js/nunaliit2/n2.couchDbPerspective.js index <HASH>..<HASH> 100644 --- a/nunaliit2-js/src/main/js/nunaliit2/n2.couchDbPerspective.js +++ b/nunaliit2-js/src/main/js/nunaliit2/n2.couchDbPerspective.js @@ -212,7 +212,7 @@ var DbPerspective = $n2.Class({ } else if( doc && isDocValid ) { if( doc._rev !== loadedDoc._rev ) { updated.push(loadedDoc); - delete this.docsById[loadedDoc._id]; + this.docsById[loadedDoc._id] = loadedDoc; }; }; };
nunaliit2-js: Fix bug with dbPerspective where some updates are reported as addition. Issue #<I>
GCRC_nunaliit
train
js
e3d853d2a5c1885191f8a57a94fe8819d96f6289
diff --git a/m2s3/app.py b/m2s3/app.py index <HASH>..<HASH> 100755 --- a/m2s3/app.py +++ b/m2s3/app.py @@ -7,6 +7,7 @@ Author: Alejandro Ricoveri <alejandro.ricoveri@blanclink.com> Main module """ +import os import sys import traceback #TODO replace log with logging https://docs.python.org/3.4/howto/logging.html#logging-basic-tutorial @@ -53,9 +54,7 @@ def init_parsecmdline(argv): (options, args) = parser.parse_args(argv) # Merge configuration with a JSON file - config.set_from_file(options.config_file) - log.msg("Using config file '{config_file}" - .format(config_file=options.config_file)) + config_file = os.path.abspath(options.config_file) log.msg("Attempting to use configuration file '{config_file}'" .format(config_file=config_file)) try:
Configuration file absolute path is determined before trying to use it
axltxl_m2bk
train
py
8cbf1e67881cc1b9bf44d19d7279489d4b27b3cd
diff --git a/datascience/tables.py b/datascience/tables.py index <HASH>..<HASH> 100644 --- a/datascience/tables.py +++ b/datascience/tables.py @@ -1041,10 +1041,10 @@ class Table(collections.abc.MutableMapping): the values that match both row and column based on ``collect``. Args: - ``columns`` -- a single column label, (``str``), in table, used to - create new columns, based on its unique values. - ``rows`` -- row labels, as (``str``) or array of strings, used to - create new rows based on it's unique values. + ``columns`` -- a single column label or index, (``str`` or ``int``), + used to create new columns, based on its unique values. + ``rows`` -- row labels or indices, (``str`` or ``int`` or list), + used to create new rows based on it's unique values. ``values`` -- column label in table for use in aggregation. Default None. ``collect`` -- aggregation function, used to group ``values`` @@ -1106,6 +1106,7 @@ class Table(collections.abc.MutableMapping): raise TypeError('collect requires values to be specified') if values is not None and collect is None: raise TypeError('values requires collect to be specified') + columns = self._as_label(columns) rows = self._as_labels(rows) if values is None: selected = self.select([columns] + rows)
pivot accepts column index as first arg
data-8_datascience
train
py
277cbc2a25d52351798edef72d39d2f7f2eb2013
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 @@ -47,7 +47,7 @@ def each_run # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories including factories. ([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | ::Refinery::Plugins.registered.pathnames).map{|p| - Dir[p.join('spec', 'support', '**', '*.rb').to_s] + Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s] }.flatten.sort.each do |support_file| require support_file end
Strings and Pathnames are mixed into one array and we can't call .join on string.
refinery_refinerycms
train
rb
e75745f0dbaa69e124ef322a497149801b99e766
diff --git a/h5p-development.class.php b/h5p-development.class.php index <HASH>..<HASH> 100644 --- a/h5p-development.class.php +++ b/h5p-development.class.php @@ -94,6 +94,9 @@ class H5PDevelopment { // Save/update library. $this->h5pF->saveLibraryData($library, $library['libraryId'] === FALSE); + // Need to decode it again, since it is served from here. + $library['metadataSettings'] = json_decode($library['metadataSettings']); + $library['path'] = 'development/' . $contents[$i]; $this->libraries[H5PDevelopment::libraryToString($library['machineName'], $library['majorVersion'], $library['minorVersion'])] = $library; }
metadataSettings returned as JSON, not string
h5p_h5p-php-library
train
php
6d0eed40eb10c6f95dd6410300548a0c0811d8c2
diff --git a/easybatch-core/src/main/java/io/github/benas/easybatch/core/converter/BooleanTypeConverter.java b/easybatch-core/src/main/java/io/github/benas/easybatch/core/converter/BooleanTypeConverter.java index <HASH>..<HASH> 100644 --- a/easybatch-core/src/main/java/io/github/benas/easybatch/core/converter/BooleanTypeConverter.java +++ b/easybatch-core/src/main/java/io/github/benas/easybatch/core/converter/BooleanTypeConverter.java @@ -25,7 +25,8 @@ package io.github.benas.easybatch.core.converter; /** - * Boolean type converter. + * Boolean type converter : converts "true" , "1", and "yes" (ignoring case) to the boolean true value. + * Any other value will be converted to false. * * @author benas (md.benhassine@gmail.com) */ @@ -35,7 +36,7 @@ public class BooleanTypeConverter implements TypeConverter<Boolean> { * {@inheritDoc} */ public Boolean convert(final String value) { - return Boolean.valueOf(value); + return Boolean.valueOf(value) || "1".equals(value) || "yes".equals(value); } }
fix issue#<I> : make the BooleanTypeConverter more intelligent
j-easy_easy-batch
train
java
0ddb561a7b33d85cb3fd1ec8efdf120e4aa45309
diff --git a/lib/greeklish/greeklish_generator.rb b/lib/greeklish/greeklish_generator.rb index <HASH>..<HASH> 100644 --- a/lib/greeklish/greeklish_generator.rb +++ b/lib/greeklish/greeklish_generator.rb @@ -57,14 +57,6 @@ module Greeklish # list is returned to the filter. attr_reader :greeklish_list - # Input token converted into String. - attr_reader :input_token - - # Input token converted into String without substitutions. - attr_reader :initial_token - - attr_reader :words - def initialize(max_expansions) @max_expansions = max_expansions @greeklish_list = []
Remove unused properties from GreeklishGenerator
skroutz_greeklish
train
rb
8aa76b4f5c6bc2c1e478a8b3a7513ba841ebfe92
diff --git a/ltiauthenticator/__init__.py b/ltiauthenticator/__init__.py index <HASH>..<HASH> 100644 --- a/ltiauthenticator/__init__.py +++ b/ltiauthenticator/__init__.py @@ -1 +1 @@ -from ltiauthenticator.lti11.auth import LTI11Authenticator as LTIAuthenticator # noqa +from ltiauthenticator.lti11.auth import LTI11Authenticator as LTI11Authenticator # noqa
Exposed object renamed to LTI<I>Authenticator
jupyterhub_ltiauthenticator
train
py
a8a26b0f24b05d755bd6aeee4091c62ed8b3c20e
diff --git a/store/src/main/java/com/buschmais/jqassistant/core/store/api/model/NamedDescriptor.java b/store/src/main/java/com/buschmais/jqassistant/core/store/api/model/NamedDescriptor.java index <HASH>..<HASH> 100644 --- a/store/src/main/java/com/buschmais/jqassistant/core/store/api/model/NamedDescriptor.java +++ b/store/src/main/java/com/buschmais/jqassistant/core/store/api/model/NamedDescriptor.java @@ -1,13 +1,19 @@ package com.buschmais.jqassistant.core.store.api.model; +import com.buschmais.jqassistant.core.shared.annotation.ToBeRemovedInVersion; +import com.buschmais.xo.neo4j.api.annotation.Indexed; + /** * Defines a descriptor having a name. * - * This descriptor is deprecated, use the one which is provided by `jqassistant.plugin.common`. + * This descriptor is deprecated, use the one which is provided by + * `jqassistant.plugin.common`. */ @Deprecated +@ToBeRemovedInVersion(major = 1, minor = 8) public interface NamedDescriptor extends Descriptor { + @Indexed String getName(); void setName(String name);
improve performance of GAV lookup by using indexes and caching
buschmais_jqa-core-framework
train
java
0957c24646244d5c8bf68c2036b17a332881aca5
diff --git a/client/consul/consul.go b/client/consul/consul.go index <HASH>..<HASH> 100644 --- a/client/consul/consul.go +++ b/client/consul/consul.go @@ -6,7 +6,7 @@ import ( ) // ConsulServiceAPI is the interface the Nomad Client uses to register and -// remove services and checks from Consul.css +// remove services and checks from Consul. // // ACL requirements // - service:write
docs: remove erroneous characters from comment
hashicorp_nomad
train
go
ba53477d80a7ccc06f9ea303c857092b5ee4a629
diff --git a/public/js/make-api.js b/public/js/make-api.js index <HASH>..<HASH> 100644 --- a/public/js/make-api.js +++ b/public/js/make-api.js @@ -77,6 +77,13 @@ Make = function Make( options ) { } }; }, + email: function( name ) { + return { + term: { + email: name + } + }; + }, tags: function( tagOptions ) { if ( typeof tagOptions.tags === "string" ) { tagOptions.tags = [ tagOptions.tags ]; @@ -159,6 +166,11 @@ Make = function Make( options ) { return this; }, + email: function( name ) { + this.searchFilters.push( MakeMap.email( name ) ); + return this; + }, + tags: function( tagOptions ) { this.searchFilters.push( MakeMap.tags( tagOptions ) ); return this;
[#<I>] Search field for email in make api.
mozilla_MakeAPI
train
js
3b3e0e5565b5eea8d23d20f784579655fa3e8fc0
diff --git a/frameit/lib/frameit/version.rb b/frameit/lib/frameit/version.rb index <HASH>..<HASH> 100644 --- a/frameit/lib/frameit/version.rb +++ b/frameit/lib/frameit/version.rb @@ -1,3 +1,3 @@ module Frameit - VERSION = "2.7.0".freeze + VERSION = "2.8.0".freeze end
[frameit] Version bump * Update internal dependencies (#<I>) * Add a test for error shown with a UTF-8 encoded strings file (#<I>) * Display error when parsing a .strings file returns empty results fixing #<I> (#<I>) * Add a ROOT path constant for frameit (#<I>) * Escape single quotes in frameit title strings (#<I>) * Added interline spacing to frameit titles (#<I>)
fastlane_fastlane
train
rb
e8a6a8ae90d3313536c1bfbe1f03899590db36ec
diff --git a/config/laravel-uptime-monitor.php b/config/laravel-uptime-monitor.php index <HASH>..<HASH> 100644 --- a/config/laravel-uptime-monitor.php +++ b/config/laravel-uptime-monitor.php @@ -65,7 +65,7 @@ return [ * given number of minutes ago. If you change this setting you have to manually * update the `uptime_check_interval_in_minutes` value of your existing monitors. * - * When an uptime check fails we'll check the uptime for that montitor every time `monitor:check-uptime` + * When an uptime check fails we'll check the uptime for that monitor every time `monitor:check-uptime` * runs regardless of this setting. */ 'run_interval_in_minutes' => 5, @@ -78,7 +78,7 @@ return [ 'concurrent_checks' => 10, /* - * The uptime check for a monitor will fail if url does not respond after the + * The uptime check for a monitor will fail if the url does not respond after the * given number of seconds. */ 'timeout_per_site' => 10,
Fix Config comment typos Change spelling from "montitor" to "monitor"; add "the" before "url" to correct a sentence.
spatie_laravel-uptime-monitor
train
php
b65462faf19e1ea2ba5a647b0b4196a2562a6844
diff --git a/plugins/providers/virtualbox/action.rb b/plugins/providers/virtualbox/action.rb index <HASH>..<HASH> 100644 --- a/plugins/providers/virtualbox/action.rb +++ b/plugins/providers/virtualbox/action.rb @@ -209,6 +209,7 @@ module VagrantPlugins b2.use PrepareForwardedPortCollisionParams b2.use HandleForwardedPortCollisions b2.use Resume + b2.use WaitForCommunicator, [:restoring, :running] else b2.use MessageNotCreated end
providers/virtualbox: resume should wait for boot
hashicorp_vagrant
train
rb
d95b446343e85f304eec3459e92102617cd7e669
diff --git a/ella/core/managers.py b/ella/core/managers.py index <HASH>..<HASH> 100644 --- a/ella/core/managers.py +++ b/ella/core/managers.py @@ -112,7 +112,7 @@ class HitCountManager(models.Manager): kwa = {} if mods: kwa['target_ct__in'] = [ ContentType.objects.get_for_model(m) for m in mods ] - return self.filter(**kwa)[:count] + return self.filter(site__id=settings.SITE_ID, **kwa)[:count] class DependencyManager(RelatedManager): def report_dependency(self, source, source_key, target, target_key): diff --git a/ella/core/models.py b/ella/core/models.py index <HASH>..<HASH> 100644 --- a/ella/core/models.py +++ b/ella/core/models.py @@ -225,6 +225,7 @@ class HitCount(models.Model): target_ct = models.ForeignKey(ContentType) target_id = models.IntegerField() last_seen = models.DateTimeField(editable=False) + site = models.ForeignKey(Site) hits = models.PositiveIntegerField(_('Hits'), default=1)
Added site to Hit counts so that we can reference individual sites independently git-svn-id: <URL>
ella_ella
train
py,py
00fe9b263168326806384deda605e6413f118a26
diff --git a/matchpy/matching/many_to_one.py b/matchpy/matching/many_to_one.py index <HASH>..<HASH> 100644 --- a/matchpy/matching/many_to_one.py +++ b/matchpy/matching/many_to_one.py @@ -509,12 +509,12 @@ class ManyToOneMatcher: position[-1] += 1 if isinstance(expression, Operation): if isinstance(expression, CommutativeOperation): - for operand in expression: + for operand in op_iter(expression): position.append(0) cls._collect_variable_renaming(operand, position, variables) position.pop() else: - for operand in expression: + for operand in op_iter(expression): cls._collect_variable_renaming(operand, position, variables) return variables
Fixed m<I> customized operation arg iteration.
HPAC_matchpy
train
py
1164141143d0a15e4ddb714a7103131f0b45e186
diff --git a/pyout/tests/test_tabular.py b/pyout/tests/test_tabular.py index <HASH>..<HASH> 100644 --- a/pyout/tests/test_tabular.py +++ b/pyout/tests/test_tabular.py @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import pytest + +blessings = pytest.importorskip("blessings") + from collections import Counter from collections import OrderedDict from curses import tigetstr @@ -11,9 +15,7 @@ import sys import time import traceback -import blessings from mock import patch -import pytest from six.moves import StringIO from pyout import Tabular as TheRealTabular
Don't test Tabular if blessings isn't installed In preparation for running a subset of the tests on AppVeyor, skip running test_tabular if blessings, which is incompatible with Windows, isn't installed.
pyout_pyout
train
py
5c37a1a897837212270c28fe5be9d0512cd8a7bd
diff --git a/templates/webpack.angular.js b/templates/webpack.angular.js index <HASH>..<HASH> 100644 --- a/templates/webpack.angular.js +++ b/templates/webpack.angular.js @@ -90,7 +90,7 @@ module.exports = env => { const ngCompilerPlugin = new AngularCompilerPlugin({ hostReplacementPaths: nsWebpack.getResolver([platform, "tns"]), platformTransformers: ngCompilerTransformers.map(t => t(() => ngCompilerPlugin, resolve(appFullPath, entryModule))), - mainPath: resolve(appPath, entryModule), + mainPath: join(appFullPath, entryModule), tsConfigPath: join(__dirname, tsConfigName), skipCodeGeneration: !aot, sourceMap: !!sourceMap,
chore: merge release into master (#<I>) * release: cut the <I> release * fix: add support for ts files on test command when `--bundle` is provided (#<I>) Rel to: <URL> * fix: fix "ERROR in Must have a source file to refactor." error from ngCompilerPlugin on `test` command (#<I>)
NativeScript_nativescript-dev-webpack
train
js
6b88cd513cea032d524015c60ec7859756df4191
diff --git a/mapbox_vector_tile/encoder.py b/mapbox_vector_tile/encoder.py index <HASH>..<HASH> 100644 --- a/mapbox_vector_tile/encoder.py +++ b/mapbox_vector_tile/encoder.py @@ -230,14 +230,14 @@ class VectorTile: return [seq[pos:pos + size] for pos in xrange(0, len(seq), size)] def _can_handle_key(self, k): - return isinstance(k, str) or isinstance(k, unicode) + return isinstance(k, (str, unicode)) def _can_handle_val(self, v): - if isinstance(v, str) or isinstance(v, unicode): + if isinstance(v, (str, unicode)): return True elif isinstance(v, bool): return True - elif isinstance(v, int) or isinstance(v, long): + elif isinstance(v, (int, long)): return True elif isinstance(v, float): return True @@ -275,7 +275,7 @@ class VectorTile: val.string_value = unicode(v, 'utf-8') elif isinstance(v, unicode): val.string_value = v - elif isinstance(v, int) or isinstance(v, long): + elif isinstance(v, (int, long)): val.int_value = v elif isinstance(v, float): val.double_value = v
Use isintancof check with a tuple
tilezen_mapbox-vector-tile
train
py
96d7bad73a5b2a4741af2fc7eda2b92350c1b348
diff --git a/src/Graviton/GeneratorBundle/Generator/ResourceGenerator/XDynamicKey.php b/src/Graviton/GeneratorBundle/Generator/ResourceGenerator/XDynamicKey.php index <HASH>..<HASH> 100644 --- a/src/Graviton/GeneratorBundle/Generator/ResourceGenerator/XDynamicKey.php +++ b/src/Graviton/GeneratorBundle/Generator/ResourceGenerator/XDynamicKey.php @@ -27,12 +27,12 @@ class XDynamicKey $functions = self::prepareFunctionNames($refMethods); foreach ($fields as $record) { $orgRec = $record; - for ($i = 0, $imax = count($functions); $i < $imax; $i++) { - if (method_exists($record, $functions[$i])) { - $record = $record->$functions[$i](); + foreach ($functions as $function) { + if (method_exists($record, $function)) { + $record = $record->$function(); } else { throw new XDynamicKeyException( - 'x-dynamic-key ref-method could not be resolved: '.$functions[$i] + 'x-dynamic-key ref-method could not be resolved: '.$function ); } }
using foreach each instead of for
libgraviton_graviton
train
php
edacc8dcbe5b24c81dc5fa20213642bdc7014c45
diff --git a/sauce/object.php b/sauce/object.php index <HASH>..<HASH> 100644 --- a/sauce/object.php +++ b/sauce/object.php @@ -73,6 +73,10 @@ class Object extends CallableProperty implements \ArrayAccess, \Countable $this->storage[0] = $data; return; } + + if (is_a($data, '\Sauce\Object')) { + $data = $data->storage; + } foreach ($data as $key => $value) { if (is_numeric($key)) { @@ -160,6 +164,11 @@ class Object extends CallableProperty implements \ArrayAccess, \Countable } } } + + public function getArrayCopy () + { + return $this->storage; + } } ?>
Added getArrayCopy method and fixed bug in \Sauce\Object - Object#getArrayCopy returns a copy of the storage array used internally - PHP's protected/private attributes only work on objects of other classes. That means if you use foreach on an object of the same type in a class, you as well get the key-value pairs for protected/private properties of given object. To circumvent this we now added getArrayCopy and use that to iterate over the given object in the constructor.
Brainsware_sauce
train
php
281544e5c8f7a85b128f3987404949e0f76f138a
diff --git a/lib/Models/ArcGisMapServerCatalogItem.js b/lib/Models/ArcGisMapServerCatalogItem.js index <HASH>..<HASH> 100644 --- a/lib/Models/ArcGisMapServerCatalogItem.js +++ b/lib/Models/ArcGisMapServerCatalogItem.js @@ -198,9 +198,14 @@ ArcGisMapServerCatalogItem.prototype.updateFromMetadata = function(mapServerJson if (!defined(thisLayerJson[i])) { console.log('A layer with the name or ID \"' + layers[i] + '\" does not exist on the ArcGIS MapServer - ignoring it.'); thisLayerJson.splice(i, 1); + layers.splice(i, 1); --i; } } + + if (layers.length === 0) { + return; + } } this._mapServerData = mapServerJson;
Don't crash when no layers match.
TerriaJS_terriajs
train
js
9fd5a8b5e98827431add4a4c997286f10092cb9c
diff --git a/core/lib/refinery/application_controller.rb b/core/lib/refinery/application_controller.rb index <HASH>..<HASH> 100644 --- a/core/lib/refinery/application_controller.rb +++ b/core/lib/refinery/application_controller.rb @@ -11,7 +11,7 @@ module Refinery :current_refinery_user, :authorisation_manager, :authorization_manager - base.protect_from_forgery # See ActionController::RequestForgeryProtection + base.protect_from_forgery with: :exception # See ActionController::RequestForgeryProtection base.send :include, Refinery::Crud # basic create, read, update and delete methods
Add protect_from_forgery with: :exception
refinery_refinerycms
train
rb
ea382ef8d652a487be71ea0f710c94e96f18fce6
diff --git a/OMMBV/__init__.py b/OMMBV/__init__.py index <HASH>..<HASH> 100644 --- a/OMMBV/__init__.py +++ b/OMMBV/__init__.py @@ -5,9 +5,11 @@ __version__ = '0.5.5' on_rtd = os.environ.get('ONREADTHEDOCS') == 'True' -if not on_rtd: +try: from OMMBV import igrf -else: +except ImportError: + print("ERROR: igrf module could not be imported. " + + "OMMBV probably won't work") igrf = None from OMMBV import satellite
BUG: Improve robustness without compiled fortran
rstoneback_pysatMagVect
train
py
07bd9b068ffea41e5ed447f8a62e64c2b2038bae
diff --git a/benchexec/tools/p4-test-tool.py b/benchexec/tools/p4-test-tool.py index <HASH>..<HASH> 100644 --- a/benchexec/tools/p4-test-tool.py +++ b/benchexec/tools/p4-test-tool.py @@ -20,8 +20,13 @@ class Tool(benchexec.tools.template.BaseTool2): return "P4 Test" def determine_result(self, run): + run_succreded = False + #Traverse through the output and check for and Ok for line in run.output: - if run.cmdline[3] + " ... ok" in line: - return benchexec.result.RESULT_CLASS_TRUE - else: - return benchexec.result.RESULT_CLASS_FALSE + if "OK" in line: + run_succreded = True + + if run_succreded: + return benchexec.result.RESULT_CLASS_TRUE + else: + return benchexec.result.RESULT_CLASS_FALSE
Fixed tool to work on more test cases
sosy-lab_benchexec
train
py
67b54d6c0bf260877ac808d18ae4caf7a8a5af8a
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/searchExplorer.js b/bundles/org.eclipse.orion.client.core/web/orion/searchExplorer.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/searchExplorer.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/searchExplorer.js @@ -492,7 +492,7 @@ define(['i18n!orion/search/nls/messages', 'require', 'dojo', 'dijit','orion/expl qParams.location = item.parentLocation; qParams.start = 0; var href = mSearchUtils.generateSearchHref(qParams); - var link = dojo.create("a", {className: "navlink", href: href}, spanHolder, "last"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + var link = dojo.create("a", {className: "navlinkonpage", href: href}, spanHolder, "last"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ link.title = dojo.string.substitute(messages["Search again in this folder with \"${0}\""], [this.explorer.model.queryObj.searchStrTitle]); mNavUtils.addNavGrid(this.explorer.getNavDict(), item, link); var that = this;
Bug <I> - use dashed underline for 'search in' links on search results page
eclipse_orion.client
train
js
8546b390b06f445df13363e8239ae2036ce765d3
diff --git a/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java b/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java +++ b/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java @@ -145,8 +145,8 @@ public class Validator implements Service { } } - // Validate all pseudo-scoped beans, except for session beans which are proxied by the EJB container - if (!normalScoped && !(bean instanceof SessionBean)) { + // Validate all pseudo-scoped beans, except for built-in beans and session beans which are proxied by the EJB container + if (!normalScoped && !(bean instanceof AbstractBuiltInBean) && !(bean instanceof SessionBean)) { validatePseudoScopedBean(bean, beanManager); } @@ -934,9 +934,6 @@ public class Validator implements Service { dependencyPath.remove(bean); } - /** - * finds pseudo beans and adds them to the list of beans to be validated - */ private static void validatePseudoScopedInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager, Set<Object> dependencyPath, Set<Bean<?>> validatedBeans) { Set<Bean<?>> resolved = beanManager.getBeans(ij); Bean<?> bean = beanManager.resolve(resolved);
Don't detect circularities in built-in beans
weld_core
train
java
5a0af104f4b67f4c15b16ec766717da0f42b1669
diff --git a/lib/system/windows/index.js b/lib/system/windows/index.js index <HASH>..<HASH> 100644 --- a/lib/system/windows/index.js +++ b/lib/system/windows/index.js @@ -24,8 +24,9 @@ var clean_string = function(str){ exports.process_running = function(process_name, callback){ var cmd = 'tasklist /fi "imagename eq ' + process_name + '"'; - exec(cmd, function(err, stdout){ - callback(stdout && stdout.toString().indexOf(process_name) !== -1); + exec(cmd, function(err, stdout) { + var bool = stdout && stdout.toString().indexOf(process_name) !== -1; + callback(!!bool); }); };
Make sure process_running in Windows returns a bool.
prey_prey-node-client
train
js
004301e29ba6c94228ebda2a162d609b8d40c9e0
diff --git a/src/edeposit/amqp/ftp/decoders/fields.py b/src/edeposit/amqp/ftp/decoders/fields.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/ftp/decoders/fields.py +++ b/src/edeposit/amqp/ftp/decoders/fields.py @@ -8,7 +8,18 @@ #= Variables ================================================================== - +REQUIRED_FIELDS = [ + "ISBN", + "Vazba/forma", + "Název", + "Url (pouze pro online publikace)", + "Formát (pouze pro online publikace)", + "Místo vydání", + "Nakladatel", + "Měsíc a rok vydání", + "Pořadí vydání", + "Zpracovatel záznamu" # TODO: look only for the first word +] #= Functions & objects ========================================================
Added REQUIRED_FIELDS as mentioned in #7.
edeposit_edeposit.amqp.ftp
train
py
f2b646a3af8381a72ffcff98b642517e25f383b5
diff --git a/pip_module_scanner/scanner.py b/pip_module_scanner/scanner.py index <HASH>..<HASH> 100644 --- a/pip_module_scanner/scanner.py +++ b/pip_module_scanner/scanner.py @@ -20,7 +20,7 @@ class Scanner: def __init__(self, path=os.getcwd(), output=None): # Compiled import regular expression - self.import_statement = re.compile(r'(?:from|import) ([a-zA-Z0-9]+)(?:.*)') + self.import_statement = re.compile(r'(?:from|import) ([a-zA-Z0-9_]+)(?:.*)') # List of pip distributions # Called once and then imported for performance
Issue #3. Find packages with underscore in the name
Paradoxis_PIP-Module-Scanner
train
py
b5bc5ce221e3a0d33495da416a9f0629855f2e5c
diff --git a/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java b/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java index <HASH>..<HASH> 100644 --- a/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java +++ b/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java @@ -41,7 +41,7 @@ import java.util.Arrays; public class NotYetImplementedASTTransformation extends AbstractASTTransformation { private static final ClassNode CATCHED_THROWABLE_TYPE = ClassHelper.make(Throwable.class); - private static final ClassNode ASSERTION_FAILED_ERROR_TYPE = ClassHelper.make(AssertionFailedError.class); + private static final ClassNode ASSERTION_FAILED_ERROR_TYPE = ClassHelper.make("junit.framework.AssertionFailedError"); public void visit(ASTNode[] nodes, SourceUnit source) { if (nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
removed static class reference from builtin AST transform implementation class to third-party class junit.framework.AssertionFailedError - this solves a class loading error for compiler environments (like Gradle) which separate class loading of the compiler from that of the compile class path
apache_groovy
train
java
ec46bc6c47e4e81bf5cce5a9bc8ca90dadbde692
diff --git a/src/syncers/collection.js b/src/syncers/collection.js index <HASH>..<HASH> 100644 --- a/src/syncers/collection.js +++ b/src/syncers/collection.js @@ -124,6 +124,8 @@ export default class CollectionSyncer extends BaseSyncer { return items } + this.state = this._initialState() + items.forEach(item => { this._set(item[this._id], item) })
clear this.state before _loadState() in collection.js (#<I>) * clear this.state before _loadState() in collection.js
t2t2_vue-syncers-feathers
train
js
5f989fc170154174fd2b717c6da5bb81fde354f9
diff --git a/spec/constraint_spec.rb b/spec/constraint_spec.rb index <HASH>..<HASH> 100644 --- a/spec/constraint_spec.rb +++ b/spec/constraint_spec.rb @@ -19,22 +19,36 @@ describe PGExaminer do c = examine <<-SQL CREATE TABLE test_table ( + a integer CONSTRAINT con CHECK (a > 0) + ); + SQL + + d = examine <<-SQL + CREATE TABLE test_table ( a integer ); ALTER TABLE test_table ADD CONSTRAINT con_two CHECK (a > 0); SQL - d = examine <<-SQL + e = examine <<-SQL + CREATE TABLE test_table ( + a integer CHECK (a > 0) + ); + SQL + + f = examine <<-SQL CREATE TABLE test_table ( a integer ); SQL a.should == b - a.should_not == c - b.should_not == c + a.should == c + b.should == c a.should_not == d - b.should_not == d + a.should_not == e + a.should_not == f + e.should_not == f end end
Flesh out constraint differentiation a bit.
chanks_pg_examiner
train
rb
e3ef9368df1f5e1097772833c37722e715f92b42
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php @@ -17,10 +17,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Exception\LogicException; /** - * If there are any tagged loaders replace - * default filesystem loader with chain loader - * - * Add tagged loaders to chain loader + * Adds services tagged twig.loader as Twig loaders * * @author Daniel Leech <daniel@dantleech.com> */ @@ -45,9 +42,8 @@ class TwigLoaderPass implements CompilerPassInterface $chainLoader = $container->getDefinition('twig.loader.chain'); foreach (array_keys($loaderIds) as $id) { $chainLoader->addMethodCall('addLoader', array(new Reference($id))); - }; + } $container->setAlias('twig.loader', 'twig.loader.chain'); } } } -
[FrameworkBundle] tweaked previous merge
symfony_symfony
train
php
271b9f57681686093183f4924300c1622964fc56
diff --git a/ghost/admin/mixins/pagination-view-infinite-scroll.js b/ghost/admin/mixins/pagination-view-infinite-scroll.js index <HASH>..<HASH> 100644 --- a/ghost/admin/mixins/pagination-view-infinite-scroll.js +++ b/ghost/admin/mixins/pagination-view-infinite-scroll.js @@ -22,9 +22,14 @@ var PaginationViewInfiniteScrollMixin = Ember.Mixin.create({ * Bind to the scroll event once the element is in the DOM */ attachCheckScroll: function () { - var el = this.$(); + var el = this.$(), + controller = this.get('controller'); el.on('scroll', Ember.run.bind(this, this.checkScroll)); + + if (this.element.scrollHeight <= this.element.clientHeight) { + controller.send('loadNextPage'); + } }.on('didInsertElement'), /**
Load next page if scrollHeight <= clientHeight closes #<I> - call loadNextPage in attachCheckScroll, if element scrollHeight <= clientHeight
TryGhost_Ghost
train
js
3e90104ac4880255887de2182e7242c0883116a6
diff --git a/scripts/bundle.config.js b/scripts/bundle.config.js index <HASH>..<HASH> 100644 --- a/scripts/bundle.config.js +++ b/scripts/bundle.config.js @@ -70,9 +70,10 @@ const config = { loader: 'babel-loader', include: /src/, options: { - presets: [ - ['@babel/preset-env', {forceAllTransforms: true}] - ] + presets: [['@babel/preset-env', {forceAllTransforms: true}]], + // all of the helpers will reference the module @babel/runtime to avoid duplication + // across the compiled output. + plugins: ['@babel/transform-runtime'] } } ] @@ -88,8 +89,14 @@ const config = { new webpack.DefinePlugin({ __VERSION__: JSON.stringify(PACKAGE_INFO.version) }) + // Uncomment for bundle size debug + // ,new (require('webpack-bundle-analyzer').BundleAnalyzerPlugin)() ], + node: { + Buffer: false + }, + devtool: false };
Optimize bundle size (#<I>)
uber_deck.gl
train
js
c8432ecf2ffa749061f25bcabaafc747bc2ad012
diff --git a/mapclassify/classifiers.py b/mapclassify/classifiers.py index <HASH>..<HASH> 100644 --- a/mapclassify/classifiers.py +++ b/mapclassify/classifiers.py @@ -1825,12 +1825,8 @@ class FisherJenksSampled(MapClassifier): counts : array (k,1), the number of observations falling in each class - Examples - -------- - - (Turned off due to timing being different across hardware) - - + Notes + ----- For theoretical details see :cite:`Rey_2016`. """
[MAINT] remove Example& hardware comment in FisherJenksSampled
pysal_mapclassify
train
py
0f5d5a34eee84057b1fc26e01177c1eba1f04295
diff --git a/src/predef.js b/src/predef.js index <HASH>..<HASH> 100644 --- a/src/predef.js +++ b/src/predef.js @@ -98,7 +98,7 @@ module.exports = { code: [ 'function $has(obj, key) {', ' if (obj === null || obj === undefined) {', - ' return false;', + ' throw new Error(obj + " cannot have keys");', ' }', ' if (typeof key === "string" ||', ' typeof key === "number" && key % 1 === 0) {',
Make $has throw an error on null and undefined
squiggle-lang_squiggle-lang
train
js
f836eb47010bdf7d068276752442a76271ebf0c5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -67,7 +67,7 @@ WPOAuth.prototype.urlToConnect = function(resource, params){ * @api public */ -WPOAuth.prototype.setCode = function(code){ +WPOAuth.prototype.code = function(code){ this._code = code; debug('code: `%s`', this._code); };
core: rename setCode() by code()
Automattic_node-wpcom-oauth
train
js
b79d95b51efdf1796a5ffa769562043e386e8d71
diff --git a/URL.php b/URL.php index <HASH>..<HASH> 100644 --- a/URL.php +++ b/URL.php @@ -171,7 +171,7 @@ class URL implements iURL // Попытаемся получить переменную с указанным именем в текущем модуле // Если переменная модуля не существует тогда используем строковое представление аргумента // добавим "разпознанное" значение аргумента в коллекцию параметров URL - $url_params[] = isset( $m[$arg] ) ? $m->$arg : $arg; + $url_params[] = isset( $m[$arg] ) && !is_object($m[$arg])? $m->$arg : $arg; } // Вернем полный URL-путь относительно текущего хоста и веб-приложения
Fixed URL:build() method, added check for object to string convertion
samsonos_php_core
train
php
68e8db16501a4fe0b5c5d7e743efc142d9c34f9f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,11 @@ var cached = require('gulp-cached'); var remember = require('gulp-remember'); var streamqueue = require('streamqueue'); +function handleError(e) { + console.log(e.toString()); + this.emit('end'); +} + module.exports = function(options) { options = options || {}; @@ -31,12 +36,14 @@ module.exports = function(options) { moduleRoot: options.modulePrefix, externalHelpers: options.externalHelpers })) + .on('error', handleError) .pipe(remember('scripts'))); stream.queue(gulp.src(options.bootstrapFiles) .pipe(babel({ externalHelpers: options.externalHelpers - }))); + })) + .on('error', handleError)); stream.done() .pipe(concat(path.basename(options.outputFile)))
Gracefully handle errors during gulp watch
flarum_flarum-gulp
train
js
553128c09391f31744cd0336d899254c6ea584f0
diff --git a/lib/rabl/builder.rb b/lib/rabl/builder.rb index <HASH>..<HASH> 100644 --- a/lib/rabl/builder.rb +++ b/lib/rabl/builder.rb @@ -5,6 +5,7 @@ module Rabl # Constructs a new ejs hash based on given object and options def initialize(data, options={}, &block) @options = options + @_scope = options[:scope] @_data = data @_object = data_object(data) @_result = {} diff --git a/lib/rabl/engine.rb b/lib/rabl/engine.rb index <HASH>..<HASH> 100644 --- a/lib/rabl/engine.rb +++ b/lib/rabl/engine.rb @@ -14,6 +14,7 @@ module Rabl def render(scope, locals, &block) @_locals, @_scope = locals, scope self.copy_instance_variables_from(@_scope, [:@assigns, :@helpers]) + @_options[:scope] = @_scope @_data = locals[:object] || self.default_object instance_eval(@_source) if @_source.present? instance_eval(&block) if block_given?
Adds scope ivar to builder
nesquena_rabl
train
rb,rb
0f8b3bedbc8e22952e81ba757c6f69ebc59fb31f
diff --git a/src/howler.core.js b/src/howler.core.js index <HASH>..<HASH> 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -782,6 +782,9 @@ self._emit('play', sound._id); } + // Setting rate before playing won't work in IE, so we set it again here. + node.playbackRate = sound._rate; + // If the node is still paused, then we can assume there was a playback issue. if (node.paused) { self._emit('playerror', sound._id, 'Playback was unable to start. This is most commonly an issue ' +
Fix rate not working in IE Fixes #<I>
goldfire_howler.js
train
js
01abde067029fd4f6e36c4cde8556031ccc3ecb9
diff --git a/validator/testcases/javascript/traverser.py b/validator/testcases/javascript/traverser.py index <HASH>..<HASH> 100644 --- a/validator/testcases/javascript/traverser.py +++ b/validator/testcases/javascript/traverser.py @@ -160,10 +160,7 @@ class Traverser: "http://blog.mozilla.com/addons/2009/01/16/" "firefox-extensions-global-namespace-pollution/" ", or use JavaScript modules.", - filename=self.filename, - line=self.line, - column=self.position, - context=self.context) + filename=self.filename) def _can_handle_node(self, node_name): "Determines whether a node can be handled."
JS Pollution should not have line/column/context data.
mozilla_amo-validator
train
py
36d8df018f4da85f111b12acdf26e2e5a9e5249f
diff --git a/IPython/html/static/notebook/js/widget.js b/IPython/html/static/notebook/js/widget.js index <HASH>..<HASH> 100644 --- a/IPython/html/static/notebook/js/widget.js +++ b/IPython/html/static/notebook/js/widget.js @@ -64,7 +64,7 @@ define(["components/underscore/underscore-min", } }, - send = function (content) { + send: function(content) { // Used the last modified view as the sender of the message. This // will insure that any python code triggered by the sent message
Fixed typo in widget model code causing notebook to not load
jupyter-widgets_ipywidgets
train
js
85d40a08531cc67e62ac42be10114f6d78cf4cce
diff --git a/src/Import/XmlParser/ProductJsonToXml.php b/src/Import/XmlParser/ProductJsonToXml.php index <HASH>..<HASH> 100644 --- a/src/Import/XmlParser/ProductJsonToXml.php +++ b/src/Import/XmlParser/ProductJsonToXml.php @@ -1,6 +1,6 @@ <?php -declare(strict_types=1); +declare(strict_types = 1); namespace LizardsAndPumpkins\Import\XmlParser; @@ -21,7 +21,7 @@ class ProductJsonToXml */ private $context = []; - public function toXml(string $product) : string + public function toXml(string $product): string { $product = json_decode($product, true); @@ -97,7 +97,7 @@ class ProductJsonToXml } /** - * @param array $product + * @param array[] $product */ private function writeAttributes(array $product) {
Issue #<I>: Refactor Catalog Import - Correct type hint
lizards-and-pumpkins_catalog
train
php
c2733e537a5231d3dfbd123c9ac0881e94f71c8f
diff --git a/bin/nopt.js b/bin/nopt.js index <HASH>..<HASH> 100755 --- a/bin/nopt.js +++ b/bin/nopt.js @@ -1,5 +1,6 @@ #!/usr/bin/env node var nopt = require("../lib/nopt") + , path = require("path") , types = { num: Number , bool: Boolean , help: Boolean @@ -11,6 +12,7 @@ var nopt = require("../lib/nopt") , clear: Boolean , config: Boolean , length: Number + , file: path } , shorthands = { s: [ "--str", "astring" ] , b: [ "--bool" ] @@ -22,6 +24,7 @@ var nopt = require("../lib/nopt") , n: [ "--num", "125" ] , c: ["--config"] , l: ["--length"] + , f: ["--file"] } , parsed = nopt( types , shorthands
Add a path arg to example script
npm_nopt
train
js
7bd15717b1b882b7572e8026f8e7e18124b05a05
diff --git a/web-bundle/src/main/js/custom-model-editor/src/custom_model_editor.js b/web-bundle/src/main/js/custom-model-editor/src/custom_model_editor.js index <HASH>..<HASH> 100644 --- a/web-bundle/src/main/js/custom-model-editor/src/custom_model_editor.js +++ b/web-bundle/src/main/js/custom-model-editor/src/custom_model_editor.js @@ -1,6 +1,7 @@ import CodeMirror from "codemirror"; import "codemirror/mode/yaml/yaml"; import "codemirror/mode/javascript/javascript"; +import "codemirror/addon/edit/matchbrackets"; import "codemirror/addon/hint/show-hint"; import "codemirror/addon/lint/lint"; import YAML from "yaml"; @@ -27,6 +28,7 @@ class CustomModelEditor { this.cm = CodeMirror(callback, { lineNumbers: true, + matchBrackets: true, mode: "yaml", extraKeys: { 'Ctrl-Space': this.showAutoCompleteSuggestions
Custom model editor: Enable matched bracket highlighting
graphhopper_graphhopper
train
js
678f276321a718e573707fefe7adda9d2e40e9dc
diff --git a/closure/goog/ui/abstractspellchecker.js b/closure/goog/ui/abstractspellchecker.js index <HASH>..<HASH> 100644 --- a/closure/goog/ui/abstractspellchecker.js +++ b/closure/goog/ui/abstractspellchecker.js @@ -318,19 +318,6 @@ goog.ui.AbstractSpellChecker.prototype.getSpellCheck = function() { return this.spellCheck; }; - -/** - * @return {goog.spell.SpellCheck} The handler used for caching and lookups. - * @override - * @suppress {checkTypes} This method makes no sense. It overrides - * Component's getHandler with something different. - * @deprecated Use #getSpellCheck instead. - */ -goog.ui.AbstractSpellChecker.prototype.getHandler = function() { - return this.getSpellCheck(); -}; - - /** * Sets the spell checker used for caching and lookups. * @param {goog.spell.SpellCheck} spellCheck The handler used for caching and
Remove method that doesn't typecheck. It already has suppress checkTypes, but it doesn't look used anyways. RELNOTES: Removing deprecated method, goog.ui.AbstractSpellChecker.prototype.getHandler ------------- Created by MOE: <URL>
google_closure-library
train
js
bcace1ba9fb6c04b0801b2786e554936069d0f13
diff --git a/src/maker.js b/src/maker.js index <HASH>..<HASH> 100644 --- a/src/maker.js +++ b/src/maker.js @@ -1,4 +1,5 @@ const Solver = require( "./solver.js" ); +const Publisher = require( "./publisher.js" ); function Maker(){ } @@ -8,15 +9,20 @@ Start the application reading the tsmake.json to create the tsconfig.json files @param file {string} File within the configuration of project */ Maker.prototype.make = function ( file ) { - // Use this object to creare one tsconfig file foreach hotpoint declared in tsmake + // Use this object to creare one tsconfig file foreach hotpoint declared + // in tsmake var makeopt = JSON.parse( file ); - // Passing configuration that the Solver and the Builder use it to creata the tsconfig files - var solver = new Solver( makeopt ); + + var solver = new Solver( makeopt ); + var publisher = new Publisher( makeopt ); // Catch all hotpoint in tsmake Object.keys( makeopt.hotpoint ).forEach( function ( key ) { - // Create a uncomplete tsconfig object - console.log( solver.solve( key ) ); + // Create a uncomplete tsconfig object without information rleative + // to directory configuration project but only at the topic + var tsconfig = solver.solve( key ); + // Publish the tsconfig.json with the left information + publisher.publish( tsconfig, makeopt.hotpoint[key] ); }); };
Keep <I> column, add comments and reference to publisher
BugBusterSWE_burstmake
train
js
0c3bd47bc4c69aa9694c10968ccb14648b20b2e1
diff --git a/src/rabird/core/distutils/command/install.py b/src/rabird/core/distutils/command/install.py index <HASH>..<HASH> 100644 --- a/src/rabird/core/distutils/command/install.py +++ b/src/rabird/core/distutils/command/install.py @@ -149,7 +149,7 @@ class GithubUwbpepPackages(object): raise KeyError("Can't find the requirement : %s" % requirement_text) class PypiUwbpepPackages(object): - page_url = "https://pypi.python.org/pypi/uwbpep/0.1.0" + page_url = "https://pypi.python.org/pypi/uwbpep/1.0" def __init__(self): pass
Version of Uwbpep on pypi should be <I> now
starofrainnight_rabird.core
train
py
a40e658d654e81d152aee40e217b79e2c86836fa
diff --git a/src/components/level/level.js b/src/components/level/level.js index <HASH>..<HASH> 100644 --- a/src/components/level/level.js +++ b/src/components/level/level.js @@ -7,6 +7,11 @@ export default class Level extends Component { style: PropTypes.object, children: PropTypes.any, className: PropTypes.string, + responsive: PropTypes.oneOf([ + 'isMobile', + 'isDesktop', + 'isTablet', + ]), }; static defaultProps = { @@ -17,6 +22,7 @@ export default class Level extends Component { createClassName() { return [ styles.level, + styles[this.props.responsive], this.props.className, ].join(' ').trim(); }
Added option to set responsive attribute on Level (#<I>)
bokuweb_re-bulma
train
js
a440db7d387e29156ea9e4142792827226e060be
diff --git a/azurerm/internal/services/web/resource_arm_function_app.go b/azurerm/internal/services/web/resource_arm_function_app.go index <HASH>..<HASH> 100644 --- a/azurerm/internal/services/web/resource_arm_function_app.go +++ b/azurerm/internal/services/web/resource_arm_function_app.go @@ -852,11 +852,14 @@ func expandFunctionAppConnectionStrings(d *schema.ResourceData) map[string]*web. } func expandFunctionAppIpRestriction(input interface{}) ([]web.IPSecurityRestriction, error) { - ipSecurityRestrictions := input.([]interface{}) restrictions := make([]web.IPSecurityRestriction, 0) - for i, ipSecurityRestriction := range ipSecurityRestrictions { - restriction := ipSecurityRestriction.(map[string]interface{}) + for i, r := range input.([]interface{}) { + if r == nil { + continue + } + + restriction := r.(map[string]interface{}) ipAddress := restriction["ip_address"].(string) vNetSubnetID := restriction["subnet_id"].(string)
azurerm_function_app - prevent a panic from an empty IPSecurity… (#<I>)
terraform-providers_terraform-provider-azurerm
train
go
92a17086e0f8f46c7f01a3427fb6457d9520e1d2
diff --git a/src/datab-data.js b/src/datab-data.js index <HASH>..<HASH> 100644 --- a/src/datab-data.js +++ b/src/datab-data.js @@ -13,10 +13,14 @@ * drop_col - drop a column * drop_row - drop a row * - * append_to - append as an html table to a d3 selection * to_json - create a json string of the data * to_csv - output a csv * to_obj - output as an array of (dict-like) objects + * + * from_input - create data object from a file input selection + * ( csv files only ) + * from_obj - create data object from an array of dict-like + * row objects * */
Added datab.data.from_input to handle file selection input
jakekara_datab.js
train
js
85d24eba1939894b07254897ed629dcf535df036
diff --git a/satpy/tests/compositor_tests/__init__.py b/satpy/tests/compositor_tests/__init__.py index <HASH>..<HASH> 100644 --- a/satpy/tests/compositor_tests/__init__.py +++ b/satpy/tests/compositor_tests/__init__.py @@ -654,6 +654,13 @@ class TestGenericCompositor(unittest.TestCase): check_areas.assert_called_once() mask_datasets.assert_not_called() check_areas.reset_mock() + # Dataset for alpha given, so shouldn't be masked + projectables = [self.all_valid, self.all_valid] + check_areas.return_value = projectables + res = self.comp(projectables) + check_areas.assert_called_once() + mask_datasets.assert_not_called() + check_areas.reset_mock() # When areas are incompatible, masking shouldn't happen check_areas.side_effect = IncompatibleAreas() self.assertRaises(IncompatibleAreas,
Test that a given alpha channel disables common channel masking
pytroll_satpy
train
py
5c6d625077f1f119c9e611ac677d7a0e15addb8e
diff --git a/lib/model_base/version.rb b/lib/model_base/version.rb index <HASH>..<HASH> 100644 --- a/lib/model_base/version.rb +++ b/lib/model_base/version.rb @@ -1,3 +1,3 @@ module ModelBase - VERSION = "0.3.8" + VERSION = "0.3.9" end
Bump up the version from <I> to <I>
akm_model_base_generators
train
rb