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 |
|---|---|---|---|---|---|
f8156e56ebff165df2217ff5ea8ca1ddc43d482d | diff --git a/mod/forum/lib.php b/mod/forum/lib.php
index <HASH>..<HASH> 100644
--- a/mod/forum/lib.php
+++ b/mod/forum/lib.php
@@ -3272,7 +3272,7 @@ function forum_tp_clean_read_records() {
'WHERE fp.modified < '.$cutoffdate.' AND fp.id = fr.postid';
if (($oldreadposts = get_records_sql($sql))) {
foreach($oldreadposts as $oldreadpost) {
- delete_records('forum_read', 'userid', $oldreadpost->userid, 'postid', $oldreadpost->postid);
+ delete_records('forum_read', 'id', $oldreadpost->id);
}
} | Delete forum_read records more efficiently | moodle_moodle | train | php |
a2af00edf17e641dfd1a3449e819c83db91ccba3 | diff --git a/mod/wiki/view.php b/mod/wiki/view.php
index <HASH>..<HASH> 100644
--- a/mod/wiki/view.php
+++ b/mod/wiki/view.php
@@ -7,7 +7,7 @@
require_once("../../config.php");
require_once("lib.php");
#require_once("$CFG->dirroot/course/lib.php"); // For side-blocks
- require_once(dirname(__FILE__).'/../../lib/ajax/ajaxlib.php');
+ require_once($CFG->libdir . '/ajax/ajaxlib.php');
$ewiki_action = optional_param('ewiki_action', '', PARAM_ALPHA); // Action on Wiki-Page
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
@@ -444,7 +444,7 @@
}
} else {
// OK, the page is now locked to us. Put in the AJAX for keeping the lock
- print_require_js(array('yui_yahoo','yui_connection'));
+ require_js(array('yui_yahoo','yui_connection'));
$strlockcancelled=get_string('lockcancelled','wiki');
$strnojslockwarning=get_string('nojslockwarning','wiki');
$intervalms=WIKI_LOCK_RECONFIRM*1000; | Merged fix for MDL-<I> from stable | moodle_moodle | train | php |
8a78ee0fabe8704e1f8a443232ff7a01f1430630 | diff --git a/master/buildbot/config.py b/master/buildbot/config.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/config.py
+++ b/master/buildbot/config.py
@@ -700,7 +700,7 @@ class ReconfigurableServiceMixin:
if isinstance(svc, ReconfigurableServiceMixin) ]
# sort by priority
- reconfigurable_services.sort(key=lambda svc : svc.reconfig_priority)
+ reconfigurable_services.sort(key=lambda svc : -svc.reconfig_priority)
for svc in reconfigurable_services:
d = svc.reconfigService(new_config)
diff --git a/master/buildbot/test/unit/test_config.py b/master/buildbot/test/unit/test_config.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_config.py
+++ b/master/buildbot/test/unit/test_config.py
@@ -1074,7 +1074,6 @@ class ReconfigurableServiceMixin(unittest.TestCase):
@d.addCallback
def check(_):
prio_order = [ svc.called for svc in services ]
- prio_order.reverse()
called_order = sorted(prio_order)
self.assertEqual(prio_order, called_order)
return d | fix reconfig priorities
The reconfig code was sorting services in the reverse of the direction
the docs -- and all users of the priority -- indicated. | buildbot_buildbot | train | py,py |
409daceb735ea5bdc468835ee18493153d487bd4 | diff --git a/version/version.go b/version/version.go
index <HASH>..<HASH> 100644
--- a/version/version.go
+++ b/version/version.go
@@ -15,6 +15,6 @@
package version
var (
- Version = "2.0.1"
+ Version = "2.0.2"
InternalVersion = "2"
) | *: bump to <I> | etcd-io_etcd | train | go |
ff0ebba379918bf21d4b64c3527cf7e2cf9c89dd | diff --git a/byte-buddy-agent/src/test/java/net/bytebuddy/utility/OpenJDKRule.java b/byte-buddy-agent/src/test/java/net/bytebuddy/utility/OpenJDKRule.java
index <HASH>..<HASH> 100644
--- a/byte-buddy-agent/src/test/java/net/bytebuddy/utility/OpenJDKRule.java
+++ b/byte-buddy-agent/src/test/java/net/bytebuddy/utility/OpenJDKRule.java
@@ -25,7 +25,7 @@ public class OpenJDKRule implements MethodRule {
public OpenJDKRule() {
System.out.println(System.getProperty(JAVA_VM_NAME_PROPERTY));
- System.out.println(new File(System.getProperty(JAVA_HOME_PROPERTY).replace('\\', '/') + TOOLS_JAR_LOCATION).isFile());
+ System.out.println(new File(System.getProperty(JAVA_HOME_PROPERTY).replace('\\', '/') + TOOLS_JAR_LOCATION).canRead());
openJDK = System.getProperty(JAVA_VM_NAME_PROPERTY).contains(HOT_SPOT)
&& new File(System.getProperty(JAVA_HOME_PROPERTY).replace('\\', '/') + TOOLS_JAR_LOCATION).isFile();
} | Refined OpenJDK specific test. | raphw_byte-buddy | train | java |
f1be8ff92206674536e47fab974b5bbb5079f74c | diff --git a/lib/puppet/pops/loader/module_loaders.rb b/lib/puppet/pops/loader/module_loaders.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/pops/loader/module_loaders.rb
+++ b/lib/puppet/pops/loader/module_loaders.rb
@@ -176,7 +176,7 @@ module Puppet::Pops::Loader::ModuleLoaders
#
def private_loader
# The system loader has a nil module_name and it does not have a private_loader as there are no functions
- # that can only by called by puppet runtime - if so, it acts as the privuate loader directly.
+ # that can only by called by puppet runtime - if so, it acts as the private loader directly.
@private_loader ||= ((module_name.nil? && self) || @loaders.private_loader_for_module(module_name))
end
end | (MAINT) Fix typo in comment | puppetlabs_puppet | train | rb |
0a5529898136f6893bdab3e48dd901d58384b298 | diff --git a/lib/authn.rb b/lib/authn.rb
index <HASH>..<HASH> 100644
--- a/lib/authn.rb
+++ b/lib/authn.rb
@@ -1,5 +1,5 @@
-require 'ostruct'
require 'active_model'
+require 'astruct'
require_relative 'authn/version'
require_relative 'authn/config'
require_relative 'authn/model' | Switching from astruct to ostrich | krainboltgreene_authn | train | rb |
5f2485fb5ba1b35ec0326391054bf92d6868db90 | diff --git a/src/experimentalcode/erich/approxknn/RandomSampleKNNExperiment.java b/src/experimentalcode/erich/approxknn/RandomSampleKNNExperiment.java
index <HASH>..<HASH> 100644
--- a/src/experimentalcode/erich/approxknn/RandomSampleKNNExperiment.java
+++ b/src/experimentalcode/erich/approxknn/RandomSampleKNNExperiment.java
@@ -26,7 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
-import de.lmu.ifi.dbs.elki.algorithm.outlier.KNNOutlier;
+import de.lmu.ifi.dbs.elki.algorithm.outlier.distance.KNNOutlier;
import de.lmu.ifi.dbs.elki.algorithm.outlier.lof.LOF;
import de.lmu.ifi.dbs.elki.data.NumberVector;
import de.lmu.ifi.dbs.elki.data.type.TypeUtil; | Reorganize outlier detection algorithms into a deeper package hierarchy. | elki-project_elki | train | java |
d3d0220db63dd71094a5fd6ebbf96c2344df239d | diff --git a/src/Console/Commands/Update.php b/src/Console/Commands/Update.php
index <HASH>..<HASH> 100644
--- a/src/Console/Commands/Update.php
+++ b/src/Console/Commands/Update.php
@@ -41,9 +41,18 @@ class Update extends Command
$packageName = $this->argument('name');
if (!$this->templateStorageEngine->packageExists($packageName)) {
- $this->comment("The package {$packageName} is not currently installed.");
-
- return;
+ if (!$this->confirm("The package {$packageName} is not currently installed. Would you like to install it instead? [yes|no]",
+ false)
+ ) {
+ $this->comment("The package {$packageName} is not currently installed, and will not be installed right now.");
+
+ return;
+ } else {
+ $this->comment("Okay, we will install the {$packageName} package template. Give us a moment to get things ready...");
+ $this->call('template:install', ['name' => $packageName]);
+
+ return;
+ }
} | Update offers to install if the template isn't installed | newup_core | train | php |
ab32bfe1da7a11786f92c12f3ca71873f8cabfaf | diff --git a/lib/jets/internal/app/jobs/jets/preheat_job.rb b/lib/jets/internal/app/jobs/jets/preheat_job.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/internal/app/jobs/jets/preheat_job.rb
+++ b/lib/jets/internal/app/jobs/jets/preheat_job.rb
@@ -24,7 +24,7 @@ class Jets::PreheatJob < ApplicationJob
end
end
threads.each { |t| t.join }
- "Finished prewarming your application with a concurrency of #{concurrency}."
+ "Finished prewarming your application with a concurrency of #{CONCURRENCY}."
end
warming ? rate(PREWARM_RATE) : disable(true) | fix preheat job, use constants for scope | tongueroo_jets | train | rb |
754dee4338c8c353c0a3251b8e42fe193de42331 | diff --git a/examples/src/test/java/org/mapfish/print/ExamplesTest.java b/examples/src/test/java/org/mapfish/print/ExamplesTest.java
index <HASH>..<HASH> 100644
--- a/examples/src/test/java/org/mapfish/print/ExamplesTest.java
+++ b/examples/src/test/java/org/mapfish/print/ExamplesTest.java
@@ -199,9 +199,9 @@ public class ExamplesTest {
BufferedImage image = ImageIO.read(new ByteArrayInputStream(out.toByteArray()));
- File outDir = new File("/tmp/examples_text", example.getName()+"/expected_output");
- outDir.mkdirs();
- ImageIO.write(image, "png", new File(outDir, requestFile.getName().replace(".json", ".png")));
+// File outDir = new File("/tmp/examples_text", example.getName()+"/expected_output");
+// outDir.mkdirs();
+// ImageIO.write(image, "png", new File(outDir, requestFile.getName().replace(".json", ".png")));
File expectedOutputDir = new File(example, "expected_output");
File expectedOutput = new File(expectedOutputDir, requestFile.getName().replace(".json", ".png")); | don't write debug files. | mapfish_mapfish-print | train | java |
a9d5094e59b6f0957bb8714653213592b40feedc | diff --git a/packages/icon/src/react/index.js b/packages/icon/src/react/index.js
index <HASH>..<HASH> 100644
--- a/packages/icon/src/react/index.js
+++ b/packages/icon/src/react/index.js
@@ -62,14 +62,14 @@ const rmNonHtmlProps = props => {
const Icon = props => {
return (
<IconContainer {...rmNonHtmlProps(props)}>
- {icons[props.id](React)}
+ {props.children || icons[props.id](React)}
</IconContainer>
)
}
import PropTypes from 'prop-types'
Icon.propTypes = {
- id: PropTypes.oneOf(Object.keys(ids)).isRequired,
+ id: PropTypes.oneOf(Object.keys(ids)),
size: PropTypes.oneOf(Object.keys(sizes))
}
Icon.defaultProps = { | feat(icon): handle custom icon
pass as a child
Fixes #<I> | pluralsight_design-system | train | js |
489f6963c48f7f79477ffad8c5881be27009d8fa | diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -26,6 +26,7 @@ describe Chef::Application::Client, "reconfigure" do
before do
allow(Kernel).to receive(:trap).and_return(:ok)
+ allow(::File).to receive(:read).with("/etc/chef/client.rb").and_return("")
@original_argv = ARGV.dup
ARGV.clear
@@ -236,11 +237,13 @@ describe Chef::Application::Client, "setup_application" do
end
describe Chef::Application::Client, "configure_chef" do
+ let(:app) { Chef::Application::Client.new }
+
before do
@original_argv = ARGV.dup
ARGV.clear
- @app = Chef::Application::Client.new
- @app.configure_chef
+ expect(::File).to receive(:read).with("/etc/chef/client.rb").and_return("")
+ app.configure_chef
end
after do | Stub reading of /etc/chef/client.rb | chef_chef | train | rb |
6635cd7296708bb4bff38fc36286bd5e883c0e6e | diff --git a/tests/lexer/LexerCheck.test.php b/tests/lexer/LexerCheck.test.php
index <HASH>..<HASH> 100644
--- a/tests/lexer/LexerCheck.test.php
+++ b/tests/lexer/LexerCheck.test.php
@@ -31,7 +31,6 @@ function read_dir($dir, $ext = null)
}
$list = read_dir(__DIR__ . '/phpfastcache/', 'php');
-$list += read_dir(__DIR__ . '/phpfastcache/', 'tpl');
$exit = 0;
foreach ($list as $file) { | Moved Lexer test to a distinct directory | PHPSocialNetwork_phpfastcache | train | php |
589442b09b76004f6cfd9d012d457e23edbf2e77 | diff --git a/lib/devise/omniauth/config.rb b/lib/devise/omniauth/config.rb
index <HASH>..<HASH> 100644
--- a/lib/devise/omniauth/config.rb
+++ b/lib/devise/omniauth/config.rb
@@ -4,7 +4,7 @@ module Devise
def initialize(strategy)
@strategy = strategy
super("Could not find a strategy with name `#{strategy}'. " \
- "Please ensure it is required or explicitly set it using the :klass option.")
+ "Please ensure it is required or explicitly set it using the :strategy_class option.")
end
end | Update lib/devise/omniauth/config.rb | plataformatec_devise | train | rb |
6a10c27362a1853409660b7905800c8ba4ee5da4 | diff --git a/spyder/widgets/dependencies.py b/spyder/widgets/dependencies.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/dependencies.py
+++ b/spyder/widgets/dependencies.py
@@ -145,7 +145,9 @@ class DependenciesDialog(QDialog):
"them.<br><br>"
"<b>Note</b>: You can safely use Spyder "
"without the following modules installed: "
- "<b>%s</b> and <b>%s</b>")
+ "<b>%s</b> and <b>%s</b>. Also note that new "
+ "dependencies or changed ones will be correctly "
+ "detected only after Spyder is restarted.")
% (', '.join(opt_mods[:-1]), opt_mods[-1]))
self.label.setWordWrap(True)
self.label.setAlignment(Qt.AlignJustify) | change of the label in the dependencies dialog to specify the need for restart Spyder to update dependencies | spyder-ide_spyder | train | py |
3554163e90394a5e8ebc0bdf37445c30c91ec2e9 | diff --git a/Navigation/Item/NavigationItem.php b/Navigation/Item/NavigationItem.php
index <HASH>..<HASH> 100644
--- a/Navigation/Item/NavigationItem.php
+++ b/Navigation/Item/NavigationItem.php
@@ -129,7 +129,9 @@ final class NavigationItem extends AbstractNode implements NavigationInterface {
if (0 < $this->size()) {
$output["subitems"] = [];
foreach ($this->getNodes() as $current) {
- $output["subitems"][] = $current->toArray();
+ if ($current instanceof NavigationItem) {
+ $output["subitems"][] = $current->toArray();
+ }
}
} | Test if the class is an NavigationItem | webeweb_core-library | train | php |
318d372e1a1493ab9c224aed2c224469a3bf9991 | diff --git a/lib/rest-core/client.rb b/lib/rest-core/client.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-core/client.rb
+++ b/lib/rest-core/client.rb
@@ -180,7 +180,7 @@ module RestCore::Client
- protected
+ private
def string_keys hash
hash.inject({}){ |r, (k, v)|
if v.kind_of?(Hash) | client.rb: make those methods private instead of protected | godfat_rest-core | train | rb |
b426bb778ed608affc5cdc692a4a79bd00d57f07 | diff --git a/lib/gir_ffi/class_base.rb b/lib/gir_ffi/class_base.rb
index <HASH>..<HASH> 100644
--- a/lib/gir_ffi/class_base.rb
+++ b/lib/gir_ffi/class_base.rb
@@ -24,7 +24,7 @@ module GirFFI
send method_name, *arguments, &block
end
- # FIXME: JRuby should fix FFI::MemoryPointer#== to return true for
+ # NOTE: JRuby should fix FFI::MemoryPointer#== to return true for
# equivalent FFI::Pointer. For now, user to_ptr.address
def == other
other.class == self.class && to_ptr.address == other.to_ptr.address | Downgrade non-fixable FIXME to NOTE | mvz_gir_ffi | train | rb |
72b961b24b65eccb374afb4f3fa414a585c7cca8 | diff --git a/natasha/grammars/location/tests.py b/natasha/grammars/location/tests.py
index <HASH>..<HASH> 100644
--- a/natasha/grammars/location/tests.py
+++ b/natasha/grammars/location/tests.py
@@ -8,6 +8,7 @@ import unittest
from natasha.tests import BaseTestCase
from natasha.grammars.location import LocationObject, AddressObject
+from yargy.compat import RUNNING_ON_PYTHON_2_VERSION
from yargy.normalization import get_normalized_text
from yargy.interpretation import InterpretationEngine
@@ -1261,7 +1262,7 @@ def generate(test):
for index, test in enumerate(parse(ADDRESS_TESTS)):
function = generate(test)
- function.__name__ = u'test_address_%d' % index
+ function.__name__ = str('test_address_%d' % index) if RUNNING_ON_PYTHON_2_VERSION else 'test_address_%d' % index
if test.skip:
function = unittest.skip('just skip')(function) | Another try to fix py2 issues | natasha_natasha | train | py |
48b3859c51dc308f1402cce2f14afed500fd7063 | diff --git a/src/Model/ProjectUser.php b/src/Model/ProjectUser.php
index <HASH>..<HASH> 100644
--- a/src/Model/ProjectUser.php
+++ b/src/Model/ProjectUser.php
@@ -54,7 +54,26 @@ class ProjectUser extends Resource
return $result['role'];
}
}
- throw new \Exception("User role not found for environment {$environment->id}");
+
+ return $this->getProperty('role');
+ }
+
+ /**
+ * Change the user's environment-level role.
+ *
+ * @param Environment $environment
+ * @param string $newRole The new role ('admin', 'contributor',
+ * or 'viewer').
+ */
+ public function changeEnvironmentRole(Environment $environment, $newRole)
+ {
+ if (!in_array($newRole, ['admin', 'contributor', 'viewer'])) {
+ throw new \InvalidArgumentException("Invalid role: $newRole");
+ }
+
+ $this->sendRequest($environment->getUri() . '/access/' . $this->id, 'patch', [
+ 'json' => ['role' => $newRole],
+ ]);
}
/** | Add User::changeEnvironmenRole() | platformsh_platformsh-client-php | train | php |
d18e2132931a776e085bd9c5cf553432a959cbf6 | diff --git a/src/Auryn/Provider.php b/src/Auryn/Provider.php
index <HASH>..<HASH> 100644
--- a/src/Auryn/Provider.php
+++ b/src/Auryn/Provider.php
@@ -53,8 +53,8 @@ class Provider implements Injector {
* @param ReflectionStorage $reflectionStorage
* @return \Auryn\Provider
*/
- public function __construct(ReflectionStorage $reflectionStorage) {
- $this->reflectionStorage = $reflectionStorage;
+ public function __construct(ReflectionStorage $reflectionStorage = NULL) {
+ $this->reflectionStorage = $reflectionStorage ?: new ReflectionPool;
}
/** | Added lazy injection to Provider::__construct | rdlowrey_auryn | train | php |
78fad10266de672126f57d427216d7afafe811a3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,6 @@ extras_require = {
'transip': ['transip>=0.3.0'],
'plesk': ['xmltodict'],
'henet': ['beautifulsoup4'],
- 'hetzner': ['dnspython>=1.15.0', 'beautifulsoup4', 'html5lib'],
'easyname': ['beautifulsoup4'],
'localzone': ['localzone'],
'gratisdns': ['beautifulsoup4'], | Remove additional dependencies for Hetzner. (#<I>)
As the old Hetzner integration was removed we don't need these
dependencies anymore. The new dns.hetzner.com integration only uses
common dependencies.
This change removes dependency on dnspython and html5lib, whereas
beautifulsoup is still used by other integrations. | AnalogJ_lexicon | train | py |
798b4f3ebf9183dac423752ccc6529a0403c892c | diff --git a/cihai/datasets/unihan.py b/cihai/datasets/unihan.py
index <HASH>..<HASH> 100644
--- a/cihai/datasets/unihan.py
+++ b/cihai/datasets/unihan.py
@@ -219,7 +219,7 @@ def save(url, filename, urlretrieve=urlretrieve, *args):
:returns: Result of ``retrieve`` function
"""
- return urlretrieve(url, filename, *args)
+ return urlretrieve(url, filename, *args[2:])
def download(url, dest, urlretrieve=urlretrieve):
@@ -249,7 +249,7 @@ def download(url, dest, urlretrieve=urlretrieve):
if no_unihan_files_exist():
if not_downloaded():
print('Downloading Unihan.zip...')
- save(url, dest, urlretrieve)
+ save(url, dest, urlretrieve, _dl_progress)
return dest | Pass _dl_progress callback into unihan. | cihai_cihai | train | py |
6598f903f557c2d1cc9261def7702fe42bdd7344 | diff --git a/Tank/stepper/instance_plan.py b/Tank/stepper/instance_plan.py
index <HASH>..<HASH> 100644
--- a/Tank/stepper/instance_plan.py
+++ b/Tank/stepper/instance_plan.py
@@ -1,5 +1,6 @@
from itertools import cycle, chain
from util import parse_duration
+import sys
import re
@@ -16,7 +17,7 @@ class InstanceLP(object):
def __len__(self):
'''Return total ammo count'''
- return None
+ return sys.maxint
def get_rps_list(self):
return []
diff --git a/Tank/stepper/stepper.py b/Tank/stepper/stepper.py
index <HASH>..<HASH> 100644
--- a/Tank/stepper/stepper.py
+++ b/Tank/stepper/stepper.py
@@ -27,7 +27,7 @@ class AmmoFactory(object):
# FIXME: wrong ammo count when loop_limit is set
lp_len = len(self.load_plan)
ammo_len = len(self.ammo_generator)
- return min(lp_len, ammo_len) or max(lp_len, ammo_len)
+ return min(lp_len, ammo_len)
def get_loop_count(self):
return self.ammo_generator.loop_count() | return sys.maxint as length of instance plan | yandex_yandex-tank | train | py,py |
e2fbfda974479ef80c40eaf1e41b61993a2fcf85 | diff --git a/pysat/_instrument.py b/pysat/_instrument.py
index <HASH>..<HASH> 100644
--- a/pysat/_instrument.py
+++ b/pysat/_instrument.py
@@ -1052,7 +1052,7 @@ class Instrument(object):
self._password_req = False
def __repr__(self):
- # Print the basic Instrument properties
+ """ Print the basic Instrument properties"""
out_str = "".join(["Instrument(platform='", self.platform, "', name='",
self.name, "', sat_id='", self.sat_id,
"', clean_level='", self.clean_level,
@@ -1062,6 +1062,8 @@ class Instrument(object):
return out_str
def __str__(self):
+ """ Descriptively print the basic Instrument properties"""
+
# Get the basic Instrument properties
output_str = 'pysat Instrument object\n'
output_str += '-----------------------\n' | DOC: Instrument docstrings
Added missing docstrings to Instrument `__repr__` and `__str__` methods. | rstoneback_pysat | train | py |
0b6190807281892fd12de1833b81230e1507d57c | diff --git a/recordlinkage/comparing.py b/recordlinkage/comparing.py
index <HASH>..<HASH> 100644
--- a/recordlinkage/comparing.py
+++ b/recordlinkage/comparing.py
@@ -6,7 +6,7 @@ import numpy as np
class Compare(object):
"""A class to make comparing of records fields easier. It can be used to compare fields of the record pairs. """
- def __init__(self, pairs, store_to_memory=True, store_to_csv=None, store_to_hdf=None):
+ def __init__(self, pairs=None, store_to_memory=True, store_to_csv=None, store_to_hdf=None):
self.pairs = pairs | Drop restriction that there must be data given to the compare class | J535D165_recordlinkage | train | py |
36900cac998f0e2d5e1276eaa04cfa65dc18eaad | diff --git a/app/controllers/api/StreamsApiController.java b/app/controllers/api/StreamsApiController.java
index <HASH>..<HASH> 100644
--- a/app/controllers/api/StreamsApiController.java
+++ b/app/controllers/api/StreamsApiController.java
@@ -22,9 +22,7 @@ import java.io.IOException;
/**
* @author Dennis Oelkers <dennis@torch.sh>
*/
-public class StreamsApiController extends Controller {
- private static final Form<TestMatchRequest> testMatchForm = Form.form(TestMatchRequest.class);
-
+public class StreamsApiController extends AuthenticatedController {
@Inject
StreamService streamService; | Changing superclass of controller to AuthenticatedController
Removing unused form instance | Graylog2_graylog2-server | train | java |
3288aabe7a73f7347b2fda280b7bd6d67b8b1f67 | diff --git a/yfinance/base.py b/yfinance/base.py
index <HASH>..<HASH> 100644
--- a/yfinance/base.py
+++ b/yfinance/base.py
@@ -350,6 +350,10 @@ class TickerBase():
self._info.update(data[item])
except Exception:
pass
+
+ if not isinstance(data.get('summaryDetail'), dict):
+ # For some reason summaryDetail did not give any results. The price dict usually has most of the same info
+ self._info.update(data.get('price', {}))
try:
# self._info['regularMarketPrice'] = self._info['regularMarketOpen'] | If summaryDetail fails, pull in the price dict
For some tickers, such as `ETHI.AX`, the `summaryDetail` result is `None`. In this case, use the `price` dict if possible. | ranaroussi_fix-yahoo-finance | train | py |
3c4e8b84d597b48986fe928521cf01098c7fec56 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,8 @@
-from yasha import __version__
+#??? from yasha import __version__
from setuptools import setup, find_packages
+__version__ = "1.4.dev"
+
setup(
name="yasha",
author="Kim Blomqvist", | Try fix travis
Can't explain why this stopped working in travis. Works fine for me. | kblomqvist_yasha | train | py |
a608eac2b5a4f8bf2aef3636c8444ce69aa6191e | diff --git a/src/main/java/biweekly/io/text/ICalWriter.java b/src/main/java/biweekly/io/text/ICalWriter.java
index <HASH>..<HASH> 100644
--- a/src/main/java/biweekly/io/text/ICalWriter.java
+++ b/src/main/java/biweekly/io/text/ICalWriter.java
@@ -236,6 +236,10 @@ public class ICalWriter implements Closeable {
/**
* Writes an iCalendar object to the data stream.
* @param ical the iCalendar object to write
+ * @throws IllegalArgumentException if the marshaller class for a component
+ * or property object cannot be found (only happens when an experimental
+ * property/component marshaller is not registered with the
+ * <code>registerMarshaller</code> method.)
* @throws IOException if there's a problem writing to the data stream
*/
public void write(ICalendar ical) throws IOException { | Added Javadoc to "ICalWriter.write()" explaining why it throws an "IllegalArgumentException". | mangstadt_biweekly | train | java |
fb65c7f4bab0ad3764657b3f4c67ab93093343f6 | diff --git a/src/client.js b/src/client.js
index <HASH>..<HASH> 100644
--- a/src/client.js
+++ b/src/client.js
@@ -2263,6 +2263,27 @@ MatrixClient.prototype.mxcUrlToHttp =
};
/**
+ * Sets a new status message for the user. The message may be null/falsey
+ * to clear the message.
+ * @param {string} newMessage The new message to set.
+ * @return {module:client.Promise} Resolves: to nothing
+ * @return {module:http-api.MatrixError} Rejects: with an error response.
+ */
+MatrixClient.prototype.setStatusMessage = function(newMessage) {
+ return Promise.all(this.getRooms().map((room) => {
+ const isJoined = room.getMyMembership() === "join";
+ const looksLikeDm = room.getInvitedAndJoinedMemberCount() === 2;
+ if (isJoined && looksLikeDm) {
+ return this.sendStateEvent(room.roomId, "im.vector.user_status", {
+ status: newMessage,
+ }, this.getUserId());
+ } else {
+ return Promise.resolve();
+ }
+ }));
+};
+
+/**
* @param {Object} opts Options to apply
* @param {string} opts.presence One of "online", "offline" or "unavailable"
* @param {string} opts.status_msg The status message to attach. | Support setting status message in rooms that look like 1:1s
Part of <URL> | matrix-org_matrix-js-sdk | train | js |
51d0176f53a4d0dedd2fa76c8db6c45a95b4dc8c | diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py
index <HASH>..<HASH> 100644
--- a/dosagelib/plugins/c.py
+++ b/dosagelib/plugins/c.py
@@ -182,7 +182,7 @@ class CyanideAndHappiness(_BasicScraper):
_latestUrl = 'http://www.explosm.net/comics/'
starter = bounceStarter(_latestUrl, compile(tagre("a", "href", r"(/comics/\d+/)", before="next")))
stripUrl = _latestUrl + '%s/'
- imageSearch = compile(tagre("img", "src", r'(http://(?:www\.)?explosm\.net/db/files/(?:Comics/|comic)[^"]+)'))
+ imageSearch = compile(tagre("img", "src", r'(http://(?:www\.)?explosm\.net/db/files/[^"]+)', before="a daily webcomic"))
prevSearch = compile(tagre("a", "href", r'(/comics/\d+/)', before="prev"))
help = 'Index format: n (unpadded)' | Fix CyanideAndHappiness image regex - really. | wummel_dosage | train | py |
3b66c2a15d41049be534a72a70ea90009cd50a8d | diff --git a/crosscat/utils/geweke_utils.py b/crosscat/utils/geweke_utils.py
index <HASH>..<HASH> 100644
--- a/crosscat/utils/geweke_utils.py
+++ b/crosscat/utils/geweke_utils.py
@@ -590,6 +590,7 @@ def run_geweke(config):
return result
def result_to_series(result):
+ import pandas
base = result['config'].copy()
base.update(result['summary']['summary_kls'])
return pandas.Series(base) | BUGFIX: import pandas in result_to_series | probcomp_crosscat | train | py |
f8c5bcdac96146f68f6da6588e09b16cc0992318 | diff --git a/app/models/concerns/enju_seed/enju_user.rb b/app/models/concerns/enju_seed/enju_user.rb
index <HASH>..<HASH> 100644
--- a/app/models/concerns/enju_seed/enju_user.rb
+++ b/app/models/concerns/enju_seed/enju_user.rb
@@ -6,7 +6,7 @@ module EnjuSeed
scope :administrators, -> { joins(:role).where('roles.name = ?', 'Administrator') }
scope :librarians, -> { joins(:role).where('roles.name = ? OR roles.name = ?', 'Administrator', 'Librarian') }
scope :suspended, -> { where('locked_at IS NOT NULL') }
- has_one :profile
+ has_one :profile, dependent: :nullify
if defined?(EnjuBiblio)
has_many :import_requests
has_many :picture_files, as: :picture_attachable, dependent: :destroy | add :nullify option to User | next-l_enju_seed | train | rb |
62a1474db5d7a654c707dc4f2ffdf09c50748a39 | diff --git a/lib/ExportsInfo.js b/lib/ExportsInfo.js
index <HASH>..<HASH> 100644
--- a/lib/ExportsInfo.js
+++ b/lib/ExportsInfo.js
@@ -457,7 +457,6 @@ class ExportsInfo {
case UsageState.NoInfo:
return null;
case UsageState.Unknown:
- return true;
case UsageState.OnlyPropertiesUsed:
case UsageState.Used:
return true; | Remove code duplication
The body of this case clause 'UsageState.Unknown' duplicates the body of this case clause 'case UsageState.Used'. This may be caused by a copy-paste error. If this usage is intentional, consider using fall-through to remove code duplication. | webpack_webpack | train | js |
3c719a646d2e52dcf0677932c41a01daa543dabb | diff --git a/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java b/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java
+++ b/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java
@@ -384,10 +384,14 @@ public class DataTableRenderer extends CoreRenderer {
UIComponent header = column.getFacet("header");
String headerText = column.getHeaderText();
+ writer.startElement("div", null);
+
if(header != null)
header.encodeAll(context);
else if(headerText != null)
writer.write(headerText);
+
+ writer.endElement("div");
}
protected void encodeColumnsHeader(FacesContext context, DataTable table, Columns columns) throws IOException { | IE hack for Datatable resizer. | primefaces_primefaces | train | java |
741181734c8d5266e19f01fb9918c8d08b6698ad | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -70,7 +70,7 @@ export default {
lintOnFly: true,
lint: (TextEditor) => {
const filePath = TextEditor.getPath();
- const fileText = TextEditor.buffer.cachedText;
+ const fileText = TextEditor.getText();
// Is flow enabled for current file ?
const firstComStart = fileText.indexOf('\/*'); | Don't rely on buffers having cached text | AtomLinter_linter-flow | train | js |
e7bf95172a8acc350055cad284840a7bf3b2e4a8 | diff --git a/system/core/models/File.php b/system/core/models/File.php
index <HASH>..<HASH> 100644
--- a/system/core/models/File.php
+++ b/system/core/models/File.php
@@ -645,7 +645,7 @@ class File extends Model
$directory = $pathinfo['dirname'];
}
- if (!file_exists($directory) && !mkdir($directory, 0644, true)) {
+ if (!file_exists($directory) && !mkdir($directory, 0775, true)) {
unlink($temp);
$this->error = $this->language->text('Unable to create @name', array('@name' => $directory));
return false;
@@ -661,7 +661,7 @@ class File extends Model
return $this->error;
}
- $this->chmod($destination);
+ chmod($destination, 0644);
$this->transferred = $destination;
return true;
}
@@ -822,17 +822,4 @@ class File extends Model
return $this->error;
}
- /**
- * Set directory permissions depending on public/private access
- * @param string $file
- * @return boolean
- */
- protected function chmod($file)
- {
- if (strpos($file, GC_PRIVATE_DIR) === 0) {
- return chmod($file, 0640);
- }
- return chmod($file, 0644);
- }
-
} | Remove models\File::chmod() + change chmod | gplcart_gplcart | train | php |
0ba43e5e5edd255a54b7ddcbf7d26140fdb72922 | diff --git a/core/src/main/java/me/prettyprint/cassandra/connection/ConcurrentHClientPool.java b/core/src/main/java/me/prettyprint/cassandra/connection/ConcurrentHClientPool.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/me/prettyprint/cassandra/connection/ConcurrentHClientPool.java
+++ b/core/src/main/java/me/prettyprint/cassandra/connection/ConcurrentHClientPool.java
@@ -9,6 +9,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import me.prettyprint.cassandra.service.CassandraHost;
import me.prettyprint.hector.api.exceptions.HectorException;
+import me.prettyprint.hector.api.exceptions.HectorTransportException;
import me.prettyprint.hector.api.exceptions.PoolExhaustedException;
import org.slf4j.Logger;
@@ -233,7 +234,12 @@ public void releaseClient(HThriftClient client) throws HectorException {
client.close();
}
} else {
- addClientToPoolGently(new HThriftClient(cassandraHost).open());
+ try {
+ addClientToPoolGently(createClient());
+ } catch (HectorTransportException e) {
+ // if unable to open client then don't add one back to the pool
+ log.error("Transport exception in re-opening client in release on {}", getName());
+ }
}
realActiveClientsCount.decrementAndGet(); | Fix ex on releaseClient. Thanks to Eric Zoerner | hector-client_hector | train | java |
b9f4650edfbf0969ff60be4dc956657b6fb52665 | diff --git a/snippets/validated.py b/snippets/validated.py
index <HASH>..<HASH> 100644
--- a/snippets/validated.py
+++ b/snippets/validated.py
@@ -1,3 +1,5 @@
+# validated.py
+
from mongoframes import *
__all__ = [
@@ -47,8 +49,8 @@ class InvalidDocument(Exception):
An exception raised when `save` is called and the document fails validation.
"""
- def __init__(errors):
- super(InvalidDocument, self).__init__()
+ def __init__(self, errors):
+ super(InvalidDocument, self).__init__(str(errors))
self.errors = errors
@@ -68,7 +70,7 @@ class ValidatedFrame(Frame):
if not fields:
fields = self._fields
- data = {f: self[f] for f in fields}
+ data = {f: self[f] for f in fields if f in self}
# Build the form to validate our data with
form = self._form(FormData(data))
@@ -83,4 +85,4 @@ class ValidatedFrame(Frame):
raise InvalidDocument(form.errors)
# Document is valid, save the changes :)
- self.upsert(*fields)
\ No newline at end of file
+ self.upsert(*fields)
\ No newline at end of file | Fix for issues in validated snippet. | GetmeUK_MongoFrames | train | py |
ad61eba32166703318f3c0f81b666bc5b8f92732 | diff --git a/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java b/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java
index <HASH>..<HASH> 100644
--- a/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java
+++ b/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java
@@ -265,10 +265,11 @@ public abstract class ArchiveTestBase<T extends Archive<T>>
Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
archive.add(location, asset);
- byte[] addedData = IOUtil.asByteArray(asset.getStream());
- byte[] fetchedData = IOUtil.asByteArray(archive.get(location).getStream());
+ Asset fetchedAsset = archive.get(location);
- Assert.assertTrue("Asset should be returned from path: " + location.get(), Arrays.equals(addedData, fetchedData));
+ Assert.assertTrue(
+ "Asset should be returned from path: " + location.get(),
+ compareAssets(asset, fetchedAsset));
}
/** | TMPARCH-<I> Changed to use compareAssets instead of IOUtil directly | shrinkwrap_shrinkwrap | train | java |
71dfc247e010865343de61a907c6ef8ad6deb2f4 | diff --git a/tcex/tcex_batch_v2.py b/tcex/tcex_batch_v2.py
index <HASH>..<HASH> 100644
--- a/tcex/tcex_batch_v2.py
+++ b/tcex/tcex_batch_v2.py
@@ -559,7 +559,7 @@ class TcExBatch(object):
"""
data = []
# process group objects
- for xid in groups.keys():
+ for xid in list(groups.keys()):
# get association from group data
assoc_group_data = self.data_group_association(xid)
data += assoc_group_data
@@ -1429,7 +1429,7 @@ class TcExBatch(object):
halt_on_error = self.halt_on_file_error
upload_status = []
- for xid, content_data in self._files.items():
+ for xid, content_data in list(self._files.items()):
del self._files[xid] # win or loose remove the entry
status = True | Fixing bugs encountered when creating documents/reports
We need to cast the .keys() and .items() to a list because at some points in the code, we are deleting from the dictionary we are trying to iterate through (e.g. <URL>) | ThreatConnect-Inc_tcex | train | py |
1cefcb29907b4a5322de4a4131effd56279f8da1 | diff --git a/tests/test_document.py b/tests/test_document.py
index <HASH>..<HASH> 100644
--- a/tests/test_document.py
+++ b/tests/test_document.py
@@ -4,6 +4,7 @@ import io
import tempfile
from nose import tools
+from unittest import skipIf as skip_if
from PyPDF2 import PdfFileReader
@@ -33,6 +34,13 @@ METADATA = {
"keywords": "pdf, documents",
}
+try:
+ import __pypy__
+except ImportError:
+ IN_PYPY = False
+else:
+ IN_PYPY = True
+
def _compare_pdf_metadata(pdf_file, assertion):
@@ -54,6 +62,7 @@ def _compare_pdf_metadata(pdf_file, assertion):
assertion(actual_value, expected_value)
+@skip_if(IN_PYPY, "This doesn't work in pypy")
def test_document_creation_without_metadata():
with tempfile.TemporaryFile() as pdf_file:
pisaDocument(
@@ -63,6 +72,7 @@ def test_document_creation_without_metadata():
_compare_pdf_metadata(pdf_file, tools.assert_not_equal)
+@skip_if(IN_PYPY, "This doesn't work in pypy")
def test_document_creation_with_metadata():
with tempfile.TemporaryFile() as pdf_file:
pisaDocument( | Skip document tests in pypy | xhtml2pdf_xhtml2pdf | train | py |
04c0b4f8a7e4e722d767f708759dbd493e89ee57 | diff --git a/lib/tmuxinator/project.rb b/lib/tmuxinator/project.rb
index <HASH>..<HASH> 100644
--- a/lib/tmuxinator/project.rb
+++ b/lib/tmuxinator/project.rb
@@ -26,7 +26,7 @@ module Tmuxinator
def root
root = yaml["project_root"] || yaml["root"]
- root.blank? ? nil : File.expand_path(root)
+ root.blank? ? nil : File.expand_path(root).shellescape
end
def name | Escape path string in order to handle paths with spaces, parentheses etc. | tmuxinator_tmuxinator | train | rb |
78f54ba353475e5eaf6316bd2586fa794d343b44 | diff --git a/src/dolo/misc/yamlfile.py b/src/dolo/misc/yamlfile.py
index <HASH>..<HASH> 100644
--- a/src/dolo/misc/yamlfile.py
+++ b/src/dolo/misc/yamlfile.py
@@ -40,7 +40,11 @@ Imports the content of a modfile into the current interpreter scope
context = dict(context)
# add some common functions
- for f in [sympy.log, sympy.exp, sympy.atan, sympy.pi]:
+ for f in [sympy.log, sympy.exp,
+ sympy.sin, sympy.cos, sympy.tan,
+ sympy.asin, sympy.acos, sympy.atan,
+ sympy.sinh, sympy.cosh, sympy.tanh,
+ sympy.pi]:
context[str(f)] = f
context['sqrt'] = sympy.sqrt | Added usual functions to yamlfile parser | EconForge_dolo | train | py |
87d5df3d31a380c9d55e0895b4fc91ea423172ba | diff --git a/src/deep-db/lib/DB.js b/src/deep-db/lib/DB.js
index <HASH>..<HASH> 100644
--- a/src/deep-db/lib/DB.js
+++ b/src/deep-db/lib/DB.js
@@ -308,6 +308,9 @@ export class DB extends Kernel.ContainerAware {
docClient.service.config.credentials = credentials;
dynamoDriver.config.credentials = credentials;
+ // reset existent models to make sure old credentials are not cached by each model
+ this._models = {};
+
return this;
} | #<I>: Reset existent models to make sure old credentials are not cached by each model | MitocGroup_deep-framework | train | js |
2d87189f4ba4e17a88acc8ea9afdf0787ac267b7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,11 +2,11 @@
# -*- coding: utf-8 -*-
from setuptools import setup
-from crosspm.config import __version__
+from crosspm import config
setup(
name='crosspm',
- version=__version__,
+ version=config.__version__,
description='Cross Package Manager',
license='MIT',
author='Alexander Kovalev',
@@ -36,10 +36,12 @@ setup(
'crosspm.adapters',
],
setup_requires=[
+ 'docopt',
'pytest-runner',
'wheel',
],
tests_require=[
+ 'docopt',
'pytest',
'pytest-flask',
], | crosspm as module + path processing bugfixes | devopshq_crosspm | train | py |
564aabc2fe0187e38a4acf3ea4149aa5844a8d23 | diff --git a/tests/B5bis.php b/tests/B5bis.php
index <HASH>..<HASH> 100644
--- a/tests/B5bis.php
+++ b/tests/B5bis.php
@@ -1,6 +1,6 @@
<?php
- include ('../NuxeoAutomationClient/NuxeoAutomationAPI.php');
+ include ('../NuxeoAutomationClient/NuxeoAutomationAPI.php');
/**
*
@@ -11,6 +11,8 @@
function getFileContent($path = '/default-domain/workspaces/jkjkj/teezeareate.1304515647395') {
$eurl = explode("/", $path);
+
+ $temp = str_replace(" ", "", end($eurl));
$client = new PhpAutomationClient('http://localhost:8080/nuxeo/site/automation');
@@ -23,7 +25,7 @@
else{
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename='.end($eurl).'.pdf');
+ header('Content-Disposition: attachment; filename='. $temp .'.pdf');
readfile('tempstream');
}
} | fix the bug that making sometimes the .pdf to not appears | nuxeo_nuxeo-php-client | train | php |
dd2498f984e743672e3184e9776c7287584c97ed | diff --git a/ipfshttpclient/client/base.py b/ipfshttpclient/client/base.py
index <HASH>..<HASH> 100644
--- a/ipfshttpclient/client/base.py
+++ b/ipfshttpclient/client/base.py
@@ -115,9 +115,8 @@ class ClientBase(object):
_clientfactory = http.HTTPClient
def __init__(self, addr=DEFAULT_ADDR, base=DEFAULT_BASE,
- username=None, password=None,
chunk_size=multipart.default_chunk_size,
- session=False, **defaults):
+ session=False, username=None, password=None, **defaults):
"""Connects to the API port of an IPFS node."""
self.chunk_size = chunk_size | [This one's worse, I promise] | ipfs_py-ipfs-api | train | py |
d865a13c2a8287a0f1dcbcb957539c876b1feaf8 | diff --git a/structr-ui/src/main/resources/structr/js/crud.js b/structr-ui/src/main/resources/structr/js/crud.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/crud.js
+++ b/structr-ui/src/main/resources/structr/js/crud.js
@@ -2273,7 +2273,7 @@ var _Crud = {
searchResults.append('<div id="resultsFor' + type + '" class="searchResultGroup resourceBox"><h3>' + type.capitalize() + '</h3></div>');
}
var displayName = _Crud.displayName(node);
- $('#resultsFor' + type, searchResults).append('<div title="' + displayName + '" " class="_' + node.id + ' node">' + fitStringToWidth(displayName, 120) + '</div>');
+ $('#resultsFor' + type, searchResults).append('<div title="name: ' + node.name + '\nid: ' + node.id + '' + ' \ntype: ' + node.type + '' + '" class="_' + node.id + ' node">' + fitStringToWidth(displayName, 120) + '</div>');
var nodeEl = $('#resultsFor' + type + ' ._' + node.id, searchResults);
if (node.isImage) { | Enhancement: Adds object id and type to title attribute of search results for related nodes search results in crud. | structr_structr | train | js |
3912c82f99017889dc147f45980734940ec6ce3c | diff --git a/lib/CLIntegracon/file_tree_spec.rb b/lib/CLIntegracon/file_tree_spec.rb
index <HASH>..<HASH> 100644
--- a/lib/CLIntegracon/file_tree_spec.rb
+++ b/lib/CLIntegracon/file_tree_spec.rb
@@ -205,7 +205,7 @@ module CLIntegracon
def transform_paths!
glob_all.each do |path|
context.transformers_for(path).each do |transformer|
- transformer.call(path)
+ transformer.call(path) if path.exist?
end
end
end | [FileTreeSpec] Only attempt to transform paths if they exist | mrackwitz_CLIntegracon | train | rb |
d593fb0dd0d74b0e68e2d782a07d7c8f0de3a54c | diff --git a/ggplot/themes/theme_gray.py b/ggplot/themes/theme_gray.py
index <HASH>..<HASH> 100644
--- a/ggplot/themes/theme_gray.py
+++ b/ggplot/themes/theme_gray.py
@@ -91,5 +91,8 @@ def _theme_grey_post_plot_callback(ax):
#Set minor grid lines
ax.grid(True, 'minor', color='#F2F2F2', linestyle='-', linewidth=0.7)
- ax.xaxis.set_minor_locator(mpl.ticker.AutoMinorLocator(2))
- ax.yaxis.set_minor_locator(mpl.ticker.AutoMinorLocator(2))
+
+ if not isinstance(ax.xaxis.get_major_locator(), mpl.ticker.LogLocator):
+ ax.xaxis.set_minor_locator(mpl.ticker.AutoMinorLocator(2))
+ if not isinstance(ax.yaxis.get_major_locator(), mpl.ticker.LogLocator):
+ ax.yaxis.set_minor_locator(mpl.ticker.AutoMinorLocator(2)) | Prevent theme changing minor ticklocs in log plots | has2k1_plotnine | train | py |
c6b23fc696c3218dc3fe97185beb6b012f1746e9 | diff --git a/frasco_users/blueprint.py b/frasco_users/blueprint.py
index <HASH>..<HASH> 100644
--- a/frasco_users/blueprint.py
+++ b/frasco_users/blueprint.py
@@ -75,7 +75,7 @@ def signup(users):
"users.login", next=request.args.get("next")))
if current_context["form"].is_submitted() and current_context["form"].validate():
- if users.options['recaptcha_secret']:
+ if users.options['recaptcha_secret'] and not current_app.debug and not current_app.testing:
if 'g-recaptcha-response' not in request.form:
return redirect(url_for('users.signup', next=request.args.get('next')))
r = requests.post('https://www.google.com/recaptcha/api/siteverify', data={
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name='frasco-users',
- version='0.7.4',
+ version='0.7.5',
url='http://github.com/frascoweb/frasco-users',
license='MIT',
author='Maxime Bouroumeau-Fuseau', | dont check recaptcha if app is in debug or testing | frascoweb_frasco-users | train | py,py |
306272529259f0b37276eaa71cf0ea94b17998e8 | diff --git a/src/rewrite.js b/src/rewrite.js
index <HASH>..<HASH> 100644
--- a/src/rewrite.js
+++ b/src/rewrite.js
@@ -35,9 +35,6 @@ module.exports = function(routes, srcPath) {
// Remove first character and query to convert URL to a relative path
const fileRoute = req.url.substr(1).split('?')[0]
- // Absolute path to the requested file
- const filePath = path.join(srcPath, fileRoute)
-
// Generate an array of matching routes and use the first matching route only
const matches = routes.filter((route) => mm.isMatch(fileRoute, route.path))
const route = matches[0]
@@ -57,12 +54,15 @@ module.exports = function(routes, srcPath) {
}
- // Get mime type of request files
- const contentType = mime.lookup(filePath)
+ // Absolute path to the requested file
+ const filePath = path.join(srcPath, fileRoute)
// Load file with a different extension as filePath points to the target extension
const fileLoad = rename(filePath, route.handler.in(route.opts))
+ // Get mime type of request files
+ const contentType = mime.lookup(filePath)
+
// Execute handler
execute(route, fileRoute, fileLoad, (err, data) => { | Changed location of filePath definition | electerious_Rosid | train | js |
37dc0ef62c3488ae25653944f722181021829efa | diff --git a/doc/source/conf.py b/doc/source/conf.py
index <HASH>..<HASH> 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -15,6 +15,7 @@ import os
# add the pymrio path for the autodoc function
+autodoc_mock_imports = ['_tkinter']
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the | added mock for tkinter in conf | konstantinstadler_pymrio | train | py |
8ac1d3a95b0a44021e6a98ce86b45414d97ac01f | diff --git a/src/main/java/com/rometools/rome/io/WireFeedInput.java b/src/main/java/com/rometools/rome/io/WireFeedInput.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/rometools/rome/io/WireFeedInput.java
+++ b/src/main/java/com/rometools/rome/io/WireFeedInput.java
@@ -370,8 +370,8 @@ public class WireFeedInput {
private void setFeature(SAXBuilder saxBuilder, XMLReader parser, String feature, boolean value) {
try {
- saxBuilder.setFeature(feature, true);
- parser.setFeature(feature, true);
+ saxBuilder.setFeature(feature, value);
+ parser.setFeature(feature, value);
} catch (final SAXNotRecognizedException e) {
// ignore
} catch (final SAXNotSupportedException e) { | Fix setting xml features
The argument of the method has been unused leading to all of the
features being set to true regardless of the passed argument value. | rometools_rome | train | java |
c2da18471c33f10dbac538308970d8687877b12b | diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/fixtures/base_case.py
+++ b/seleniumbase/fixtures/base_case.py
@@ -3277,6 +3277,7 @@ class BaseCase(unittest.TestCase):
new_presentation = (
'<html>\n'
'<head>\n'
+ '<meta charset="utf-8">\n'
'<link rel="stylesheet" href="%s">\n'
'<link rel="stylesheet" href="%s">\n'
'<style>\n'
@@ -3905,7 +3906,7 @@ class BaseCase(unittest.TestCase):
raise Exception("Chart {%s} does not exist!" % chart_name)
if not filename.endswith('.html'):
raise Exception('Chart file must end in ".html"!')
- the_html = ""
+ the_html = '<meta charset="utf-8">\n'
for chart_data_point in self._chart_data[chart_name]:
the_html += chart_data_point
the_html += ( | Add meta charset data to the head of html presentations | seleniumbase_SeleniumBase | train | py |
d046eeac2870485db5a3ca3639c196ad1620e29c | diff --git a/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java b/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java
index <HASH>..<HASH> 100755
--- a/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java
+++ b/restygwt/src/main/java/org/fusesource/restygwt/rebind/RestServiceClassCreator.java
@@ -657,13 +657,10 @@ public class RestServiceClassCreator extends BaseSourceCreator {
} else if (contentArg.getType() == DOCUMENT_TYPE) {
p("__method.xml(" + contentArg.getName() + ");");
} else {
- JClassType contentClass = contentArg.getType().isClass();
+ JClassType contentClass = contentArg.getType().isClassOrInterface();
if (contentClass == null) {
- contentClass = contentArg.getType().isClassOrInterface();
- if (!locator.isCollectionType(contentClass)) {
- getLogger().log(ERROR, "Content argument must be a class.");
- throw new UnableToCompleteException();
- }
+ getLogger().log(ERROR, "Content argument must be a class.");
+ throw new UnableToCompleteException();
}
jsonAnnotation = getAnnotation(contentArg, Json.class); | Accept Interfaces as parameter types.
RestyGWT does not accept intefaces as content parameter in Rest Methods.
This commit removes this restriction as it works fine on the server and on the client. | resty-gwt_resty-gwt | train | java |
73aaacd804a0f559ba221ab705f1430eebcd6633 | diff --git a/tests/test_sequence.py b/tests/test_sequence.py
index <HASH>..<HASH> 100644
--- a/tests/test_sequence.py
+++ b/tests/test_sequence.py
@@ -35,6 +35,15 @@ def test_nested_sequence_mapping(complicated_config):
assert complicated_config.different.types[3].containing.surprise[0] == 'another'
+def test_sequence_reference(complicated_config):
+ seq = complicated_config.different.sequence
+
+ assert isinstance(seq, Sequence)
+ assert seq[0] == 'simple value'
+ assert seq[1] == 'example'
+ assert seq[2] == 'value with a reference in it'
+
+
def test_deep_reference(complicated_config):
ns = complicated_config.different.types[3].containing.surprise[1] | Add test to verify that references in a sequence get resolved | HolmesNL_confidence | train | py |
73130af3b2287834dcac9a3e87649bf81ce2d86a | diff --git a/tests/units/Writers/RouteWriterTest.php b/tests/units/Writers/RouteWriterTest.php
index <HASH>..<HASH> 100644
--- a/tests/units/Writers/RouteWriterTest.php
+++ b/tests/units/Writers/RouteWriterTest.php
@@ -63,7 +63,7 @@ class RouteWriterTest extends TestCase
$this->assertViewRouteContains([
"name: 'perm.group.show'",
'component: TestModelShow',
- "title: 'Tests Models Profile'"
+ "title: 'Show Tests Models'"
], 'perm/group/show.js');
} | fixes tests (#<I>) | laravel-enso_StructureManager | train | php |
0aeb241ecf2b4d952b822083d6ca0a27586dfb6f | diff --git a/lib/decoder/bmp_decoder.rb b/lib/decoder/bmp_decoder.rb
index <HASH>..<HASH> 100644
--- a/lib/decoder/bmp_decoder.rb
+++ b/lib/decoder/bmp_decoder.rb
@@ -21,7 +21,41 @@ along with imageruby. if not, see <http://www.gnu.org/licenses/>.
class BmpDecoder < Decoder
def decode(data)
- Image.new(10,10)
+ # read bmp header
+ header = data[0..13]
+ dib_header = data[14..54]
+
+ magic = header[0..1]
+
+ # check magic
+ unless magic == "BM"
+ raise UnableToDecodeException
+ end
+
+ pixeldata_offset = header[10..13].unpack("L").first
+
+ width = dib_header[4..7].unpack("L").first
+ height = dib_header[8..11].unpack("L").first
+
+ # create image object
+
+ image = Image.new(width,height)
+
+ # read pixel data
+ width.times do |x|
+ height.times do |y|
+ offset = pixeldata_offset+(y*width)+x
+ color_triplet = data[offset..offset+2]
+ image[x,y] = Color.from_rgb(
+ color_triplet[0],
+ color_triplet[1],
+ color_triplet[2]
+ )
+ end
+ end
+
+ image
+
end
def encode(image, format) | implemented basic decode process for bmp files | tario_imageruby | train | rb |
42f06e538034b9aeaba15d994ca0e1f83d160ef4 | diff --git a/src/radical/entk/task/task.py b/src/radical/entk/task/task.py
index <HASH>..<HASH> 100644
--- a/src/radical/entk/task/task.py
+++ b/src/radical/entk/task/task.py
@@ -800,12 +800,8 @@ class Task(object):
raise TypeError(expected_type=list,
actual_type=type(d['pre_exec']))
- if 'executable' in d:
- if isinstance(d['executable'], str) or isinstance(d['executable'], unicode):
- self._executable = d['executable']
- else:
- raise TypeError(expected_type=str,
- actual_type=type(d['executable']))
+ if d.get('executable'):
+ self.executable = d['executable']
if 'arguments' in d:
if isinstance(d['arguments'], list): | fall back to setter type checks
the dict type checks for executable were inconsistent with those from the setter (they did not allow backward-compatible lists) | radical-cybertools_radical.entk | train | py |
b4726c0c1fbf997beac96a111d24d72be2a6f612 | diff --git a/modules/memory.js b/modules/memory.js
index <HASH>..<HASH> 100644
--- a/modules/memory.js
+++ b/modules/memory.js
@@ -16,7 +16,9 @@ module.exports=function(app,config){
data.values=da
app.emitters.forEach(function(emitter){
emitter.emit("known-data",data)
- })
+ })
+ knownSensors[data.senderId].last=data.values
+ fs.writeFile(outFile, JSON.stringify(knownSensors, null, 4), function(err) {})
} else {
if(app.learnMode==="on"){
app.learnMode="off" | save the last telegram for every known sensor in the sensorFile | enocean-js_node-enocean | train | js |
177c2dc4f10c8f81b9b1c4008b2c6d992a2d8f99 | diff --git a/src/currencyEngine/indexEngine.js b/src/currencyEngine/indexEngine.js
index <HASH>..<HASH> 100644
--- a/src/currencyEngine/indexEngine.js
+++ b/src/currencyEngine/indexEngine.js
@@ -176,10 +176,9 @@ export default (bcoin:any, txLibInfo:any) => class CurrencyEngine implements Abc
masterPath,
masterIndex
})
+ await this.wallet.setLookahead(0, this.gapLimit)
await this.saveMemDumpToDisk()
}
-
- await this.wallet.setLookahead(0, this.gapLimit)
await this.syncDiskData()
} | no reason to setLookAhead if we loaded the wallet from cache | EdgeApp_edge-currency-bitcoin | train | js |
05adc401ad416b45e413a96b192383965995195e | diff --git a/src/wyc/stages/TypePropagation.java b/src/wyc/stages/TypePropagation.java
index <HASH>..<HASH> 100755
--- a/src/wyc/stages/TypePropagation.java
+++ b/src/wyc/stages/TypePropagation.java
@@ -387,6 +387,7 @@ public class TypePropagation extends ForwardFlowAnalysis<TypePropagation.Env> {
checkIsSubtype(Type.T_REAL,lhs,stmt);
result = lhs;
} else {
+ checkIsSubtype(Type.T_REAL,lhs,stmt);
checkIsSubtype(Type.T_REAL,rhs,stmt);
result = rhs;
} | Minor bug fix for arithmetic operators and byte types. | Whiley_WhileyCompiler | train | java |
951930795003f1006a7cd849ee8f098e1f88f35d | diff --git a/src/menus/ServerActionsMenu.php b/src/menus/ServerActionsMenu.php
index <HASH>..<HASH> 100644
--- a/src/menus/ServerActionsMenu.php
+++ b/src/menus/ServerActionsMenu.php
@@ -133,7 +133,7 @@ class ServerActionsMenu extends Menu
array_push($items, [
'label' => AjaxModalWithTemplatedButton::widget([
'ajaxModalOptions' => [
- 'id' => "{$key}-modal",
+ 'id' => "{$key}-modal-{$this->model->id}",
'bulkPage' => true,
'header' => Html::tag('h4', $item['label'], ['class' => 'modal-title']),
'scenario' => 'default', | bugfix: modals have same id and load for all models after clicking at one (#<I>) | hiqdev_hipanel-module-server | train | php |
d36d5027af46190cffad752bd73c2f20158ef14d | diff --git a/server/test/utils.js b/server/test/utils.js
index <HASH>..<HASH> 100644
--- a/server/test/utils.js
+++ b/server/test/utils.js
@@ -109,15 +109,6 @@ class TestUtils {
throw e;
}
}
-
- if (backendDatabaseUri.startsWith('mssql:')) {
- const sequelize2 = new Sequelize(backendDatabaseUri, {
- logging: (message) => appLog.debug(message),
- });
- await sequelize2.query(
- 'CREATE TYPE [dbo].[JSON] FROM [NVARCHAR](MAX) NULL;'
- );
- }
}
db.makeDb(this.config, this.instanceAlias); | removed create type as now part of migrations | rickbergfalk_sqlpad | train | js |
4795bd793cf8cf26d2566e98e298ff0838d9171c | diff --git a/registry.py b/registry.py
index <HASH>..<HASH> 100644
--- a/registry.py
+++ b/registry.py
@@ -23,7 +23,7 @@ from flask.ext.registry import RegistryError, RegistryProxy
class WorkflowsRegistry(DictModuleAutoDiscoverySubRegistry):
- def keygetter(self, key, class_):
+ def keygetter(self, key, orig_value, class_):
return class_.__name__ if key is None else key
def valuegetter(self, class_or_module): | workflows: registry fix for keygetter method
* `keygetter` method of WorkflowsRegistry updated for keygetter fix. | inveniosoftware-contrib_invenio-workflows | train | py |
1aec93d75f587fa7b8797cef4d6def602c23d299 | diff --git a/src/unpoly/util.js b/src/unpoly/util.js
index <HASH>..<HASH> 100644
--- a/src/unpoly/util.js
+++ b/src/unpoly/util.js
@@ -1911,23 +1911,7 @@ up.util = (function() {
@internal
*/
function sprintf(message, ...args) {
- return sprintfWithFormattedArgs(identity, message, ...args)
- }
-
- /*-
- @function up.util.sprintfWithFormattedArgs
- @internal
- */
- function sprintfWithFormattedArgs(formatter, message, ...args) {
- if (!message) { return ''; }
-
- let i = 0
- return message.replace(SPRINTF_PLACEHOLDERS, function() {
- let arg = args[i]
- arg = formatter(stringifyArg(arg))
- i += 1
- return arg
- })
+ return message.replace(SPRINTF_PLACEHOLDERS, () => stringifyArg(args.shift()))
}
// Remove with IE11.
@@ -2073,7 +2057,6 @@ up.util = (function() {
camelToKebabCase,
nullToUndefined,
sprintf,
- sprintfWithFormattedArgs,
renameKeys,
allSettled,
negate, | Simplify up.util.sprintf() | unpoly_unpoly | train | js |
20348b611d422004878d94abaa8d2f7c446b9e16 | diff --git a/packages/selenium-ide/src/neo/stores/view/PlaybackState.js b/packages/selenium-ide/src/neo/stores/view/PlaybackState.js
index <HASH>..<HASH> 100644
--- a/packages/selenium-ide/src/neo/stores/view/PlaybackState.js
+++ b/packages/selenium-ide/src/neo/stores/view/PlaybackState.js
@@ -31,6 +31,7 @@ import { play, playSingleCommand, resumePlayback } from "../../IO/SideeX/playbac
import WindowSession from "../../IO/window-session";
import ExtCommand from "../../IO/SideeX/ext-command";
import WebDriverExecutor from "../../IO/playback/webdriver";
+import { isStaging } from "../../../content/utils";
class PlaybackState {
@observable runId = "";
@@ -376,6 +377,7 @@ class PlaybackState {
this.logger.error(result.message);
this.forceFailure();
if (!this.hasFinishedSuccessfully) {
+ if (isStaging) console.log(result.message);
this.failures++;
}
} | Added console.log for failure message when running playback in staging | SeleniumHQ_selenium-ide | train | js |
5b731736fea815ef16446960f1e729564f7bdecc | diff --git a/src/_parsers.py b/src/_parsers.py
index <HASH>..<HASH> 100644
--- a/src/_parsers.py
+++ b/src/_parsers.py
@@ -706,7 +706,7 @@ class GenKey(object):
raise ValueError("Unknown status message: %r" % key)
if self.type in ('B', 'P'):
- self.primary_key_created = True
+ self.primary_created = True
if self.type in ('B', 'S'):
self.subkey_created = True | Remove duplicate attribute primary_key_created from GenKey. | isislovecruft_python-gnupg | train | py |
6407619362f91e2a8c1aca7460e8325dbc6e41fe | diff --git a/includes/class-bitbucket-api.php b/includes/class-bitbucket-api.php
index <HASH>..<HASH> 100644
--- a/includes/class-bitbucket-api.php
+++ b/includes/class-bitbucket-api.php
@@ -25,7 +25,7 @@ class GitHub_Updater_BitBucket_API extends GitHub_Updater {
*/
public function __construct( $type ) {
$this->type = $type;
- self::$hours = 4;
+ self::$hours = 12;
add_filter( 'http_request_args', array( $this, 'maybe_authenticate_http' ), 10, 2 );
}
diff --git a/includes/class-github-api.php b/includes/class-github-api.php
index <HASH>..<HASH> 100644
--- a/includes/class-github-api.php
+++ b/includes/class-github-api.php
@@ -25,7 +25,7 @@ class GitHub_Updater_GitHub_API extends GitHub_Updater {
*/
public function __construct( $type ) {
$this->type = $type;
- self::$hours = 4;
+ self::$hours = 12;
}
/** | change timeout to <I> hours | afragen_github-updater | train | php,php |
2706188c832e90121e716f38dec454788490340d | diff --git a/test/mapper/test_prior_model.py b/test/mapper/test_prior_model.py
index <HASH>..<HASH> 100644
--- a/test/mapper/test_prior_model.py
+++ b/test/mapper/test_prior_model.py
@@ -88,6 +88,26 @@ class TestFloatAnnotation(object):
assert isinstance(result.object.position[0], Distance)
assert isinstance(result.object.position[1], Distance)
+ def test_prior_linking(self):
+ mapper = mm.ModelMapper()
+ mapper.a = SimpleClass
+ mapper.b = SimpleClass
+
+ assert mapper.prior_count == 4
+
+ mapper.a.one = mapper.b.one
+
+ assert mapper.prior_count == 3
+
+ mapper.a.two = mapper.b.two
+
+ assert mapper.prior_count == 2
+
+ mapper.a.one = mapper.a.two
+ mapper.b.one = mapper.b.two
+
+ assert mapper.prior_count == 1
+
class TestHashing(object):
def test_is_hashable(self): | test demonstrating prior linking wwith annotations | rhayes777_PyAutoFit | train | py |
65b1e9ef2c6f2e7372303ff36994c215036301a3 | diff --git a/core/src/main/java/feign/Client.java b/core/src/main/java/feign/Client.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/feign/Client.java
+++ b/core/src/main/java/feign/Client.java
@@ -15,6 +15,8 @@
*/
package feign;
+import static java.lang.String.format;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -150,6 +152,12 @@ public interface Client {
int status = connection.getResponseCode();
String reason = connection.getResponseMessage();
+ if (status < 0 || reason == null) {
+ // invalid response
+ throw new IOException(format("Invalid HTTP executing %s %s", connection.getRequestMethod(),
+ connection.getURL()));
+ }
+
Map<String, Collection<String>> headers = new LinkedHashMap<String, Collection<String>>();
for (Map.Entry<String, List<String>> field : connection.getHeaderFields().entrySet()) {
// response message | Handle invalid HTTP received from server
If response was empty it caused a NPE | OpenFeign_feign | train | java |
5d97336452d0e3883bc429c4a3144acc4295f984 | diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py
index <HASH>..<HASH> 100644
--- a/pylint/__pkginfo__.py
+++ b/pylint/__pkginfo__.py
@@ -18,7 +18,7 @@ install_requires = [
'astroid >= 1.5.0,<1.6.0',
'six',
'isort >= 4.2.5',
- 'mccabe == 0.4.0',
+ 'mccabe',
]
if sys.platform == 'win32': | Don't pin mccabe version
Fixes #<I> | PyCQA_pylint | train | py |
33f7ab9c2567bf5546446845e22c5f27e58ce376 | diff --git a/src/style.js b/src/style.js
index <HASH>..<HASH> 100644
--- a/src/style.js
+++ b/src/style.js
@@ -287,6 +287,9 @@ export default class Style {
width: width + 'px'
});
+ // remove the body height, so that it resets to it's original
+ $.removeStyle(this.bodyScrollable, 'height');
+
// when there are less rows than the container
// adapt the container height
const height = $.getStyle(this.bodyScrollable, 'height'); | fix: 🐛 Reset body height before setting the bodyStyle
In case when there are very less number of rows, the height will adapt
to a lower value. But in the next refresh the number of rows could
increase so the body height should be reset to it's original value | frappe_datatable | train | js |
0fc8007f9ca010bbb31fbc02a8af780d20ecf710 | diff --git a/visidata/threads.py b/visidata/threads.py
index <HASH>..<HASH> 100644
--- a/visidata/threads.py
+++ b/visidata/threads.py
@@ -235,10 +235,13 @@ def checkForFinishedThreads(self):
@VisiData.api
def sync(self, *joiningThreads):
'Wait for joiningThreads to finish. If no joiningThreads specified, wait for all but current thread to finish.'
- joiningThreads = joiningThreads or (set(self.unfinishedThreads)-set([threading.current_thread()]))
+ joiningThreads = list(joiningThreads) or (set(self.unfinishedThreads)-set([threading.current_thread()]))
while any(t in self.unfinishedThreads for t in joiningThreads):
for t in joiningThreads:
try:
+ if not t.is_alive():
+ joiningThreads.remove(t)
+ break
t.join()
except RuntimeError: # maybe thread hasn't started yet or has already joined
pass | [threads] check to see if thread is_alive before joining it | saulpw_visidata | train | py |
bf659cf05e63614055e0de034273a3e2bd446526 | diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index <HASH>..<HASH> 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -1993,7 +1993,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
if ($result && $oldversion < 2009050614) {
/// fill in any missing contextids with a dummy value, so we can add the not-null constraint.
- $DB->execute("UPDATE {block_instances} SET contextid = -1 WHERE contextid IS NULL");
+ $DB->execute("UPDATE {block_instances} SET contextid = 0 WHERE contextid IS NULL");
/// Main savepoint reached
upgrade_main_savepoint($result, 2009050614); | blocks upgrade: MDL-<I> Oops. contextid is unsigned, so use 0 as a dummy value, not -1 | moodle_moodle | train | php |
213c09116d25b682da2bb4b7e8bea74791496d06 | diff --git a/adjustText/adjustText.py b/adjustText/adjustText.py
index <HASH>..<HASH> 100644
--- a/adjustText/adjustText.py
+++ b/adjustText/adjustText.py
@@ -291,7 +291,7 @@ def adjust_text(x, y, texts, ax=None, expand_text=(1.2, 1.2),
"""
if ax is None:
ax = plt.gca()
- r = ax.get_figure().canvas.get_renderer()
+ r = ax.get_figure().canvas.get_renderer()
orig_xy = [text.get_position() for text in texts]
orig_x = [xy[0] for xy in orig_xy]
orig_y = [xy[1] for xy in orig_xy] | Fixed an inconsistency in indentation whitespace | Phlya_adjustText | train | py |
7b3bc82d8789dd1696ab1be5bd94abc00027249a | diff --git a/WordPress/Sniff.php b/WordPress/Sniff.php
index <HASH>..<HASH> 100644
--- a/WordPress/Sniff.php
+++ b/WordPress/Sniff.php
@@ -115,6 +115,7 @@ abstract class WordPress_Sniff implements PHP_CodeSniffer_Sniff {
'comments_popup_link' => true,
'comments_popup_script' => true,
'comments_rss_link' => true,
+ 'count' => true,
'delete_get_calendar_cache' => true,
'disabled' => true,
'do_shortcode' => true, | Add count() to the list of auto-escaped functions
Fixes #<I> | WordPress-Coding-Standards_WordPress-Coding-Standards | train | php |
6fdf4e391866d2c168d09a6b03a4e693716fcd8c | diff --git a/symphony/lib/toolkit/trait.databasewheredefinition.php b/symphony/lib/toolkit/trait.databasewheredefinition.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/toolkit/trait.databasewheredefinition.php
+++ b/symphony/lib/toolkit/trait.databasewheredefinition.php
@@ -76,12 +76,12 @@ trait DatabaseWhereDefinition
if ($k === 'or' || $k === 'and') {
$K = strtoupper($k);
return '(' . implode(" $K ", array_map(function ($k) use ($c) {
- return $this->buildWhereClauseFromArray([$k => $c[$k]]);
+ return $this->buildSingleWhereClauseFromArray($k, $c[$k]);
}, array_keys($c))) . ')';
// key is the VALUES_DELIMITER (i.e. a comma `,`)
} elseif ($k === self::VALUES_DELIMITER) {
return implode(self::LIST_DELIMITER, General::array_map(function ($k, $c) {
- return $this->buildWhereClauseFromArray([$k => $c]);
+ return $this->buildSingleWhereClauseFromArray($k, $c);
}, $c));
// first value key is the IN() function
} elseif ($vk === 'in' || $vk === 'not in') { | Remove not needed array pass
We can simply call the single version directly
Picked from f<I>aebebce
Picked from <I>ef8a<I>e5 | symphonycms_symphony-2 | train | php |
7286fd442fa74f63e9ff00229c4e31fd8e8fe419 | diff --git a/lib/puppetserver/ca/version.rb b/lib/puppetserver/ca/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppetserver/ca/version.rb
+++ b/lib/puppetserver/ca/version.rb
@@ -1,5 +1,5 @@
module Puppetserver
module Ca
- VERSION = "2.0.1"
+ VERSION = "2.0.2"
end
end | (GEM) update puppetserver-ca version to <I> | puppetlabs_puppetserver-ca-cli | train | rb |
6df9013ac42125dbfcd753a3cb84f08f150776ee | diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/MethodTransformer.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/MethodTransformer.java
index <HASH>..<HASH> 100644
--- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/MethodTransformer.java
+++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/MethodTransformer.java
@@ -17,7 +17,7 @@ import static net.bytebuddy.utility.ByteBuddyCommons.nonNull;
/**
* A method transformer allows to transform a method prior to its definition. This way, previously defined methods
* can be substituted by a different method description. It is the responsibility of the method transformer that
- * the substitute method remains compatible to the substituted method.
+ * the substitute method remains signature compatible to the substituted method.
*/
public interface MethodTransformer { | Added additional information to javadoc. | raphw_byte-buddy | train | java |
943149031f2d4d0a07ddcaa02a49c38fd2913cc2 | diff --git a/php/wp-settings-cli.php b/php/wp-settings-cli.php
index <HASH>..<HASH> 100644
--- a/php/wp-settings-cli.php
+++ b/php/wp-settings-cli.php
@@ -107,8 +107,8 @@ require( ABSPATH . WPINC . '/link-template.php' );
require( ABSPATH . WPINC . '/author-template.php' );
require( ABSPATH . WPINC . '/post.php' );
require( ABSPATH . WPINC . '/post-template.php' );
-Utils\maybe_require( '3.5-alpha-23466', ABSPATH . WPINC . '/revision.php' );
-Utils\maybe_require( '3.5-alpha-23466', ABSPATH . WPINC . '/post-formats.php' );
+Utils\maybe_require( '3.6-alpha-23451', ABSPATH . WPINC . '/revision.php' );
+Utils\maybe_require( '3.6-alpha-23451', ABSPATH . WPINC . '/post-formats.php' );
require( ABSPATH . WPINC . '/post-thumbnail-template.php' );
require( ABSPATH . WPINC . '/category.php' );
require( ABSPATH . WPINC . '/category-template.php' ); | fix version check for revision.php and post-formats.php
* <I>-alpha, not <I>-alpha
* <I>, because $wp_version wasn't updated with r<I>
fixes #<I>. see #<I> | wp-cli_export-command | train | php |
9064a77148774533a6b259890ae05285319d60c7 | diff --git a/lib/actions/ProjectInit.js b/lib/actions/ProjectInit.js
index <HASH>..<HASH> 100644
--- a/lib/actions/ProjectInit.js
+++ b/lib/actions/ProjectInit.js
@@ -145,7 +145,7 @@ module.exports = function(SPlugin, serverlessPath) {
if (_this.evt.options.name) isName = true;
// Check if project exists
- if (_this.S.getProject()) {
+ if (_this.S.hasProject()) {
// Set temp name
name = _this.evt.options.name ? _this.evt.options.name : (_this.S.getProject().getName() + '-' + SUtils.generateShortId(6)).toLowerCase();
} else { | Updated unnecessary getProject() with hasProject() | serverless_serverless | train | js |
0d854f0945e4a17bd24f11f6350e82f66a00914c | diff --git a/fusionbox/forms/forms.py b/fusionbox/forms/forms.py
index <HASH>..<HASH> 100644
--- a/fusionbox/forms/forms.py
+++ b/fusionbox/forms/forms.py
@@ -91,7 +91,10 @@ class SearchForm(BaseChangeListForm):
else:
kwarg = {field + '__icontains': q}
args.append(Q(**kwarg))
- qs = qs.filter(reduce(lambda x,y: x|y, args))
+ if len(args) > 1:
+ qs = qs.filter(reduce(lambda x,y: x|y, args))
+ elif len(args) == 1:
+ qs = qs.filter(args[0])
qs = self.post_search(qs) | added catch in search form for zero or one length search fields parameters | fusionbox_django-argonauts | train | py |
4025b4885b4675ba5697a71f92f05ba563f73089 | diff --git a/modules/system/assets/js/framework.extras.js b/modules/system/assets/js/framework.extras.js
index <HASH>..<HASH> 100644
--- a/modules/system/assets/js/framework.extras.js
+++ b/modules/system/assets/js/framework.extras.js
@@ -43,7 +43,7 @@
$field
$.each(fields, function(fieldName, fieldMessages) {
- $field = $('[data-validate-for='+fieldName+']', $this)
+ $field = $('[data-validate-for="'+fieldName+'"]', $this)
messages = $.merge(messages, fieldMessages)
if (!!$field.length) {
if (!$field.text().length || $field.data('emptyMode') == true) { | fix for array fields validation in client-side framework | octobercms_october | train | js |
8caaae601baf7065ab8fcd4293ac07fbd979d7d2 | diff --git a/javascript/ToggleCompositeField.js b/javascript/ToggleCompositeField.js
index <HASH>..<HASH> 100644
--- a/javascript/ToggleCompositeField.js
+++ b/javascript/ToggleCompositeField.js
@@ -5,6 +5,7 @@
this._super();
this.accordion({
+ heightStyle: "content",
collapsible: true,
active: (this.hasClass("ss-toggle-start-closed")) ? false : 0
}); | BUG Fix accordion sometimes displaying scrollbars | silverstripe_silverstripe-framework | train | js |
b928f7c021d3ca8810de14b1c94b5800f39bcd0c | diff --git a/asset/resource.py b/asset/resource.py
index <HASH>..<HASH> 100644
--- a/asset/resource.py
+++ b/asset/resource.py
@@ -279,6 +279,21 @@ def load(pattern, *args, **kws):
return Asset(group, pkgname, pkgpat)
#------------------------------------------------------------------------------
+def exists(pattern, *args, **kws):
+ '''
+ Helper method to check to see if a `load` will be successful,
+ effectively identical to::
+
+ from asset import load, NoSuchAsset
+ try:
+ load(pattern).peek()
+ return True
+ except NoSuchAsset:
+ return False
+ '''
+ return load(pattern, *args, **kws).exists()
+
+#------------------------------------------------------------------------------
def chunks(stream, size=None):
'''
Returns a generator of chunks from the `stream` with a maximum | added top-level `exists` helper method | metagriffin_asset | train | py |
045643f8bc2318e3eb0ca39c899b422aa553c420 | diff --git a/lib/hector/channel.rb b/lib/hector/channel.rb
index <HASH>..<HASH> 100644
--- a/lib/hector/channel.rb
+++ b/lib/hector/channel.rb
@@ -55,8 +55,8 @@ module Hector
end
def names(session)
- session.respond_with(353, channel_name, :text => sessions.map { |session| session.nickname }.join(" "))
- session.respond_with(366, channel_name, :text => "End of /NAMES list.");
+ session.respond_with(353, session.nickname, '=', channel_name, :text => sessions.map { |session| session.nickname }.join(" "))
+ session.respond_with(366, session.nickname, channel_name, :text => "End of /NAMES list.");
end
def join(session) | Colloquy would not connect to channels property without the nickname prefixed here and the channel type '=' | sstephenson_hector | train | rb |
11c26b04cde436df0f5c0d03d0189fdb204bbfe3 | diff --git a/spec/assessorSpec.js b/spec/assessorSpec.js
index <HASH>..<HASH> 100644
--- a/spec/assessorSpec.js
+++ b/spec/assessorSpec.js
@@ -83,7 +83,7 @@ describe( "an assessor object", function() {
/**
* A mock marker function.
*
- * @returns {void}.
+ * @returns {void}
*/
marker: function() {},
} ); | Remove full-stop at the end of the comment in spec/assessorSpec.js | Yoast_YoastSEO.js | train | js |
2112599858a655836afef613b0def004db3c053d | diff --git a/cchecker.py b/cchecker.py
index <HASH>..<HASH> 100755
--- a/cchecker.py
+++ b/cchecker.py
@@ -92,7 +92,7 @@ def main():
parser.add_argument('-l', '--list-tests', action='store_true',
help='List the available tests')
- parser.add_argument('-d', '--download-standard-names', nargs='?',
+ parser.add_argument('-d', '--download-standard-names',
help=("Specify a version of the cf standard name table"
" to download as packaged version")) | Revert accidental `nargs='?'` addition to `-d` | ioos_compliance-checker | train | py |
2fd6dc1f77138e767ae44d209e387e88461bdce3 | diff --git a/analytical/templatetags/google_analytics.py b/analytical/templatetags/google_analytics.py
index <HASH>..<HASH> 100644
--- a/analytical/templatetags/google_analytics.py
+++ b/analytical/templatetags/google_analytics.py
@@ -50,6 +50,7 @@ ALLOW_LINKER_CODE = "_gaq.push(['_setAllowLinker', true]);"
CUSTOM_VAR_CODE = "_gaq.push(['_setCustomVar', %(index)s, '%(name)s', " \
"'%(value)s', %(scope)s]);"
SITE_SPEED_CODE = "_gaq.push(['_trackPageLoadTime']);"
+ANONYMIZE_IP_CODE = "_gaq.push (['_gat._anonymizeIp']);"
register = Library()
@@ -120,6 +121,8 @@ class GoogleAnalyticsNode(Node):
commands = []
if getattr(settings, 'GOOGLE_ANALYTICS_SITE_SPEED', False):
commands.append(SITE_SPEED_CODE)
+ if getattr(settings, 'GOOGLE_ANALYTICS_ANONYMIZE_IP', False):
+ commands.append(ANONYMIZE_IP_CODE)
return commands
def contribute_to_analytical(add_node): | add ip anonymization setting to google analytics | jazzband_django-analytical | train | py |
3b5fad02d984cbb31a830709291cb20de8edbfea | diff --git a/src/lib/widget.js b/src/lib/widget.js
index <HASH>..<HASH> 100644
--- a/src/lib/widget.js
+++ b/src/lib/widget.js
@@ -131,7 +131,6 @@ define([
then(function(storageInfo) {
return requestToken(storageInfo.properties['auth-endpoint']);
}).
- then(requestToken).
then(schedule.enable, util.curry(setState, 'error'));
} | widget: removed duplicate call to requestToken that mysteriously didn't break anything... | remotestorage_remotestorage.js | train | js |
e8c4b3465b658911c276b945ab2a81a8f44ae252 | diff --git a/bddrest/tests/test_call.py b/bddrest/tests/test_call.py
index <HASH>..<HASH> 100644
--- a/bddrest/tests/test_call.py
+++ b/bddrest/tests/test_call.py
@@ -185,6 +185,9 @@ def test_querystring_parser():
assert '/:id' == call.url
assert dict(a='1') == call.query
+ call = FirstCall('Testing querystring parsing', url='/id: 1?a=1&a=2')
+ assert dict(a=['1','2']) == call.query
+
def test_form_parser():
pyload = dict(a=1, b=2) | Another test has been added for query string parser about multiple query strings with the same name | Carrene_bddrest | train | py |
6452dc2abe2f0704a477f95bc15a96e7ae4cb286 | diff --git a/ApiBundle/Controller/ContentController.php b/ApiBundle/Controller/ContentController.php
index <HASH>..<HASH> 100644
--- a/ApiBundle/Controller/ContentController.php
+++ b/ApiBundle/Controller/ContentController.php
@@ -280,7 +280,7 @@ class ContentController extends BaseController
$siteId,
$published,
10,
- array('updateAt' => -1)
+ array('createdAt' => -1)
);
return $this->get('open_orchestra_api.transformer_manager')->get('content_collection')->transform($content);
diff --git a/ApiBundle/Controller/NodeController.php b/ApiBundle/Controller/NodeController.php
index <HASH>..<HASH> 100644
--- a/ApiBundle/Controller/NodeController.php
+++ b/ApiBundle/Controller/NodeController.php
@@ -151,7 +151,7 @@ class NodeController extends BaseController
$siteId,
$published,
10,
- array('updateAt' => -1)
+ array('createdAt' => -1)
);
return $this->get('open_orchestra_api.transformer_manager')->get('node_collection')->transform($nodes); | sort by created instead of update to ensure dashboard view | open-orchestra_open-orchestra-cms-bundle | train | php,php |
d8a2c541823fad0a5d1458a08e991ca4cc7fd216 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -24,8 +24,8 @@ module.exports = function(grunt) {
coverage: true,
legend: true,
check: {
- lines: 90,
- statements: 90
+ lines: 68,
+ statements: 70
},
root: './lib',
reportFormats: ['lcov'] | Adjust limits to meet what we have currently | xmpp-ftw_xmpp-ftw | train | js |
2b3ea4a7683ed0a478ed04ba2936f152f9b6c49d | diff --git a/functions.php b/functions.php
index <HASH>..<HASH> 100644
--- a/functions.php
+++ b/functions.php
@@ -38,7 +38,14 @@ $required_wp = '4.3';
$current_wp = get_bloginfo( 'version' );
if ( version_compare( $current_wp, $required_wp, '<' ) ) {
- $messages[] = sprintf( esc_html__( 'This theme requires WordPress version %1$s or newer. Update WordPress.', 'jentil' ), $required_wp, $current_wp );
+ if ( current_user_can( 'update_core' ) ) {
+ $string = esc_html__( 'This theme requires WordPress version %1$s or newer. Your current version is %2$s.', 'jentil' );
+ $string .= ' <a href="' . network_admin_url( '/update-core.php' ) . '">' . esc_html__( 'Update WordPress', 'jentil' ) . '</a>.';
+ } else {
+ $string = esc_html__( 'This theme requires WordPress version %1$s or newer.', 'jentil' );
+ }
+
+ $messages[] = sprintf( $string, $required_wp, $current_wp );
}
/** | updated the message for required WP version | GrottoPress_jentil | train | php |
eae580391009d8eca1137f01aa8d2a8e30cb9e4e | diff --git a/zipline/data/benchmarks.py b/zipline/data/benchmarks.py
index <HASH>..<HASH> 100644
--- a/zipline/data/benchmarks.py
+++ b/zipline/data/benchmarks.py
@@ -120,7 +120,8 @@ def get_benchmark_returns(symbol, start_date=None, end_date=None):
benchmark_returns = []
for i, data_point in enumerate(data_points):
if i == 0:
- returns = 0
+ curr_open = data_points[i]['open']
+ returns = (data_points[i]['close'] - curr_open) / curr_open
else:
prev_close = data_points[i-1]['close']
returns = (data_point['close'] - prev_close) / prev_close | BUG: Calculate benchmark returns for first day
Before we were setting benchmark returns on the first day
to 0. This commit changes this by calculating the benchmark
return from open to close.
According to @eherbert this is also what the answer key does. | quantopian_zipline | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.