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
35c7f83030ebccd74a86a07b6c1c283bc9ede309
diff --git a/tensorlayer/layers.py b/tensorlayer/layers.py index <HASH>..<HASH> 100755 --- a/tensorlayer/layers.py +++ b/tensorlayer/layers.py @@ -1733,7 +1733,7 @@ class BatchNormLayer(Layer): trainable=False) moving_variance = _get_variable('moving_variance', params_shape, - initializer=tf.ones_initializer, + initializer=tf.ones_initializer(), trainable=False) # These ops will only be preformed when training.
Update layers.py The init_ops.one_initializer() function is rewritten on tensorflow <I>. Maybe 'tf.one_initializer' should be replaced by 'tf.one_initializer()' in tensorlayer for tensorflow <I>. But i did not check it for tensorflow <I> backend.
tensorlayer_tensorlayer
train
py
83780d6900386558202e538b3eb3fab4d08cbb72
diff --git a/lib/split/experiment.rb b/lib/split/experiment.rb index <HASH>..<HASH> 100644 --- a/lib/split/experiment.rb +++ b/lib/split/experiment.rb @@ -1,7 +1,6 @@ module Split class Experiment attr_accessor :name - attr_accessor :winner def initialize(name, *alternative_names) @name = name.to_s
attr_accessor not required for winner as we define our own methods
splitrb_split
train
rb
8a790753dcb832a9292107525b6625aa5189446f
diff --git a/code/steppedcheckout/CheckoutStep_Membership.php b/code/steppedcheckout/CheckoutStep_Membership.php index <HASH>..<HASH> 100644 --- a/code/steppedcheckout/CheckoutStep_Membership.php +++ b/code/steppedcheckout/CheckoutStep_Membership.php @@ -10,6 +10,7 @@ class CheckoutStep_Membership extends CheckoutStep{ 'MembershipForm', 'LoginForm', 'createaccount', + 'docreateaccount', 'CreateAccountForm' );
Added 'docreateaccount' to list of CheckoutStep_Membership allowed actions
silvershop_silvershop-core
train
php
4837407527091ec03dbdf15ae47f67e8160b8f6f
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php @@ -60,7 +60,7 @@ class WebTestCase extends BaseWebTestCase return new $class( $options['test_case'], isset($options['root_config']) ? $options['root_config'] : 'config.yml', - isset($options['environment']) ? $options['environment'] : 'securitybundletest', + isset($options['environment']) ? $options['environment'] : 'securitybundletest' . strtolower($options['test_case']), isset($options['debug']) ? $options['debug'] : true ); }
[SecurityBundle] Fix execution of functional tests with different names Using "securitybundletest" as the default environment for the functional test's kernel causes a PHP fatal error redeclaring the class "appSecuritybundletestDebugProjectContainer" when multiple tests (with unique names) are executed. In lieu of forcing tests to specify their own environment explicitly, we can simply append the test name into the environment. Note: this bug may be related to PHPUnit executing multiple tests within the same process.
symfony_symfony
train
php
03b26ddfc5f1a82f4f356b680e246834d84048c7
diff --git a/lib/bundler/monkey_patch.rb b/lib/bundler/monkey_patch.rb index <HASH>..<HASH> 100644 --- a/lib/bundler/monkey_patch.rb +++ b/lib/bundler/monkey_patch.rb @@ -11,11 +11,11 @@ module Bundler end module Bundler # Handles all the fetching with the rubygems server - class Fetcher + class Fetcher + alias :initialize_old :initialize + def initialize(remote_uri) - @remote_uri = RubygemsMirror.to_uri(remote_uri) - @has_api = true # will be set to false if the rubygems index is ever fetched - @@connection ||= Net::HTTP::Persistent.new nil, :ENV + initialize_old RubygemsMirror.to_uri(remote_uri) end end end
make monkey patch more robust against upstream changes
sonatype_nexus-gem
train
rb
92a68c9a73a1078fe7df17b7ce705feb33a363e1
diff --git a/lib/discourse_api/api/categories.rb b/lib/discourse_api/api/categories.rb index <HASH>..<HASH> 100644 --- a/lib/discourse_api/api/categories.rb +++ b/lib/discourse_api/api/categories.rb @@ -28,6 +28,11 @@ module DiscourseApi response['body']['category'] if response['body'] end + def delete_category(id) + response = delete("/categories/#{id}") + response[:body]['success'] + end + def categories(params = {}) response = get('/categories.json', params) response[:body]['category_list']['categories']
add api to delete category (#<I>)
discourse_discourse_api
train
rb
464d2853a6807b3142c236b503c968408505e131
diff --git a/server/src/main/java/org/openqa/selenium/server/testgenerator/XlateHtmlSeleneseToJava.java b/server/src/main/java/org/openqa/selenium/server/testgenerator/XlateHtmlSeleneseToJava.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/openqa/selenium/server/testgenerator/XlateHtmlSeleneseToJava.java +++ b/server/src/main/java/org/openqa/selenium/server/testgenerator/XlateHtmlSeleneseToJava.java @@ -448,9 +448,7 @@ public class XlateHtmlSeleneseToJava { return beginning.replaceFirst("\n", "") + ": op not meaningful from rc client"; } if (op.endsWith("AndWait")) { - if (!op.startsWith("click")) { - ending += EOL + "selenium.waitForPageToLoad(\"" + timeOut + "\");"; - } + ending += EOL + "selenium.waitForPageToLoad(\"" + timeOut + "\");"; op = op.replaceFirst("AndWait", ""); tokens[0] = tokens[0].replaceFirst("AndWait", ""); }
wait for page to load after when translating "clickAndWait" r<I>
SeleniumHQ_selenium
train
java
de6376141292061cd59093fe2043936941232b2a
diff --git a/nx-dev/nx-dev/tailwind.config.js b/nx-dev/nx-dev/tailwind.config.js index <HASH>..<HASH> 100644 --- a/nx-dev/nx-dev/tailwind.config.js +++ b/nx-dev/nx-dev/tailwind.config.js @@ -52,6 +52,12 @@ module.exports = { 'code::after': { content: '', }, + 'blockquote p:first-of-type::before': { + content: '', + }, + 'blockquote p:last-of-type::after': { + content: '', + }, }, }, },
docs(core): remove extra quotes for blockquote (#<I>)
nrwl_nx
train
js
2ceeaa90534231489944e55c42e8c819c95664d6
diff --git a/bcbio/variation/gatkjoint.py b/bcbio/variation/gatkjoint.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/gatkjoint.py +++ b/bcbio/variation/gatkjoint.py @@ -84,6 +84,9 @@ def _run_genotype_gvcfs_genomicsdb(genomics_db, region, out_file, data): "-R", dd.get_ref_file(data), "--output", tx_out_file, "-L", bamprep.region_to_gatk(region)] + # Avoid slow genotyping runtimes with improved quality score calculation in GATK4 + # https://gatkforums.broadinstitute.org/gatk/discussion/11471/performance-troubleshooting-tips-for-genotypegvcfs/p1 + params += ["--use-new-qual-calculator"] cores = dd.get_cores(data) memscale = {"magnitude": 0.9 * cores, "direction": "increase"} if cores > 1 else None broad_runner.run_gatk(params, memscale=memscale)
GATK4: improve GenotypeGVCFs speed with new-qual Swaps to use improved speed in GATK4's new quality calculator. Fixes #<I>
bcbio_bcbio-nextgen
train
py
91c1d5abf84487f86fc3a46fca090f10dfa98c97
diff --git a/sovrin_client/test/cli/test_tutorial_manual.py b/sovrin_client/test/cli/test_tutorial_manual.py index <HASH>..<HASH> 100644 --- a/sovrin_client/test/cli/test_tutorial_manual.py +++ b/sovrin_client/test/cli/test_tutorial_manual.py @@ -51,7 +51,6 @@ def testGettingStartedTutorialAgainstSandbox(newGuyCLI, be, do): @pytest.mark.skipif('sys.platform == "win32"', reason='SOV-384') -@pytest.mark.skipif('sys.platform == "linux"', reason='SOV-501') def testManual(do, be, poolNodesStarted, poolTxnStewardData, philCLI, connectedToTest, nymAddedOut, attrAddedOut, schemaAdded, issuerKeyAdded, aliceCLI, newKeyringOut, aliceMap,
[#SOV-<I>] remove skip statement which was bring back accidentally in previous merge
hyperledger-archives_indy-client
train
py
628734bface78cc8b85a0ffa6359032902e14785
diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index <HASH>..<HASH> 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -1029,7 +1029,7 @@ public class BranchSDK extends CordovaPlugin { JSONObject response = new JSONObject(); - if (error == null) { + if (error == null || url != null) { try { response.put("url", url);
fix: corrected android long url with no tracking
BranchMetrics_cordova-ionic-phonegap-branch-deep-linking
train
java
30dd336889e03f7c8405fdf95cdcc29824bf08a7
diff --git a/packages/posts/sources/cachePosts.js b/packages/posts/sources/cachePosts.js index <HASH>..<HASH> 100644 --- a/packages/posts/sources/cachePosts.js +++ b/packages/posts/sources/cachePosts.js @@ -2,13 +2,14 @@ import logger from "../lib/logger"; import initializedSources from "./"; const cachePosts = searchParams => { - return Promise.all(initializedSources.map(postSource => { - return postSource.getAllServicePosts(searchParams) - .catch(error => { - logger.error(error); - return []; - }); - })); + return initializedSources + .then(initializedSources => Promise.all(initializedSources.map(postSource => { + return postSource.getAllServicePosts(searchParams) + .catch(error => { + logger.error(error); + return []; + }); + }))); }; export default cachePosts;
fix(posts): `initializedSources` is actually a Promised array.
randytarampi_me
train
js
5e7b5084bc626c8214d41c5e3f4c2783b5b4de05
diff --git a/eZ/Publish/Core/Repository/Tests/Service/InMemory/RepositoryTest.php b/eZ/Publish/Core/Repository/Tests/Service/InMemory/RepositoryTest.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Repository/Tests/Service/InMemory/RepositoryTest.php +++ b/eZ/Publish/Core/Repository/Tests/Service/InMemory/RepositoryTest.php @@ -13,7 +13,7 @@ use eZ\Publish\Core\Repository\Tests\Service\RepositoryTest as BaseRepositoryTes /** * Test case for Repository Service using InMemory storage class */ -class RoleTest extends BaseRepositoryTest +class RepositoryTest extends BaseRepositoryTest { protected function getRepository() {
Fix wrong class name from cc<I>a5
ezsystems_ezpublish-kernel
train
php
d89c2e439823e0a94d1d0504075a3e22bc16a7ad
diff --git a/ui/AbstractEditor.js b/ui/AbstractEditor.js index <HASH>..<HASH> 100644 --- a/ui/AbstractEditor.js +++ b/ui/AbstractEditor.js @@ -45,7 +45,7 @@ class AbstractEditor extends Component { this.editingBehavior = this.editorSession.editingBehavior this.markersManager = this.editorSession.markersManager - this.ResourceManageranager = new ResourceManager(this.editorSession, this.getChildContext()) + this.resourceManager = new ResourceManager(this.editorSession, this.getChildContext()) } /** @@ -89,6 +89,7 @@ class AbstractEditor extends Component { globalEventHandler: this.globalEventHandler, iconProvider: this.iconProvider, labelProvider: this.labelProvider, + resourceManager: this.resourceManager, // ATTENTION: this is a map of tool target names to maps of tool names to tools // i.e. a declarative way to map tools to tool groups toolGroups: this.toolGroups,
Expose resourceManger properly.
substance_substance
train
js
03cfbffad729646e268d33bd8c3411b592ea3290
diff --git a/src/frontend/org/voltdb/sysprocs/UpdateApplicationBase.java b/src/frontend/org/voltdb/sysprocs/UpdateApplicationBase.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/sysprocs/UpdateApplicationBase.java +++ b/src/frontend/org/voltdb/sysprocs/UpdateApplicationBase.java @@ -272,7 +272,6 @@ public abstract class UpdateApplicationBase extends VoltNTSystemProcedure { retval.worksWithElastic = diff.worksWithElastic(); } catch (PrepareDiffFailureException e) { - compilerLog.warn(e.getMessage(), e); throw e; } catch (Exception e) {
ENG-<I>: Remove unhelpful log warning with stack trace. (#<I>)
VoltDB_voltdb
train
java
d77d29daf9257b411d7f420cbc6fe28cb96570b7
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ function WindowPage() { this.format = function(obj) { var query = QueryString.stringify(obj.query); if (query) obj.search = query; - else obj.search = null; + else delete obj.search; if (obj.path) { var help = this.parse(obj.path); obj.pathname = help.pathname;
Everything passed to search is casted to string
kapouer_window-page
train
js
daf0813c02fd12feae03172a26680d487c45f21e
diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -537,7 +537,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate foreach ($this->items as $key => $item) { - if ($value($item, $key)) return $key; + if (call_user_func($value, $item, $key)) return $key; } return false;
Get rid of PHPStorm warning
laravel_framework
train
php
416875f4863c6270496ffa38425aba4584024edf
diff --git a/domain/pool/poolstore.go b/domain/pool/poolstore.go index <HASH>..<HASH> 100644 --- a/domain/pool/poolstore.go +++ b/domain/pool/poolstore.go @@ -48,14 +48,12 @@ type storeImpl struct { //GetResourcePools Get a list of all the resource pools func (ps *storeImpl) GetResourcePools(ctx datastore.Context) ([]ResourcePool, error) { defer ctx.Metrics().Stop(ctx.Metrics().Start("PoolStore.GetResourcePools")) - plog.Debug("Pool Store.GetResourcePools") return query(ctx, "_exists_:ID") } // GetResourcePoolsByRealm gets a list of resource pools for a given realm func (s *storeImpl) GetResourcePoolsByRealm(ctx datastore.Context, realm string) ([]ResourcePool, error) { defer ctx.Metrics().Stop(ctx.Metrics().Start("PoolStore.GetResourcePoolsByRealm")) - plog.WithField("realml", realm).Debug("Pool Store.GetResourcePoolsByRealm") id := strings.TrimSpace(realm) if id == "" { return nil, errors.New("empty realm not allowed")
Remove execution flow logging from pool store because we don't have it in the other stores
control-center_serviced
train
go
ff8f6c969d733ea46290f5efc44a6b86da64e5d1
diff --git a/simplelru/lru_interface.go b/simplelru/lru_interface.go index <HASH>..<HASH> 100644 --- a/simplelru/lru_interface.go +++ b/simplelru/lru_interface.go @@ -10,7 +10,7 @@ type LRUCache interface { // updates the "recently used"-ness of the key. #value, isFound Get(key interface{}) (value interface{}, ok bool) - // Check if a key exsists in cache without updating the recent-ness. + // Checks if a key exists in cache without updating the recent-ness. Contains(key interface{}) (ok bool) // Returns key's value without updating the "recently used"-ness of the key. @@ -31,6 +31,6 @@ type LRUCache interface { // Returns the number of items in the cache. Len() int - // Clear all cache entries + // Clears all cache entries. Purge() }
Fix typo: 'exsists' (#<I>)
hashicorp_golang-lru
train
go
458eff5bd1640b7113da436523a04c2ac2fc254c
diff --git a/mixbox/entities.py b/mixbox/entities.py index <HASH>..<HASH> 100644 --- a/mixbox/entities.py +++ b/mixbox/entities.py @@ -294,6 +294,42 @@ class Entity(object): return cls.from_dict(d) + def _get_namespaces(self, recurse=True): + """Only used in a couple places in nose tests now.""" + nsset = set() + + # Get all _namespaces for parent classes + namespaces = [x._namespace for x in self.__class__.__mro__ + if hasattr(x, '_namespace')] + + nsset.update(namespaces) + + #In case of recursive relationships, don't process this item twice + self.touched = True + if recurse: + for x in self._get_children(): + if not hasattr(x, 'touched'): + nsset.update(x._get_namespaces()) + del self.touched + + return nsset + + def _get_children(self): + #TODO: eventually everything should be in _fields, not the top level + # of vars() + + members = {} + members.update(vars(self)) + members.update(self._fields) + + for v in six.itervalues(members): + if isinstance(v, Entity): + yield v + elif isinstance(v, list): + for item in v: + if isinstance(item, Entity): + yield item + @classmethod def istypeof(cls, obj): """Check if `cls` is the type of `obj`
Re-added the Entity._get_namespaces() and Entity._get_children() methods, since it turned out there are some python-cybox tests which use them. They don't seem to be used anywhere else; makes me think maybe the tests should be rewritten...
CybOXProject_mixbox
train
py
22aee2494adaf28f482dd56c9861421e7e06237b
diff --git a/fieldpath.go b/fieldpath.go index <HASH>..<HASH> 100644 --- a/fieldpath.go +++ b/fieldpath.go @@ -157,6 +157,27 @@ func newFieldpathHuffman() HuffmanTree { return buildTree(huffmanlist) } +// Returns the static huffman tree based on our observed tree states +func newFieldpathHuffmanStatic() HuffmanTree { + var h HuffmanTree + h = &HuffmanNode{0, nil, nil} + + addNode(h, 0, 1, 0) // PlusOne + addNode(h, 1, 2, 1) // EncodingFinish + addNode(h, 7, 4, 2) // PlusTwo + addNode(h, 11, 5, 3) // PlusN + addNode(h, 19, 6, 4) // PlusThree + addNode(h, 51, 6, 5) // PopAllButOnePlusOne + addNode(h, 91, 8, 6) // PushOneLeftDeltaOneRightZero + addNode(h, 283, 10, 7) // NonTopoComplexPack4Bits + addNode(h, 1819, 11, 8) // NonTopoComplex + addNode(h, 2843, 12, 9) // PushOneLeftDeltaZeroRightZero + addNode(h, 17179, 15, 10) // PopOnePlusOne + addNode(h, 103195, 27, 11) // PushTwoLeftDeltaZero + + return h +} + func PlusOne(r *reader, fp *fieldpath) { _debugf("Name: %s", fp.parent.Name)
Added newFieldpathHuffmanStatic function
dotabuff_manta
train
go
eefd0414d82c713a2155392772c39a4baa49c6b5
diff --git a/src/ossos-pipeline/ossos/ssos.py b/src/ossos-pipeline/ossos/ssos.py index <HASH>..<HASH> 100644 --- a/src/ossos-pipeline/ossos/ssos.py +++ b/src/ossos-pipeline/ossos/ssos.py @@ -62,9 +62,16 @@ class TracksParser(object): input_mpc_lines = filestr.split('\n') mpc_observations = [] + next_comment = None for line in input_mpc_lines: mpc_observation = mpc.Observation.from_string(line) - if mpc_observation is not None: + if isinstance(mpc_observation, mpc.MPCComment): + next_comment = mpc_observation + continue + if isinstance(mpc_observation, mpc.Observation): + if next_comment is not None: + mpc_observation.comment = next_comment + next_comment = None mpc_observations.append(mpc_observation) mpc_observations.sort(key=lambda obs: obs.date.jd) @@ -221,7 +228,8 @@ class SSOSParser(object): ccd=None, version='p', ext='.fits', - subdir=None) + subdir="") + logger.debug('Trying to access {}'.format(image_uri)) if not storage.exists(image_uri, force=False):
allow MPC lines to have the comment preceeding the astrometric line. This ability should be more generic for creating an observation but I'm not sure how.
OSSOS_MOP
train
py
17a34ccfe1a3e07748250fdbafe7a43c2cb1ca1f
diff --git a/Migrations/DatabaseMigrationRepository.php b/Migrations/DatabaseMigrationRepository.php index <HASH>..<HASH> 100755 --- a/Migrations/DatabaseMigrationRepository.php +++ b/Migrations/DatabaseMigrationRepository.php @@ -121,7 +121,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface { // The migrations table is responsible for keeping track of which of the // migrations have actually run for the application. We'll create the // table to hold the migration file's path as well as the batch ID. - $table->string('migration'); + $table->string('migration')->unique(); $table->integer('batch'); });
Add a unique index to migration column
illuminate_database
train
php
098ed9b094d7df2bae5f9dfc0493829df930a0ab
diff --git a/tests/test_pytest_cover.py b/tests/test_pytest_cover.py index <HASH>..<HASH> 100644 --- a/tests/test_pytest_cover.py +++ b/tests/test_pytest_cover.py @@ -1,11 +1,10 @@ import os import sys +import subprocess import virtualenv - import py import pytest -import subprocess import pytest_cover.plugin pytest_plugins = 'pytester', 'cov' @@ -188,6 +187,34 @@ def test_central_coveragerc(testdir): assert result.ret == 0 +def test_show_missing_coveragerc(testdir): + script = testdir.makepyfile(SCRIPT) + testdir.tmpdir.join('.coveragerc').write(""" +[run] +source = . + +[report] +show_missing = true +""") + + result = testdir.runpytest('-v', + '--cov', + '--cov-report=term', + script) + + result.stdout.fnmatch_lines([ + '*- coverage: platform *, python * -*', + 'Name * Stmts * Miss * Cover * Missing', + 'test_show_missing_coveragerc* %s * 11' % SCRIPT_RESULT, + '*10 passed*', + ]) + + # single-module coverage report + assert result.stdout.lines[-3].startswith('test_show_missing_coveragerc') + + assert result.ret == 0 + + def test_no_cov_on_fail(testdir): script = testdir.makepyfile(SCRIPT_FAIL)
Test that --cov-report=term will report missing lines if .coveragerc has show_missing=true. Ref #1.
pytest-dev_pytest-cov
train
py
19073295e5912d707b328056cb50bcfb7cd8c049
diff --git a/testing/mgo.go b/testing/mgo.go index <HASH>..<HASH> 100644 --- a/testing/mgo.go +++ b/testing/mgo.go @@ -9,6 +9,7 @@ import ( "net" "os" "os/exec" + "path/filepath" "strconv" stdtesting "testing" "time" @@ -40,10 +41,18 @@ func startMgoServer() error { if err != nil { return err } + pemPath := filepath.Join(dbdir, "server.pem") + err = ioutil.WriteFile(pemPath, []byte(CACertPEM + CAKeyPEM), 0600) + if err != nil { + return fmt.Errorf("cannot write cert/key PEM: %v", err) + } mgoport := strconv.Itoa(FindTCPPort()) mgoargs := []string{ "--auth", "--dbpath", dbdir, + "--sslOnNormalPorts", + "--sslPEMKeyFile", pemPath, + "--sslPEMKeyPassword", "ignored", "--bind_ip", "localhost", "--port", mgoport, "--nssize", "1",
testing: start mgo with ssl
juju_juju
train
go
24963d8833905356cfdcb197fb575f3eade8750e
diff --git a/src/NodejsPhpFallback/NodejsPhpFallback.php b/src/NodejsPhpFallback/NodejsPhpFallback.php index <HASH>..<HASH> 100644 --- a/src/NodejsPhpFallback/NodejsPhpFallback.php +++ b/src/NodejsPhpFallback/NodejsPhpFallback.php @@ -6,6 +6,8 @@ use Composer\Composer; use Composer\IO\IOInterface; use Composer\Json\JsonFile; use Composer\Script\Event; +use Exception; +use Throwable; class NodejsPhpFallback { @@ -245,7 +247,14 @@ class NodejsPhpFallback $remindedChoice = static::getConfirmRemindedChoiceFile(); if (!file_exists($remindedChoice) || !is_readable($remindedChoice)) { - $manual = strtolower($io->ask($message)); + try { + $manual = strtolower($io->ask($message)); + } catch (Exception $e) { + return 'y'; + } catch (Throwable $e) { + return 'y'; + } + @file_put_contents($remindedChoice, $manual); return $manual;
Fallback to "yes" if IO ask fail
kylekatarnls_nodejs-php-fallback
train
php
e1ab713cecc76ce71f52dc2fa3d2ad4ca14b73b8
diff --git a/llrb.go b/llrb.go index <HASH>..<HASH> 100644 --- a/llrb.go +++ b/llrb.go @@ -158,6 +158,11 @@ func (self *Node) moveRedRight() *Node { return self } +// Len returns the number of elements stored in the Tree. +func (self *Tree) Len() int { + return self.Count +} + // Get returns the first match of q in the Tree. If insertion without // replacement is used, this is probably not what you want. func (self *Tree) Get(q Comparable) Comparable { @@ -171,11 +176,6 @@ func (self *Tree) Get(q Comparable) Comparable { return n.Elem } -// Len returns the number of elements stored in the Tree. -func (self *Tree) Len() int { - return self.Count -} - func (self *Node) search(q Comparable) (n *Node) { n = self for n != nil {
Code reorganisation: Fix interrupted function pair Get and search should be adjacent.
biogo_store
train
go
bb288cbbb9d3b0bfe5dd553a6c8095a3338e90a4
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js +++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js @@ -695,6 +695,8 @@ define([ var _h = Hover.formatMarkdownHover(completion.doc); if(_h) { obj.content += _h.content; + } else { + obj.content += proposal.name; } } if(completion.url) {
Bug <I> - [assist] Proposals with ignored doc show empty hover
eclipse_orion.client
train
js
72699c8d3b075515c7bb005ae284798044880a21
diff --git a/lib/i18n-inflector/interpolate.rb b/lib/i18n-inflector/interpolate.rb index <HASH>..<HASH> 100644 --- a/lib/i18n-inflector/interpolate.rb +++ b/lib/i18n-inflector/interpolate.rb @@ -284,13 +284,12 @@ module I18n # process each token from set results = tokens.split(OPERATOR_COMPLEX).map do |token| raise IndexError.new if token.empty? - r = interpolate_core( - PATTERN_MARKER + kinds.next + '{' + token + ':' + value + '}', - locale, options) if value == LOUD_MARKER - break if r.empty? - elsif r != value - break # stop with this set, because something is not matching + r = interpolate_core("#{PATTERN_MARKER}#{kinds.next}{#{token}:#{value}|@}", locale, options) + break if r == PATTERN_MARKER + else + r = interpolate_core("#{PATTERN_MARKER}#{kinds.next}{#{token}:#{value}}", locale, options) + break if r != value # stop with this set, because something is not matching end r end
Interpolation routine for complex kinds simplified
siefca_i18n-inflector
train
rb
ff95e466918fc570a0195232c44887a31736a282
diff --git a/lib/dm-validations.rb b/lib/dm-validations.rb index <HASH>..<HASH> 100644 --- a/lib/dm-validations.rb +++ b/lib/dm-validations.rb @@ -47,6 +47,10 @@ module DataMapper resource end end + + # models that are non DM resources must get .validators + # and other methods, too + model.extend Validate::ClassMethods end # Ensures the object is valid for the context provided, and otherwise
[dm-validations] When DataMapper::Validate is included, extend model with class methods, since it may be a non DM model. * Makes it possible to use DM validations gem with non DataMapper models
emmanuel_aequitas
train
rb
decf2f3df426e3c268e36e9c076a3fba6e14d6b5
diff --git a/Form/FileType.php b/Form/FileType.php index <HASH>..<HASH> 100644 --- a/Form/FileType.php +++ b/Form/FileType.php @@ -41,6 +41,7 @@ class FileType extends AbstractType implements DataMapperInterface, EventSubscri 'multiple' => false, 'options' => [], 'required_message' => 'Choose a file.', + 'allow_file_upload' => true, ]) ->setAllowedTypes('class', 'string') ->setAllowedTypes('multiple', 'bool')
Fixing FileType according tonew option allow_file_upload
vaniocz_vanio-domain-bundle
train
php
870725b8543ecf0f583dc37cda183b05963da521
diff --git a/src/Controller/Frontend/Basket/Standard.php b/src/Controller/Frontend/Basket/Standard.php index <HASH>..<HASH> 100644 --- a/src/Controller/Frontend/Basket/Standard.php +++ b/src/Controller/Frontend/Basket/Standard.php @@ -423,7 +423,7 @@ class Standard } // remove service rebate of original price - $price = $provider->calcPrice( $this->get() )->setRebate( '0.00' ); + $price = $provider->calcPrice( $this->get(), $config )->setRebate( '0.00' ); $orderBaseServiceManager = \Aimeos\MShop::create( $context, 'order/base/service' );
Pass config options to calcPrice() of service providers
aimeos_ai-controller-frontend
train
php
28a212e7ad198cf6d5387264b7a949f6f58fa06d
diff --git a/js/gatecoin.js b/js/gatecoin.js index <HASH>..<HASH> 100644 --- a/js/gatecoin.js +++ b/js/gatecoin.js @@ -176,6 +176,12 @@ module.exports = class gatecoin extends Exchange { ], }, }, + 'fees': { + 'trading': { + 'maker': 0.0025, + 'taker': 0.0035, + }, + }, }); }
gatecoin: taker/maker fees added
ccxt_ccxt
train
js
f9ade9a2f9b42eb2eccc314f06f63ea6c92c1eb4
diff --git a/src/UDB2/EventRepository.php b/src/UDB2/EventRepository.php index <HASH>..<HASH> 100644 --- a/src/UDB2/EventRepository.php +++ b/src/UDB2/EventRepository.php @@ -81,13 +81,11 @@ class EventRepository implements RepositoryInterface // At this point we need to have // - the user associated with the event, from the metadata // - the token and secret of the user stored in the database - $token = ''; - $secret = ''; + $metadata = $domainMessage->getMetadata()->serialize(); + $tokenCredentials = $metadata['uitid_token_credentials']; + //throw new \Exception($userId); $entryAPI = $this->entryAPIFactory->withTokenCredentials( - new TokenCredentials( - $token, - $secret - ) + $tokenCredentials ); $entryAPI->addTagToEvent( $event,
iii-<I>: Use token credentials from context (temporarily)
cultuurnet_udb3-php
train
php
00420a83c0283e7b02a5385d78d0ec984120a852
diff --git a/lib/branches/get-tags.js b/lib/branches/get-tags.js index <HASH>..<HASH> 100644 --- a/lib/branches/get-tags.js +++ b/lib/branches/get-tags.js @@ -14,15 +14,10 @@ module.exports = async ({cwd, env, options: {tagFormat}}, branches) => { return pReduce( branches, async (branches, branch) => { - const branchTags = await Promise.all( - (await getTags(branch.name, {cwd, env})) - .map(tag => { - const [, version, channel] = tag.match(tagRegexp) || []; - return {gitTag: tag, version, channel}; - }) - .filter(({version}) => version && semver.valid(semver.clean(version))) - .map(async ({gitTag, ...rest}) => ({gitTag, ...rest})) - ); + const branchTags = (await getTags(branch.name, {cwd, env})).reduce((tags, tag) => { + const [, version, channel] = tag.match(tagRegexp) || []; + return version && semver.valid(semver.clean(version)) ? [...tags, {gitTag: tag, version, channel}] : tags; + }, []); debug('found tags for branch %s: %o', branch.name, branchTags); return [...branches, {...branch, tags: branchTags}];
fix: simplify `get-tags` algorithm
semantic-release_semantic-release
train
js
c49443e3567dedb5e1f265a2522dafa9aa625d3e
diff --git a/tests/core/network/test_grids.py b/tests/core/network/test_grids.py index <HASH>..<HASH> 100644 --- a/tests/core/network/test_grids.py +++ b/tests/core/network/test_grids.py @@ -191,6 +191,10 @@ class TestMVGridDing0(object): Checks that the ring obtained from the rings_nodes function setting the include_root_node parameter to "True" contains the list of nodes that are expected. + Currently the test doesn't check the consistency of the + order of the items in the resulting list. It only checks + if all the nodes expected are present and the + length of the list is the same """ ring, grid = ring_mvgridding0 station = grid.station() @@ -201,7 +205,8 @@ class TestMVGridDing0(object): generators[1], station] rings_nodes = list(grid.rings_nodes(include_root_node=True))[0] - assert rings_nodes == rings_nodes_expected + assert len(rings_nodes) == len(rings_nodes_expected) + assert set(rings_nodes) == set(rings_nodes_expected) def test_rings_nodes_root_only_exclude_root(self, ring_mvgridding0): """
Made one more test a little less stringent based on design recommendations
openego_ding0
train
py
bf1797be1c5d72eb6f86502bbe6fd1bb0eb73d21
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,9 +42,6 @@ RSpec.configure do |config| # config.mock_with :rr config.mock_with :rspec - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true.
Fix reading files from specs for v1.x
solidusio-contrib_solidus_shipwire
train
rb
bcccd51bc6ea41fcf0401d5bbd99bf07e279a9ef
diff --git a/azurerm/resource_arm_application_gateway.go b/azurerm/resource_arm_application_gateway.go index <HASH>..<HASH> 100644 --- a/azurerm/resource_arm_application_gateway.go +++ b/azurerm/resource_arm_application_gateway.go @@ -1357,10 +1357,12 @@ func flattenApplicationGatewayWafConfig(waf *network.ApplicationGatewayWebApplic } func flattenApplicationGatewaySslPolicy(policy *network.ApplicationGatewaySslPolicy) []interface{} { - result := make([]interface{}, 0, len(*policy.DisabledSslProtocols)) + result := make([]interface{}, 0) - for _, proto := range *policy.DisabledSslProtocols { - result = append(result, string(proto)) + if protocols := policy.DisabledSslProtocols; protocols != nil { + for _, proto := range *protocols { + result = append(result, string(proto)) + } } return result
Fixing a crash where DisabledSSLProtocols could be nil
terraform-providers_terraform-provider-azurerm
train
go
e4fc1a606b1f05b5368f6fc85f96e9f7154bc642
diff --git a/lib/DirectEditing.js b/lib/DirectEditing.js index <HASH>..<HASH> 100644 --- a/lib/DirectEditing.js +++ b/lib/DirectEditing.js @@ -16,7 +16,7 @@ function DirectEditing(eventBus, canvas) { this._providers = []; this._textbox = new TextBox({ container: canvas.getPaper().node.parentNode, - keyHandler: this._handleKey.bind(this) + keyHandler: _.bind(this._handleKey, this) }); }
fix(plug-in): use _.bind instead of Function#bind Function#bind is not supported in older webkit browsers.
bpmn-io_diagram-js-direct-editing
train
js
2ea55b1c86e925267c828b40bbbef8efdf80b9e7
diff --git a/src/ZipCodeValidator/Constraints/ZipCodeValidator.php b/src/ZipCodeValidator/Constraints/ZipCodeValidator.php index <HASH>..<HASH> 100644 --- a/src/ZipCodeValidator/Constraints/ZipCodeValidator.php +++ b/src/ZipCodeValidator/Constraints/ZipCodeValidator.php @@ -101,7 +101,7 @@ class ZipCodeValidator extends ConstraintValidator 'HT' => '\\d{4}', 'HU' => '\\d{4}', 'ID' => '\\d{5}', - 'IE' => '[\\dA-Z]{3} ?[\\dA-Z]{4}', + 'IE' => '[\\dA-Z]{3}( ?[\\dA-Z]{4})?', 'IL' => '\\d{5}(?:\\d{2})?', 'IM' => 'IM\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}', 'IN' => '\\d{6}',
Change to allow the second part of an Irish postcode to be optional (#<I>)
barbieswimcrew_zip-code-validator
train
php
b4903cabf642f7acdc1f629c8b081b2945732dd2
diff --git a/src/Controller.php b/src/Controller.php index <HASH>..<HASH> 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -13,6 +13,7 @@ namespace app\admin; use infuse\Inflector; use infuse\Utility as U; +use infuse\View; class Controller { @@ -48,7 +49,7 @@ class Controller 'title' => Inflector::titleize( $module ), 'adminViewsDir' => $this->adminViewsDir ]; - $this->app[ 'view_engine' ]->assignData( $adminViewParams ); + $this->app[ 'view_engine' ]->setGlobalParameters($adminViewParams); // set module param if module is not using scaffolding $controller = '\\app\\' . $module . '\\Controller'; @@ -156,7 +157,7 @@ class Controller $params[ 'modelJSON' ] = json_encode( $modelInfo ); $params[ 'ngApp' ] = 'models'; - $res->render( $this->adminViewsDir . 'model', $params ); + return new View($this->adminViewsDir . 'model', $params); } /////////////////////////
support Response/View changes to infuse/libs
infusephp_admin
train
php
58b26e4703dbbb39ad9f915ba4f440a6c0a35983
diff --git a/tests/api/test_sentinelhub_batch.py b/tests/api/test_sentinelhub_batch.py index <HASH>..<HASH> 100644 --- a/tests/api/test_sentinelhub_batch.py +++ b/tests/api/test_sentinelhub_batch.py @@ -68,6 +68,8 @@ def test_create_and_run_batch_request(batch_client, requests_mock): } } }, + "tileCount": 42, + "status": "CREATED", } } ],
fixed failing batch test by adding new fields in mocked response
sentinel-hub_sentinelhub-py
train
py
3e19ef87cc467f1a7689586f21414bbf99702c90
diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index <HASH>..<HASH> 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -111,7 +111,7 @@ module Rake if args.empty? task_name = key arg_names = [] - deps = value + deps = value || [] else task_name = args.shift arg_names = key diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index <HASH>..<HASH> 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -59,6 +59,11 @@ class TestRakeDefinitions < Rake::TestCase assert_raises(RuntimeError) { Task[:x].invoke } end + def test_falsey_dependencies + task :x => nil + assert_equal [], Task[:x].prerequisites + end + def test_implicit_file_dependencies runs = [] create_existing_file
Ignore falsey dependencies When creating Rake tasks programatically, it could so happen that the prerequisites reach the point of creation as an argument. This change teaches the Rake DSL to ignore falsey (`nil' or `false') values when they are specified as the dependencies; this way, programmatic creation does not have to deal with a special case.
ruby_rake
train
rb,rb
8b4f509234544279180a4201dc1868faaf88e6c6
diff --git a/lib/boot/load/tymly-loader/load-dir.js b/lib/boot/load/tymly-loader/load-dir.js index <HASH>..<HASH> 100644 --- a/lib/boot/load/tymly-loader/load-dir.js +++ b/lib/boot/load/tymly-loader/load-dir.js @@ -28,7 +28,6 @@ module.exports = function loadDir (rootDir, allComponents, options) { }) const rootComponents = {} - let componentDir componentDirs.forEach( function (componentTypeDir) { @@ -37,7 +36,7 @@ module.exports = function loadDir (rootDir, allComponents, options) { rootComponents[componentTypeName] = {} } if (componentTypeDir[0] !== '.' && COMPONENT_DIR_BLACKLIST.indexOf(componentTypeName) === -1) { - componentDir = path.join(rootDir, componentTypeDir) + const componentDir = path.join(rootDir, componentTypeDir) const dirContent = fs.readdirSync(componentDir) dirContent.forEach( function (filename) {
refactor: Move componentDir declaration into the loop
wmfs_tymly-core
train
js
f865a9238fb700dcdf4d4355d2237f7466f9cf7a
diff --git a/app/models/no_cms/blocks/concerns/model_with_slots.rb b/app/models/no_cms/blocks/concerns/model_with_slots.rb index <HASH>..<HASH> 100644 --- a/app/models/no_cms/blocks/concerns/model_with_slots.rb +++ b/app/models/no_cms/blocks/concerns/model_with_slots.rb @@ -24,8 +24,8 @@ module NoCms::Blocks::Concerns # In the dup implementation we configure the `dup_block_when_duping_slot` # virtual attribute of the slot with the same value than the attribute # from this model. This way we propagate the configuration. - def dup_with_slots options = {} - duplicated = dup_without_slots + def dup + duplicated = super # We just need to dub root slots, if there are nested slots # will be dupped in each slot block_slots.roots.each do |slot| @@ -36,8 +36,6 @@ module NoCms::Blocks::Concerns end duplicated end - alias_method_chain :dup, :slots - end end
Removing deprecated alias_method_chain Issue #<I>
simplelogica_nocms-blocks
train
rb
1bbbb0a101377b57b342ae0fc03045f0bca44581
diff --git a/boatd_client/__init__.py b/boatd_client/__init__.py index <HASH>..<HASH> 100644 --- a/boatd_client/__init__.py +++ b/boatd_client/__init__.py @@ -1 +1 @@ -from boatd_client import Boat +from .boatd_client import Boat
Fix build for python 3.x
boatd_python-boatd
train
py
5d422c93f1e8d6444dcf7682d28da9e9e52bacff
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,6 +28,7 @@ module.exports = { 'react/style-prop-object': 'off', 'react/display-name': 'off', 'react/require-default-props': 'off', - 'react/forbid-component-props': 'off' + 'react/forbid-component-props': 'off', + 'react/no-unused-prop-types': 'off' } }; \ No newline at end of file
Disable react/no-unused-prop-types
paypal_paypal-checkout-components
train
js
f3f1e569e29c72d6eb673f3b4666e0d6dd7915a4
diff --git a/km3pipe/io/hdf5.py b/km3pipe/io/hdf5.py index <HASH>..<HASH> 100644 --- a/km3pipe/io/hdf5.py +++ b/km3pipe/io/hdf5.py @@ -107,8 +107,16 @@ class HDF5Sink(Module): return blob def finish(self): - for tab in self._tables.values(): - tab.cols.event_id.create_index() + for tab in self._tables.itervalues(): + if 'frame_id' in tab.colnames: + print("Creating index for '{0}' using 'frame_id'..." + .format(tab.name)) + tab.cols.frame_id.create_index() + elif 'event_id' in tab.colnames: + print("Creating index for '{0}' using 'event_id'..." + .format(tab.name)) + tab.cols.event_id.create_index() + tab.flush() self.h5file.root._v_attrs.km3pipe = str(kp.__version__) self.h5file.root._v_attrs.pytables = str(tb.__version__)
Fixing indexing bug. I am not crazy
tamasgal_km3pipe
train
py
c0fcff17f5bec5dd051a8652bbf21233c20e1dd6
diff --git a/lib/tokyo_metro/static/operator/info.rb b/lib/tokyo_metro/static/operator/info.rb index <HASH>..<HASH> 100644 --- a/lib/tokyo_metro/static/operator/info.rb +++ b/lib/tokyo_metro/static/operator/info.rb @@ -18,6 +18,10 @@ class TokyoMetro::Static::Operator::Info < TokyoMetro::Static::Fundamental::Info include ::OdptCommon::Modules::MethodMissing::Decision::Common::Operator + def self.instance_variable_names + [ :same_as , :name , :index , :additional_infos , :twitter_account_info ] + end + # @!group Constructor # Constructor
<I>_<I> Update - TokyoMetro::Static::Operator::Info
osorubeki-fujita_odpt_tokyo_metro
train
rb
01d94cc31c7af3aa9cdf86ca9b72bdad82a72cc6
diff --git a/openpnm/geometry/StickAndBall2D.py b/openpnm/geometry/StickAndBall2D.py index <HASH>..<HASH> 100644 --- a/openpnm/geometry/StickAndBall2D.py +++ b/openpnm/geometry/StickAndBall2D.py @@ -45,10 +45,10 @@ class StickAndBall2D(GenericGeometry): >>> pn = op.network.CubicDual(shape=[5, 5, 5]) >>> Ps = pn.pores('primary') >>> Ts = pn.throats('primary') - >>> geo1 = op.geometry.StickAndBall_2D(network=pn, pores=Ps, throats=Ts) + >>> geo1 = op.geometry.StickAndBall2D(network=pn, pores=Ps, throats=Ts) >>> Ps = pn.pores('secondary') >>> Ts = pn.throats(['secondary', 'interconnect']) - >>> geo2 = op.geometry.StickAndBall_2D(network=pn, pores=Ps, throats=Ts) + >>> geo2 = op.geometry.StickAndBall2D(network=pn, pores=Ps, throats=Ts) Now override the 'pore.diameter' values on the ``geo2`` object:
Class names shouldn't have underscores
PMEAL_OpenPNM
train
py
e08c654f3c79048ae83f08c1452be4167bca900d
diff --git a/pyvista/plotting/colors.py b/pyvista/plotting/colors.py index <HASH>..<HASH> 100644 --- a/pyvista/plotting/colors.py +++ b/pyvista/plotting/colors.py @@ -152,6 +152,16 @@ white whitesmoke yellow yellowgreen +tab:blue +tab:orange +tab:green +tab:red +tab:purple +tab:brown +tab:pink +tab:gray +tab:olive +tab:cyan """ @@ -305,7 +315,17 @@ hexcolors = { 'white': '#FFFFFF', 'whitesmoke': '#F5F5F5', 'yellow': '#FFFF00', - 'yellowgreen': '#9ACD32'} + 'yellowgreen': '#9ACD32', + 'tab:blue': '#1f77b4', + 'tab:orange': '#ff7f0e', + 'tab:green': '#2ca02c', + 'tab:red': '#d62728', + 'tab:purple': '#9467bd', + 'tab:brown': '#8c564b', + 'tab:pink': '#e377c2', + 'tab:gray': '#7f7f7f', + 'tab:olive': '#bcbd22', + 'tab:cyan': '#17becf'} color_char_to_word = { 'b': 'blue',
add new colors (#<I>)
vtkiorg_vtki
train
py
d370045ef1107cb8420854047e017efe390bdee1
diff --git a/mistletoe/block_token.py b/mistletoe/block_token.py index <HASH>..<HASH> 100644 --- a/mistletoe/block_token.py +++ b/mistletoe/block_token.py @@ -404,7 +404,6 @@ class ListItem(BlockToken): lines.anchor() prepend = -1 leader = None - newline = 0 line_buffer = [] next_line = lines.peek() # first line in list item @@ -420,13 +419,25 @@ class ListItem(BlockToken): next_line = lines.peek() if empty_first_line and next_line is not None and next_line.strip() == '': return line_buffer, prepend, leader - while (next_line is not None - and not cls.parse_marker(next_line, prepend, leader)): + newline = 0 + while True: + # no more lines + if next_line is None: + # strip off newlines + if newline: + del line_buffer[-newline:] + break + # not in continuation if not cls.in_continuation(next_line, prepend): + # next_line is a new list item + if cls.parse_marker(next_line, prepend, leader): + break + # not another item, has newlines -> not continuation if newline: del line_buffer[-newline:] break - elif cls.other_token(next_line): + # directly followed by another token + if cls.other_token(next_line): break line = next(lines) stripped = line.lstrip(' ')
refactor ListItem.read condition checks
miyuchina_mistletoe
train
py
68e0499b1a9f587252c006d69f48f226e16d5f7f
diff --git a/azurerm/provider.go b/azurerm/provider.go index <HASH>..<HASH> 100644 --- a/azurerm/provider.go +++ b/azurerm/provider.go @@ -340,11 +340,11 @@ func Provider() terraform.ResourceProvider { "azurerm_mysql_virtual_network_rule": resourceArmMySqlVirtualNetworkRule(), "azurerm_network_connection_monitor": resourceArmNetworkConnectionMonitor(), "azurerm_network_ddos_protection_plan": resourceArmNetworkDDoSProtectionPlan(), + "azurerm_network_interface": resourceArmNetworkInterface(), "azurerm_network_interface_application_gateway_backend_address_pool_association": resourceArmNetworkInterfaceApplicationGatewayBackendAddressPoolAssociation(), "azurerm_network_interface_application_security_group_association": resourceArmNetworkInterfaceApplicationSecurityGroupAssociation(), "azurerm_network_interface_backend_address_pool_association": resourceArmNetworkInterfaceBackendAddressPoolAssociation(), "azurerm_network_interface_nat_rule_association": resourceArmNetworkInterfaceNatRuleAssociation(), - "azurerm_network_interface": resourceArmNetworkInterface(), "azurerm_network_packet_capture": resourceArmNetworkPacketCapture(), "azurerm_network_profile": resourceArmNetworkProfile(), "azurerm_network_security_group": resourceArmNetworkSecurityGroup(),
Fix: gofmt issue for provider.go
terraform-providers_terraform-provider-azurerm
train
go
e56ad35287fddf8c90f8bfc32a3415e513a6b6cb
diff --git a/lib/mongoid/validations/uniqueness.rb b/lib/mongoid/validations/uniqueness.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/validations/uniqueness.rb +++ b/lib/mongoid/validations/uniqueness.rb @@ -156,8 +156,8 @@ module Mongoid #:nodoc: # # @since def scope_value_changed?(document) - Array.wrap(options[:scope]).reduce(false) do |result, item| - (result || document.send("attribute_changed?", item.to_s)) + Array.wrap(options[:scope]).any? do |item| + document.send("attribute_changed?", item.to_s) end end end
Changed *reduce* to *any?*, since any? is more optimized in case of multiple scopes. It's also more readable.
mongodb_mongoid
train
rb
70c5cfaebb311aeb0c9879f62bf18092e1ad5701
diff --git a/Controller/BlogController.php b/Controller/BlogController.php index <HASH>..<HASH> 100644 --- a/Controller/BlogController.php +++ b/Controller/BlogController.php @@ -53,7 +53,7 @@ class BlogController extends Controller $date = null; if (null !== $filter) { - $tag = $this->get('icap.blog.tag_repository')->findOneByName($filter); + $tag = $this->get('icap.blog.tag_repository')->findOneBySlug($filter); if (null === $tag) { $author = $this->getDoctrine()->getRepository('ClarolineCoreBundle:User')->findOneByUsername($filter);
[BlogBundle] Retrieving tag from slug for searching
claroline_Distribution
train
php
5bcc8e23aea0d639261f29d4195805bdb026587a
diff --git a/admin_media.php b/admin_media.php index <HASH>..<HASH> 100644 --- a/admin_media.php +++ b/admin_media.php @@ -1276,12 +1276,11 @@ echo WT_JS_START; ?> echo '<br />'; } } - echo "</td></tr>"; break; } } - if ($passCount==1 && $printDone) echo "<tr><td class=\"\" colspan=\"3\">&nbsp;</td></tr>"; + if ($passCount==1 && !$isExternal && $printDone) echo "<tr><td class=\"\" colspan=\"3\">&nbsp;</td></tr>"; } ?> </tbody>
fix: error when the jquery table don't appear
fisharebest_webtrees
train
php
46fff33a5c247720adee007fd374f43445e94b28
diff --git a/acceptance/tests/modules/install/with_modulepath.rb b/acceptance/tests/modules/install/with_modulepath.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/modules/install/with_modulepath.rb +++ b/acceptance/tests/modules/install/with_modulepath.rb @@ -9,7 +9,7 @@ step "Install a module with relative modulepath" on master, "cd /etc/puppet/modules2 && puppet module install pmtacceptance-nginx --modulepath=." do assert_output <<-OUTPUT Preparing to install into /etc/puppet/modules2 ... - Downloading from http://forge.puppetlabs.com ... + Downloading from https://forge.puppetlabs.com ... Installing -- do not interrupt ... /etc/puppet/modules2 └── pmtacceptance-nginx (\e[0;36mv0.0.1\e[0m) @@ -22,7 +22,7 @@ step "Install a module with absolute modulepath" on master, puppet('module install pmtacceptance-nginx --modulepath=/etc/puppet/modules2') do assert_output <<-OUTPUT Preparing to install into /etc/puppet/modules2 ... - Downloading from http://forge.puppetlabs.com ... + Downloading from https://forge.puppetlabs.com ... Installing -- do not interrupt ... /etc/puppet/modules2 └── pmtacceptance-nginx (\e[0;36mv0.0.1\e[0m)
(#<I>) Fix test to expect https not http After a <I>.x -> <I>rc rollup the with_modulepath system test was failing due to the conversion to HTTPS. This patch converts the test.
puppetlabs_puppet
train
rb
91730b8448cdc6038c5db9e9ffab48a58a24be43
diff --git a/core/common/src/test/java/alluxio/AlluxioURITest.java b/core/common/src/test/java/alluxio/AlluxioURITest.java index <HASH>..<HASH> 100644 --- a/core/common/src/test/java/alluxio/AlluxioURITest.java +++ b/core/common/src/test/java/alluxio/AlluxioURITest.java @@ -11,20 +11,18 @@ package alluxio; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; + import alluxio.util.OSUtils; -import org.junit.Assert; -import org.junit.Assume; import org.junit.Test; import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; -import static org.junit.Assume.assumeTrue; - /** * Unit tests for {@link AlluxioURI}. */
[SMALLFIX] Fix build
Alluxio_alluxio
train
java
2e46c6e469b55970e19cb00ec3df8b26cd343c43
diff --git a/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/VcfRepository.java b/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/VcfRepository.java index <HASH>..<HASH> 100644 --- a/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/VcfRepository.java +++ b/molgenis-data-vcf/src/main/java/org/molgenis/data/vcf/VcfRepository.java @@ -338,9 +338,9 @@ public class VcfRepository extends AbstractRepository if (isListValue) { // TODO support list of primitives datatype - return MolgenisFieldTypes.FieldTypeEnum.STRING; + return MolgenisFieldTypes.FieldTypeEnum.TEXT; } - return MolgenisFieldTypes.FieldTypeEnum.STRING; + return MolgenisFieldTypes.FieldTypeEnum.TEXT; default: throw new MolgenisDataException("unknown vcf info type [" + vcfMetaInfo.getType() + "]"); }
change "string" VCF INFO fields to TEXT because we don't know how many characters it can contain
molgenis_molgenis
train
java
a6a3496011b4758ab345016f7c7747868d6b5bc7
diff --git a/cfgrib/messages.py b/cfgrib/messages.py index <HASH>..<HASH> 100644 --- a/cfgrib/messages.py +++ b/cfgrib/messages.py @@ -260,7 +260,7 @@ class FileStream(collections.Iterable): break except Exception: if self.errors == 'ignore': - logging.exception("skipping corrupted Message") + LOG.exception("skipping corrupted Message") else: raise
Bugfix: minor, use the configured logger.
ecmwf_cfgrib
train
py
6acce3fc394f65bd002b727fb974bdd0788d6767
diff --git a/lib/active_remote/persistence.rb b/lib/active_remote/persistence.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/persistence.rb +++ b/lib/active_remote/persistence.rb @@ -238,7 +238,6 @@ module ActiveRemote run_callbacks :create do # Use the getter here so we get the type casting. new_attributes = attributes - new_attributes.delete(primary_key.to_s) response = rpc.execute(:create, new_attributes) diff --git a/spec/lib/active_remote/persistence_spec.rb b/spec/lib/active_remote/persistence_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/active_remote/persistence_spec.rb +++ b/spec/lib/active_remote/persistence_spec.rb @@ -208,7 +208,7 @@ describe ::ActiveRemote::Persistence do subject { Tag.new } it "creates the record" do - expected_attributes = subject.attributes.reject { |key, value| key == "guid" } + expected_attributes = subject.attributes expect(rpc).to receive(:execute).with(:create, expected_attributes) subject.save end
Allow primary_key to be set on create ActiveRecord allows the primary key to be set on create. This makes ActiveRemote#create behave the same way by allowing the primary_key attribute to be sent in a create operation.
liveh2o_active_remote
train
rb,rb
d09b6167e130a061799059a4987fddd73b918186
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java b/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/resources/TaskResource.java @@ -684,7 +684,6 @@ public class TaskResource extends AbstractLeaderAwareResource { @Override public STATE onBodyPartReceived(HttpResponseBodyPart bodyPart) throws Exception { - LOG.trace("Proxying download of {} from Mesos: Body chunk has length={}", requestBuilder.build().getUrl(), bodyPart.length()); bodyPart.writeTo(wrappedOutputStream); wrappedOutputStream.flush(); return STATE.CONTINUE;
This is way too verbose even for TRACE.
HubSpot_Singularity
train
java
cef8fbbb08d8db9767f78832de9aed82025ecd07
diff --git a/design/satellite_passes.py b/design/satellite_passes.py index <HASH>..<HASH> 100644 --- a/design/satellite_passes.py +++ b/design/satellite_passes.py @@ -1,3 +1,12 @@ +""" +On my laptop, this script shows that simply computing the positions and +the sunlit-ness of the ISS for each of the 381 seconds of this pass +takes roughly the same amount of time as mounting a full search for the +moment it passes into shadow. But the benefit is far greater, because +with almost no additional expense all altitudes and azimuths can also +be computed. + +""" import numpy as np from skyfield import almanac, api from skyfield.nutationlib import iau2000b @@ -62,11 +71,4 @@ DT = time() - T0 print(DT, 'to re-use the positions to compute altitude and azimuth') -print(''' -On my laptop, this script shows that simply computing the positions and -the sunlit-ness of the ISS for each of the 381 seconds of this pass -takes roughly the same amount of time as mounting a full search for the -moment it passes into shadow. But the benefit is far greater, because -with almost no additional expense all altitudes and azimuths can also -be computed. -''') +print(__doc__.rstrip())
Move explanation to top where folks might see it
skyfielders_python-skyfield
train
py
477da6de0d092fce849c78a308ae2e28ada786c3
diff --git a/tests/test_disque.py b/tests/test_disque.py index <HASH>..<HASH> 100644 --- a/tests/test_disque.py +++ b/tests/test_disque.py @@ -166,9 +166,8 @@ class TestDisque(unittest.TestCase): assert stat.get('jobs-in', None) is not None assert stat.get('jobs-out', None) is not None - # TODO (canardleteer): bring this back - """ def test_shownack(self): + """Test that NACK and SHOW work appropriately.""" queuename = "test_show-%s" % self.testID test_job = six.b("Show me.") @@ -179,12 +178,10 @@ class TestDisque(unittest.TestCase): for queue_name, job_id, job in jobs: self.client.nack_job(job_id) - shown = self.client.show(job_id) + shown = self.client.show(job_id, True) - print(shown) + assert shown.get('body') == test_job + assert shown.get('nacks') == 1 - assert shown[six.b('body')] == test_job - assert shown[six.b('nacks')] == 1 - """ if __name__ == '__main__': unittest.main()
Added a unit test for the new SHOW / dict style.
ybrs_pydisque
train
py
08e9e33cd1ab86fa499df3a263a9ecc2d89fbf17
diff --git a/tests/testcases/unpublication_tests.py b/tests/testcases/unpublication_tests.py index <HASH>..<HASH> 100644 --- a/tests/testcases/unpublication_tests.py +++ b/tests/testcases/unpublication_tests.py @@ -76,7 +76,8 @@ class UnpublicationTestCase(unittest.TestCase): prefix=self.prefix, coupler=self.coupler, data_node=self.data_node, - message_timestamp='some_moment' + message_timestamp='some_moment', + consumer_solr_url='fake_solr_foo' ) return assistant @@ -183,7 +184,8 @@ class UnpublicationTestCase(unittest.TestCase): "message_timestamp": "anydate", "drs_id": self.drs_id, "data_node": self.data_node, - "ROUTING_KEY": "unpublish_all_versions" + "ROUTING_KEY": "unpublish_all_versions", + "consumer_solr_url":"fake_solr_foo" } received_rabbit_task = self.__get_received_message_from_rabbit_mock(self.coupler, 0) messagesOk = tests.utils.compare_json_return_errormessage(expected_rabbit_task, received_rabbit_task)
Unit tests: Fixed unpublication tests (added new mandatory arg 'consumer_solr_url').
IS-ENES-Data_esgf-pid
train
py
7bbb9be53dfab8393ec2093c19a7235e5c18bf5c
diff --git a/tasks/config.js b/tasks/config.js index <HASH>..<HASH> 100644 --- a/tasks/config.js +++ b/tasks/config.js @@ -17,6 +17,15 @@ const shared = { module: { loaders: [{ test: /\.js$/, + exclude: /node_modules/, + loader: 'babel', + query: { + presets: ['es2015'], + plugins: ['transform-runtime'] + } + }, { + test: /\.js$/, + include: /node_modules\/(hoek|qs|wreck|boom)/, loader: 'babel', query: { presets: ['es2015'],
fix(build): Do not run all deps through babel
ipfs_js-ipfs
train
js
3a49f3f4430c26562687bfeccf83b0b27b089ac3
diff --git a/osrparse/utils.py b/osrparse/utils.py index <HASH>..<HASH> 100644 --- a/osrparse/utils.py +++ b/osrparse/utils.py @@ -64,7 +64,7 @@ class KeyMania(IntFlag): K7 = 1 << 6 K8 = 1 << 7 -class ReplayEvent: +class ReplayEvent(abc.ABC): def __init__(self, time_delta: int): self.time_delta = time_delta @@ -92,6 +92,9 @@ class ReplayEventOsu(ReplayEvent): return (f"{self.time_delta} ({self.x}, {self.y}) " f"{self.keys}") + def _members(self): + return (self.time_delta, self.x, self.y, self.keys) + class ReplayEventTaiko(ReplayEvent): def __init__(self, time_delta: int, x: int, keys: int): super().__init__(time_delta)
fix _members not being defined for ReplayEventOsu
kszlim_osu-replay-parser
train
py
50bc196b5b9238736c5ed231ceaa822f337b140d
diff --git a/lib/ruby_expect/expect.rb b/lib/ruby_expect/expect.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_expect/expect.rb +++ b/lib/ruby_expect/expect.rb @@ -257,6 +257,7 @@ module RubyExpect # end # def expect *patterns, &block + @logger.debug("Expecting #{patterns.inspect}") if @logger.debug? patterns = pattern_escape(*patterns) @end_time = 0 if (@timeout != 0) @@ -271,6 +272,7 @@ module RubyExpect @last_match = nil patterns.each_index do |i| if (match = patterns[i].match(@buffer)) + @logger.debug("Matched #{match}") if @logger.debug? @last_match = match @before = @buffer.slice!(0...match.begin(0)) @match = @buffer.slice!(0...match.to_s.length) @@ -285,6 +287,7 @@ module RubyExpect return matched_index end end + @logger.debug("Timeout") return nil end @@ -356,7 +359,7 @@ module RubyExpect else input = @read_fh.readpartial(4096) @buffer << input - @logger.debug(input) if (@logger.debug?) + @logger.info(input) if (@logger.info?) end end rescue EOFError => e
Added some debugging and changed IO debugging to informational
abates_ruby_expect
train
rb
a27e272ebf9568b02cf82217f60f80dcebb80064
diff --git a/repo_hooks.go b/repo_hooks.go index <HASH>..<HASH> 100644 --- a/repo_hooks.go +++ b/repo_hooks.go @@ -95,6 +95,8 @@ type PayloadRepo struct { ID int64 `json:"id"` Name string `json:"name"` URL string `json:"url"` + SSHURL string `json:"ssh_url"` + CloneURL string `json:"clone_url"` Description string `json:"description"` Website string `json:"website"` Watchers int `json:"watchers"`
add more field to repo payload
gogs_go-gogs-client
train
go
1c36a55fc63c4b5d090a974b831dc374eaa729dd
diff --git a/goagen/gen_app/writers.go b/goagen/gen_app/writers.go index <HASH>..<HASH> 100644 --- a/goagen/gen_app/writers.go +++ b/goagen/gen_app/writers.go @@ -779,8 +779,8 @@ func Configure{{ goify .SchemeName true }}Security(service *goa.Service, f goa.{ return scopes } middleware := f(def, fetchScopes) -{{ else }}{{/* -*/}} middleware := f(def) +{{ else }} + middleware := f(def) {{ end }}{{/* */}} service.Context = context.WithValue(service.Context, securitySchemeKey({{ printf "%q" .SchemeName }}), middleware) }{{ end }}
Fix overzealous newline removal. (#<I>)
goadesign_goa
train
go
9f0f815e6e7b8eb2d3daa011a5baf61411c7a830
diff --git a/samples/update-intent.js b/samples/update-intent.js index <HASH>..<HASH> 100644 --- a/samples/update-intent.js +++ b/samples/update-intent.js @@ -17,6 +17,7 @@ process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements async function main(projectId, intentId, displayName) { + // [START dialogflow_update_intent_sample] const {IntentsClient} = require('@google-cloud/dialogflow'); const intentClient = new IntentsClient(); @@ -39,6 +40,7 @@ async function main(projectId, intentId, displayName) { //Send the request for update the intent. const result = await intentClient.updateIntent(updateIntentRequest); console.log(result); + // [END dialogflow_update_intent_sample] } process.on('unhandledRejection', err => {
docs: added region tags (#<I>)
googleapis_nodejs-dialogflow
train
js
87f3ec34b155c19a1f635f506a75494bb317b09a
diff --git a/src/materials/DepthCopyMaterial.js b/src/materials/DepthCopyMaterial.js index <HASH>..<HASH> 100644 --- a/src/materials/DepthCopyMaterial.js +++ b/src/materials/DepthCopyMaterial.js @@ -111,6 +111,19 @@ export class DepthCopyMaterial extends ShaderMaterial { } /** + * Sets the screen position of the texel to copy. + * + * @param {Number} x - The X-coordinate. + * @param {Number} y - The X-coordinate. + */ + + setScreenPosition(x, y) { + + this.uniforms.screenPosition.value.set(x, y); + + } + + /** * Returns the depth copy mode. * * @return {DepthCopyMode} The depth copy mode.
Add accessors for configurable uniforms Added setDepthBuffer() and setScreenPosition().
vanruesc_postprocessing
train
js
8a0bd68c393423a6c3bdae27d3826e6161a101c1
diff --git a/datasette/views/table.py b/datasette/views/table.py index <HASH>..<HASH> 100644 --- a/datasette/views/table.py +++ b/datasette/views/table.py @@ -200,11 +200,7 @@ class TableView(RowTableShared): "SELECT count(*) from sqlite_master WHERE type = 'view' and name=:n", {"n": table}, ) - )[ - 0 - ][ - 0 - ] + )[0][0] ) view_definition = None table_definition = None @@ -215,11 +211,7 @@ class TableView(RowTableShared): 'select sql from sqlite_master where name = :n and type="view"', {"n": table}, ) - )[ - 0 - ][ - 0 - ] + )[0][0] else: table_definition_rows = list( await self.execute(
Undid some slightly weird code formatting by 'black'
simonw_datasette
train
py
3e72ef8400e1e293a34022029ffded4f7a534502
diff --git a/phat-gui/src/main/java/phat/gui/logging/PrettyLogViewerPanel.java b/phat-gui/src/main/java/phat/gui/logging/PrettyLogViewerPanel.java index <HASH>..<HASH> 100644 --- a/phat-gui/src/main/java/phat/gui/logging/PrettyLogViewerPanel.java +++ b/phat-gui/src/main/java/phat/gui/logging/PrettyLogViewerPanel.java @@ -76,6 +76,8 @@ public class PrettyLogViewerPanel extends JPanel { for (int k = arg0.getFirstRow(); k <= arg0.getLastRow(); k++) { String agent = tableModel.getValueAt(k, 2).toString(); String simtime = tableModel.getValueAt(k, 1).toString(); + //removes the date from simtime string + simtime = simtime.split("-")[0]; String action = tableModel.getValueAt(k, 4).toString(); String type = tableModel.getValueAt(k, 5).toString(); String description = "";
Sim date is no longer showed on action preview
Grasia_phatsim
train
java
0b2fb7fd7890f9a5eb51c7ca4fa888378f540b15
diff --git a/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/tests/Doctrine/Tests/OrmFunctionalTestCase.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/OrmFunctionalTestCase.php +++ b/tests/Doctrine/Tests/OrmFunctionalTestCase.php @@ -219,7 +219,7 @@ abstract class OrmFunctionalTestCase extends OrmTestCase protected function tearDown() { $conn = static::$_sharedConn; - $platform = $this->_em->getConnection()->getDatabasePlatform(); + $platform = $conn->getDatabasePlatform(); $this->_sqlLoggerStack->enabled = false;
Fixed identifier quoting in functional tests.
doctrine_orm
train
php
595a06339fbf3827f7756fb7e1fa129ce8a6ee80
diff --git a/scenarios/kubernetes_e2e.py b/scenarios/kubernetes_e2e.py index <HASH>..<HASH> 100755 --- a/scenarios/kubernetes_e2e.py +++ b/scenarios/kubernetes_e2e.py @@ -329,7 +329,7 @@ if __name__ == '__main__': PARSER.add_argument( '--soak-test', action='store_true', help='If the test is a soak test job') PARSER.add_argument( - '--tag', default='v20170225-b97ce6de', help='Use a specific kubekins-e2e tag if set') + '--tag', default='v20170227-4ae05be9', help='Use a specific kubekins-e2e tag if set') PARSER.add_argument( '--test', default='true', help='If we need to set --test in e2e.go') PARSER.add_argument(
Update kubekins to <I>-4ae<I>be9
kubernetes_test-infra
train
py
c8c1a5791915f0e86207646074fba919055ebeac
diff --git a/autopep8.py b/autopep8.py index <HASH>..<HASH> 100755 --- a/autopep8.py +++ b/autopep8.py @@ -2248,7 +2248,9 @@ def is_python_file(filename): def main(): """Tool main.""" # Exit on broken pipe. - signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + if sys.platform != 'win32': + signal.signal(signal.SIGPIPE, signal.SIG_DFL) try: options, args = parse_args(sys.argv[1:])
SIGPIPE is not available on Windows
hhatto_autopep8
train
py
0996b37fe7ec4b55e9032de74508e0c814bbe4ba
diff --git a/src/ol/renderer/canvas/VectorLayer.js b/src/ol/renderer/canvas/VectorLayer.js index <HASH>..<HASH> 100644 --- a/src/ol/renderer/canvas/VectorLayer.js +++ b/src/ol/renderer/canvas/VectorLayer.js @@ -224,7 +224,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer { const multiWorld = vectorSource.getWrapX() && projection.canWrapX(); const worldWidth = multiWorld ? getWidth(projectionExtent) : null; const endWorld = multiWorld - ? Math.ceil((extent[2] + projectionExtent[2]) / worldWidth) + ? Math.ceil((extent[2] - projectionExtent[2]) / worldWidth) + 1 : 1; let world = multiWorld ? Math.floor((extent[0] - projectionExtent[0]) / worldWidth)
Fix end world calculation if projection is not symmetric
openlayers_openlayers
train
js
2aad6d8e1003d5edb16e7629f8d92928b1273067
diff --git a/volume/delete.go b/volume/delete.go index <HASH>..<HASH> 100644 --- a/volume/delete.go +++ b/volume/delete.go @@ -59,7 +59,9 @@ func (p *nfsProvisioner) ganeshaUnexport(volume *v1.PersistentVolume) error { return fmt.Errorf("PV doesn't have an annotation %s, can't remove the export from the server", annExportId) } exportId, _ := strconv.ParseUint(ann, 10, 16) + p.mapMutex.Lock() delete(p.exportIds, uint16(exportId)) + p.mapMutex.Unlock() // Call RemoveExport using dbus conn, err := dbus.SystemBus() @@ -90,7 +92,9 @@ func (p *nfsProvisioner) kernelUnexport(volume *v1.PersistentVolume) error { if ann, ok := volume.Annotations[annExportId]; ok { // If PV doesn't have this annotation it's no big deal for knfs exportId, _ := strconv.ParseUint(ann, 10, 16) + p.mapMutex.Lock() delete(p.exportIds, uint16(exportId)) + p.mapMutex.Unlock() } line, ok := volume.Annotations[annLine]
Lock deletion from map just in case...
kubernetes-incubator_external-storage
train
go
d6b3cc41aeaafc2bcde33a7dd89dcf7a8edacb35
diff --git a/boolean/boolean.py b/boolean/boolean.py index <HASH>..<HASH> 100644 --- a/boolean/boolean.py +++ b/boolean/boolean.py @@ -507,7 +507,7 @@ class Expression(object): Include recursively subexpressions symbols. This includes duplicates. """ - return [s for s in self.literals if isinstance(s, Symbol)] + return [s for s in self.get_literals() if isinstance(s, Symbol)] @property def symbols(self,):
Ensure that symbols are returned in a stable order.
bastikr_boolean.py
train
py
6421839957d76aea70d7843ec8e1e77ec04ad3df
diff --git a/src/main/java/org/iq80/leveldb/table/TableBuilder.java b/src/main/java/org/iq80/leveldb/table/TableBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/iq80/leveldb/table/TableBuilder.java +++ b/src/main/java/org/iq80/leveldb/table/TableBuilder.java @@ -76,7 +76,7 @@ public class TableBuilder public long getFileSize() throws IOException { - return fileChannel.position(); + return fileChannel.position() + dataBlockBuilder.currentSizeEstimate(); } public void add(BlockEntry blockEntry)
Include unwritten block in TableBuilder.getFileSize() estimate
dain_leveldb
train
java
01eba325e8b0180530815f297dfb8b295089ede0
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,6 +25,7 @@ exports.register = function(plugin, options, next) { host: options.host || 'localhost', dialect: options.dialect || 'mysql', port: options.port || 3306, + storage: options.storage || '', define: options.defaults || {} });
Added storage option in object passed to Sequelize Added storage option in object passed to Sequelize for the sqlite dialect
danecando_hapi-sequelize
train
js
6ba5ae77eecbd455dedd142817ce3a193f500647
diff --git a/pycbc/filter/matchedfilter.py b/pycbc/filter/matchedfilter.py index <HASH>..<HASH> 100644 --- a/pycbc/filter/matchedfilter.py +++ b/pycbc/filter/matchedfilter.py @@ -169,6 +169,26 @@ def sigma(htilde, psd = None, low_frequency_cutoff=None, return sqrt(sigmasq(htilde, psd, low_frequency_cutoff, high_frequency_cutoff)) def get_cutoff_indices(flow, fhigh, df, N): + """ + Gets the indices of a frequency series at which to stop an overlap calculation. + + Parameters + ---------- + flow: float + The frequency (in Hz) of the lower index. + fhigh: float + The frequency (in Hz) of the upper index. + df: float + The frequency step (in Hz) of the frequency series. + N: int + The number of points in the **time** series. Can be odd + or even. + + Returns + ------- + kmin: int + kmax: int + """ if flow: kmin = int(flow / df) else: @@ -176,7 +196,9 @@ def get_cutoff_indices(flow, fhigh, df, N): if fhigh: kmax = int(fhigh / df ) else: - kmax = N/2 + 1 + # int() truncates towards 0, so this is + # equivalent to the floor of the float + kmax = int((N + 1)/2.) return kmin,kmax
Apply matchedfilter nyquist bug fix from Collin as reported in <URL>
gwastro_pycbc
train
py
8d2375f70a2a1cc4abf1af5af2e1c007b3c397f5
diff --git a/lib/slingshot/results/item.rb b/lib/slingshot/results/item.rb index <HASH>..<HASH> 100644 --- a/lib/slingshot/results/item.rb +++ b/lib/slingshot/results/item.rb @@ -7,7 +7,7 @@ module Slingshot # and leaving everything else alone. # def initialize(args={}) - if args.is_a? Hash + if args.respond_to?(:each_pair) args.each_pair do |key, value| self[key.to_sym] = value.is_a?(Hash) ? self.class.new(value) : value end
[REFACTORING] Use message based type testing in Results::Item
karmi_retire
train
rb
afc36479bca9cc28009046d11d360322b597aa71
diff --git a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php @@ -368,7 +368,29 @@ class SqlServerGrammar extends Grammar */ public function supportsSavepoints() { - return false; + return true; + } + + /** + * Compile the SQL statement to define a savepoint. + * + * @param string $name + * @return string + */ + public function compileSavepoint($name) + { + return 'SAVE TRANSACTION '.$name; + } + + /** + * Compile the SQL statement to execute a savepoint rollback. + * + * @param string $name + * @return string + */ + public function compileSavepointRollBack($name) + { + return 'ROLLBACK TRANSACTION '.$name; } /**
Added nested transactions support for SqlServer (#<I>)
laravel_framework
train
php
68fefdbe1421a7d9c946bb4431a26436fc3070af
diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index <HASH>..<HASH> 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -468,7 +468,7 @@ function quiz_print_question($number, $questionid, $grade, $courseid, foreach ($answerids as $key => $answerid) { $answer = $answers[$answerid]; - $qnum = $key + 1; + $qnumchar = chr(ord('a') + $key); if (empty($feedback) or empty($response[$answerid])) { $checked = ""; @@ -483,9 +483,9 @@ function quiz_print_question($number, $questionid, $grade, $courseid, } echo "</TD>"; if (empty($feedback) or empty($correct[$answer->id])) { - echo "<TD valign=top>$qnum. $answer->answer</TD>"; + echo "<TD valign=top>$qnumchar. $answer->answer</TD>"; } else { - echo "<TD valign=top CLASS=highlight>$qnum. $answer->answer</TD>"; + echo "<TD valign=top CLASS=highlight>$qnumchar. $answer->answer</TD>"; } if (!empty($feedback)) { echo "<TD valign=top>&nbsp;";
Change MC answers to letters a, b, c etc ...
moodle_moodle
train
php
e8d40ba7fd9408c884e23e84ab11d604bdda7810
diff --git a/glue/ligolw/dbtables.py b/glue/ligolw/dbtables.py index <HASH>..<HASH> 100644 --- a/glue/ligolw/dbtables.py +++ b/glue/ligolw/dbtables.py @@ -494,9 +494,9 @@ class SearchSummaryTable(DBTable): for row in self: if process_ids is None or row.process_id in process_ids: if "," in row.ifos: - ifos = row.ifos.split(",") + ifos = map(str.strip, row.ifos.split(",")) elif "+" in row.ifos: - ifos = row.ifos.split("+") + ifos = map(str.strip, row.ifos.split("+")) else: ifos = [row.ifos] seglists |= segments.segmentlistdict([(ifo, segments.segmentlist([row.get_out()])) for ifo in ifos])
In SearchSummaryTable.get_out_segmentlistdict(), strip white space from the start and stop of comma- and plus-delimited instrument names.
gwastro_pycbc-glue
train
py
ae97c8f8a69a6c9b8229fac263540019529cdf59
diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java index <HASH>..<HASH> 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java @@ -145,13 +145,15 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy { do { OChannelBinaryAsynchClient network = null; String serverUrl = getNextAvailableServerURL(false, session); - try { - network = getNetwork(serverUrl); - } catch (OException e) { - serverUrl = useNewServerURL(serverUrl); - if (serverUrl == null) - throw e; - } + do { + try { + network = getNetwork(serverUrl); + } catch (OException e) { + serverUrl = useNewServerURL(serverUrl); + if (serverUrl == null) + throw e; + } + } while (network == null); try { // In case i do not have a token or i'm switching between server i've to execute a open operation.
fixed retry in case of an offline server
orientechnologies_orientdb
train
java
9000cf978356e7e897dda79c303e121e84e647d6
diff --git a/spec/ethon/easies/http/action_spec.rb b/spec/ethon/easies/http/action_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ethon/easies/http/action_spec.rb +++ b/spec/ethon/easies/http/action_spec.rb @@ -4,8 +4,22 @@ describe Ethon::Easies::Http::Action do let(:easy) { Ethon::Easy.new } describe ".reset" do - let(:action) { Ethon::Easies::Http::Action } - before { action.reset(easy) } + before do + easy.url = "abc" + easy.httpget = 1 + easy.httppost = 1 + easy.upload = 1 + easy.nobody = 1 + easy.customrequest = 1 + easy.postfieldsize = 1 + easy.copypostfields = 1 + easy.infilesize = 1 + described_class.reset(easy) + end + + it "unsets url" do + easy.url.should be_nil + end it "unsets httpget" do easy.httpget.should be_nil @@ -26,5 +40,17 @@ describe Ethon::Easies::Http::Action do it "unsets custom_request" do easy.customrequest.should be_nil end + + it "unsets postfieldsize" do + easy.postfieldsize.should be_nil + end + + it "unsets copypostfields" do + easy.copypostfields.should be_nil + end + + it "unsets infilesize" do + easy.infilesize.should be_nil + end end end
Add more specs for Action.reset.
typhoeus_ethon
train
rb
55d4ec7c69590419a6596a52c19d430309ab5135
diff --git a/BackofficeBundle/Resources/public/js/backboneRouter.js b/BackofficeBundle/Resources/public/js/backboneRouter.js index <HASH>..<HASH> 100644 --- a/BackofficeBundle/Resources/public/js/backboneRouter.js +++ b/BackofficeBundle/Resources/public/js/backboneRouter.js @@ -103,7 +103,7 @@ var OrchestraBORouter = Backbone.Router.extend({ mediaEdit: function(folderId, mediaId) { - this.initDisplayRouteChanges(); + this.initDisplayRouteChanges('#' + folderId); $.ajax({ url: 'http://openorchestra.dev/app_dev.php/api/media/' + mediaId, @@ -221,7 +221,7 @@ var OrchestraBORouter = Backbone.Router.extend({ return route; }, - + addParametersToRoute: function(options) { var Router = this,
[ci skip] Fix menu and poucet on F5
open-orchestra_open-orchestra-media-admin-bundle
train
js
d575e23971587d0262668aed46da97c6766a3f4d
diff --git a/lib/mpd_client.rb b/lib/mpd_client.rb index <HASH>..<HASH> 100644 --- a/lib/mpd_client.rb +++ b/lib/mpd_client.rb @@ -53,7 +53,6 @@ module MPD 'deleteid' => 'fetch_nothing', 'move' => 'fetch_nothing', 'moveid' => 'fetch_nothing', - 'playlist' => 'fetch_playlist', 'playlistfind' => 'fetch_songs', 'playlistid' => 'fetch_songs', 'playlistinfo' => 'fetch_songs', @@ -321,22 +320,22 @@ module MPD line end - def read_pair(separator) + def read_pair line = read_line return if line.nil? - line.split(separator, 2) + line.split(': ', 2) end - def read_pairs(separator = ': ') + def read_pairs result = [] - pair = read_pair(separator) + pair = read_pair while pair result << pair - pair = read_pair(separator) + pair = read_pair end result @@ -475,17 +474,6 @@ module MPD fetch_objects(['playlist']) end - def fetch_playlist - result = [] - - read_pairs(':').each do |_key, value| - value = value.chomp.force_encoding('utf-8') - result << value - end - - result - end - def fetch_stickers result = []
remove playlist command, instead use playlistinfo
mamantoha_mpd_client
train
rb
ffdba201492b1b767ba85c9cbbab149058930639
diff --git a/test/unquote-properties-test.js b/test/unquote-properties-test.js index <HASH>..<HASH> 100644 --- a/test/unquote-properties-test.js +++ b/test/unquote-properties-test.js @@ -11,4 +11,7 @@ var x = { 'class': 9, 1: 10, '2': 11, + [Math.random()]() { return 'oh no'; }, + [Math.random()]: 13, + ['quoted computed prop']: 14, }; diff --git a/test/unquote-properties-test.output.js b/test/unquote-properties-test.output.js index <HASH>..<HASH> 100644 --- a/test/unquote-properties-test.output.js +++ b/test/unquote-properties-test.output.js @@ -11,4 +11,7 @@ var x = { class: 9, 1: 10, 2: 11, + [Math.random()]() { return 'oh no'; }, + [Math.random()]: 13, + ['quoted computed prop']: 14, };
Add computed property test cases for unquote-properties transform.
cpojer_js-codemod
train
js,js
a805e37de839ac6b5393859139b28a316f2a1151
diff --git a/src/FontAwesome.php b/src/FontAwesome.php index <HASH>..<HASH> 100755 --- a/src/FontAwesome.php +++ b/src/FontAwesome.php @@ -156,7 +156,7 @@ class FontAwesome * @return $this * @throws InvalidArgumentException */ - public function attr($attr, $val) + public function addAttr($attr, $val) { if (is_string($attr) == false || is_string($val) === false) { throw new InvalidArgumentException(); @@ -175,7 +175,7 @@ class FontAwesome * @return $this * @throws InvalidArgumentException */ - public function attrs(array $attrs) + public function addAttrs(array $attrs) { foreach ($attrs as $attr => $val) { $this->attr($attr, $val);
Changing method names to include "add"
kevinkhill_FontAwesomePHP
train
php
8eed368d4f2c7a5369c7ae57615f0097c41a08fd
diff --git a/lib/SDPManagerUnified.js b/lib/SDPManagerUnified.js index <HASH>..<HASH> 100644 --- a/lib/SDPManagerUnified.js +++ b/lib/SDPManagerUnified.js @@ -339,18 +339,22 @@ class SDPManagerUnified extends SDPManager }; else //Update media info - transceiver.remote = mediaInfo; + transceiver.remote.info = mediaInfo; //Next transceiver i++; + //If we had a remote track they are different + if (transceiver.remote.track && transceiver.remote.track!=track) + { + //Stop it + transceiver.remote.track.stop(); + //Delete it from transceiver + delete (transceiver.remote.track); + } //Check new direction for remote stuff switch(mediaInfo.getDirection()) { case Direction.SENDRECV: case Direction.SENDONLY: - //If we had one nd they are different - if (transceiver.remote.track && transceiver.remote.track!=track) - //Stop it - transceiver.remote.track.stop(); //If we don't have stream if (!stream) {
Tentative fix for remote track removal
medooze_media-server-node
train
js
691923c44795d2d3f844c7ee1bdd9ee0ca31a0db
diff --git a/h2o-persist-hdfs/src/main/java/water/persist/PersistHdfs.java b/h2o-persist-hdfs/src/main/java/water/persist/PersistHdfs.java index <HASH>..<HASH> 100644 --- a/h2o-persist-hdfs/src/main/java/water/persist/PersistHdfs.java +++ b/h2o-persist-hdfs/src/main/java/water/persist/PersistHdfs.java @@ -295,10 +295,9 @@ public final class PersistHdfs extends Persist { } private static void addFolder(FileSystem fs, Path p, ArrayList<String> keys, ArrayList<String> failed) { + if (fs == null) return; + Futures futures = new Futures(); try { - if( fs == null ) return; - - Futures futures = new Futures(); for( FileStatus file : fs.listStatus(p, HIDDEN_FILE_FILTER) ) { Path pfs = file.getPath(); if(file.isDirectory()) { @@ -312,6 +311,8 @@ public final class PersistHdfs extends Persist { } catch( Exception e ) { Log.err(e); failed.add(p.toString()); + } finally { + futures.blockForPending(); } }
PUBDEV-<I>: Fix a race condition in Hdfs file import
h2oai_h2o-3
train
java
681cd29e15fcb55d907d814102cf9634863412ea
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ if (pathlib.existsSync('server/rpc/middleware')) { " /server/rpc/actions to /server/rpc\n\n" + "so that websocket middleware can be used by other websocket responders (including forthcoming models).\n" + "Please make this change to your existing project now then restart the server. Pasting this line into a UNIX-based shell should do the trick:\n\n" + - " mv server/rpc/middleware server && mv server/rpc/actions/* server/rpc/ && rm -d server/rpc/actions\n" + bar); + " mv server/rpc/middleware server && mv server/rpc/actions/* server/rpc/ && rm -fr server/rpc/actions\n" + bar); throw new Error("Please paste the line above into the shell then restart the server"); }
prevents command failing on osx because of .DS_Store
socketstream_socketstream
train
js
606c391d665ebb12ceb718e4666a30ef4dade728
diff --git a/lib/pretty_diff/chunk.rb b/lib/pretty_diff/chunk.rb index <HASH>..<HASH> 100644 --- a/lib/pretty_diff/chunk.rb +++ b/lib/pretty_diff/chunk.rb @@ -21,7 +21,14 @@ module PrettyDiff def find_lines [].tap do |lines| - wdiff(contents.split(/\r?\n|\r/)).each do |line_str| + plain_lines = contents.split(/\r?\n|\r/) + wdiff(contents.split(/\r?\n|\r/)).each_with_index do |line_str, idx| + begin + line_str =~ // + rescue ArgumentError + line_str = plain_lines[idx] + end + line = Line.new(self, line_str) next if line.ignored? lines << line
Experimental fix for per-word diffing that sometimes botches string encoding
isabanin_pretty_diff
train
rb
0b50e213248c80190f22a4b890c1aaf93fc4ee91
diff --git a/sprd/entity/SpecialTextConfiguration.js b/sprd/entity/SpecialTextConfiguration.js index <HASH>..<HASH> 100644 --- a/sprd/entity/SpecialTextConfiguration.js +++ b/sprd/entity/SpecialTextConfiguration.js @@ -14,7 +14,7 @@ define(['sprd/entity/DesignConfigurationBase', "sprd/util/ProductUtil", "js/core align: "center", initialized: false, commission: null, - + alignmentMatters: null, renderedText: null, renderedFontId: null, renderedAlign: null,
DEV-<I> made the conversion of regular text to fancy text to propagate and conserve the alignmentMatters flag
spreadshirt_rAppid.js-sprd
train
js
82ea254821136797a9f61d5e60e364089e56dd8d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ requirements = [ 'dill>0.2', 'sphinx', 'cython', - 'ipython==4.0.0', + 'ipython>=4.0.0', 'ipyparallel', 'ipykernel>=4.1', 'jupyter',
ipython <I> seems ok
dereneaton_ipyrad
train
py
c95c16ee9cfd080b389bbe4eb8ce16662ce06a2b
diff --git a/modules/directives/date/date.js b/modules/directives/date/date.js index <HASH>..<HASH> 100644 --- a/modules/directives/date/date.js +++ b/modules/directives/date/date.js @@ -37,7 +37,9 @@ angular.module('ui.directives') var userHandler = opts.onSelect; opts.onSelect = function (value, picker) { updateModel(); - return userHandler(value, picker); + scope.$apply(function() { + userHandler(value, picker); + }); }; } else { // No onSelect already specified so just update the model
Fix missing scope.$apply() for user onSelect event
angular-ui_ui-scrollpoint
train
js