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 |
|---|---|---|---|---|---|
33b14858f33332a8b900f7e41bf37bb74a193056 | diff --git a/tests/TestCase/Datasource/PaginatorTest.php b/tests/TestCase/Datasource/PaginatorTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Datasource/PaginatorTest.php
+++ b/tests/TestCase/Datasource/PaginatorTest.php
@@ -17,7 +17,6 @@ declare(strict_types=1);
namespace Cake\Test\TestCase\Datasource;
use Cake\ORM\Entity;
-use Cake\TestSuite\Fixture\TransactionStrategy;
use Cake\TestSuite\TestCase;
class PaginatorTest extends TestCase
@@ -25,11 +24,6 @@ class PaginatorTest extends TestCase
use PaginatorTestTrait;
/**
- * @inheritDoc
- */
- protected $stateResetStrategy = TransactionStrategy::class;
-
- /**
* fixtures property
*
* @var array | Remove transaction state management from another test
This relies on fixed auto-increment values as well. | cakephp_cakephp | train | php |
84c820295606cec754869a85684a0f80800f7fb3 | diff --git a/a10_neutron_lbaas/tests/unit/v1/test_handler_pool.py b/a10_neutron_lbaas/tests/unit/v1/test_handler_pool.py
index <HASH>..<HASH> 100644
--- a/a10_neutron_lbaas/tests/unit/v1/test_handler_pool.py
+++ b/a10_neutron_lbaas/tests/unit/v1/test_handler_pool.py
@@ -93,14 +93,15 @@ class TestPools(test_base.UnitTestBase):
def test_update_remove_monitor(self):
old_pool = self.fake_pool('TCP', 'LEAST_CONNECTIONS')
- old_pool['health_monitors_status'] = [{'monitor_id': 'hm1'}]
+ fake_mon = {'monitor_id': 'hm1'}
+ old_pool['health_monitors_status'] = [fake_mon]
pool = self.fake_pool('TCP', 'ROUND_ROBIN')
pool['health_monitors_status'] = []
self.a.pool.update(None, old_pool, pool)
self.print_mocks()
self.a.last_client.slb.service_group.update.assert_called()
- self.a.last_client.slb.hm.delete.assert_called()
+ self.a.last_client.slb.hm.delete.assert_called(self.a.hm._name(fake_mon))
def test_delete(self):
pool = self.fake_pool('TCP', 'LEAST_CONNECTIONS') | Another passing test. Next tests are update-oriented. | a10networks_a10-neutron-lbaas | train | py |
33f3ff4df105b9fe6574efca24b623b10df68597 | diff --git a/lib/specjour/rsync_daemon.rb b/lib/specjour/rsync_daemon.rb
index <HASH>..<HASH> 100644
--- a/lib/specjour/rsync_daemon.rb
+++ b/lib/specjour/rsync_daemon.rb
@@ -15,7 +15,7 @@ module Specjour
def start
write_config
system("rsync", "--daemon", "--config=#{config_file}", "--port=8989")
- at_exit { puts 'shutting down rsync'; stop }
+ at_exit { stop }
end
def stop | Rsync Daemon stops quietly | sandro_specjour | train | rb |
11350b02dbbe321a2f22cbf2de39d25447015272 | diff --git a/src/components/button/component.js b/src/components/button/component.js
index <HASH>..<HASH> 100644
--- a/src/components/button/component.js
+++ b/src/components/button/component.js
@@ -33,7 +33,16 @@ export let Button = xcomponent.create({
scrolling: false,
containerTemplate,
- componentTemplate,
+ componentTemplate({ props, htmlDom } : { props : Object, htmlDom : Function }) : HTMLElement {
+
+ let template = htmlDom(componentTemplate({ props }));
+
+ template.addEventListener('click', () => {
+ $logger.warn('button_pre_template_click');
+ });
+
+ return template;
+ },
sacrificialComponentTemplate: true, | Log if button clicked before fully loaded | paypal_paypal-checkout-components | train | js |
42e97012e428f0a0b91a11c152b12920031265d3 | diff --git a/wcmatch/_wcparse.py b/wcmatch/_wcparse.py
index <HASH>..<HASH> 100644
--- a/wcmatch/_wcparse.py
+++ b/wcmatch/_wcparse.py
@@ -73,6 +73,7 @@ EXT_TYPES = frozenset(('*', '?', '+', '@', '!'))
# Common flags are found between `0x0001 - 0xffff`
# Implementation specific (`glob` vs `fnmatch` vs `wcmatch`) are found between `0x00010000 - 0xffff0000`
# Internal special flags are found at `0x100000000` and above
+CASE = 0x0001
IGNORECASE = 0x0002
RAWCHARS = 0x0004
NEGATE = 0x0008
@@ -90,7 +91,6 @@ NODIR = 0x4000
NEGATEALL = 0x8000
FORCEWIN = 0x10000
FORCEUNIX = 0x20000
-CASE = 0x40000
# Internal flag
_TRANSLATE = 0x100000000 # Lets us know we are performing a translation, and we just want the regex. | CASE flag now takes the value of the old retired FORCECASE
As this is an internal value, and users should be using the flag and
not the value, this should be fine. | facelessuser_wcmatch | train | py |
277759b3335fd0a1396a4cfdb401c8f98b9b7eda | diff --git a/golbin/run.go b/golbin/run.go
index <HASH>..<HASH> 100644
--- a/golbin/run.go
+++ b/golbin/run.go
@@ -7,19 +7,22 @@ import (
"fmt"
)
+
type Console struct {
Command, StdInput, StdOutput string
}
-func start_Command(sys_Command string) *exec.Cmd{
- cmd_tokens := strings.Split(sys_Command, " ")
+
+func start_command(sys_command string) *exec.Cmd{
+ cmd_tokens := strings.Split(sys_command, " ")
cmd := cmd_tokens[0]
args := strings.Join(cmd_tokens[1:], " ")
return exec.Command(cmd, args)
}
+
func (konsole *Console) Run() {
- cmd := start_Command(konsole.Command)
+ cmd := start_command(konsole.Command)
if konsole.StdInput != ""{ cmd.Stdin = strings.NewReader(konsole.StdInput) }
@@ -33,6 +36,7 @@ func (konsole *Console) Run() {
}
}
+
func ExecOutput(cmdline string) string {
cmd := start_Command(cmdline) | [golbin] naming Case correction | abhishekkr_gol | train | go |
08cf3fcc30e114a4f170a567670d227333505c2a | diff --git a/spec/integration/run_flag_spec.rb b/spec/integration/run_flag_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/run_flag_spec.rb
+++ b/spec/integration/run_flag_spec.rb
@@ -4,12 +4,20 @@ describe 'overcommit --run' do
subject { shell(%w[overcommit --run]) }
context 'when using an existing pre-commit hook script' do
+ if Overcommit::OS.windows?
+ let(:script_name) { 'test-script.exe' }
+ let(:script_contents) { 'exit 0' }
+ else
+ let(:script_name) { 'test-script' }
+ let(:script_contents) { "#!/bin/bash\nexit 0" }
+ end
+
let(:config) do
{
'PreCommit' => {
'MyHook' => {
'enabled' => true,
- 'required_executable' => './test-script',
+ 'required_executable' => "./#{script_name}",
}
}
}
@@ -18,9 +26,9 @@ describe 'overcommit --run' do
around do |example|
repo do
File.open('.overcommit.yml', 'w') { |f| f.puts(config.to_yaml) }
- echo("#!/bin/bash\nexit 0", 'test-script')
- `git add test-script`
- FileUtils.chmod(0755, 'test-script')
+ echo(script_contents, script_name)
+ `git add #{script_name}`
+ FileUtils.chmod(0755, script_name)
example.run
end
end | Use different script name and contents for Windows | sds_overcommit | train | rb |
9d3df3a6a9b54e614b29c2a6cc7b70abb64cebaa | diff --git a/bin/fuzzy-redirect-server.js b/bin/fuzzy-redirect-server.js
index <HASH>..<HASH> 100755
--- a/bin/fuzzy-redirect-server.js
+++ b/bin/fuzzy-redirect-server.js
@@ -11,7 +11,8 @@
, subdir = process.argv[4] || ''
, server
;
-
+
+ app.use(connect.favicon());
app.use(connect.static(directory));
app.use(connect.directory(directory)); | added favicon for easier debugging
all them daggon' favicon requests always showing up that I have no interest in. | solderjs_blogger2jekyll | train | js |
4bf2961869bd92de59c55f43694da33dd93a152e | diff --git a/src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java b/src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java
index <HASH>..<HASH> 100644
--- a/src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java
+++ b/src/main/java/nl/hsac/fitnesse/fixture/slim/SlimFixture.java
@@ -220,7 +220,7 @@ public class SlimFixture implements InteractionAwareFixture {
*/
public static class PollCompletion extends FunctionalCompletion {
public PollCompletion(Supplier<Boolean> isFinishedSupplier) {
- super(isFinishedSupplier, () -> {});
+ super(isFinishedSupplier, null);
}
}
@@ -246,7 +246,9 @@ public class SlimFixture implements InteractionAwareFixture {
@Override
public void repeat() {
- repeater.run();
+ if (repeater != null) {
+ repeater.run();
+ }
}
public void setIsFinishedSupplier(Supplier<Boolean> isFinishedSupplier) { | Remove need for no-op runnable if no repeat is needed | fhoeben_hsac-fitnesse-fixtures | train | java |
d3af53d03f3314c1511d42bc39fbe9bf69196f2d | diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go
index <HASH>..<HASH> 100644
--- a/pkg/features/kube_features.go
+++ b/pkg/features/kube_features.go
@@ -589,6 +589,7 @@ const (
// owner: @robscott
// kep: http://kep.k8s.io/2433
// alpha: v1.21
+ // beta: v1.23
//
// Enables topology aware hints for EndpointSlices
TopologyAwareHints featuregate.Feature = "TopologyAwareHints"
@@ -890,7 +891,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
ProbeTerminationGracePeriod: {Default: false, PreRelease: featuregate.Beta}, // Default to false in beta 1.22, set to true in 1.24
NodeSwap: {Default: false, PreRelease: featuregate.Alpha},
PodDeletionCost: {Default: true, PreRelease: featuregate.Beta},
- TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha},
+ TopologyAwareHints: {Default: false, PreRelease: featuregate.Beta},
PodAffinityNamespaceSelector: {Default: true, PreRelease: featuregate.Beta},
ServiceLoadBalancerClass: {Default: true, PreRelease: featuregate.Beta},
IngressClassNamespacedParams: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 | Bumping TopologyAwareHints feature gate to beta | kubernetes_kubernetes | train | go |
2a84d033d19741ac7ddb04be8555695a0da7ac07 | diff --git a/lib/ApiAdmin.php b/lib/ApiAdmin.php
index <HASH>..<HASH> 100644
--- a/lib/ApiAdmin.php
+++ b/lib/ApiAdmin.php
@@ -83,7 +83,7 @@ class ApiAdmin extends ApiWeb {
function isAjaxOutput(){
// TODO: chk, i wonder if you pass any arguments through get when in ajax mode. Well
// if you do, then make a check here. Form_Field::displayFieldError relies on this.
- return true;
+ return false;
}
diff --git a/lib/static.php b/lib/static.php
index <HASH>..<HASH> 100644
--- a/lib/static.php
+++ b/lib/static.php
@@ -7,7 +7,7 @@ function lowlevel_error($error,$lev=null){
/*
* This function will be called for low level fatal errors
*/
- echo "<font color=red>Low level error:</font> $error (note: please use exception instead)<br>";
+ echo "<font color=red>Low level error:</font> $error<br>";
exit;
}
};if(!function_exists('error_handler')){ | fixed dummy method. Now it won't think every form was submitted with ajax, and it's back to how it was before previous commit | atk4_atk4 | train | php,php |
98a7670c0d6a72171149be005b357d9093385f6a | diff --git a/clients/web/src/models/FileModel.js b/clients/web/src/models/FileModel.js
index <HASH>..<HASH> 100644
--- a/clients/web/src/models/FileModel.js
+++ b/clients/web/src/models/FileModel.js
@@ -4,6 +4,7 @@ import FolderModel from 'girder/models/FolderModel';
import ItemModel from 'girder/models/ItemModel';
import Model from 'girder/models/Model';
import { restRequest, uploadHandlers, getUploadChunkSize } from 'girder/rest';
+import 'girder/utilities/S3UploadHandler'; // imported for side effect
var FileModel = Model.extend({
resourceName: 'file', | Import S3 upload handler via FileModel
This makes it so that any downstreams that use the FileModel or
the UploadWidget will also support direct-to-S3 uploads, since
unfortunately this module has to be imported for a side effect.
Refs <URL> | girder_girder | train | js |
93e128931f84ca1b921e1eb9ae4331fc207365d2 | diff --git a/test/server/SimpleServer.js b/test/server/SimpleServer.js
index <HASH>..<HASH> 100644
--- a/test/server/SimpleServer.js
+++ b/test/server/SimpleServer.js
@@ -221,7 +221,7 @@ class SimpleServer {
return;
}
response.setHeader('Cache-Control', 'public, max-age=31536000');
- response.setHeader('Last-Modified', this._startTime.toString());
+ response.setHeader('Last-Modified', this._startTime.toISOString());
} else {
response.setHeader('Cache-Control', 'no-cache, no-store');
} | test: make tests work on non-English locales (#<I>)
`Data.prototype.toString` may return non-ASCII characters, which aren't accepted by `setHeader`.
E.g., on Russian locale, it might look like this:
```
> new Date().toString()
'Thu Jun <I> <I> <I>:<I>:<I> GMT<I> (Финляндия (лето))'
``` | GoogleChrome_puppeteer | train | js |
e961f9f2a7e58ae0562cf347e03bc2e5a66b8e48 | diff --git a/shared/folders/index.desktop.js b/shared/folders/index.desktop.js
index <HASH>..<HASH> 100644
--- a/shared/folders/index.desktop.js
+++ b/shared/folders/index.desktop.js
@@ -74,9 +74,8 @@ class FoldersRender extends Component<Props> {
<TabBar
styleTabBar={{
...tabBarStyle,
- backgroundColor: !this.props.smallMode && !this.props.installed
- ? globalColors.grey
- : globalColors.white,
+ backgroundColor: globalColors.white,
+ opacity: !this.props.smallMode && !this.props.installed ? 0.4 : 1,
minHeight: this.props.smallMode ? 32 : 48,
}}
>
diff --git a/shared/folders/row.desktop.js b/shared/folders/row.desktop.js
index <HASH>..<HASH> 100644
--- a/shared/folders/row.desktop.js
+++ b/shared/folders/row.desktop.js
@@ -146,7 +146,8 @@ const Row = ({
const containerStyle = {
...styles.rowContainer,
minHeight: smallMode ? 40 : 48,
- backgroundColor: !smallMode && !installed ? globalColors.grey : globalColors.white,
+ backgroundColor: globalColors.white,
+ opacity: !smallMode && !installed ? 0.4 : 1,
}
return ( | Changed grey background to <I>% opaque (#<I>) | keybase_client | train | js,js |
b2ccf3e7614f2d4704b7148a64ec375f610a8f5d | diff --git a/PyFin/__init__.py b/PyFin/__init__.py
index <HASH>..<HASH> 100644
--- a/PyFin/__init__.py
+++ b/PyFin/__init__.py
@@ -7,7 +7,7 @@ Created on 2015-7-9
__all__ = ['__version__', 'API', 'DateUtilities', 'Enums', 'Env', 'Math', 'PricingEngines', 'Risk', 'AlgoTrading']
-__version__ = "0.3.3"
+__version__ = "0.3.4"
import PyFin.API as API
import PyFin.DateUtilities as DateUtilities | update version number to <I> | alpha-miner_Finance-Python | train | py |
e9047ad08b015787409166dd8d816777988ca8d4 | diff --git a/fusesoc/section/__init__.py b/fusesoc/section/__init__.py
index <HASH>..<HASH> 100644
--- a/fusesoc/section/__init__.py
+++ b/fusesoc/section/__init__.py
@@ -235,7 +235,10 @@ Verilog top module : {top_module}
args += ['-DVL_PRINTF=printf']
args += ['-DVM_TRACE=1']
args += ['-DVM_COVERAGE=0']
- args += ['-I'+os.getenv('SYSTEMC_INCLUDE')]
+ if os.getenv('SYSTEMC_INCLUDE'):
+ args += ['-I'+os.getenv('SYSTEMC_INCLUDE')]
+ if os.getenv('SYSTEMC'):
+ args += ['-I'+os.path.join(os.getenv('SYSTEMC'),'include')]
args += ['-Wno-deprecated']
if os.getenv('SYSTEMC_CXX_FLAGS'):
args += [os.getenv('SYSTEMC_CXX_FLAGS')] | section/verilator: add $(SYSTEMC)/include to include dirs
Also, only add the SYSTEMC_INCLUDE environment variable to
the include dirs if it's set. | olofk_fusesoc | train | py |
480d7678664fc08613ba02eee5f0556479a10172 | diff --git a/numdifftools/tests/test_numdifftools.py b/numdifftools/tests/test_numdifftools.py
index <HASH>..<HASH> 100644
--- a/numdifftools/tests/test_numdifftools.py
+++ b/numdifftools/tests/test_numdifftools.py
@@ -461,7 +461,9 @@ def approx_fprime(x, f, epsilon=None, args=(), kwargs=None, centered=True):
class TestJacobian(unittest.TestCase):
@staticmethod
def test_scalar_to_vector():
- fun = lambda x: np.array([x, x**2, x**3])
+ def fun(x):
+ return np.array([x, x**2, x**3])
+
val = np.random.randn()
j0 = nd.Jacobian(fun)(val)
assert np.allclose(j0, [1., 2*val, 3*val**2]) | Replace lambda function with a def | pbrod_numdifftools | train | py |
f7d846094a5dc642198cc4939df646a3e889a750 | diff --git a/daemon/cluster/cluster.go b/daemon/cluster/cluster.go
index <HASH>..<HASH> 100644
--- a/daemon/cluster/cluster.go
+++ b/daemon/cluster/cluster.go
@@ -39,7 +39,6 @@ package cluster
//
import (
- "crypto/x509"
"fmt"
"net"
"os"
@@ -171,13 +170,8 @@ func New(config Config) (*Cluster, error) {
logrus.Error("swarm component could not be started before timeout was reached")
case err := <-nr.Ready():
if err != nil {
- if errors.Cause(err) == errSwarmLocked {
- return c, nil
- }
- if err, ok := errors.Cause(c.nr.err).(x509.CertificateInvalidError); ok && err.Reason == x509.Expired {
- return c, nil
- }
- return nil, errors.Wrap(err, "swarm component could not be started")
+ logrus.WithError(err).Error("swarm component could not be started")
+ return c, nil
}
}
return c, nil | cluster: Proceed with startup if cluster component can't be created
The current behavior is for dockerd to fail to start if the swarm
component can't be started for some reason. This can be difficult to
debug remotely because the daemon won't be running at all, so it's not
possible to hit endpoints like /info to see what's going on. It's also
very difficult to recover from the situation, since commands like
"docker swarm leave" are unavailable.
Change the behavior to allow startup to proceed. | moby_moby | train | go |
9494955f8e5a64a6abd126049e11f916d3121ac9 | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -371,6 +371,17 @@ type Server struct {
// msg to the client if there are more than Server.Concurrency concurrent
// handlers h are running at the moment.
func TimeoutHandler(h RequestHandler, timeout time.Duration, msg string) RequestHandler {
+ return TimeoutWithCodeHandler(h,timeout,msg, StatusRequestTimeout)
+}
+
+// TimeoutWithCodeHandler creates RequestHandler, which returns an error with
+// the given msg and status code to the client if h didn't return during
+// the given duration.
+//
+// The returned handler may return StatusTooManyRequests error with the given
+// msg to the client if there are more than Server.Concurrency concurrent
+// handlers h are running at the moment.
+func TimeoutWithCodeHandler(h RequestHandler, timeout time.Duration, msg string, statusCode int) RequestHandler {
if timeout <= 0 {
return h
}
@@ -398,7 +409,7 @@ func TimeoutHandler(h RequestHandler, timeout time.Duration, msg string) Request
select {
case <-ch:
case <-ctx.timeoutTimer.C:
- ctx.TimeoutError(msg)
+ ctx.TimeoutErrorWithCode(msg, statusCode)
}
stopTimer(ctx.timeoutTimer)
} | ADD TimeoutWithCodeHandler support (#<I>)
* ADD TimeoutWithCodeHandler support
* FIX description | valyala_fasthttp | train | go |
7197aec04be7af2d8fd097da0a78eb3bf51edc97 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -239,7 +239,7 @@ function smartMergeTests(merge, loadersKey) {
assert.deepEqual(merge(a, b), result);
});
- it('should compare loaders by their whole name ' + loadersKey, function () {
+ it('should compare loaders by their whole name with ' + loadersKey, function () {
const a = {};
a[loadersKey] = [{
test: /\.js$/, | Add missing "with" to test naming | survivejs_webpack-merge | train | js |
d0fd7154c599cd282e6dc7e060b87b90f1e06c93 | diff --git a/src/transformers/file_utils.py b/src/transformers/file_utils.py
index <HASH>..<HASH> 100644
--- a/src/transformers/file_utils.py
+++ b/src/transformers/file_utils.py
@@ -68,8 +68,12 @@ except (ImportError, AssertionError):
try:
import datasets # noqa: F401
- _datasets_available = True
- logger.debug(f"Succesfully imported datasets version {datasets.__version__}")
+ # Check we're not importing a "datasets" directory somewhere
+ _datasets_available = hasattr(datasets, "__version__") and hasattr(datasets, "load_dataset")
+ if _datasets_available:
+ logger.debug(f"Succesfully imported datasets version {datasets.__version__}")
+ else:
+ logger.debug("Imported a datasets object but this doesn't seem to be the 🤗 datasets library.")
except ImportError:
_datasets_available = False | Catch import datasets common errors (#<I>) | huggingface_pytorch-pretrained-BERT | train | py |
0f218133e25e9ba55bb061dc820714d3316d405d | diff --git a/IPython/html/widgets/interaction.py b/IPython/html/widgets/interaction.py
index <HASH>..<HASH> 100644
--- a/IPython/html/widgets/interaction.py
+++ b/IPython/html/widgets/interaction.py
@@ -210,6 +210,8 @@ def interactive(__interact_f, **kwargs):
container.kwargs[widget.description] = value
if co:
clear_output(wait=True)
+ if on_demand:
+ on_demand_button.disabled = True
try:
container.result = f(**container.kwargs)
except Exception as e:
@@ -218,6 +220,9 @@ def interactive(__interact_f, **kwargs):
container.log.warn("Exception in interact callback: %s", e, exc_info=True)
else:
ip.showtraceback()
+ finally:
+ if on_demand:
+ on_demand_button.disabled = False
# Wire up the widgets
# If we are doing on demand running, the callback is only triggered by the button | Disable run button until the function finishes | jupyter-widgets_ipywidgets | train | py |
6eaccece3840573a69d5e79bbd64fe0d7845b7eb | diff --git a/src/saml2/__init__.py b/src/saml2/__init__.py
index <HASH>..<HASH> 100644
--- a/src/saml2/__init__.py
+++ b/src/saml2/__init__.py
@@ -786,3 +786,27 @@ def extension_element_to_element(extension_element, translation_functions,
return None
+def extension_elements_to_elements(extension_elements, schemas):
+ """ Create a list of elements each one matching one of the
+ given extenstion elements. This is of course dependent on the access
+ to schemas that describe the extension elements.
+
+ :param extenstion_elements: The list of extension elements
+ :param schemas: Imported Python modules that represent the different
+ known schemas used for the extension elements
+ :return: A list of elements, representing the set of extension elements
+ that was possible to match against a Class in the given schemas.
+ The elements returned are the native representation of the elements
+ according to the schemas.
+ """
+ res = []
+ for extension_element in extension_elements:
+ for schema in schemas:
+ inst = extension_element_to_element(extension_element,
+ schema.ELEMENT_FROM_STRING,
+ schema.NAMESPACE)
+ if inst:
+ res.append(inst)
+ break
+
+ return res
\ No newline at end of file | Converting extension elemenst into elements | IdentityPython_pysaml2 | train | py |
67125a3f919e1aab8e50cf05911687e2505aa134 | diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb b/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb
index <HASH>..<HASH> 100644
--- a/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb
+++ b/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb
@@ -66,9 +66,11 @@ module Middleman
super(store, path)
end
+ # rubocop:disable Style/AccessorMethodName
def get_source_file
nil
end
+ # rubocop:enable Style/AccessorMethodName
def template?
true | Supress warning because of method name offense | middleman_middleman | train | rb |
fabd3fe6d226ad4af935550ca7aa4f7e4cf4f026 | diff --git a/classes/ezjsccssoptimizer.php b/classes/ezjsccssoptimizer.php
index <HASH>..<HASH> 100644
--- a/classes/ezjsccssoptimizer.php
+++ b/classes/ezjsccssoptimizer.php
@@ -70,7 +70,7 @@ class ezjscCssOptimizer
$css = str_replace( ':0 0 0 0;', ':0;', $css );
// Optimize hex colors from #bbbbbb to #bbb
- $css = preg_replace( "/#([0-9a-fA-F])\\1([0-9a-fA-F])\\2([0-9a-fA-F])\\3/", "#\\1\\2\\3", $css );
+ $css = preg_replace( "/color:#([0-9a-fA-F])\\1([0-9a-fA-F])\\2([0-9a-fA-F])\\3/", "color:#\\1\\2\\3", $css );
}
return $css;
} | Fix CSSOptimizer color hex regex to not apply to IE filters
This will cause the optimizer to not shorten color codes on some css properties, but fixes issues with filter: which extects color codes to always have 6 letters. | ezsystems_ezpublish-legacy | train | php |
9bd59bf175dc0cccb998d4b60df3d0b947b0fcde | diff --git a/src/Common/TimeExpression.php b/src/Common/TimeExpression.php
index <HASH>..<HASH> 100644
--- a/src/Common/TimeExpression.php
+++ b/src/Common/TimeExpression.php
@@ -197,6 +197,39 @@ class TimeExpression
}
/**
+ * Check if expression is valid
+ *
+ * @param $expression
+ * @return bool
+ */
+ public static function isValid($expression)
+ {
+ try {
+ new self($expression);
+ return true;
+ } catch (Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Try to create a TimeExpression.
+ * If fail, false is returned instead of throwing an exception
+ *
+ * @param $expression
+ * @return mixed
+ */
+ public static function createFrom($expression)
+ {
+ try {
+ $te = new self($expression);
+ return $te;
+ } catch (Exception $e) {
+ return false;
+ }
+ }
+
+ /**
* Decode expression
*
* @throws Exception | added static method isValid() and createFrom() | peakphp_framework | train | php |
5fa213e721cd44dba6671012706f1b3ef9491ff0 | diff --git a/soapbox/models.py b/soapbox/models.py
index <HASH>..<HASH> 100644
--- a/soapbox/models.py
+++ b/soapbox/models.py
@@ -39,11 +39,10 @@ class MessageManager(models.Manager):
URL.
"""
- results = set()
- for message in self.active():
- if message.is_global or message.match(url):
- results.add(message)
- return list(results)
+ return list({
+ message for message in self.active() if
+ message.is_global or message.match(url)
+ })
@python_2_unicode_compatible | Slightly cleaner approach to message matching.
This also has the side effect of explicitly breaking Python <I>
compatibility, which should not break anyone's install since Python
<I> is unsupported by any current version of Django, but is worth
noting. | ubernostrum_django-soapbox | train | py |
4d6f5946c83718bc81b464b2929ef9360345d59b | diff --git a/lib/stripe_mock/data.rb b/lib/stripe_mock/data.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe_mock/data.rb
+++ b/lib/stripe_mock/data.rb
@@ -10,13 +10,23 @@ module StripeMock
:object => "customer",
:id => "c_test_customer",
:active_card => {
- :type => "Visa",
+ :object => "card",
:last4 => "4242",
- :exp_month => 11,
+ :type => "Visa",
+ :exp_month => 12,
+ :exp_year => 2013,
+ :fingerprint => "3TQGpK9JoY1GgXPw",
:country => "US",
- :exp_year => 2012,
- :id => "cc_test_card",
- :object => "card"
+ :name => "From Here",
+ :address_line1 => nil,
+ :address_line2 => nil,
+ :address_city => nil,
+ :address_state => nil,
+ :address_zip => nil,
+ :address_country => nil,
+ :cvc_check => "pass",
+ :address_line1_check => nil,
+ :address_zip_check => nil
},
:created => 1304114758
}.merge(params) | Updated customer data mock to match stripe's api docs | rebelidealist_stripe-ruby-mock | train | rb |
b06c358afdc868b066879366155222b1e95c2ccb | diff --git a/src/pyshark/config.py b/src/pyshark/config.py
index <HASH>..<HASH> 100644
--- a/src/pyshark/config.py
+++ b/src/pyshark/config.py
@@ -4,10 +4,19 @@ from configparser import ConfigParser
import pyshark
-CONFIG_PATH = os.path.join(os.path.dirname(pyshark.__file__), 'config.ini')
+
+fp_config_path = os.path.join(os.getcwd(), 'config.ini') # get config from the current directory
+pyshark_config_path = os.path.join(os.path.dirname(pyshark.__file__), 'config.ini')
def get_config():
+ if os.path.exists(fp_config_path):
+ CONFIG_PATH = fp_config_path
+ elif os.path.exists(pyshark_config_path):
+ CONFIG_PATH = pyshark_config_path
+ else:
+ return None
+
config = ConfigParser()
config.read(CONFIG_PATH)
return config | Get `config.ini` from the current directory first. | KimiNewt_pyshark | train | py |
0464bb0037367017707681e2fb1635fd7942cc73 | diff --git a/src/Auth0/Login/LoginServiceProvider.php b/src/Auth0/Login/LoginServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Auth0/Login/LoginServiceProvider.php
+++ b/src/Auth0/Login/LoginServiceProvider.php
@@ -50,8 +50,11 @@ class LoginServiceProvider extends ServiceProvider {
public function register()
{
// Bind the auth0 name to a singleton instance of the Auth0 Service
+ $this->app->singleton(Auth0Service::class, function () {
+ return new Auth0Service();
+ });
$this->app->singleton('auth0', function () {
- return new Auth0Service();
+ return $this->app->make(Auth0Service::class);
});
// When Laravel logs out, logout the auth0 SDK trough the service | Added the Auth0Service as a singleton through the classname | auth0_laravel-auth0 | train | php |
fbc20bad843f428c0eaa349455c18281ad9fb41c | diff --git a/lib/ruck/clock.rb b/lib/ruck/clock.rb
index <HASH>..<HASH> 100644
--- a/lib/ruck/clock.rb
+++ b/lib/ruck/clock.rb
@@ -3,13 +3,17 @@ require "rubygems"
require "priority_queue"
module Ruck
- # Clock keeps track of events on a virtual timeline.
+ # Clock keeps track of events on a virtual timeline. Clocks can be
+ # configured to run fast or slow relative to another clock by
+ # changing their relative_rate and providing them a parent via
+ # add_child_clock.
#
# Clocks and their sub-clocks are always at the same time; they
# fast-forward in lock-step. You should not call fast_forward on
# a clock with a parent.
class Clock
attr_reader :now # current time in this clock's units
+ attr_accessor :relative_rate # rate relative to parent clock
def initialize(relative_rate = 1.0)
@relative_rate = relative_rate
@@ -68,6 +72,7 @@ module Ruck
protected
+ # returns [clock, [event, relative_time]]
def next_event_with_clock
possible = [] # set of clocks/events to find the min of
@@ -78,7 +83,7 @@ module Ruck
# earliest event of each child, converting to absolute time
possible += @children.map { |c| [c, c.next_event] }.map do |clock, (event, relative_time)|
- [clock, [event, unscale_time(now + relative_time)]] if event
+ [clock, [event, unscale_relative_time(relative_time)]] if event
end.compact
possible.min do |(clock1, (event1, time1)), (clock2, (event2, time2))| | a little more documentation of Clock | alltom_ruck | train | rb |
9bcf522c18ad5f862813f2997a1fd881b20562ba | diff --git a/lib/minicron/cli.rb b/lib/minicron/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/minicron/cli.rb
+++ b/lib/minicron/cli.rb
@@ -26,7 +26,7 @@ module Minicron
@commander.default_command :help
# Hide --trace and -t from the help menu, waiting on commander pull request
- # Commander::Runner.instance.disable_tracing
+ # @commander.disable_tracing
# Add a global option for verbose mode
@commander.global_option '--verbose', 'Turn on verbose mode' | Not using the singleton instance anymore | jamesrwhite_minicron | train | rb |
531b6d35b21148c1aea9586b383a97a7aa297d6a | diff --git a/dump2polarion/transform.py b/dump2polarion/transform.py
index <HASH>..<HASH> 100644
--- a/dump2polarion/transform.py
+++ b/dump2polarion/transform.py
@@ -13,6 +13,13 @@ import re
from dump2polarion.verdicts import Verdicts
+def only_passed_and_wait(result):
+ """Returns PASS and WAIT results only, skips everything else."""
+ verdict = result.get('verdict', '').strip().lower()
+ if verdict in Verdicts.PASS + Verdicts.WAIT:
+ return result
+
+
# pylint: disable=unused-argument
def get_results_transform_cfme(config):
"""Return result transformation function for CFME.""" | transform func that filters only passed and wait | mkoura_dump2polarion | train | py |
63f8c002838ad787f5911c458c53a59311c2344b | diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py
index <HASH>..<HASH> 100644
--- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py
+++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py
@@ -12,6 +12,6 @@ from ._shared_access_signature_credential import EventGridSharedAccessSignatureC
from ._version import VERSION
__all__ = ['EventGridPublisherClient', 'EventGridConsumer',
- 'CloudEvent', 'CustomEvent', 'DeserializedEvent', 'EventGridEvent', 'StorageBlobCreatedEventData'
+ 'CloudEvent', 'CustomEvent', 'DeserializedEvent', 'EventGridEvent', 'StorageBlobCreatedEventData',
'generate_shared_access_signature', 'EventGridSharedAccessSignatureCredential']
__version__ = VERSION | CI fix (#<I>) | Azure_azure-sdk-for-python | train | py |
39a6d583e33f44a29026d2be90f0d8c72b7f8967 | diff --git a/plugins/noembed/trumbowyg.noembed.js b/plugins/noembed/trumbowyg.noembed.js
index <HASH>..<HASH> 100644
--- a/plugins/noembed/trumbowyg.noembed.js
+++ b/plugins/noembed/trumbowyg.noembed.js
@@ -52,6 +52,10 @@
noembed: 'Incorporar',
noembedError: 'Erro'
},
+ ko: {
+ noembed: 'oEmbed 넣기',
+ noembedError: '에러'
+ },
},
plugins: { | feat: add korean translation to noembed plugin | Alex-D_Trumbowyg | train | js |
40a1a624982dbb5b428b1d158afe92da06dfbea8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ long_description = "\n\n".join([
setup(
name='marcxml_parser',
version=getVersion(changelog),
- description="MARC XML / OAI parser.",
+ description="MARC XML / OAI parser, with few highlevel getters.",
long_description=long_description,
url='https://github.com/edeposit/marcxml_parser',
@@ -34,8 +34,6 @@ setup(
package_dir={'': 'src'},
include_package_data=True,
- # scripts=[''],
-
zip_safe=False,
install_requires=[
'setuptools', | setup.py fixed. Package registered at pypi. Closes #2. | edeposit_marcxml_parser | train | py |
682c1ec16650c992dc9bbfbb55725a30e8d15615 | diff --git a/spyder/widgets/findinfiles.py b/spyder/widgets/findinfiles.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/findinfiles.py
+++ b/spyder/widgets/findinfiles.py
@@ -489,10 +489,12 @@ class FindOptions(QWidget):
@Slot()
def select_directory(self):
"""Select directory"""
+ self.parent().redirect_stdio.emit(False)
directory = getexistingdirectory(self, _("Select directory"),
self.path)
if directory:
directory = to_text_string(osp.abspath(to_text_string(directory)))
+ self.parent().redirect_stdio.emit(True)
return directory
def set_directory(self, directory): | Find in files: Restore redirect_stdio signal when selecting a directory | spyder-ide_spyder | train | py |
f34d5cbd0c2524ae9cb461272ae550043b0b72ef | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -5,6 +5,8 @@ module.exports = {
"sort-object-props": function(context) {
var caseSensitive = context.options[0].caseSensitive;
var ignoreMethods = context.options[0].ignoreMethods;
+ var ignorePrivate = context.options[0].ignorePrivate;
+
var MSG = "Property names in object literals should be sorted";
return {
"ObjectExpression": function(node) {
@@ -25,6 +27,11 @@ module.exports = {
lastPropId = lastPropId.toLowerCase();
propId = propId.toLowerCase();
}
+
+ if (ignorePrivate && /^_/.test(propId)) {
+ return prop;
+ }
+
if (propId < lastPropId) {
context.report(prop, MSG);
} | Add an `ignorePrivate` option.
With `ignorePrivate: true` set, all keys that start with a `_` are ignored. | jacobrask_eslint-plugin-sorting | train | js |
16b10ea6058a1339b25c01ee50a58b5f57f165a4 | diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Database/DetectsLostConnections.php
+++ b/src/Illuminate/Database/DetectsLostConnections.php
@@ -23,6 +23,7 @@ trait DetectsLostConnections
'Lost connection',
'is dead or not enabled',
'Error while sending',
+ 'decryption failed or bad record mac',
]);
}
} | Added another lost connection case for pgsql | laravel_framework | train | php |
41020dd24dd3e3b1bbcbc75c810eab3867d25ef9 | diff --git a/js/lib/ext.core.TemplateHandler.js b/js/lib/ext.core.TemplateHandler.js
index <HASH>..<HASH> 100644
--- a/js/lib/ext.core.TemplateHandler.js
+++ b/js/lib/ext.core.TemplateHandler.js
@@ -198,7 +198,9 @@ TemplateHandler.prototype._expandTemplate = function ( state, frame, cb, attribs
attribTokens = Util.flattenAndAppendToks(attribTokens, null, kv.k);
}
if (kv.v) {
- attribTokens = Util.flattenAndAppendToks(attribTokens, "=", kv.v);
+ attribTokens = Util.flattenAndAppendToks(attribTokens,
+ kv.k ? "=" : '',
+ kv.v);
}
attribTokens.push('|');
} ); | Fix re-joining of key/value pairs for invalid templates
The equal sign was inserted even for empty keys. One more parser test green.
Change-Id: I7f<I>a7c<I>bbffe<I>fbbcf<I>e<I>bd<I>f<I>d8 | wikimedia_parsoid | train | js |
27f4d636c51281b761c85f32dea69ba66c3b3ce5 | diff --git a/scripts/performance/perf_load/perf_client.py b/scripts/performance/perf_load/perf_client.py
index <HASH>..<HASH> 100644
--- a/scripts/performance/perf_load/perf_client.py
+++ b/scripts/performance/perf_load/perf_client.py
@@ -244,14 +244,6 @@ class LoadClient:
return
for auth_rule in data_f:
- if not auth_rule['constraint']:
- # TODO INDY-2077
- self._logger.warning(
- "Skip auth rule setting since constraint is empty: {}"
- .format(auth_rule)
- )
- continue
-
try:
metadata_addition = self._auth_rule_metadata.get(auth_rule['auth_type'], None)
if metadata_addition: | removes a workaround for unexpected auth rule | hyperledger_indy-node | train | py |
fa570bfc1e60231af576ee7d8ee7c798a45b2a07 | diff --git a/src/edeposit/amqp/harvester/scrappers/zonerpress_cz/__init__.py b/src/edeposit/amqp/harvester/scrappers/zonerpress_cz/__init__.py
index <HASH>..<HASH> 100755
--- a/src/edeposit/amqp/harvester/scrappers/zonerpress_cz/__init__.py
+++ b/src/edeposit/amqp/harvester/scrappers/zonerpress_cz/__init__.py
@@ -247,7 +247,7 @@ def get_publications():
"""
books = []
for link in get_book_links(LINKS):
- books.append(
+ books.append(
_process_book(link)
) | Aplied coding style to zonerpress scrapper. | edeposit_edeposit.amqp.harvester | train | py |
3b4f2b4e7504a5a07995bf7e366c4782f73a7b90 | diff --git a/fontbakery-check-ttf.py b/fontbakery-check-ttf.py
index <HASH>..<HASH> 100755
--- a/fontbakery-check-ttf.py
+++ b/fontbakery-check-ttf.py
@@ -3051,6 +3051,9 @@ def main():
fb.new_check("METADATA.pb: Designer exists in GWF profiles.csv ?")
if family.designer == "":
fb.error('METADATA.pb field "designer" MUST NOT be empty!')
+ elif family.designer == "Multiple Designers":
+ fb.skip("Found 'Multiple Designers' at METADATA.pb, which is OK,"
+ "so we won't look for it at profiles.cvs")
else:
try:
fp = urllib.urlopen(PROFILES_RAW_URL)
@@ -3059,9 +3062,7 @@ def main():
if not row:
continue
designers.append(row[0].decode('utf-8'))
- if family.designer == "Multiple Designers":
- fb.ok("Found 'Multiple Designers' at METADATA.pb")
- elif family.designer not in designers:
+ if family.designer not in designers:
fb.error(("METADATA.pb: Designer '{}' is not listed"
" in profiles.csv"
" (at '{}')").format(family.designer, | actually skip "profiles.csv" check of "Multiple Designers"
(issue #<I>) | googlefonts_fontbakery | train | py |
82c11f75f991f360de4cb60763c51a0f768ac07c | diff --git a/tck/src/org/objenesis/tck/TextReporter.java b/tck/src/org/objenesis/tck/TextReporter.java
index <HASH>..<HASH> 100644
--- a/tck/src/org/objenesis/tck/TextReporter.java
+++ b/tck/src/org/objenesis/tck/TextReporter.java
@@ -73,9 +73,9 @@ public class TextReporter implements Reporter {
private int errorCount = 0;
- private SortedMap<String, Object> allCandidates;
+ private SortedMap<String, Object> allCandidates = new TreeMap<String, Object>();
- private SortedMap<String, Object> allInstantiators;
+ private SortedMap<String, Object> allInstantiators = new TreeMap<String, Object>();
private String currentObjenesis;
@@ -100,8 +100,8 @@ public class TextReporter implements Reporter {
// HT: in case the same reporter is reused, I'm guessing that it will
// always be the same platform
this.platformDescription = platformDescription;
- this.allCandidates = new TreeMap<String, Object>(allCandidates);
- this.allInstantiators = new TreeMap<String, Object>(allInstantiators);
+ this.allCandidates.putAll(allCandidates);
+ this.allInstantiators.putAll(allInstantiators);
for(String desc : allInstantiators.keySet()) {
objenesisResults.put(desc, new HashMap<String, Result>()); | Should putAll to be able to reuse the reporter | easymock_objenesis | train | java |
a5f161cea567c055d055fd74222e10115d62b702 | diff --git a/backends/graphite.js b/backends/graphite.js
index <HASH>..<HASH> 100644
--- a/backends/graphite.js
+++ b/backends/graphite.js
@@ -59,6 +59,7 @@ var flush_stats = function graphite_flush(ts, metrics) {
var counters = metrics.counters;
var gauges = metrics.gauges;
var timers = metrics.timers;
+ var sets = metrics.sets;
var pctThreshold = metrics.pctThreshold;
for (key in counters) {
@@ -135,6 +136,11 @@ var flush_stats = function graphite_flush(ts, metrics) {
numStats += 1;
}
+ for (key in sets) {
+ statString += 'stats.sets.' + key + '.count ' + sets[key].values().length + ' ' + ts + "\n";
+ numStats += 1;
+ }
+
statString += 'statsd.numStats ' + numStats + ' ' + ts + "\n";
statString += 'stats.statsd.graphiteStats.calculationtime ' + (Date.now() - starttime) + ' ' + ts + "\n";
post_stats(statString); | Add sets support in the graphite backend
The backend doesn't support sets of data, so the count of unique
elements is sent instead | statsd_statsd | train | js |
8fce4ca7a73a68508badbaad80228b31fc77337f | diff --git a/horoscope_generator/HoroscopeGenerator.py b/horoscope_generator/HoroscopeGenerator.py
index <HASH>..<HASH> 100644
--- a/horoscope_generator/HoroscopeGenerator.py
+++ b/horoscope_generator/HoroscopeGenerator.py
@@ -2,13 +2,16 @@
import logging
from nltk.grammar import Nonterminal
from nltk import CFG
+from os import path
import random
import re
+HERE = path.abspath(path.dirname(__file__))
+
try:
- GRAMMAR = CFG.fromstring(open('data/grammar.txt').read())
+ GRAMMAR = CFG.fromstring(open('%s/data/grammar.txt' % HERE).read())
except IOError:
- logging.error('Unable to load GRAMMAR')
+ logging.error('Unable to load grammar file')
raise IOError
def get_sentence(start=None, depth=7): | Fixes path to access data files | mouse-reeve_horoscope-generator | train | py |
96918a4de2720319eb35fd2cb3ecf0221ab537ba | diff --git a/lib/librato.js b/lib/librato.js
index <HASH>..<HASH> 100644
--- a/lib/librato.js
+++ b/lib/librato.js
@@ -253,13 +253,15 @@ var flush_stats = function librato_flush(ts, metrics)
countStat = typeof countStat !== 'undefined' ? countStat : true;
var match;
- if (sourceRegex && (match = measure.name.match(sourceRegex)) && match[1]) {
- // Use first capturing group as source name
+ var measureName = globalPrefix + measure.name;
+
+ // Use first capturing group as source name
+ if (sourceRegex && (match = measureName.match(sourceRegex)) && match[1]) {
measure.source = sanitize_name(match[1]);
// Remove entire matching string from the measure name & add global prefix.
- measure.name = globalPrefix + sanitize_name(measure.name.slice(0, match.index) + measure.name.slice(match.index + match[0].length));
+ measure.name = sanitize_name(measureName.slice(0, match.index) + measureName.slice(match.index + match[0].length));
} else {
- measure.name = globalPrefix + sanitize_name(measure.name);
+ measure.name = sanitize_name(measureName);
}
if (brokenMetrics[measure.name]) { | Add globalPrefix before performing sourceRegex match | librato_statsd-librato-backend | train | js |
9212eb510d9da058e3db14b5bb7fecc99b73313d | diff --git a/mqlight.js b/mqlight.js
index <HASH>..<HASH> 100644
--- a/mqlight.js
+++ b/mqlight.js
@@ -511,7 +511,7 @@ Client.prototype.send = function(topic, data, options, callback) {
}
// Validate the passed parameters
- if (topic === undefined) {
+ if (!topic) {
throw new Error('Cannot send to undefined topic');
} else if (typeof topic !== 'string') {
throw new TypeError('topic must be a string type');
@@ -647,8 +647,8 @@ Client.prototype.subscribe = function(pattern, share, options, callback) {
}
// Validate the pattern parameter
- if (pattern === undefined) {
- throw new Error('Cannot subscribe to undefined pattern');
+ if (!pattern) {
+ throw new Error('Cannot subscribe to undefined pattern.');
} else if (typeof pattern !== 'string') {
throw new TypeError('pattern must be a string type');
} | catch "" and null topic strings | mqlight_nodejs-mqlight | train | js |
8b4a6887aabbf8eac187e1a1de103800ea5d3d14 | diff --git a/ConnectionResolver.php b/ConnectionResolver.php
index <HASH>..<HASH> 100644
--- a/ConnectionResolver.php
+++ b/ConnectionResolver.php
@@ -56,6 +56,17 @@ class ConnectionResolver implements ConnectionResolverInterface {
}
/**
+ * Check if a connection has been registered.
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasConnection($name)
+ {
+ return isset($this->connections[$name]);
+ }
+
+ /**
* Get the default connection name.
*
* @return string | Added `hasConnection` method to ConnectionResolver. | illuminate_database | train | php |
4dc4cca34e77417215f02d2ba02ea9f3346054f5 | diff --git a/lib/ui/Editor.js b/lib/ui/Editor.js
index <HASH>..<HASH> 100644
--- a/lib/ui/Editor.js
+++ b/lib/ui/Editor.js
@@ -677,7 +677,11 @@ Editor.prototype._initHandlers = function () {
}
self.select({x: startX, y: mouse.y}, {x: endX, y: mouse.y});
} else {
- if (!self.data.mouseDown) self.startSelection(mouse);
+ if (!self.data.mouseDown) {
+ self.data.hideSelection = true;
+ self.startSelection(mouse);
+ self.data.hideSelection = false;
+ }
self.data.mouseDown = true;
}
}
@@ -802,7 +806,7 @@ Editor.prototype.render = function () {
line.slice(markupScrollX, markup.index(line, x + size.x)) +
_.repeat(' ', size.x).join('');
- if (selectionStyle && visibleSelection.start.y <= y && y <= visibleSelection.end.y) {
+ if (!self.data.hideSelection && selectionStyle && visibleSelection.start.y <= y && y <= visibleSelection.end.y) {
line = markup(line, selectionStyle,
y === visibleSelection.start.y ? visibleSelection.start.x - x : 0,
y === visibleSelection.end.y ? visibleSelection.end.x - x : Infinity); | Fixes selection flicker on click | slap-editor_slap | train | js |
a404e65427e20b41f633530b7279a581531a788a | diff --git a/views/block/index.js b/views/block/index.js
index <HASH>..<HASH> 100644
--- a/views/block/index.js
+++ b/views/block/index.js
@@ -60,7 +60,10 @@ module.exports = view.extend({
this.page(this.$data.back);
},
onCancel: function (e) {
- global.history.back();
+ e.preventDefault();
+ app.remove(index);
+ var id = this.$root.$data.params.id;
+ this.page('/make/' + id + '/add');
}
},
created: function () { | Fix #<I> - Cancel shouldn't add block to my app | mozilla_webmaker-android | train | js |
7b12dc6915dc67bf3a047c8087732b84b2f33f55 | diff --git a/ClassCollectionLoader.php b/ClassCollectionLoader.php
index <HASH>..<HASH> 100644
--- a/ClassCollectionLoader.php
+++ b/ClassCollectionLoader.php
@@ -116,8 +116,8 @@ class ClassCollectionLoader
}
// cache the core classes
- if (!is_dir(dirname($cache))) {
- mkdir(dirname($cache), 0777, true);
+ if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
+ throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
}
self::writeCacheFile($cache, '<?php '.$content);
diff --git a/ClassMapGenerator.php b/ClassMapGenerator.php
index <HASH>..<HASH> 100644
--- a/ClassMapGenerator.php
+++ b/ClassMapGenerator.php
@@ -134,7 +134,7 @@ class ClassMapGenerator
}
if ($isClassConstant) {
- continue;
+ break;
}
// Find the classname | [<I>] Static Code Analysis for Components | symfony_class-loader | train | php,php |
1ee00c0e84d483f8dbd229cfd4c3db22d9f3c85d | diff --git a/tests/test_cache.py b/tests/test_cache.py
index <HASH>..<HASH> 100644
--- a/tests/test_cache.py
+++ b/tests/test_cache.py
@@ -52,6 +52,9 @@ class InlineTestT(Transformer):
def NUM(self, token):
return int(token)
+ def __reduce__(self):
+ raise TypeError("This Transformer should not be pickled.")
+
def append_zero(t):
return t.update(value=t.value + '0')
@@ -107,6 +110,8 @@ class TestCache(TestCase):
def test_inline(self):
# Test inline transformer (tree-less) & lexer_callbacks
+ # Note: the Transformer should not be saved to the file,
+ # and is made unpickable to check for that
g = """
start: add+
add: NUM "+" NUM
@@ -134,7 +139,7 @@ class TestCache(TestCase):
assert len(self.mock_fs.files) == 1
res = parser.parse("ab")
self.assertEqual(res, Tree('startab', [Tree('expr', ['a', 'b'])]))
-
+ | added test for not caching the Transformer | lark-parser_lark | train | py |
3455341576cc96f2a9d952799412b25c4e7c2694 | diff --git a/src/Worker.php b/src/Worker.php
index <HASH>..<HASH> 100644
--- a/src/Worker.php
+++ b/src/Worker.php
@@ -49,4 +49,12 @@ class Worker implements WorkerInterface
{
return $this->busy;
}
+
+ /*
+ * @return PromiseInterface
+ */
+ public function terminate()
+ {
+ return $this->messenger->softTerminate();
+ }
}
diff --git a/src/WorkerInterface.php b/src/WorkerInterface.php
index <HASH>..<HASH> 100644
--- a/src/WorkerInterface.php
+++ b/src/WorkerInterface.php
@@ -24,4 +24,9 @@ interface WorkerInterface extends EventEmitterInterface
* @return bool
*/
public function isBusy();
+
+ /**
+ * @return PromiseInterface
+ */
+ public function terminate();
} | Added terminate to be passed on to the messenger | WyriHaximus_reactphp-child-process-pool | train | php,php |
b6bb064b016348c2bd6159a7132ee2eed0454529 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -449,7 +449,7 @@ describe('CachingBrowserify', function() {
expect(loader.entries).to.have.keys(['npm:my-module']);
var file = fs.readFileSync(result.directory + '/browserify/browserify.js', 'UTF8');
- expect(file).to.match(/sourceMappingURL=data:application\/json;base64/);
+ expect(file).to.match(/sourceMappingURL=data:application\/json;.*base64,/);
expect(spy).to.have.callCount(1);
return builder.build();
}).then(function(){ | allow additional entries (like encoding) before base<I>, | ef4_ember-browserify | train | js |
6a10b671da9c3dc05661988327c5675f776d983b | diff --git a/HMpTy/mysql/conesearch.py b/HMpTy/mysql/conesearch.py
index <HASH>..<HASH> 100644
--- a/HMpTy/mysql/conesearch.py
+++ b/HMpTy/mysql/conesearch.py
@@ -285,7 +285,7 @@ class conesearch():
trixelArray = self._get_trixel_ids_that_overlap_conesearch_circles()
htmLevel = "htm%sID" % self.htmDepth
- if trixelArray.size > 50000:
+ if trixelArray.size > 35000:
minID = np.min(trixelArray)
maxID = np.max(trixelArray)
htmWhereClause = "where %(htmLevel)s between %(minID)s and %(maxID)s " % locals( | decreasing the size of the HTMid selection query again | thespacedoctor_HMpTy | train | py |
19280ba3fabb10c5bbb7e398eba4b5bcf137e63d | diff --git a/lib/utils.js b/lib/utils.js
index <HASH>..<HASH> 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -69,6 +69,7 @@ var CommonController = {
var setResData = function setResData(data, scope) {
if (scope.req.method.toLowerCase() !== 'head') {
scope.restfulResult = data;
+ scope.res.restfulResult = data; // we need a way to get it from res
}
}; | put `restfulResult` to `res` | vedi_restifizer | train | js |
bb27eac27cd2e60402f3fa6394c1ed12f112bb55 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -95,7 +95,8 @@ master_doc = 'index'
# General information about the project.
project = 'MetPy'
# noinspection PyShadowingBuiltins
-copyright = ('2019, MetPy Developers. Development supported by National Science Foundation grants '
+copyright = ('2019-2020, MetPy Developers. '
+ 'Development supported by National Science Foundation grants '
'AGS-1344155, OAC-1740315, and AGS-1901712.')
# The version info for the project you're documenting, acts as replacement for | Update copyright year to include <I> | Unidata_MetPy | train | py |
8f79aae741092928266dcb372bf5e32d14048daf | diff --git a/src/plugins/withTyping.js b/src/plugins/withTyping.js
index <HASH>..<HASH> 100644
--- a/src/plugins/withTyping.js
+++ b/src/plugins/withTyping.js
@@ -2,15 +2,19 @@ import sleep from 'delay';
const methods = [
'sendText',
+ 'sendMessage',
'sendAttachment',
'sendImage',
'sendAudio',
'sendVideo',
'sendFile',
'sendQuickReplies',
+ 'sendTemplate',
'sendGenericTemplate',
'sendButtonTemplate',
'sendListTemplate',
+ 'sendOpenGraphTemplate',
+ 'sendMediaTemplate',
'sendReceiptTemplate',
'sendAirlineBoardingPassTemplate',
'sendAirlineCheckinTemplate',
@@ -28,7 +32,6 @@ const methods = [
'sendVoice',
'sendVenue',
'sendContact',
- 'sendChatAction',
];
export default options => context => { | refined affected methods in withTyping | Yoctol_bottender | train | js |
53181f3ec3f1c1ddec3f8b51186eb478f01e9b14 | diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go
index <HASH>..<HASH> 100644
--- a/cmd/lncli/commands.go
+++ b/cmd/lncli/commands.go
@@ -60,7 +60,7 @@ var newAddressCommand = cli.Command{
Description: "Generate a wallet new address. Address-types has to be one of:\n" +
" - p2wkh: Push to witness key hash\n" +
" - np2wkh: Push to nested witness key hash\n" +
- " - p2pkh: Push to public key hash",
+ " - p2pkh: Push to public key hash (can't be used to fund channels)",
Action: newAddress,
}
diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go
index <HASH>..<HASH> 100644
--- a/lnwallet/wallet.go
+++ b/lnwallet/wallet.go
@@ -60,7 +60,7 @@ type ErrInsufficientFunds struct {
}
func (e *ErrInsufficientFunds) Error() string {
- return fmt.Sprintf("not enough outputs to create funding transaction,"+
+ return fmt.Sprintf("not enough witness outputs to create funding transaction,"+
" need %v only have %v available", e.amountAvailable,
e.amountSelected)
} | cmd/lncli+lnwallet: specify need for witness outputs for funding channels
In this commit, we extend the help message for `newaddress`
to indicate which address types can be used when directly
funding channels. Additionally, we add some additional text
to the insufficient funding error to detail that we don't have
enough witness outputs. | lightningnetwork_lnd | train | go,go |
babb0c14fd1281b309de46c3481a5bea88b8031d | diff --git a/pkg/urlutil/urlutil.go b/pkg/urlutil/urlutil.go
index <HASH>..<HASH> 100644
--- a/pkg/urlutil/urlutil.go
+++ b/pkg/urlutil/urlutil.go
@@ -9,7 +9,15 @@ import (
var (
validPrefixes = map[string][]string{
- "url": {"http://", "https://"},
+ "url": {"http://", "https://"},
+
+ // The github.com/ prefix is a special case used to treat context-paths
+ // starting with `github.com` as a git URL if the given path does not
+ // exist locally. The "github.com/" prefix is kept for backward compatibility,
+ // and is a legacy feature.
+ //
+ // Going forward, no additional prefixes should be added, and users should
+ // be encouraged to use explicit URLs (https://github.com/user/repo.git) instead.
"git": {"git://", "github.com/", "git@"},
"transport": {"tcp://", "tcp+tls://", "udp://", "unix://", "unixgram://"},
} | Be explicit about github.com prefix being a legacy feature | moby_moby | train | go |
06b1db82d2541605e70a33c4278ef87bee09e1e6 | diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -256,7 +256,7 @@ function record_exists($table, $field1="", $value1="", $field2="", $value2="", $
*/
function record_exists_sql($sql) {
- global $db;
+ global $CFG, $db;
if (!$rs = $db->Execute($sql)) {
if (isset($CFG->debug) and $CFG->debug > 7) {
@@ -328,7 +328,7 @@ function count_records_select($table, $select="") {
*/
function count_records_sql($sql) {
- global $db;
+ global $CFG, $db;
$rs = $db->Execute("$sql");
if (!$rs) {
@@ -648,7 +648,7 @@ function get_records_select_menu($table, $select="", $sort="", $fields="*") {
*/
function get_records_sql_menu($sql) {
- global $db;
+ global $CFG, $db;
if (!$rs = $db->Execute($sql)) {
if (isset($CFG->debug) and $CFG->debug > 7) { | Decalre some globals so debugging works better | moodle_moodle | train | php |
494c57d282e2939f16e80fe9a932ed9fe04ea4cc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,11 +19,17 @@ setup(
platforms=['OS Independent'],
license='MIT License',
classifiers=[
- 'Development Status :: 4 - Beta',
- 'Environment :: Web Environment',
+ 'Development Status :: 2 - Pre-Alpha',
+ 'Environment :: Console',
'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Topic :: Multimedia :: Graphics',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
],
install_requires=[ | Used more accurate trove classifiers. | samastur_pyimagediet | train | py |
d2c305157da34a3b28a41c6cae608de54b6d2861 | diff --git a/src/pyctools/core/compound.py b/src/pyctools/core/compound.py
index <HASH>..<HASH> 100644
--- a/src/pyctools/core/compound.py
+++ b/src/pyctools/core/compound.py
@@ -38,6 +38,8 @@ from .config import ConfigGrandParent
class Compound(object):
def __init__(self, **kw):
super(Compound, self).__init__()
+ self.inputs = []
+ self.outputs = []
# get child components
self._compound_children = {}
for key in kw:
@@ -54,6 +56,7 @@ class Compound(object):
getattr(self._compound_children[dest], inbox))
elif dest == 'self':
self._compound_outputs[inbox] = (src, outbox)
+ self.outputs.append(inbox)
else:
self._compound_children[src].bind(
outbox, self._compound_children[dest], inbox)
@@ -66,7 +69,6 @@ class Compound(object):
config = ConfigGrandParent()
for name, child in self._compound_children.iteritems():
child_config = child.get_config()
- child_config.name = name
config[name] = child_config
return config | Add 'inputs' and 'outputs' to compound components | jim-easterbrook_pyctools | train | py |
2380886ba8eefa76c25d3ee6696f4d390d6148c8 | diff --git a/lib/catissue/wustl/logger.rb b/lib/catissue/wustl/logger.rb
index <HASH>..<HASH> 100644
--- a/lib/catissue/wustl/logger.rb
+++ b/lib/catissue/wustl/logger.rb
@@ -4,8 +4,6 @@ require 'fileutils'
module Wustl
# Logger configures the +edu.wustl+ logger.
module Logger
- include FileUtils
-
# @quirk caTissue caTissue requires that a +log+ directory exist in the working directory.
# Messages are logged to +client.log+ and +catissuecore.log+ in this directory. Although
# these logs are large and the content is effectively worthless, nevertheless the directory
@@ -32,7 +30,7 @@ module Wustl
# directory contains a log subdirectory.
def self.configure
dir = File.expand_path('log')
- mkdir(dir) unless File.exists?(dir)
+ FileUtils.mkdir(dir) unless File.exists?(dir)
# Set the configured flag. Configure only once.
if @configured then return else @configured = true end | Scope mkdir by FileUtils. | caruby_tissue | train | rb |
09a51802483c6a07eeea4a4698c0cce4ad27c73c | diff --git a/app/controllers/media_controller.rb b/app/controllers/media_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/media_controller.rb
+++ b/app/controllers/media_controller.rb
@@ -24,7 +24,7 @@ class MediaController < ApplicationController
q = params[:q]
if q.to_s != ''
# Search with ES if query provided
- @media = Media.search :load => {:include => %w(user tags)}, :page => page, :per_page => per_page do
+ @media = Media.search :load => true, :page => page, :per_page => per_page do
query { string q }
sort { by :created_at, :desc }
end | Simplify load options until we determine reason for errors (demo) | cortex-cms_cortex | train | rb |
7bf93d86b177db8a9ef21bc451be66f49253d14e | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100755
--- a/src/core.js
+++ b/src/core.js
@@ -1150,6 +1150,9 @@ window.me = window.me || {};
// dummy current level
api.currentLevel = {pos:{x:0,y:0}};
+ // reset the transform matrix to the normal one
+ frameBuffer.setTransform(1, 0, 0, 1, 0, 0);
+
// reset the frame counter
frameCounter = 0;
frameRate = Math.round(60/me.sys.fps); | putting back this one as a safety net :) | melonjs_melonJS | train | js |
8e4cae391ccd06542fbe472beb43af5f67620ccc | diff --git a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java
index <HASH>..<HASH> 100644
--- a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java
+++ b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java
@@ -64,6 +64,10 @@ public class ForwardingService {
// Parse the address given as the first parameter.
var address = Address.fromString(NetworkParameters.of(network), args[0]);
+ forward(network, address);
+ }
+
+ public static void forward(BitcoinNetwork network, Address address) {
System.out.println("Network: " + network.id());
System.out.println("Forwarding address: " + address); | ForwardingService: split main() into main() and forward() | bitcoinj_bitcoinj | train | java |
44b6af11065298f4abc53b79237a07a13dfba5e9 | diff --git a/Media/DisplayBlock/Strategies/DisplayMediaStrategy.php b/Media/DisplayBlock/Strategies/DisplayMediaStrategy.php
index <HASH>..<HASH> 100644
--- a/Media/DisplayBlock/Strategies/DisplayMediaStrategy.php
+++ b/Media/DisplayBlock/Strategies/DisplayMediaStrategy.php
@@ -54,7 +54,7 @@ class DisplayMediaStrategy extends AbstractStrategy
if (!empty($nodeToLink)) {
$language = $this->currentSiteManager->getCurrentSiteDefaultLanguage();
$siteId = $this->currentSiteManager->getCurrentSiteId();
- $linkUrl = $this->nodeRepository->findOneCurrentlyPublished($nodeToLink, $language, $siteId);
+ $linkUrl = $this->nodeRepository->findOnePublished($nodeToLink, $language, $siteId);
}
$parameters = array( | remove currently version (#<I>) | open-orchestra_open-orchestra-media-bundle | train | php |
8b4ebac2a45f651d3226d7f3428e1a18e54698b4 | diff --git a/lib/rollbar/plugins/basic_socket.rb b/lib/rollbar/plugins/basic_socket.rb
index <HASH>..<HASH> 100644
--- a/lib/rollbar/plugins/basic_socket.rb
+++ b/lib/rollbar/plugins/basic_socket.rb
@@ -1,4 +1,5 @@
Rollbar.plugins.define('basic_socket') do
+
load_on_demand
dependency { !configuration.disable_core_monkey_patch }
@@ -9,11 +10,8 @@ Rollbar.plugins.define('basic_socket') do
Gem::Version.new(ActiveSupport::VERSION::STRING) < Gem::Version.new('5.2.0')
end
- @original_as_json = ::BasicSocket.public_instance_method(:as_json)
-
execute do
- require 'socket'
-
+ @original_as_json = ::BasicSocket.public_instance_method(:as_json)
class BasicSocket # :nodoc:
def as_json(_options = nil)
{ | <I>: move socket require so it's only invoked if the dependencies are met | rollbar_rollbar-gem | train | rb |
d4aed6bcda8e2481cf422fd528155bc20b35ea27 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ except:
setup(
name = 'flask-whooshee',
- version = '0.0.6',
+ version = '0.0.7',
description = 'Flask - SQLAlchemy - Whoosh integration',
long_description = 'Flask - SQLAlchemy - Whoosh integration that allows to create and search custom indexes.',
keywords = 'flask, sqlalchemy, whoosh', | Bump to version <I> | bkabrda_flask-whooshee | train | py |
278fb30151abcaff7ee0ed65959ba32feac8e23f | diff --git a/godaddypy/client.py b/godaddypy/client.py
index <HASH>..<HASH> 100644
--- a/godaddypy/client.py
+++ b/godaddypy/client.py
@@ -235,6 +235,8 @@ class Client(object):
"""
records = self.get_records(domain)
+ if records is None:
+ return False # we don't want to replace the records with nothing at all
save = list()
deleted = 0
for record in records: | Added null check to the delete method, so if client.get_records fails, existing records won't be removed... | eXamadeus_godaddypy | train | py |
9e9bbcc18a5b51365e0cb94f565fcc70b5667e2d | diff --git a/resources/lang/es-ES/forms.php b/resources/lang/es-ES/forms.php
index <HASH>..<HASH> 100644
--- a/resources/lang/es-ES/forms.php
+++ b/resources/lang/es-ES/forms.php
@@ -156,7 +156,7 @@ return [
'time_before_refresh' => 'Tasa de actualización de la página de estado (en segundos)',
'major_outage_rate' => 'Major outage threshold (in %)',
'banner' => 'Imagen del banner',
- 'banner-help' => 'Se recomienda subir una imagen no más grande de 930px de ancho',
+ 'banner-help' => "Se recomienda subir una imagen no más grande de 930px de ancho",
'subscribers' => '¿Permitir a la gente inscribirse mediante noficiacion por correo electronico?',
'suppress_notifications_in_maintenance' => '¿Suprimir notificaciones cuando el incidente ocurra durante el período de mantenimiento?',
'skip_subscriber_verification' => '¿Omitir verificación de usuarios? (Advertencia, podrías ser spammeado)', | New translations forms.php (Spanish) | CachetHQ_Cachet | train | php |
2aaa08e1f73af59b63b50f6d918e1d1fbea6a8d7 | diff --git a/lib/beaker-answers/version.rb b/lib/beaker-answers/version.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-answers/version.rb
+++ b/lib/beaker-answers/version.rb
@@ -1,5 +1,5 @@
module BeakerAnswers
module Version
- STRING = '0.13.0'
+ STRING = '0.14.0'
end
end | (GEM) update beaker-answers version to <I> | puppetlabs_beaker-answers | train | rb |
00214ff83b03b1d3e499d5458cb9da26fa835356 | diff --git a/lib/extensions/array.rb b/lib/extensions/array.rb
index <HASH>..<HASH> 100644
--- a/lib/extensions/array.rb
+++ b/lib/extensions/array.rb
@@ -2,8 +2,4 @@ class Array
def rand
self[Kernel.rand(length)]
end
-
- def shuffle
- self.sort_by{Kernel.rand}
- end
-end
\ No newline at end of file
+end | shuffle exists in <I> and <I>, so remove it | stympy_faker | train | rb |
94ec4ce2e31a4801ccb5e2d22774f4d36b8d77d3 | diff --git a/test/phonopy/unfolding/test_unfolding.py b/test/phonopy/unfolding/test_unfolding.py
index <HASH>..<HASH> 100644
--- a/test/phonopy/unfolding/test_unfolding.py
+++ b/test/phonopy/unfolding/test_unfolding.py
@@ -60,7 +60,7 @@ class TestUnfolding(unittest.TestCase):
with open(filename) as f:
bin_data_in_file = np.loadtxt(f)
np.testing.assert_allclose(bin_data, bin_data_in_file,
- atol=1e-3, rtol=0)
+ atol=1e-2, rtol=0)
def _prepare_unfolding(self, qpoints, unfolding_supercell_matrix):
supercell = get_supercell(self._cell, np.diag([2, 2, 2])) | Tolerance to be 1e-2. This error is probably coming from different eigensolvers of different system for handling degeneracy. | atztogo_phonopy | train | py |
3ee61486c75efea5a95d7e6b79ea19ea0b435807 | diff --git a/indra/explanation/pathfinding/pathfinding.py b/indra/explanation/pathfinding/pathfinding.py
index <HASH>..<HASH> 100644
--- a/indra/explanation/pathfinding/pathfinding.py
+++ b/indra/explanation/pathfinding/pathfinding.py
@@ -373,7 +373,7 @@ def bfs_search_multiple_nodes(g, source_nodes, path_limit=None, **kwargs):
break
-def get_path_iter(graph, source, target, path_length, loop):
+def get_path_iter(graph, source, target, path_length, loop, dummy_target):
"""Return a generator of paths with path_length cutoff from source to
target."""
path_iter = nx.all_simple_paths(graph, source, target, path_length) | Fix a bug caused by rebase | sorgerlab_indra | train | py |
d1ea14ab8d5a036fe54bd1bec3d79532268a16d1 | diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-embed.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-embed.js
index <HASH>..<HASH> 100644
--- a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-embed.js
+++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-embed.js
@@ -151,7 +151,7 @@ export default Component.extend({
throw 'No HTML returned';
}
- set(this.payload.linkOnError, undefined);
+ set(this.payload, 'linkOnError', undefined);
set(this.payload, 'html', response.html);
set(this.payload, 'type', response.type);
this.saveCard(this.payload, false); | Koenig - Fixed embeds cards
no issue
- `set` call to remove `linkOnError` from the embed card payload was malformed | TryGhost_Ghost | train | js |
d58345c39d79c52f7532970225b5678c2f2df928 | diff --git a/girder/utility/acl_mixin.py b/girder/utility/acl_mixin.py
index <HASH>..<HASH> 100644
--- a/girder/utility/acl_mixin.py
+++ b/girder/utility/acl_mixin.py
@@ -20,7 +20,7 @@
import itertools
import six
-from ..models.model_base import Model
+from ..models.model_base import Model, AccessException
from ..constants import AccessType
@@ -78,6 +78,26 @@ class AccessControlMixin(object):
return self.model(self.resourceColl).hasAccess(resource, user=user,
level=level)
+ def requireAccess(self, doc, user=None, level=AccessType.READ):
+ """
+ This wrapper just provides a standard way of throwing an
+ access denied exception if the access check fails.
+ """
+ if not self.hasAccess(doc, user, level):
+ if level == AccessType.READ:
+ perm = 'Read'
+ elif level == AccessType.WRITE:
+ perm = 'Write'
+ else:
+ perm = 'Admin'
+ if user:
+ userid = str(user.get('_id', ''))
+ else:
+ userid = None
+ raise AccessException("%s access denied for %s %s (user %s)." %
+ (perm, self.name, doc.get('_id', 'unknown'),
+ userid))
+
def filterResultsByPermission(self, cursor, user, level, limit, offset,
removeKeys=()):
""" | implement requireAccess() in AccessControlMixin | girder_girder | train | py |
909d6c8366348c16ef8e4a66029039982ac08e68 | diff --git a/lib/celluloid_benchmark/visitor.rb b/lib/celluloid_benchmark/visitor.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid_benchmark/visitor.rb
+++ b/lib/celluloid_benchmark/visitor.rb
@@ -30,14 +30,7 @@ module CelluloidBenchmark
begin
instance_eval session
rescue Mechanize::ResponseCodeError => e
- self.request_end_time = Time.now
- benchmark_run.async.log(
- e.response_code,
- request_start_time,
- request_end_time,
- current_request_label,
- current_request_threshold
- )
+ log_response_code_error e
end
elapsed_time = Time.now - started_at
@@ -81,5 +74,16 @@ module CelluloidBenchmark
benchmark_run.async.log response.code, request_start_time, request_end_time, current_request_label, current_request_threshold
end
end
+
+ def log_response_code_error(error)
+ self.request_end_time = Time.now
+ benchmark_run.async.log(
+ e.response_code,
+ request_start_time,
+ request_end_time,
+ current_request_label,
+ current_request_threshold
+ )
+ end
end
end | Extract complicated error logging into its own method | scottwillson_celluloid-benchmark | train | rb |
e69b9fa3fa7011697b4a92fda469624b67ba9aff | diff --git a/lib/watir-webdriver/extensions/wait.rb b/lib/watir-webdriver/extensions/wait.rb
index <HASH>..<HASH> 100644
--- a/lib/watir-webdriver/extensions/wait.rb
+++ b/lib/watir-webdriver/extensions/wait.rb
@@ -97,10 +97,9 @@ module Watir
end
def wait_while_present(timeout = 30)
- begin
- Watir::Wait.while(timeout) { self.present? }
- rescue Selenium::WebDriver::Error::ObsoleteElementError
- end
+ Watir::Wait.while(timeout) { self.present? }
+ rescue Selenium::WebDriver::Error::ObsoleteElementError
+ # it's not present
end
end # Element | Fix rescue in wait_while_present. | watir_watir | train | rb |
343608611e8109d69c2b018a282d63f106329886 | diff --git a/project_generator/exporters/uvision_definitions.py b/project_generator/exporters/uvision_definitions.py
index <HASH>..<HASH> 100644
--- a/project_generator/exporters/uvision_definitions.py
+++ b/project_generator/exporters/uvision_definitions.py
@@ -20,9 +20,8 @@ class uVisionDefinitions():
try:
return self.mcu_def[name]
except KeyError:
- pass
- # raise RuntimeError(
- # "Mcu was not recognized for uvision. Please check mcu_def dictionary.")
+ raise RuntimeError(
+ "Mcu was not recognized for uvision. Please check mcu_def dictionary.")
# MCU definitions which are currently supported. Add a new one, define a name as it is
# in uVision, create an empty project for that MCU, open the project file (uvproj) in any text | uvision def - error uncommented, mcu has to be defined, via board or mcu | project-generator_project_generator | train | py |
141c653d6bfbe9c3f7f8e1427143bc8966999461 | diff --git a/src/main/java/net/snowflake/client/core/SFSession.java b/src/main/java/net/snowflake/client/core/SFSession.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/snowflake/client/core/SFSession.java
+++ b/src/main/java/net/snowflake/client/core/SFSession.java
@@ -600,7 +600,7 @@ public class SFSession
logger.debug(
"input: server={}, account={}, user={}, password={}, role={}, " +
"database={}, schema={}, warehouse={}, validate_default_parameters={}, authenticator={}, ocsp_mode={}, " +
- "passcode_in_passward={}, passcode={}, private_key={}, " +
+ "passcode_in_password={}, passcode={}, private_key={}, " +
"use_proxy={}, proxy_host={}, proxy_port={}, proxy_user={}, proxy_password={}, disable_socks_proxy={}, " +
"application={}, app_id={}, app_version={}, " +
"login_timeout={}, network_timeout={}, query_timeout={}, tracing={}, private_key_file={}, private_key_file_pwd={}. " + | try a robust way to use smiley face | snowflakedb_snowflake-jdbc | train | java |
8628b4180328cf0ca92bb16f47a3f2ee05a74130 | diff --git a/lib/celluloid/actor.rb b/lib/celluloid/actor.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/actor.rb
+++ b/lib/celluloid/actor.rb
@@ -116,6 +116,9 @@ module Celluloid
while @running
begin
message = @mailbox.receive
+ rescue MailboxShutdown
+ # If the mailbox detects shutdown, exit the actor
+ @running = false
rescue ExitEvent => exit_event
fiber = Fiber.new do
initialize_thread_locals
diff --git a/lib/celluloid/io/mailbox.rb b/lib/celluloid/io/mailbox.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/io/mailbox.rb
+++ b/lib/celluloid/io/mailbox.rb
@@ -45,7 +45,7 @@ module Celluloid
message
rescue DeadWakerError
shutdown # force shutdown of the mailbox
- raise MailboxError, "mailbox shutdown called during receive"
+ raise MailboxShutdown, "mailbox shutdown called during receive"
end
# Cleanup any IO objects this Mailbox may be using
diff --git a/lib/celluloid/mailbox.rb b/lib/celluloid/mailbox.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/mailbox.rb
+++ b/lib/celluloid/mailbox.rb
@@ -2,6 +2,7 @@ require 'thread'
module Celluloid
class MailboxError < StandardError; end # you can't message the dead
+ class MailboxShutdown < StandardError; end # raised if the mailbox can no longer be used
# Actors communicate with asynchronous messages. Messages are buffered in
# Mailboxes until Actors can act upon them. | Detect mailbox shutdowns and handle them gracefully | celluloid_celluloid | train | rb,rb,rb |
d99ab58ccfa3f3f3676389a512e5238588dd1557 | diff --git a/addon/components/sl-menu.js b/addon/components/sl-menu.js
index <HASH>..<HASH> 100644
--- a/addon/components/sl-menu.js
+++ b/addon/components/sl-menu.js
@@ -281,6 +281,10 @@ export default Ember.Component.extend( StreamEnabled, {
* @returns {undefined}
*/
select( index ) {
+ if ( this.get( 'showingAll' ) ) {
+ this.hideAll();
+ }
+
const selections = this.get( 'selections' );
const selectionsLength = selections.length;
let item; | Add handling of showingAll state in select() | softlayer_sl-ember-components | train | js |
23946c982625523ec11d7ae8b09431aa8e3fc45b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ if sys.version_info[:2] < (2, 7) or ((3,0) <= sys.version_info[:2] < (3,2)):
setup(
name='gridtk',
- version='1.0.0',
+ version='1.0.1a1',
description='SGE Grid and Local Submission and Monitoring Tools for Idiap',
url='https://github.com/idiap/gridtk', | Increased version number (hopefully this helps tracking the nightlies problem). | bioidiap_gridtk | train | py |
e23e993b6027df35b031f784fe6bae4c52718f1b | diff --git a/tests/test_foreign.py b/tests/test_foreign.py
index <HASH>..<HASH> 100644
--- a/tests/test_foreign.py
+++ b/tests/test_foreign.py
@@ -76,7 +76,7 @@ class MyTestCase(unittest.TestCase):
prolog = Prolog()
result = list(prolog.query("get_list_of_lists(Result)"))
- self.assertTrue({'Result': [[1], [2]]} in result, 'A string return value should not be converted to an atom.')
+ self.assertTrue({'Result': [[1], [2]]} in result, 'Nested lists should be unified correctly as return value.')
def test_register_with_module(self):
def get_int(result): | Fixed wrong explanation string for unit test. | yuce_pyswip | train | py |
21a6ddca55c8b5da70d806afa18f08ac20cb04c0 | diff --git a/src/zsl/interface/webservice/performers/method.py b/src/zsl/interface/webservice/performers/method.py
index <HASH>..<HASH> 100644
--- a/src/zsl/interface/webservice/performers/method.py
+++ b/src/zsl/interface/webservice/performers/method.py
@@ -7,7 +7,7 @@
from __future__ import unicode_literals
import logging
-from importlib import import_module, reload
+from importlib import import_module
import sys | Remove the unused import and fix testing library | AtteqCom_zsl | train | py |
d3d832242a0a693b5c5999d71f75b6b9a322e1e3 | diff --git a/src/basis/data.js b/src/basis/data.js
index <HASH>..<HASH> 100644
--- a/src/basis/data.js
+++ b/src/basis/data.js
@@ -1501,11 +1501,39 @@
},
/**
- * Proxy method for contained dataset. If no dataset, returns empty array.
- * @return {Array.<basis.data.Object>}
+ * Proxy method for contained dataset.
+ */
+ has: function(object){
+ return this.dataset ? this.dataset.has(object) : null;
+ },
+
+ /**
+ * Proxy method for contained dataset.
*/
getItems: function(){
- return this.dataset ? this.dataset.getItems() : []
+ return this.dataset ? this.dataset.getItems() : [];
+ },
+
+ /**
+ * Proxy method for contained dataset.
+ */
+ pick: function(){
+ return this.dataset ? this.dataset.pick() : null;
+ },
+
+ /**
+ * Proxy method for contained dataset.
+ */
+ top: function(count){
+ return this.dataset ? this.dataset.top(count) : [];
+ },
+
+ /**
+ * Proxy method for contained dataset.
+ */
+ forEach: function(fn){
+ if (this.dataset)
+ return this.dataset.forEach(fn);
},
/** | extend basis.data.DatasetWrapper with has/pick/top/forEach proxy methods | basisjs_basisjs | train | js |
d670db2b0814c8ec4c1d1b77ac4c0a0f903d1ce2 | diff --git a/src/renderers/ListRenderer.php b/src/renderers/ListRenderer.php
index <HASH>..<HASH> 100644
--- a/src/renderers/ListRenderer.php
+++ b/src/renderers/ListRenderer.php
@@ -233,6 +233,14 @@ class ListRenderer extends BaseRenderer
Html::addCssClass($options, 'form-group');
}
+ if (is_callable($column->columnOptions)) {
+ $columnOptions = call_user_func($column->columnOptions, $column->getModel(), $index, $this->context);
+ } else {
+ $columnOptions = $column->columnOptions;
+ }
+
+ $options = array_merge_recursive($options, $columnOptions);
+
$content = Html::beginTag('div', $options);
if (empty($column->title)) { | Added support for `columOptions` in ListRenderer | unclead_yii2-multiple-input | train | php |
1a8f5814bbb91407794a93b3a66bc8a40dab8309 | diff --git a/tasks/dist.js b/tasks/dist.js
index <HASH>..<HASH> 100644
--- a/tasks/dist.js
+++ b/tasks/dist.js
@@ -67,7 +67,7 @@ var buildPolyfill = function () {
var detect = fs.readFileSync(fillPath + poly + '/detect.js', 'utf8'),
pfill = fs.readFileSync(fillPath + poly + '/polyfill.js', 'utf8');
- fill += 'if (!' + detect + '){' + pfill + '}';
+ fill += 'if (!(' + detect + ')){' + pfill + '}';
});
fill += '}());' | Improve polyfill injection to make detection of CustomEvent working - fixes Snugug/eq.js/issues/#<I> | Snugug_eq.js | train | js |
0206500037755b509e62048813a87b06392992ca | diff --git a/src/main/java/com/ning/metrics/eventtracker/CollectorController.java b/src/main/java/com/ning/metrics/eventtracker/CollectorController.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/ning/metrics/eventtracker/CollectorController.java
+++ b/src/main/java/com/ning/metrics/eventtracker/CollectorController.java
@@ -78,9 +78,9 @@ public class CollectorController
}
@Managed(description = "Whether the eventtracker library accepts events")
- public AtomicBoolean isAcceptEvents()
+ public boolean isAcceptEvents()
{
- return acceptEvents;
+ return acceptEvents.get();
}
@Managed(description = "Number of events received") | jmx: don't use AtomicBoolean to make jmxutils happy
jmxutils doesn't like AtomicBoolean for is... properties. | pierre_eventtracker | train | java |
2258a551f79905d7c11fc80ebdc23fe023d0af84 | diff --git a/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
+++ b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
@@ -141,9 +141,10 @@ final class AnnotationRegistry
*/
static public function loadAnnotationClass($class)
{
- if (isset(self::$successfullyLoaded[$class])) {
+ if (\class_exists($class, false)) {
return true;
}
+
if (isset(self::$failedToAutoload[$class])) {
return false;
} | #<I> completely skip autoloading for already loaded classes | doctrine_annotations | train | php |
6988614f3b3b40ca4a56e93403bc0b9c89476fca | diff --git a/neuropythy/__init__.py b/neuropythy/__init__.py
index <HASH>..<HASH> 100644
--- a/neuropythy/__init__.py
+++ b/neuropythy/__init__.py
@@ -11,7 +11,7 @@ from vision import (retinotopy_data, empirical_retinotopy_data, predicted_re
neighborhood_cortical_magnification)
# Version information...
-__version__ = '0.1.6'
+__version__ = '0.2.0'
description = 'Integrate Python environment with FreeSurfer and perform mesh registration' | Updated version to <I>! | noahbenson_neuropythy | train | py |
a27773cc7c17d8a5f9852b75517d5325dad883b9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,8 @@
# -*- coding: utf-8 -*-
import setuptools
-from setuptools import setup, Extension
+from setuptools import setup
+from distutils.extension import Extension
from Cython.Build import cythonize
import numpy | Swap setuptools extension for distutils for Cython compatibility | eddiejessup_fealty | train | py |
0a888d2dc886040729edc45682a9fd06645d0ca0 | diff --git a/test/test_licensee_project.rb b/test/test_licensee_project.rb
index <HASH>..<HASH> 100644
--- a/test/test_licensee_project.rb
+++ b/test/test_licensee_project.rb
@@ -17,7 +17,7 @@ class TestLicenseeProject < Minitest::Test
def make_project(fixture_name)
dest = File.join('tmp', 'fixtures', fixture_name)
FileUtils.mkdir_p File.dirname(dest)
- system 'git', 'clone', '-q', fixture_path(fixture_name), dest
+ Rugged::Repository.clone_at(fixture_path(fixture_name), dest).close
FileUtils.rm_rf File.join(dest, '.git')
Licensee::FSProject.new(dest) | Use Rugged to clone test repos
Avoid the additional dependency on the command line Git client.
This also resolves file locking issues when removing temporary test data
in Git for Windows with "core.fscache" set to "true" [1] (which is the
default in recent versions).
[1] <URL> | licensee_licensee | train | rb |
2b744247047cc10257ac419528201750ac2d2e59 | diff --git a/src/Ubiquity/orm/bulk/BulkUpdates.php b/src/Ubiquity/orm/bulk/BulkUpdates.php
index <HASH>..<HASH> 100644
--- a/src/Ubiquity/orm/bulk/BulkUpdates.php
+++ b/src/Ubiquity/orm/bulk/BulkUpdates.php
@@ -96,7 +96,6 @@ class BulkUpdates extends AbstractBulks {
$quote = $this->db->quote;
$tableName = OrmUtils::getTableName ( $this->class );
$sql = '';
- $count = \count ( $this->instances );
foreach ( $this->instances as $instance ) {
$kv = OrmUtils::getKeyFieldsAndValues ( $instance );
$sql .= "UPDATE {$quote}{$tableName}{$quote} SET " . $this->db->getUpdateFieldsKeyAndValues ( $instance->_rest ) . ' WHERE ' . $this->db->getCondition ( $kv ) . ';';
@@ -104,7 +103,7 @@ class BulkUpdates extends AbstractBulks {
while ( true ) {
try {
if ($this->db->beginTransaction ()) {
- if ($count == $this->db->execute ( $sql )) {
+ if ($this->db->execute ( $sql )) {
if ($this->db->commit ()) {
return true;
} | [skip ci] Fix query count pb | phpMv_ubiquity | train | php |
b7f75d5ade07e0063a1f3dfa6620535502201e6d | diff --git a/jss/pretty_element.py b/jss/pretty_element.py
index <HASH>..<HASH> 100644
--- a/jss/pretty_element.py
+++ b/jss/pretty_element.py
@@ -50,7 +50,12 @@ class PrettyElement(ElementTree.Element):
def __getattr__(self, name):
if re.match(_DUNDER_PATTERN, name):
return super(PrettyElement, self).__getattr__(name)
- return self.find(name)
+ result = self.find(name)
+ if result is not None:
+ return result
+ else:
+ raise AttributeError(
+ 'There is no element with the tag "{}"'.format(name))
# TODO: This can be removed once `JSSObject.__init__` signature is fixed.
def makeelement(self, tag, attrib): | Getattr should raise AttributeError when nothing is found | jssimporter_python-jss | train | py |
595532bc6cf5422cd67147b8e6caec155e861ea8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@ py_version = platform.python_version()
if py_version < '2.7':
REQUIRED_PACKAGES.append('argparse>=1.2.1')
-_APITOOLS_VERSION = '0.4.7'
+_APITOOLS_VERSION = '0.4.8'
with open('README.rst') as fileobj:
README = fileobj.read() | Update for <I> release. | google_apitools | train | py |
27279a34afadaf7632c47704a8c11f113c9c01a8 | diff --git a/src/main/java/com/twilio/sdk/verbs/Dial.java b/src/main/java/com/twilio/sdk/verbs/Dial.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/twilio/sdk/verbs/Dial.java
+++ b/src/main/java/com/twilio/sdk/verbs/Dial.java
@@ -47,6 +47,7 @@ public class Dial extends Verb {
this.allowedVerbs.add(Verb.V_CONFERENCE);
this.allowedVerbs.add(Verb.V_CLIENT);
this.allowedVerbs.add(Verb.V_QUEUE);
+ this.allowedVerbs.add(Verb.V_SIP);
}
/** | Adding support to append Sip into Dial Verb | twilio_twilio-java | train | java |
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.