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
ca010f7827c9e9688222051350accf9787e2af64
diff --git a/Entity/User.php b/Entity/User.php index <HASH>..<HASH> 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -10,7 +10,7 @@ use SumoCoders\FrameworkMultiUserBundle\ValueObject\Status; use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface; /** - * @ORM\Entity + * @ORM\Entity(repositoryClass="SumoCoders\FrameworkMultiUserBundle\User\DoctrineUserRepository") * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="discr", type="string") */
Set the doctrine repository as our base user's repository
sumocoders_FrameworkMultiUserBundle
train
php
af0133aea0074ef5f5dcef148bffc4e5df8bb02b
diff --git a/test/test_sparkline.py b/test/test_sparkline.py index <HASH>..<HASH> 100644 --- a/test/test_sparkline.py +++ b/test/test_sparkline.py @@ -8,14 +8,54 @@ Run from the root folder with either 'python setup.py test' or from __future__ import unicode_literals, print_function -from sparkline import sparklines +from sparklines import sparklines, scale_values -def test0(): +def test_scale0(): + "Test scale..." + + res = scale_values([1, 2, 3]) + exp = [1., 4., 8.] + assert res == exp + + +def test_scale1(): + "Test scale..." + + res = scale_values([1, 2, 3], num_lines=2) + exp = [1., 9., 18.] + assert res == exp + + +def test_scale_pi(): + "Test scale Pi." + + res = scale_values([3, 1, 4, 1, 5, 9, 2, 6]) + exp = [3, 1, 4, 1, 4, 8, 2, 5] + assert res == exp + + +def test_pi(): "Test first eight digits of Pi." res = sparklines([3, 1, 4, 1, 5, 9, 2, 6]) - exp = ['▃▁▄▁▅█▂▅'] + exp = ['▃▁▄▁▄█▂▅'] + assert res == exp + + +def test_minmax(): + "Test two values, min and max." + + res = sparklines([1, 8]) + exp = ['▁█'] # 1, 8 + assert res == exp + + +def test_rounding0(): + "Test two values, min and max." + + res = sparklines([1, 5, 8]) + exp = ['▁▅█'] # 1, 5, 8 assert res == exp
Added tests, respecting bankers rounding
deeplook_sparklines
train
py
d75b71fdff3648228a324c30f112875f3c3f5176
diff --git a/plugins/trader/portfolioManager.js b/plugins/trader/portfolioManager.js index <HASH>..<HASH> 100644 --- a/plugins/trader/portfolioManager.js +++ b/plugins/trader/portfolioManager.js @@ -158,24 +158,17 @@ Manager.prototype.trade = function(what, retry) { if(what === 'BUY') { amount = this.getBalance(this.currency) / this.ticker.ask; - - price = this.ticker.bid; - price *= 1e8; - price = Math.floor(price); - price /= 1e8; - - this.buy(amount, price); - + if(amount > 0){ + price = this.ticker.bid; + this.buy(amount, price); + } } else if(what === 'SELL') { - price *= 1e8; - price = Math.ceil(price); - price /= 1e8; - amount = this.getBalance(this.asset) - this.keepAsset; - if(amount < 0) amount = 0; - price = this.ticker.ask; - this.sell(amount, price); + if(amount > 0){ + price = this.ticker.ask; + this.sell(amount, price); + } } }; async.series([
initialize price and ensure amount > 0 to trade
askmike_gekko
train
js
87b3b50c4ed047afa92041ee6e1ed88db33272db
diff --git a/lib/authc/AuthRequestParser.js b/lib/authc/AuthRequestParser.js index <HASH>..<HASH> 100644 --- a/lib/authc/AuthRequestParser.js +++ b/lib/authc/AuthRequestParser.js @@ -24,7 +24,7 @@ function AuthRequestParser(request,locationsToSearch){ var searchHeader = locationsToSearch.indexOf('header') > -1; var searchUrl = locationsToSearch.indexOf('url') > -1; - var body = typeof req.body === 'object' ? req.body : {}; + var body = typeof req.body === 'object' && req.body !== null ? req.body : {}; var urlParams = url.parse(req.url,true).query;
Adding support for null bodies. Should fix #<I>.
stormpath_stormpath-sdk-node
train
js
ed7e60249aeea0c4a6290ab6ca458a7f5517dd8b
diff --git a/phy/session/session.py b/phy/session/session.py index <HASH>..<HASH> 100644 --- a/phy/session/session.py +++ b/phy/session/session.py @@ -388,7 +388,7 @@ class Session(BaseSession): self.model.add_clustering('empty', spike_clusters_orig) # Instantiate the KlustaKwik instance. - kk = KlustaKwik(**kwargs) + kk = KlustaKwik(**params) # Save the current clustering in the Kwik file. @kk.connect
Fixed bug in session with KK params.
kwikteam_phy
train
py
8b5efb21a6b0b5462223ba25ef5cabc41157b7ac
diff --git a/spec/addressable/uri_spec.rb b/spec/addressable/uri_spec.rb index <HASH>..<HASH> 100644 --- a/spec/addressable/uri_spec.rb +++ b/spec/addressable/uri_spec.rb @@ -1013,11 +1013,11 @@ describe Addressable::URI, "when parsed from " + end it "should have the correct password after assignment" do - @uri.password = "secret@123!" - @uri.password.should == "secret@123!" - @uri.normalized_password.should == "secret%40123%21" + @uri.password = "#secret@123!" + @uri.password.should == "#secret@123!" + @uri.normalized_password.should == "%23secret%40123%21" @uri.user.should == "" - @uri.normalize.to_s.should == "http://:secret%40123%[email protected]/" + @uri.normalize.to_s.should == "http://:%23secret%40123%[email protected]/" @uri.omit(:password).to_s.should == "http://example.com" end
Adding test for password assignment with reserved characters.
sporkmonger_addressable
train
rb
fdd94633a80100cf04d40214f048dccd82c54b0e
diff --git a/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php b/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php +++ b/system/src/Grav/Common/Markdown/MarkdownGravLinkTrait.php @@ -33,7 +33,7 @@ trait MarkdownGravLinkTrait if (!isset($url['host']) && isset($url['path'])) { // convert the URl is required - $Excerpt['element']['attributes']['href'] = $this->convertUrl($url['path']); + $Excerpt['element']['attributes']['href'] = $this->convertUrl(Uri::build_url($url)); } }
fix for markdown links with fragments and query elements
getgrav_grav
train
php
b80e88f221387a51836f6889d481c7433e226951
diff --git a/validator/validator.go b/validator/validator.go index <HASH>..<HASH> 100644 --- a/validator/validator.go +++ b/validator/validator.go @@ -47,7 +47,6 @@ func New( expectedClaims: jwt.Expected{ Issuer: issuerURL, Audience: audience, - Time: time.Now(), }, } @@ -88,6 +87,7 @@ func (v *Validator) ValidateToken(ctx context.Context, tokenString string) (inte } registeredClaims := *claimDest[0].(*jwt.Claims) + v.expectedClaims.Time = time.Now() if err = registeredClaims.ValidateWithLeeway(v.expectedClaims, v.allowedClockSkew); err != nil { return nil, fmt.Errorf("expected claims not validated: %w", err) }
Set expected time claim just before validating
auth0_go-jwt-middleware
train
go
8b45c242d64b9c9737df1260895540b3543c0e86
diff --git a/lib/generators/tolaria/install/install_generator.rb b/lib/generators/tolaria/install/install_generator.rb index <HASH>..<HASH> 100644 --- a/lib/generators/tolaria/install/install_generator.rb +++ b/lib/generators/tolaria/install/install_generator.rb @@ -6,7 +6,7 @@ module Tolaria source_root File.expand_path("../templates", __FILE__) def install - copy_file "tolaria_initializer.rb", "app/config/initializers/tolaria.rb" + copy_file "tolaria_initializer.rb", "config/initializers/tolaria.rb" migration_template "administrators_migration.rb", "db/migrate/create_administrators.rb" end
place the generated initializer in the correct directory
Threespot_tolaria
train
rb
edf586b8396e7163002fdbec1c7b69a65f9aadc4
diff --git a/src/CommandExtension/AlfredInteractiveCommand.php b/src/CommandExtension/AlfredInteractiveCommand.php index <HASH>..<HASH> 100644 --- a/src/CommandExtension/AlfredInteractiveCommand.php +++ b/src/CommandExtension/AlfredInteractiveCommand.php @@ -152,7 +152,7 @@ class AlfredInteractiveCommand extends ContainerAwareCommand implements LoggerAw } $argument = is_string($input->getArgument($name)) ? trim($input->getArgument($name), "'") : $input->getArgument($name); - if (is_null($argument)) { + if (is_null($argument) || $argument === '') { return $this->acFieldsList[$name]; } $matches = [];
Correct handling of zero value and empty string as option
dpeuscher_alfred-symfony-tools
train
php
6b501943831dcd591424a77c57ef3386b2a038ab
diff --git a/src/Query/Builder.php b/src/Query/Builder.php index <HASH>..<HASH> 100644 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -179,14 +179,18 @@ class Builder /** * Returns a new Query Builder instance. * + * @param string $baseDn + * * @return Builder */ - public function newInstance() + public function newInstance($baseDn = null) { // We'll set the base DN of the new Builder so // developers don't need to do this manually. + $dn = is_null($baseDn) ? $this->getDn() : $baseDn; + return (new static($this->connection, $this->grammar, $this->schema)) - ->setDn($this->getDn()); + ->setDn($dn); } /**
Allow setting the base DN with the newInstance method.
Adldap2_Adldap2
train
php
9654db0d0c46ddac8aa77a51f427166da1176a02
diff --git a/src/Search/Paginator.php b/src/Search/Paginator.php index <HASH>..<HASH> 100644 --- a/src/Search/Paginator.php +++ b/src/Search/Paginator.php @@ -34,7 +34,7 @@ class Paginator */ public function createOrmPaginator($queryBuilder, $page = 1, $maxPerPage = self::MAX_ITEMS) { - $paginator = new Pagerfanta(new DoctrineORMAdapter($queryBuilder, true, false)); + $paginator = new Pagerfanta(new DoctrineORMAdapter($queryBuilder)); $paginator->setMaxPerPage($maxPerPage); $paginator->setCurrentPage($page);
Fixed total count on list view when grouping data
EasyCorp_EasyAdminBundle
train
php
a2529f95e4bf217eb82ec30ede0aba1155aa658a
diff --git a/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java b/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java index <HASH>..<HASH> 100644 --- a/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java +++ b/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java @@ -102,6 +102,8 @@ public class FactoryProcessor extends ToothpickProcessor { } } + //TODO LOL it's not recursive !!! We don't recursively crawl the injection tree + private boolean isSingleInjectedConstructor(Element constructorElement) { TypeElement enclosingElement = (TypeElement) constructorElement.getEnclosingElement();
TODO make it recursive for optimistic creation of factories
stephanenicolas_toothpick
train
java
86dd2f841d29b326cc480e9c58de63f54799d2c1
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/testing/setup_and_teardown.rb +++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb @@ -8,7 +8,7 @@ module ActiveSupport include ActiveSupport::Callbacks define_callbacks :setup, :teardown - if defined? MiniTest + if defined?(MiniTest::Assertions) && TestCase < MiniTest::Assertions include ForMiniTest else include ForClassicTestUnit
Tightening the condition for including ActiveSupport::Testing::SetupAndTeardown::ForMiniTest. [#<I> state:committed]
rails_rails
train
rb
8010fc0c0cb2e3ab52c564c9c1f9b47e95975c9e
diff --git a/bika/lims/workflow/__init__.py b/bika/lims/workflow/__init__.py index <HASH>..<HASH> 100644 --- a/bika/lims/workflow/__init__.py +++ b/bika/lims/workflow/__init__.py @@ -103,9 +103,13 @@ def doActionFor(instance, action_id, active_only=True, allowed_transition=True): "Available transitions: {4}".format(action_id, clazzname, instance.getId(), currstate, transitions) - logger.error(msg) + logger.warning(msg) _logTransitionFailure(instance, action_id) return actionperformed, message + else: + logger.warning( + "doActionFor should never (ever) be called with allowed_transition" + "set to True as it avoids permission checks.") try: workflow.doActionFor(instance, action_id) actionperformed = True
Changed a doActionFor error to a warning.
senaite_senaite.core
train
py
9b48a9c38489bc624e1f9235c48994cc5d63173e
diff --git a/lib/chef/chef_fs/file_system/repository/acls_dir.rb b/lib/chef/chef_fs/file_system/repository/acls_dir.rb index <HASH>..<HASH> 100644 --- a/lib/chef/chef_fs/file_system/repository/acls_dir.rb +++ b/lib/chef/chef_fs/file_system/repository/acls_dir.rb @@ -28,14 +28,16 @@ class Chef module Repository class AclsDir < Repository::Directory + BARE_FILES = %w{ organization.json root } + def can_have_child?(name, is_dir) - is_dir ? Chef::ChefFS::FileSystem::ChefServer::AclsDir::ENTITY_TYPES.include?(name) : name == "organization.json" + is_dir ? Chef::ChefFS::FileSystem::ChefServer::AclsDir::ENTITY_TYPES.include?(name) : BARE_FILES.include?(name) end protected def make_child_entry(child_name) - if child_name == "organization.json" + if BARE_FILES.include? child_name Acl.new(child_name, self) else AclsSubDir.new(child_name, self)
Root ACLs are a top level json file not a sub-directory Ensure that we correctly write to them and manage them.
chef_chef
train
rb
6cafce547eda78285e4eec8f7cf1f562f9506f53
diff --git a/salt/modules/service.py b/salt/modules/service.py index <HASH>..<HASH> 100644 --- a/salt/modules/service.py +++ b/salt/modules/service.py @@ -35,6 +35,7 @@ def __virtual__(): 'Devuan', 'Arch', 'Arch ARM', + 'Manjaro', 'ALT', 'SUSE Enterprise Server', 'SUSE',
Disable the `service` module on Manjaro since it is using systemd
saltstack_salt
train
py
1aae5aaba4a4a6d17d0f5f5b0a9ae90c4d4c4af3
diff --git a/shared/android/app/src/main/java/io/keybase/ossifrage/KeybasePushNotificationListenerService.java b/shared/android/app/src/main/java/io/keybase/ossifrage/KeybasePushNotificationListenerService.java index <HASH>..<HASH> 100644 --- a/shared/android/app/src/main/java/io/keybase/ossifrage/KeybasePushNotificationListenerService.java +++ b/shared/android/app/src/main/java/io/keybase/ossifrage/KeybasePushNotificationListenerService.java @@ -100,7 +100,7 @@ public class KeybasePushNotificationListenerService extends FirebaseMessagingSer { CharSequence name = context.getString(R.string.channel_name); String description = context.getString(R.string.channel_description); - int importance = NotificationManager.IMPORTANCE_DEFAULT; + int importance = NotificationManager.IMPORTANCE_HIGH; NotificationChannel chat_channel = new NotificationChannel(CHAT_CHANNEL_ID, name, importance); chat_channel.setDescription(description); // Register the channel with the system; you can't change the importance
Make chat notifications have high importance (#<I>)
keybase_client
train
java
8f16b0cdec692a01593341cf962211fc597c4550
diff --git a/figlet-parser.go b/figlet-parser.go index <HASH>..<HASH> 100644 --- a/figlet-parser.go +++ b/figlet-parser.go @@ -4,6 +4,8 @@ import ( "fmt" "log" "os" + "path" + "runtime" "strconv" "strings" ) @@ -14,8 +16,9 @@ var charDelimiters = [3]string{"@", "#", "$"} var hardblanksBlacklist = [2]byte{'a', '2'} func getFile(name string) (file *os.File) { - file_path := fmt.Sprintf("../figure/fonts/%s.flf", name) //TODO change path - file, err := os.Open(file_path) + _, packageDir, _, _ := runtime.Caller(0) + filePath := fmt.Sprintf("%s/fonts/%s.flf", path.Dir(packageDir), name) + file, err := os.Open(filePath) if err != nil { log.Fatal("invalid font name.") }
fixes path to open font files, so package works when included with other projects.
common-nighthawk_go-figure
train
go
06a44fa3f7814ade7ac6f0c52a9edd807fd2012d
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,7 @@ end def mock_client_action(url, params) client = Minitest::Mock.new - client.expect(:action, { 'result' => 'done' }, [url, params].compact) + client.expect(:action, { 'result' => 'done' }, [url, params]) client end
`nil` isn't passed to mock action
nwjsmith_thumbtack
train
rb
36009d5541690a3c226fa37bf2e57a77bb62c4ec
diff --git a/src/main/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java b/src/main/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java +++ b/src/main/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java @@ -65,7 +65,7 @@ public class AtomPlacer3D { AtomPlacer3D(){} /** - * Initialize the atomPlacer class + * Initialize the atomPlacer class. * * @param parameterSet Force Field parameter as Hashtable */
This commit solves the nightly OpenJavaDocCheck report <URL>
cdk_cdk
train
java
b5b47f4ac56b2162ee15b4964b2309c4b1b798a1
diff --git a/hibernate-ogm-core/src/test/java/org/hibernate/ogm/test/utils/TestHelper.java b/hibernate-ogm-core/src/test/java/org/hibernate/ogm/test/utils/TestHelper.java index <HASH>..<HASH> 100644 --- a/hibernate-ogm-core/src/test/java/org/hibernate/ogm/test/utils/TestHelper.java +++ b/hibernate-ogm-core/src/test/java/org/hibernate/ogm/test/utils/TestHelper.java @@ -107,7 +107,7 @@ public class TestHelper { helper.dropSchemaAndDatabase( sessionFactory ); } catch ( Exception e ) { - log.warn( "Exception while dropping scheme and database in test", e ); + log.warn( "Exception while dropping schema and database in test", e ); } } }
OGM-<I> Refactor sessionfactory close logic in test to always drop database Also make drop database logic exception friendly
hibernate_hibernate-ogm
train
java
a702e08942eb23a58103ed61bf3fb44b7970cd31
diff --git a/hug/development_runner.py b/hug/development_runner.py index <HASH>..<HASH> 100644 --- a/hug/development_runner.py +++ b/hug/development_runner.py @@ -87,13 +87,14 @@ def hug(file: 'A Python file that contains a Hug API'=None, module: 'A Python mo sys.exit(1) reload_checker.reloading = False ran = True - for module in [name for name in sys.modules.keys() if name not in INIT_MODULES]: - del(sys.modules[module]) - if file: - api_module = importlib.machinery.SourceFileLoader(file.split(".")[0], - file).load_module() - elif module: - api_module = importlib.import_module(module) + for name in list(sys.modules.keys()): + if name not in INIT_MODULES: + del(sys.modules[name]) + if file: + api_module = importlib.machinery.SourceFileLoader(file.split(".")[0], + file).load_module() + elif module: + api_module = importlib.import_module(module) else: _start_api(api_module, host, port, no_404_documentation, not ran)
Fix development_runner bug The application should now reload once only, and the `module` parameter is no longer overwritten.
hugapi_hug
train
py
05358647b8955e6c27c9003a007db9b9abfb9f8a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -176,8 +176,11 @@ Funnel.prototype.build = function() { if (this.shouldLinkRoots()) { linkedRoots = true; if (fs.existsSync(inputPath)) { - rimraf.sync(this.outputPath); - this._copy(inputPath, this.destPath); + // Only re-symlink when either this.destPath doesn't exist or is not a symlink + if (!fs.existsSync(this.destPath) || !fs.lstatSync(this.destPath).isSymbolicLink()) { + rimraf.sync(this.outputPath); + this._copy(inputPath, this.destPath); + } } else if (this.allowEmpty) { mkdirp.sync(this.destPath); }
avoid re-symlink when this.destPath is already symlinked
broccolijs_broccoli-funnel
train
js
8ad2a19005431a87af148ba151c4b438ca6afee7
diff --git a/atlassian/bitbucket/__init__.py b/atlassian/bitbucket/__init__.py index <HASH>..<HASH> 100644 --- a/atlassian/bitbucket/__init__.py +++ b/atlassian/bitbucket/__init__.py @@ -2028,8 +2028,11 @@ class Bitbucket(BitbucketBase): params["path"] = path return self.get(url, params=params) + def _url_commit_pull_requests(self, project_key, repository_slug, commit_id): + return "{}/pull-requests".format(self._url_commit(project_key, repository_slug, commit_id)) + def get_pull_requests_contain_commit(self, project_key, repository_slug, commit): - url = self._url_commit(project_key, repository_slug, commit) + url = self._url_commit_pull_requests(project_key, repository_slug, commit) return (self.get(url) or {}).get("values") def get_changelog(self, project_key, repository_slug, ref_from, ref_to, start=0, limit=None):
[BITBUCKET] fix Bitbucket.get_pull_requests_contain_commit (#<I>) * Bitbucket: request pull requests containing a commit on the correct URL
atlassian-api_atlassian-python-api
train
py
c6a4c45a0f821de09e3e7e0a4a3121d77549b4ba
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( 'setuptools_scm', ], install_requires=[ - 'edalize>=0.1.3', + 'edalize>=0.1.6', 'ipyxact>=0.2.3', 'pyparsing', 'pytest>=3.3.0',
Bump edalize dependency
olofk_fusesoc
train
py
48e4b6ff3c75dd070a9b9502b5525ae2ce62a171
diff --git a/satpy/readers/ascat_l2_soilmoisture_bufr.py b/satpy/readers/ascat_l2_soilmoisture_bufr.py index <HASH>..<HASH> 100644 --- a/satpy/readers/ascat_l2_soilmoisture_bufr.py +++ b/satpy/readers/ascat_l2_soilmoisture_bufr.py @@ -87,8 +87,8 @@ class ASCATSOILMOISTUREBUFR(BaseFileHandler): seconds = np.resize(ec.codes_get_array(bufr, 'second'), size) for year, month, day, hour, minute, second in zip(years, months, days, hours, minutes, seconds): time_stamp = datetime(year, month, day, hour, minute, second) - date_min = not date_min and time_stamp or min(date_min, time_stamp) - date_max = not date_max and time_stamp or max(date_max, time_stamp) + date_min = time_stamp if not date_min else min(date_min, time_stamp) + date_max = time_stamp if not date_max else max(date_max, time_stamp) return date_min, date_max def get_bufr_data(self, key):
Changed to use ternary operator
pytroll_satpy
train
py
c2a554253c035c9a2bc8fd98044be58aa9f25b36
diff --git a/src/Stringy.php b/src/Stringy.php index <HASH>..<HASH> 100644 --- a/src/Stringy.php +++ b/src/Stringy.php @@ -520,7 +520,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess 'Ἇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'Ᾰ', 'Ᾱ', 'Ὰ', 'Ά', 'ᾼ', 'А'), 'B' => array('Б', 'Β'), - 'C' => array('Ć', 'Č', 'Ĉ', 'Ċ'), + 'C' => array('Ç','Ć', 'Č', 'Ĉ', 'Ċ'), 'D' => array('Ď', 'Ð', 'Đ', 'Ɖ', 'Ɗ', 'Ƌ', 'ᴅ', 'ᴆ', 'Д', 'Δ'), 'E' => array('É', 'È', 'Ẻ', 'Ẽ', 'Ẹ', 'Ê', 'Ế', 'Ề', 'Ể', 'Ễ', 'Ệ', 'Ë', 'Ē', 'Ę', 'Ě', 'Ĕ', 'Ė', 'Ε', 'Έ', 'Ἐ',
Added Turkish Character Added Turkish Character ; Ç
danielstjules_Stringy
train
php
af8fdb445c42f425067ac97c39fcdbef5ebac73e
diff --git a/lib/observatory/dispatcher.rb b/lib/observatory/dispatcher.rb index <HASH>..<HASH> 100644 --- a/lib/observatory/dispatcher.rb +++ b/lib/observatory/dispatcher.rb @@ -158,8 +158,6 @@ module Observatory # Initialize the list of observers for this signal and add this observer observers[signal] ||= Stack.new observers[signal].push(observer, options[:priority]) - - observer end # Removes an observer from a signal stack, so it no longer gets triggered. @@ -230,3 +228,4 @@ module Observatory end end end +
Simplify Dispatcher#connect return No need for explicit return as the push already returns the item
avdgaag_observatory
train
rb
1435671efdd5fea4b2a93b8fed3c0d30ad147c82
diff --git a/graceful.go b/graceful.go index <HASH>..<HASH> 100644 --- a/graceful.go +++ b/graceful.go @@ -366,6 +366,7 @@ func (srv *Server) manageConnections(add, idle, active, remove chan net.Conn, sh select { case conn := <-add: srv.connections[conn] = struct{}{} + srv.idleConnections[conn] = struct{}{} // Newly-added connections are considered idle until they become active. case conn := <-idle: srv.idleConnections[conn] = struct{}{} case conn := <-active:
Mark newly-added connections as idle
tylerb_graceful
train
go
0285e5e0a9ecdcceb12f13c96ac1ea3da54d3017
diff --git a/lib/models/exchange-report.js b/lib/models/exchange-report.js index <HASH>..<HASH> 100644 --- a/lib/models/exchange-report.js +++ b/lib/models/exchange-report.js @@ -30,7 +30,11 @@ type: String, required: true }, - exchangeTime: { + exchangeStart: { + type: Date, + required: true + }, + exchangeEnd: { type: Date, required: true },
Use exchange start and end timestamps instead of elapsed time
storj_service-storage-models
train
js
372d27d060afc53e791b547d52e283cacad6320d
diff --git a/src/js/mep-feature-progress.js b/src/js/mep-feature-progress.js index <HASH>..<HASH> 100644 --- a/src/js/mep-feature-progress.js +++ b/src/js/mep-feature-progress.js @@ -48,7 +48,7 @@ newTime = (percentage <= 0.02) ? 0 : percentage * media.duration; // seek to where the mouse is - if (mouseIsDown && newTime !== media.getCurrentTime()) { + if (mouseIsDown && newTime !== player.getCurrentTime()) { media.setCurrentTime(newTime); }
Fix broken seek bar The media variable refers to the html5 video, the player variable refers to the mediaelement.js player. This change fixes the broken seek bar due to no getCurrentTime method on the media variable. This was broken in (at least) Chrome and Firefox on the sample video on mediaelementjs.com.
mediaelement_mediaelement
train
js
685b8fd3ab5460a5d58ca528e07503d379fd0f87
diff --git a/application/shared/databases/sql/Database.php b/application/shared/databases/sql/Database.php index <HASH>..<HASH> 100644 --- a/application/shared/databases/sql/Database.php +++ b/application/shared/databases/sql/Database.php @@ -122,7 +122,7 @@ class Database extends Databases\Database if($isSuccessful === false) { - throw new SQLExceptions\SQLException("Could not run query \"" . $query . "\" with parameters " . print_r($params, true) . ". PDO error: " . print_r($this->pdoStatement->errorInfo(), true)); + throw new SQLExceptions\SQLException("Could not run query \"" . $query . "\". PDO error: " . print_r($this->pdoStatement->errorInfo(), true)); } return new QueryResults($this->pdoConnection, $this->pdoStatement);
I was dumping parameters from failed queries into the error log, but this is vulnerable in the case of server compromise
opulencephp_Opulence
train
php
eae5cee12df708de5cebfbed2fff42a1890070f5
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb index <HASH>..<HASH> 100755 --- a/lib/puppet/type/mount.rb +++ b/lib/puppet/type/mount.rb @@ -95,7 +95,7 @@ module Puppet # Solaris specifies two devices, not just one. newproperty(:blockdevice) do - desc "The the device to fsck. This is property is only valid + desc "The device to fsck. This is property is only valid on Solaris, and in most cases will default to the correct value."
Fixing a duplicate word in the mount docs
puppetlabs_puppet
train
rb
a25de7f6603970e7e8ab70c44d59b06de7b7f5d2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import setup def main(): setup( name='venv-update', - version='0.1', + version='0.1.1dev0', description="Quickly and exactly synchronize a virtualenv with a requirements.txt", url='https://github.com/Yelp/venv-update', author='Buck Golemon',
any further commits are not <I>
Yelp_venv-update
train
py
ec65df2f34ef2e58a3250e7385bf3ba9ebf3b795
diff --git a/aws/resource_aws_emr_cluster.go b/aws/resource_aws_emr_cluster.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_emr_cluster.go +++ b/aws/resource_aws_emr_cluster.go @@ -402,7 +402,7 @@ func resourceAwsEMRClusterCreate(d *schema.ResourceData, meta interface{}) error applications := d.Get("applications").(*schema.Set).List() keepJobFlowAliveWhenNoSteps := true - if v, ok := d.GetOk("keep_job_flow_alive_when_no_steps"); ok { + if v, ok := d.GetOkExists("keep_job_flow_alive_when_no_steps"); ok { keepJobFlowAliveWhenNoSteps = v.(bool) }
r/emr_cluster: Replace GetOk with GetOkExists
terraform-providers_terraform-provider-aws
train
go
1f79d808554aca6f8d938f010523c98c21c9b71b
diff --git a/concrete/src/Console/Command/InstallThemeCommand.php b/concrete/src/Console/Command/InstallThemeCommand.php index <HASH>..<HASH> 100644 --- a/concrete/src/Console/Command/InstallThemeCommand.php +++ b/concrete/src/Console/Command/InstallThemeCommand.php @@ -7,17 +7,11 @@ use Concrete\Core\Console\Command; use Concrete\Core\Support\Facade\Application; use Concrete\Core\Page\Theme\Theme; use Loader; -use Database; -use DateTimeZone; use Exception; -use Hautelook\Phpass\PasswordHash; use InvalidArgumentException; -use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\Question;
Cleans up use cases in theme instal class
concrete5_concrete5
train
php
0b99fd5710a832829867968cbcd8ddbc34900cc9
diff --git a/src/Saft/Backend/HttpStore/Store/Http.php b/src/Saft/Backend/HttpStore/Store/Http.php index <HASH>..<HASH> 100644 --- a/src/Saft/Backend/HttpStore/Store/Http.php +++ b/src/Saft/Backend/HttpStore/Store/Http.php @@ -134,28 +134,6 @@ class Http extends AbstractSparqlStore } /** - * Returns a list of all available graph URIs of the store. It can also respect access control, - * to only returned available graphs in the current context. But that depends on the implementation - * and can differ. - * - * @return array Simple array of key-value-pairs, which consists of graph URIs as key and NamedNode - * instance as value. - */ - public function getAvailableGraphs() - { - $result = $this->query('SELECT DISTINCT ?g WHERE { GRAPH ?g {?s ?p ?o.} }'); - - $graphs = array(); - - // $entry is of type NamedNode - foreach ($result as $entry) { - $graphs[$entry['g']->getUri()] = $this->nodeFactory->createNamedNode($entry['g']->getUri()); - } - - return $graphs; - } - - /** * @return array Empty * TODO implement getStoreDescription */
Remove getAvailableGraphs from Http Store because it is implemented in the abstract class
SaftIng_Saft
train
php
f522c37b68ae861eff77279d780211ad4bc23de9
diff --git a/mapclassify/_classify_API.py b/mapclassify/_classify_API.py index <HASH>..<HASH> 100644 --- a/mapclassify/_classify_API.py +++ b/mapclassify/_classify_API.py @@ -132,7 +132,9 @@ def classify(y, scheme, k=5, pct=[1,10,50,90,99,100], classifier = _classifiers[scheme](y, k, initial) elif scheme == 'userdefined': classifier = _classifiers[scheme](y, bins) - else: + elif scheme in ['equalinterval', 'fisherjenks', + 'jenkscaspall','jenkscaspallforced', + 'quantiles'] classifier = _classifiers[scheme](y, k) return classifier \ No newline at end of file
[MAINT] list schemes explicitly in if clause
pysal_mapclassify
train
py
77315744b219b90eb6a02efc9d26e5400f99af62
diff --git a/lib/report.js b/lib/report.js index <HASH>..<HASH> 100644 --- a/lib/report.js +++ b/lib/report.js @@ -74,7 +74,7 @@ class Report { reports.create(_reporter, { skipEmpty: false, skipFull: this.skipFull, - maxCols: 100 + maxCols: process.stdout.columns || 100 }).execute(context) } }
feat: use process.stdout.columns for reporter maxCols (#<I>)
bcoe_c8
train
js
5e79a426635af48a53d784ebaa2dce00fafb17c0
diff --git a/src/Applications/Form/Attributes.php b/src/Applications/Form/Attributes.php index <HASH>..<HASH> 100644 --- a/src/Applications/Form/Attributes.php +++ b/src/Applications/Form/Attributes.php @@ -21,7 +21,7 @@ class Attributes extends Form { public function init() { - $this->setLabel(/*@translate*/ 'Attributes') + $this//->setLabel(/*@translate*/ 'Attributes') ->setAttribute('data-submit-on', 'checkbox');
[Applications] Removes label from Attributes formular (when applying)
yawik_applications
train
php
23da256821ebf6690ed4da68632cdcd461b2f512
diff --git a/tests/calculators/hazard/classical/post_processing_test.py b/tests/calculators/hazard/classical/post_processing_test.py index <HASH>..<HASH> 100644 --- a/tests/calculators/hazard/classical/post_processing_test.py +++ b/tests/calculators/hazard/classical/post_processing_test.py @@ -53,10 +53,6 @@ class MeanCurveCalculatorTestCase(unittest.TestCase): 1, self.__class__.MAX_CURVES_PER_LOCATION) self.level_nr = random.randint(1, self.__class__.MAX_LEVEL_NR) - # set level_nr to an odd value, such that we easily create - # poes curves with median == mean - if not self.level_nr % 2: - self.level_nr += 1 self.curve_db, self.location_db = _curve_db( self.location_nr, self.level_nr,
we don't need anymore an odd number of levels
gem_oq-engine
train
py
4ab611a05c6fca7b91d78e63225762066b42051a
diff --git a/procmem/main_write.py b/procmem/main_write.py index <HASH>..<HASH> 100644 --- a/procmem/main_write.py +++ b/procmem/main_write.py @@ -15,8 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -import os - +from procmem.memory import Memory from procmem.pack import text2bytes @@ -25,13 +24,8 @@ def main_write(pid, args): data = text2bytes(args.DATA, args.type) - procdir = os.path.join("/proc", str(pid)) - - mem_filename = os.path.join(procdir, "mem") - - with open(mem_filename, "wb", buffering=0) as fout: - fout.seek(address) - fout.write(data) + with Memory.from_pid(pid, mode='wb') as mem: + mem.write(address, data) # EOF #
Use Memory class in 'procmem write'
Grumbel_procmem
train
py
ef8366d189b8c53f4acdc279caaae9fe682d63f2
diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index <HASH>..<HASH> 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -242,6 +242,7 @@ class StreamDispatcher extends Writable { while (repeats--) { if (!this.player.voiceConnection.sockets.udp) { this.emit('debug', 'Failed to send a packet - no UDP socket'); + return; } this.player.voiceConnection.sockets.udp.send(packet) .catch(e => {
voice: properly null-check udp socket first (#<I>)
discordjs_discord.js
train
js
5a7e19a485b89df7a67beb68b2dd3c2e721acb9b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -266,6 +266,9 @@ TChannel.prototype.removePeer = function removePeer(hostPort, conn) { // objects... note how these current semantics can implicitly convert // an in socket to an out socket list.splice(index, 1); + if (!list.length) { + delete self.peers[hostPort]; + } }; TChannel.prototype.getPeers = function getPeers() {
Clean up tchannel peers when last connection closes
uber_tchannel-node
train
js
539c6fb0a32c2e3d500041e067bbbd532ada7412
diff --git a/xurls.go b/xurls.go index <HASH>..<HASH> 100644 --- a/xurls.go +++ b/xurls.go @@ -26,8 +26,8 @@ const ( email = `[a-zA-Z0-9._%\-+]+@` + hostName comScheme = `[a-zA-Z.\-+]+://` - scheme = `(\b|^)(` + comScheme + `|` + otherScheme + `)` - strict = scheme + pathCont + scheme = `(` + comScheme + `|` + otherScheme + `)` + strict = `(\b|^)` + scheme + pathCont relaxed = strict + `|` + webURL + `|` + email )
Move start-of-word stuff out of scheme again
mvdan_xurls
train
go
7c0169d9763b1ae041fedf316c2bc8b2abaf5166
diff --git a/test/e2e/network/ingress.go b/test/e2e/network/ingress.go index <HASH>..<HASH> 100644 --- a/test/e2e/network/ingress.go +++ b/test/e2e/network/ingress.go @@ -136,6 +136,8 @@ var _ = SIGDescribe("Loadbalancing: L7", func() { ginkgo.It("should support multiple TLS certs", func() { ginkgo.By("Creating an ingress with no certs.") + + _ = gceController.CreateStaticIP(ns) jig.CreateIngress(filepath.Join(e2eingress.IngressManifestPath, "multiple-certs"), ns, map[string]string{ e2eingress.IngressStaticIPKey: ns, }, map[string]string{})
Reserve Static IP in Ingress test
kubernetes_kubernetes
train
go
7e24d3ff79ebf8869f967f3c5178b5121a0fc771
diff --git a/scripts/build/build-docs.js b/scripts/build/build-docs.js index <HASH>..<HASH> 100644 --- a/scripts/build/build-docs.js +++ b/scripts/build/build-docs.js @@ -2,6 +2,7 @@ "use strict"; +const fs = require("fs"); const path = require("path"); const shell = require("shelljs"); const parsers = require("./parsers"); @@ -39,6 +40,13 @@ shell.exec( `node_modules/babel-cli/bin/babel.js ${docs}/index.js --out-file ${docs}/index.js --presets=es2015` ); +// wrap content with IIFE to avoid `assign to readonly` error on Safari +(function(filename) { + const content = fs.readFileSync(filename, "utf8"); + const wrapped = `"use strict";(function(){${content}}());`; + fs.writeFileSync(filename, wrapped); +})(`${docs}/index.js`); + shell.exec( `rollup -c scripts/build/rollup.docs.config.js --environment filepath:parser-babylon.js -i ${prettierPath}/parser-babylon.js` );
fix(playground): avoid `assign to readonly` error on Safari (#<I>) * fix(playground): suppress`assign to readonly` error * fix(playground): avoid `assign to readonly` error
josephfrazier_prettier_d
train
js
2975a860a3be509aad1f68cb0a88c0ebf8b4b277
diff --git a/src/Page/ObjectCreatorPage.php b/src/Page/ObjectCreatorPage.php index <HASH>..<HASH> 100644 --- a/src/Page/ObjectCreatorPage.php +++ b/src/Page/ObjectCreatorPage.php @@ -64,7 +64,7 @@ class ObjectCreatorPage extends Page { private static $createable_types = array('Page', File::class); private static $db = array( - 'CreateType' => 'Varchar(32)', + 'CreateType' => 'Varchar(255)', 'CreateLocationID' => 'Int', 'RestrictCreationTo' => 'Varchar(255)', 'AllowUserSelection' => 'Boolean',
fix(ObjectCreatorPage) Updated CreateType field length
nyeholt_silverstripe-frontend-objects
train
php
3c426c155dcd5ea45251b40624214f57937b71d8
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -120,7 +120,7 @@ Configure::write('Session', [ /** * Loads plugins */ -Plugin::load('RecaptchaMailhide', ['bootstrap' => false, 'path' => ROOT]); +Plugin::load('RecaptchaMailhide', ['bootstrap' => true, 'routes' => true, 'path' => ROOT]); DispatcherFactory::add('Routing'); DispatcherFactory::add('ControllerFactory');
fixed. Loads bootstrap and routes from plugin
mirko-pagliai_cakephp-recaptcha-mailhide
train
php
429cc792191491e50c9dd015dc28db15f3a39987
diff --git a/test/discount_code_test.py b/test/discount_code_test.py index <HASH>..<HASH> 100644 --- a/test/discount_code_test.py +++ b/test/discount_code_test.py @@ -28,5 +28,3 @@ class DiscountCodeTest(TestCase): self.fake('price_rules/1213131/discount_codes/34', method='DELETE', body='destroyed') self.discount_code.destroy() self.assertEqual('DELETE', self.http.request.get_method()) - -
Run end-of-file-fixer to fix tests
Shopify_shopify_python_api
train
py
ff2538e9a5593a1c87937099e5eaafe6d99caaa5
diff --git a/MusicBoxApi/api.py b/MusicBoxApi/api.py index <HASH>..<HASH> 100644 --- a/MusicBoxApi/api.py +++ b/MusicBoxApi/api.py @@ -46,6 +46,12 @@ from .storage import Storage from .utils import notify from . import logger + +class TooManyTracksException(Exception): + """The playlist contains more than 1000 tracks.""" + pass + + # 歌曲榜单地址 top_list_all = { 0: ['云音乐新歌榜', '/discover/toplist?id=3779629'], @@ -440,7 +446,16 @@ class NetEase(object): playlist_id) try: data = self.httpRequest('GET', action) - return data['result']['tracks'] + if data['code'] == 200: + result = data['result'] + length = result['trackCount'] + if length > 1000: + raise TooManyTracksException("There are {} (> 1000) in the playlist.".format(length)) + else: + return data['result']['tracks'] + else: + log.error(data['code']) + return [] except requests.exceptions.RequestException as e: log.error(e) return []
raise TooManyTracksException for playlist longer than <I>
wzpan_MusicBoxApi
train
py
143e8bdfc83ae60daae16cebe11800bb54c8fa21
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,9 +1,14 @@ +/* global fetch */ import LokkaTransport from 'lokka/transport'; // In some envionment like in ReactNative, we don't need fetch at all. // Technically, this should be handle by 'isomorphic-fetch'. // But it's not happening. So this is the fix -if(typeof fetch !== 'function') { - fetch = require('isomorphic-fetch'); + +let fetchUrl; +if (typeof fetch === 'function') { + fetchUrl = fetch; +} else { + fetchUrl = require('isomorphic-fetch'); } export class Transport extends LokkaTransport { @@ -40,7 +45,7 @@ export class Transport extends LokkaTransport { const payload = {query, variables, operationName}; const options = this._buildOptions(payload); - return fetch(this.endpoint, options).then(response => { + return fetchUrl(this.endpoint, options).then(response => { // 200 is for success // 400 is for bad request if (response.status !== 200 && response.status !== 400) {
Cleanup the codebase on the requiring of fetch
kadirahq_lokka-transport-http
train
js
a58faf618d67c2d2949ab5fc7f03a1e91a8393c7
diff --git a/lib/genesis/seeder.rb b/lib/genesis/seeder.rb index <HASH>..<HASH> 100644 --- a/lib/genesis/seeder.rb +++ b/lib/genesis/seeder.rb @@ -80,8 +80,8 @@ module Genesis end def self.determine_current_version - current_seed = SchemaSeed.order( :version ).last - @current_version = current_seed.nil? ? '' : current_seed[:version] + current_seed = SchemaSeed.order( :seed_version ).last + @current_version = current_seed.nil? ? '' : current_seed[:seed_version] end def self.determine_and_prepare_seed_direction( to_version ) @@ -136,7 +136,7 @@ module Genesis log_entry_start( class_name ) klass.send( @method ) if @method == :up - ActiveRecord::Base.connection.execute( "INSERT INTO schema_seeds(#{ActiveRecord::Base.connection.quote_column_name 'version'}) VALUES('#{version}');" ) + ActiveRecord::Base.connection.execute( "INSERT INTO schema_seeds(#{ActiveRecord::Base.connection.quote_column_name 'seed_version'}) VALUES('#{version}');" ) else schema_seed = SchemaSeed.where( :seed_version => version ).first schema_seed.destroy unless schema_seed.nil?
Fix issue with version vs seed_Version attribute name.
midas_genesis
train
rb
20ac730058678541a2ec38974956916a5f085744
diff --git a/lib/DAV/Version.php b/lib/DAV/Version.php index <HASH>..<HASH> 100644 --- a/lib/DAV/Version.php +++ b/lib/DAV/Version.php @@ -14,6 +14,6 @@ class Version { /** * Full version number */ - const VERSION = '3.0.0-alpha1'; + const VERSION = '3.0.0-beta1'; }
Next version will be a beta.
sabre-io_dav
train
php
ba3918ecba0837a35bf21791ef023162b229ec77
diff --git a/code/pages/ListingPage.php b/code/pages/ListingPage.php index <HASH>..<HASH> 100644 --- a/code/pages/ListingPage.php +++ b/code/pages/ListingPage.php @@ -333,6 +333,9 @@ class ListingPage extends Page { } public function Content() { + if (!$this->ID) { + return ''; + } $action = (Controller::has_curr()) ? Controller::curr()->getRequest()->latestParam('Action') : null; if ($this->ComponentFilterName && !$action) { // For a list of relations like tags/categories/etc
FIX Issue where creating a listing page with no ID set would start a horrible loop of populateDefaults
nyeholt_silverstripe-listingpage
train
php
b3c498210c30c884182a379a9d315232f1ca9c85
diff --git a/tooling/circle-cli/commands/trigger-build.js b/tooling/circle-cli/commands/trigger-build.js index <HASH>..<HASH> 100644 --- a/tooling/circle-cli/commands/trigger-build.js +++ b/tooling/circle-cli/commands/trigger-build.js @@ -64,10 +64,31 @@ module.exports = { return build; }) .then(blockUntilComplete(argv, ci)) + // TODO if status is retried, start polling for completion of new job .then(tap((result) => statusToXunit(argv, ci, result))) .then(tap(() => downloadArtifacts(argv, ci, build))) .then((result) => { + /* eslint complexity: [0] */ console.log(`build ${build.build_num} completed with status ${result.status}`); + switch (result.status) { + case `success`: + case `fixed`: + case `failed`: + process.exit(0); + break; + case `retried`: + case `canceled`: + case `timedout`: + case `not_run`: + case `running`: + case `queued`: + case `scheduled`: + case `not_running`: + case `no_tests`: + case `infrastructure_fail`: + default: + process.exit(1); + } }) .catch(exitWithError); }
chore(tooling): be more aggressive about non-test build failures
webex_spark-js-sdk
train
js
8cce2508a9aad73fd2597539b20f1e89cd462a67
diff --git a/packages/tiptap-extensions/src/nodes/Table.js b/packages/tiptap-extensions/src/nodes/Table.js index <HASH>..<HASH> 100644 --- a/packages/tiptap-extensions/src/nodes/Table.js +++ b/packages/tiptap-extensions/src/nodes/Table.js @@ -19,6 +19,7 @@ import { fixTables, } from 'prosemirror-tables' import { createTable } from 'prosemirror-utils' +import { TextSelection } from 'prosemirror-state' import TableNodes from './TableNodes' export default class Table extends Node { @@ -43,6 +44,11 @@ export default class Table extends Node { (state, dispatch) => { const nodes = createTable(schema, rowsCount, colsCount, withHeaderRow) const tr = state.tr.replaceSelectionWith(nodes).scrollIntoView() + + // get selection for first cell + const resolvedPos = tr.doc.resolve(tr.selection.anchor - nodes.content.size) + tr.setSelection(TextSelection.near(resolvedPos)) + dispatch(tr) } ),
set selection to first cell after table insert fixes #<I>
scrumpy_tiptap
train
js
6e28188d7b9ab8f6ab36b9887b4170f0fb286347
diff --git a/rinoh/layout.py b/rinoh/layout.py index <HASH>..<HASH> 100644 --- a/rinoh/layout.py +++ b/rinoh/layout.py @@ -545,14 +545,7 @@ class Chain(FlowableTarget): def render(self, container, rerender=False, last_descender=None): """Flow the flowables into the containers that have been added to this - chain. - - Returns an empty iterator when all flowables have been sucessfully - rendered. - When the chain runs out of containers before all flowables have been - rendered, this method returns an iterator yielding itself. This signals - the :class:`Document` to generate a new page and register new containers - with this chain.""" + chain.""" if rerender: container.clear() if not self._rerendering:
Chain.render's docstring is no longer up to date
brechtm_rinohtype
train
py
8bf693a478db2c374d9a267067cf5754ab175949
diff --git a/erizoController/erizoController.js b/erizoController/erizoController.js index <HASH>..<HASH> 100644 --- a/erizoController/erizoController.js +++ b/erizoController/erizoController.js @@ -88,7 +88,7 @@ var updateMyState = function() { nRooms++; } - if(nRooms < WARNING_N_ROOMS) return; + if(nRooms < WARNING_N_ROOMS) newState = 2; if(nRooms > LIMIT_N_ROOMS) newState = 0; else newState = 1; @@ -234,7 +234,12 @@ var listen = function() { socket.room.streams.splice(index, 1); } socket.room.webRtcController.removeClient(socket.id); - } + } + if (socket.room.sockets.length == 0) { + console.log('Empty room ' , socket.room.id, '. Deleting it'); + delete rooms[socket.room.id]; + updateMyState(); + }; }); }); }
Now when a room is empty erizoController removes it
lynckia_licode
train
js
dc1401140a26b29f2e604d31c09d94b2cfa8f97b
diff --git a/ploy/common.py b/ploy/common.py index <HASH>..<HASH> 100644 --- a/ploy/common.py +++ b/ploy/common.py @@ -144,9 +144,9 @@ class StartupScriptMixin(object): class BaseMaster(object): - def __init__(self, ctrl, id, master_config): + def __init__(self, ctrl, mid, master_config): from ploy.config import ConfigSection # avoid circular import - self.id = id + self.id = mid self.ctrl = ctrl assert self.ctrl.__class__.__name__ == 'Controller' self.main_config = self.ctrl.config
Rename argument to prevent override of builtin.
ployground_ploy
train
py
bd8243adadb426526238e54d7e20d28ddbc39627
diff --git a/commands/repo/prune/command.go b/commands/repo/prune/command.go index <HASH>..<HASH> 100644 --- a/commands/repo/prune/command.go +++ b/commands/repo/prune/command.go @@ -191,6 +191,12 @@ func collectStoryBranches(remoteName string) ([]*git.GitBranch, error) { return nil, err } + // Get the current branch name so that it can be excluded. + currentBranch, err := git.CurrentBranch() + if err != nil { + return nil, err + } + // Filter the branches. storyBranches := make([]*git.GitBranch, 0, len(branches)) for _, branch := range branches { @@ -199,6 +205,12 @@ func collectStoryBranches(remoteName string) ([]*git.GitBranch, error) { continue } + // Exclude the current branch. + if branch.BranchName == currentBranch { + log.Warn(fmt.Sprintf("Branch '%v' is checked out, it cannot be deleted", currentBranch)) + continue + } + // Keep the story branches only. isLocalStoryBranch := strings.HasPrefix(branch.BranchName, StoryBranchPrefix) isRemoteStoryBranch := strings.HasPrefix(branch.RemoteBranchName, StoryBranchPrefix)
repo prune: Exclude the current branch In case the user is on a story branch, exclude that branch. Trying to delete the current branch would lead to an error. Story-Id: SF-<I> Change-Id: d3c<I>b<I>
salsaflow_salsaflow
train
go
a06c1c6830203a1d0c27b59e605d2d4bc00a6ac4
diff --git a/packages/vue-styleguidist/scripts/make-webpack-config.js b/packages/vue-styleguidist/scripts/make-webpack-config.js index <HASH>..<HASH> 100644 --- a/packages/vue-styleguidist/scripts/make-webpack-config.js +++ b/packages/vue-styleguidist/scripts/make-webpack-config.js @@ -147,10 +147,16 @@ module.exports = function(config, env) { webpackConfig = merge(webpackConfig, { plugins: [new webpack.HotModuleReplacementPlugin()], output: { - publicPath: config.styleguidePublicPath + publicPath: + webpackConfig.output && webpackConfig.output.publicPath + ? webpackConfig.output.publicPath + : config.styleguidePublicPath }, devServer: { - publicPath: config.styleguidePublicPath + publicPath: + webpackConfig.devServer && webpackConfig.devServer.publicPath + ? webpackConfig.devServer.publicPath + : config.styleguidePublicPath }, entry: [require.resolve('react-dev-utils/webpackHotDevClient')] })
fix: webpackConfig has priority on publicPath closes #<I>
vue-styleguidist_vue-styleguidist
train
js
568ba0a19a6050e37ba713c41aac1b5ef20e462f
diff --git a/src/runner.js b/src/runner.js index <HASH>..<HASH> 100644 --- a/src/runner.js +++ b/src/runner.js @@ -40,6 +40,9 @@ function runUser(userId, onlyInRoom) { if(runResult.memory) { promises.push(driver.saveUserMemory(userId, runResult.memory, onlyInRoom)); } + if(runResult.memorySegments) { + promises.push(driver.saveUserMemorySegments(userId, runResult.memorySegments)); + } if(runResult.intents) { promises.push(driver.saveUserIntents(userId, runResult.intents)); }
feat(runtime): new asynchronous memory segments feature
screeps_engine
train
js
330597a43b4c69273075c2f23f9adaab86c75300
diff --git a/annis-gui/src/main/java/annis/gui/resultview/SingleResultPanel.java b/annis-gui/src/main/java/annis/gui/resultview/SingleResultPanel.java index <HASH>..<HASH> 100644 --- a/annis-gui/src/main/java/annis/gui/resultview/SingleResultPanel.java +++ b/annis-gui/src/main/java/annis/gui/resultview/SingleResultPanel.java @@ -830,6 +830,9 @@ public class SingleResultPanel extends CssLayout implements } } + minMax.min++; + minMax.max++; + return minMax; }
Match positions start counting from 1 instead of 0 for match position in single result title bar. closes #<I>
korpling_ANNIS
train
java
8aff95d9592663613c1a32cc68350a4548c78162
diff --git a/lib/timezone/zone.rb b/lib/timezone/zone.rb index <HASH>..<HASH> 100644 --- a/lib/timezone/zone.rb +++ b/lib/timezone/zone.rb @@ -114,7 +114,16 @@ module Timezone def rule_for_reference reference reference = reference.utc - @rules.detect{ |rule| _parsetime(rule['_from']) <= reference && _parsetime(rule['_to']) > reference } + @rules.detect do |rule| + if rule['from'] and rule['to'] + from = Time.at(rule['from'].to_i / 1000.0) + to = Time.at(rule['to'].to_i / 1000.0) + else + from = _parsetime(rule['_from']) + to = _parsetime(rule['_to']) + end + from <= reference && to > reference + end end def timezone_id lat, lon #:nodoc:
Changed code to use timestamps whenever possible
panthomakos_timezone
train
rb
1c4fb97742c87c7bf7abf8f829a1aeac4d2f4be1
diff --git a/zerocore.php b/zerocore.php index <HASH>..<HASH> 100644 --- a/zerocore.php +++ b/zerocore.php @@ -30,7 +30,7 @@ define('PROJECT_TYPE', 'EIP'); | */ -define('ZN_VERSION', '5.4.78'); +define('ZN_VERSION', '5.4.8'); define('REQUIRED_PHP_VERSION', '7.0.0'); /* @@ -211,7 +211,7 @@ foreach( CONTAINER_DIRS as $key => $value ) if( PROJECT_TYPE === 'EIP' ) // For EIP edition { define($key, internalProjectContainerDir($value)); - define('EXTERNAL_' . $key, 'External/' . $value); + define('EXTERNAL_' . $key, 'External/' . $value . '/'); } else // For SE edition {
<I> -> Updated Version <I> -> Updated Version
znframework_znframework
train
php
605718c3d956bf355b2ccde6358c7a1cde97df2e
diff --git a/lorawan/semtech/decode.go b/lorawan/semtech/decode.go index <HASH>..<HASH> 100644 --- a/lorawan/semtech/decode.go +++ b/lorawan/semtech/decode.go @@ -86,12 +86,8 @@ func (d *datrparser) UnmarshalJSON(raw []byte) error { // UnmarshalJSON implements the Unmarshaler interface from encoding/json func (p *Payload) UnmarshalJSON(raw []byte) error { proxy := payloadProxy{ - ProxStat: &statProxy{ - Stat: new(Stat), - }, - ProxTXPK: &txpkProxy{ - TXPK: new(TXPK), - }, + ProxStat: &statProxy{}, + ProxTXPK: &txpkProxy{}, } if err := json.Unmarshal(raw, &proxy); err != nil {
[router] Fix error in semtech decode which created empty structure when not needed
TheThingsNetwork_ttn
train
go
3ccdb946be60f9925dfd3615ecf3ccda76b823a6
diff --git a/api/functions/ticker.js b/api/functions/ticker.js index <HASH>..<HASH> 100644 --- a/api/functions/ticker.js +++ b/api/functions/ticker.js @@ -234,7 +234,12 @@ function phase4(ticker) { // Having good depth is SUPER important // Use a lower base log to make it easier to get depth points - let depth10Score = Math.log(4 + asset.depth10_USD)/Math.log(4) - 1; // [0, infinity] + let depth10Score = 0.5 * (Math.log(2 + asset.depth10_USD)/Math.log(2) - 1); // [0, infinity] + + // Lets also add a linear component to depth score. + // Again, we are emphasizing depth. Cap it at $100k. + // $50k depth should cover the bases of small users. + depth10Score += Math.min(10, asset.depth10_USD/10000); // += [0, 10] // Volume really helps! However, it's not as important as depth especially // since there are no pecentage fees on the Stellar network
Add linear component to depth activityScore calculation
stellarterm_stellarterm
train
js
2482bfc8a45e19edd580b468a04bcdc6d7a22403
diff --git a/src/Orchestra/Memory/MemoryServiceProvider.php b/src/Orchestra/Memory/MemoryServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Orchestra/Memory/MemoryServiceProvider.php +++ b/src/Orchestra/Memory/MemoryServiceProvider.php @@ -15,8 +15,6 @@ class MemoryServiceProvider extends ServiceProvider { { return new MemoryManager($app); }); - - $this->package('orchestra/memory', 'orchestra/memory'); } /** @@ -26,6 +24,7 @@ class MemoryServiceProvider extends ServiceProvider { */ public function boot() { + $this->package('orchestra/memory', 'orchestra/memory'); $this->registerMemoryEvents(); } @@ -40,17 +39,7 @@ class MemoryServiceProvider extends ServiceProvider { $app->after(function($request, $response) use ($app) { - $app->make('orchestra.memory')->shutdown(); + $app['orchestra.memory']->shutdown(); }); } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return array('orchestra.memory'); - } } \ No newline at end of file
$this->package() should go inside boot().
orchestral_memory
train
php
225fa428f042b21cdf659fc593b7353010667d9d
diff --git a/test/sauce-labs.js b/test/sauce-labs.js index <HASH>..<HASH> 100644 --- a/test/sauce-labs.js +++ b/test/sauce-labs.js @@ -3,7 +3,7 @@ var testSauceLabs = require('test-saucelabs'); // https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities -var platforms = [{ +var platforms = [/*{ browserName: 'internet explorer', platform: 'Windows 7', version: '9' @@ -15,7 +15,7 @@ var platforms = [{ browserName: 'internet explorer', platform: 'Windows 10', version: '11.0' -}, { +}, */{ browserName: 'MicrosoftEdge', platform: 'Windows 10' }, {
Skip testing in Internet Explorer For CanJS <I>, we’re at least supporting Edge, maybe will add IE<I> support later.
canjs_can-view-live
train
js
bbc8c118f9b4469c96f4b1f8374a2e2ef299669e
diff --git a/test/test_subsystem.py b/test/test_subsystem.py index <HASH>..<HASH> 100644 --- a/test/test_subsystem.py +++ b/test/test_subsystem.py @@ -7,6 +7,7 @@ import example_networks from pyphi.subsystem import Subsystem from pyphi.models import Cut +from pyphi import config import numpy as np @@ -18,9 +19,12 @@ def test_subsystem_validation(s): with pytest.raises(ValueError): s = Subsystem(s.network, [2, 0, 0], s.node_indices) # Unreachable state. + initial_option = config.SINGLE_NODES_WITH_SELFLOOPS_HAVE_PHI + config.VALIDATE_NETWORK_STATE = True with pytest.raises(ValueError): net = example_networks.simple() s = Subsystem(net, [1, 1, 1], s.node_indices) + config.SINGLE_NODES_WITH_SELFLOOPS_HAVE_PHI = initial_option def test_empty_init(s):
Ensure state validation flag is set in subsystem validation test
wmayner_pyphi
train
py
dd51703de2d50831155687d3902d8821c3996f48
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -49,8 +49,9 @@ module.exports = { if (lexicon === undefined) { return page; } - var start = page.content.indexOf('<div class="book-body">'); - page.content = page.content.substr(0, start) + page.content.substr(start).replace(scanner(lexicon), rewriter(lexicon)); + page.content = page.content.replace(/<section[^.]*?>([^.]*?)<\/section>/g, function (match, section) { + return section.replace(scanner(lexicon), rewriter(lexicon)); + }); return page; } }
annotate lexicon only in <section>, fix #4
pm5_gitbook-plugin-lexicon
train
js
778cd35ec43415cef277e0032a278c9bcf5d2021
diff --git a/resolwe/__about__.py b/resolwe/__about__.py index <HASH>..<HASH> 100644 --- a/resolwe/__about__.py +++ b/resolwe/__about__.py @@ -8,7 +8,7 @@ __url__ = 'https://github.com/genialis/resolwe' # Semantic versioning is used. For more information see: # https://packaging.python.org/en/latest/distributing/#semantic-versioning-preferred -__version__ = '1.5.1' +__version__ = '1.6.0a' __author__ = 'Genialis d.o.o.' __email__ = '[email protected]'
Master is now <I>a
genialis_resolwe
train
py
01dcba7486bc5c2ff41649a3f5448458f827155f
diff --git a/src/Ibuildings/QA/Tools/Common/Settings.php b/src/Ibuildings/QA/Tools/Common/Settings.php index <HASH>..<HASH> 100644 --- a/src/Ibuildings/QA/Tools/Common/Settings.php +++ b/src/Ibuildings/QA/Tools/Common/Settings.php @@ -87,6 +87,35 @@ class Settings extends \ArrayObject } /** + * Get the default value for a certain key/path. Nested arrays can be traversed by defining + * the path as listing all the keys from top to bottom, separated by a dot ".". If the value + * cannot be retrieved, the fallback value is returned. + * + * @param string $path + * @param mixed $fallback + * @return mixed + */ + public function getDefaultValueFor($path, $fallback) + { + $keys = explode('.', $path); + + $current = $this; + while (!empty($keys)) { + $key = reset($keys); + if (!isset($current[$key])) { + return $fallback; + } + + if (count($keys) === 1) { + return $current[$key]; + } + + $current = $current[$key]; + array_shift($keys); + } + } + + /** * Destructor. Will write app config to file * to keep configuration persistent across app * runs.
Adding ability to get default value from Settings
ibuildingsnl_qa-tools
train
php
3ba12dcc5d426195d8c0248ba6a142a03ad5ee68
diff --git a/mod/scorm/view.php b/mod/scorm/view.php index <HASH>..<HASH> 100644 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -170,12 +170,8 @@ if (empty($launch) && ($scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTAT } echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'container', 'intro'); -// Check if SCORM available. +// Check if SCORM available. No need to display warnings because activity dates are displayed at the top of the page. list($available, $warnings) = scorm_get_availability_status($scorm); -if (!$available) { - $reason = current(array_keys($warnings)); - echo $OUTPUT->box(get_string($reason, "scorm", $warnings[$reason]), "container"); -} if ($available && empty($launch)) { scorm_print_launch($USER, $scorm, 'view.php?id='.$cm->id, $cm);
MDL-<I> mod_scorm: Remove duplicate info for open and close time
moodle_moodle
train
php
16ddfda13cf65a47c3ac2430b48f44c493704438
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -setup(name='pylib', +setup(name='pylib_kenl380', version='0.8.8', description='Python shared library', url='https://github.com/kenlowrie/pylib',
Give it a unique name for PyPI pylib is already taken, so renamed to pylib_kenl<I>
kenlowrie_pylib
train
py
577cbc823c539d7c3c7bbedf3945a7e6641d4c28
diff --git a/coconut/root.py b/coconut/root.py index <HASH>..<HASH> 100644 --- a/coconut/root.py +++ b/coconut/root.py @@ -25,7 +25,7 @@ import sys as _coconut_sys VERSION = "1.2.0" VERSION_NAME = "Colonel" -DEVELOP = 20 +DEVELOP = 21 #----------------------------------------------------------------------------------------------------------------------- # CONSTANTS:
Bump dev version to <I>
evhub_coconut
train
py
be96db1d1dadcb8f30152565da1f804833b68c77
diff --git a/config/webpack/webpack.config.ssr.js b/config/webpack/webpack.config.ssr.js index <HASH>..<HASH> 100644 --- a/config/webpack/webpack.config.ssr.js +++ b/config/webpack/webpack.config.ssr.js @@ -19,6 +19,7 @@ const { webpackDecorator, polyfills, isStartScript, + sourceMapsProd, supportedBrowsers, } = require('../../context'); @@ -85,6 +86,9 @@ const makeWebpackConfig = ({ clientPort, serverPort }) => { const publicPath = isStartScript ? clientServer : paths.publicPath; + const sourceMapStyle = isStartScript ? 'inline-source-map' : 'source-map'; + const useSourceMaps = isStartScript || sourceMapsProd; + const webpackStatsFilename = 'webpackStats.json'; // The file mask is set to just name in start/dev mode as contenthash @@ -97,7 +101,7 @@ const makeWebpackConfig = ({ clientPort, serverPort }) => { name: 'client', mode: webpackMode, entry: clientEntry, - devtool: isStartScript ? 'inline-source-map' : false, + devtool: useSourceMaps ? sourceMapStyle : false, output: { path: paths.target, publicPath,
feat: Add support for sourceMapsProd in SSR (#<I>)
seek-oss_sku
train
js
c4cba57889c08068e3be83d7ec647f3eedb60399
diff --git a/enum34_custom.py b/enum34_custom.py index <HASH>..<HASH> 100644 --- a/enum34_custom.py +++ b/enum34_custom.py @@ -2,16 +2,15 @@ from enum import Enum, EnumMeta from functools import total_ordering -class _MultiMeta(EnumMeta): - def __new__(metacls, cls, bases, classdict): - enum_class = super().__new__(metacls, cls, bases, classdict) + +class _MultiValueMeta(EnumMeta): + def __init__(self, cls, bases, classdict): # make sure we only have tuple values, not single values - for member in enum_class.__members__.values(): + for member in self.__members__.values(): if not isinstance(member.value, tuple): raise TypeError('{} = {!r}, should be tuple!' .format(member.name, member.value)) - return enum_class def __call__(cls, value): """Return the appropriate instance with any of the values listed."""
Simplify code by using __init__ instead of __new__
kissgyorgy_enum34-custom
train
py
dc10c8b4a1f7ef3a166352c911c40a3f1027056a
diff --git a/lib/excon/connection.rb b/lib/excon/connection.rb index <HASH>..<HASH> 100644 --- a/lib/excon/connection.rb +++ b/lib/excon/connection.rb @@ -190,6 +190,11 @@ module Excon case error when Excon::Errors::InvalidHeaderKey, Excon::Errors::InvalidHeaderValue, Excon::Errors::StubNotFound, Excon::Errors::Timeout raise(error) + when Errno::EPIPE + # Read whatever remains in the pipe to aid in debugging + response = socket.read + error = Excon::Error.new(response + error.message) + raise_socket_error(error) else raise_socket_error(error) end
[fix] Read server response during EPIPE When a `request_block` is used to send data, an error on the server side only gets reported as a `EPIPE`. excon doesn't read anything sent back from the server, which makes it hard to debug what went wrong. We now read the server response, if any, and show it in the exception. Closes #<I>
excon_excon
train
rb
92f6d33fff7e5a08765ff61a4ea37af62b0e1281
diff --git a/lib/dm-core/type.rb b/lib/dm-core/type.rb index <HASH>..<HASH> 100755 --- a/lib/dm-core/type.rb +++ b/lib/dm-core/type.rb @@ -39,7 +39,7 @@ module DataMapper PROPERTY_OPTIONS = [ :accessor, :reader, :writer, :lazy, :default, :nullable, :key, :serial, :field, :size, :length, - :format, :index, :unique_index, :check, :ordinal, :auto_validation, + :format, :index, :unique_index, :auto_validation, :validates, :unique, :precision, :scale ]
Nuke :check and :ordinal options that are not used anywhere
datamapper_dm-core
train
rb
f4b7c307ffb4d3f6547b557434bce6f3308ca4f2
diff --git a/lib/ruby-bbcode/templates/bbcode_errors_template.rb b/lib/ruby-bbcode/templates/bbcode_errors_template.rb index <HASH>..<HASH> 100644 --- a/lib/ruby-bbcode/templates/bbcode_errors_template.rb +++ b/lib/ruby-bbcode/templates/bbcode_errors_template.rb @@ -36,7 +36,8 @@ module RubyBBCode::Templates # Iterate over known tokens and fill in their values, if provided @tag_definition[:param_tokens].each do |token| # Use %param% to insert the parameters and their values (and re-add %param%) - @opening_part.gsub!('%param%', " #{token[:token]}=#{@node[:params][token[:token]]}%param%") unless @node[:params][token[:token]].nil? + param_value = @node[:params][token[:token]] + @opening_part.gsub!('%param%', " #{token[:token]}=#{param_value}%param%") unless param_value.nil? end end
Slightly more clear what is happening Matches html_template.rb as well (increasing clarity)
veger_ruby-bbcode
train
rb
d9e6cdb3a185676595ae04a89cd3297cdbdd53d0
diff --git a/tests/run_tests.py b/tests/run_tests.py index <HASH>..<HASH> 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -14,16 +14,16 @@ # See the License for the specific language governing permissions and # limitations under the License. - import os +import sys -os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings' - +from django.core.wsgi import get_wsgi_application from django.core import management -import django -if hasattr(django, 'setup'): - django.setup() +PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") +sys.path.append(PROJECT_DIR) +# Load models +application = get_wsgi_application() management.call_command('test', 'djangosaml2', 'testprofiles') -
Update run_tests.py to work with Django <I> and Django <I>
knaperek_djangosaml2
train
py
9456d72c70a13129dfc17d58ba9e6eb93a9f7435
diff --git a/packages/node_modules/samples/browser-single-party-call/app.js b/packages/node_modules/samples/browser-single-party-call/app.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/samples/browser-single-party-call/app.js +++ b/packages/node_modules/samples/browser-single-party-call/app.js @@ -29,6 +29,16 @@ let spark; function connect() { if (!spark) { spark = ciscospark.init({ + config: { + phone: { + // Turn on group calling; there's a few minor breaking changes with + // regards to how single-party calling works (hence, the opt-in), but + // this is how things are going to work in 2.0 and if you plan on + // doing any group calls, you'll need this turned on for your entire + // app anyway. + enableExperimentalGroupCallingSupport: true + } + }, credentials: { access_token: document.getElementById(`access-token`).value }
feat(samples): add the group calling flag to the single-party example
webex_spark-js-sdk
train
js
c8f50cffa729613a7c90308305c2b2c947824610
diff --git a/src/main/java/org/odlabs/wiquery/core/behavior/WiQueryAbstractAjaxBehavior.java b/src/main/java/org/odlabs/wiquery/core/behavior/WiQueryAbstractAjaxBehavior.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/odlabs/wiquery/core/behavior/WiQueryAbstractAjaxBehavior.java +++ b/src/main/java/org/odlabs/wiquery/core/behavior/WiQueryAbstractAjaxBehavior.java @@ -22,9 +22,7 @@ package org.odlabs.wiquery.core.behavior; import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; -import org.apache.wicket.behavior.HeaderContributor; import org.odlabs.wiquery.core.commons.IWiQueryPlugin; -import org.odlabs.wiquery.core.commons.WiQueryCoreHeaderContributor; import org.odlabs.wiquery.core.commons.WiQueryResourceManager; import org.odlabs.wiquery.core.javascript.JsStatement;
got rid of 'unused imports' compilation warnings svn path=/trunk/; revision=<I>
WiQuery_wiquery
train
java
26d6e3e305f9e2c66d45ec0866602f920dc480d7
diff --git a/libs/db/type/subobject.class.php b/libs/db/type/subobject.class.php index <HASH>..<HASH> 100644 --- a/libs/db/type/subobject.class.php +++ b/libs/db/type/subobject.class.php @@ -30,14 +30,26 @@ namespace org\octris\core\db\type { /**/ /** + * Reference to dataobject the subobject belongs to. + * + * @octdoc p:subobject/$dataobject + * @var \org\octris\core\db\type\dataobject + */ + protected $dataobject; + /**/ + + /** * Constructor. * * @octdoc m:subobject/__construct - * @param array $data Data to initialize object with, + * @param array $data Data to initialize object with. + * @param \org\octris\core\db\type\dataobject $dataobject Dataobject the subobject is part of. */ - public function __construct(array $data = array()) + public function __construct(array $data = array(), \org\octris\core\db\type\dataobject $dataobject) /**/ { + $this->dataobject = $dataobject; + foreach ($data as $key => $value) { $this[$key] = $value; } @@ -154,7 +166,7 @@ namespace org\octris\core\db\type { /**/ { if (is_array($value)) { - $value = $this->createSubObject($value); + $value = new self($value, $this->dataobject); } if ($name === null) {
store a reference to the dataobject in subobject
octris_db
train
php
3a7fb35fb03e91031af021cf4a3897609fce4125
diff --git a/command/agent.go b/command/agent.go index <HASH>..<HASH> 100644 --- a/command/agent.go +++ b/command/agent.go @@ -54,7 +54,9 @@ func (cmd *AgentCommand) readConfig() *config.RuntimeConfig { config.AddFlags(fs, &flags) if err := cmd.BaseCommand.Parse(cmd.args); err != nil { - cmd.UI.Error(fmt.Sprintf("error parsing flags: %v", err)) + if !strings.Contains(err.Error(), "help requested") { + cmd.UI.Error(fmt.Sprintf("error parsing flags: %v", err)) + } return nil }
command: don't show confusing error on usage output
hashicorp_consul
train
go
3b47b679f4f7a9714a171add29a5404bf4ca39c8
diff --git a/featureflow/__init__.py b/featureflow/__init__.py index <HASH>..<HASH> 100644 --- a/featureflow/__init__.py +++ b/featureflow/__init__.py @@ -1,4 +1,4 @@ -__version__ = '2.11.0' +__version__ = '2.12.0' from model import BaseModel, ModelExistsError diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,12 @@ from setuptools import setup import re -import warnings +import subprocess try: - import pypandoc - - long_description = pypandoc.convert('README.md', 'rst') -except(IOError, ImportError, RuntimeError): + long_description = subprocess.check_output( + 'pandoc --to rst README.md', shell=True) +except(IOError, ImportError): long_description = open('README.md').read() - warnings.warn('pypandoc is not working correctly') with open('featureflow/__init__.py', 'r') as fd: version = re.search(
New release with non-buggy pandoc usage
JohnVinyard_featureflow
train
py,py
77284709cca4dcc3493140ee1526abc76314f1bb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( author='Dustin Ingram', author_email='[email protected]', description='The official unofficial pip API', - install_requires=['packaging'], + install_requires=['packaging', 'pip'], long_description=long_description, long_description_content_type='text/markdown', name='pip-api',
setup.py: List pip as a dependency This is needed for especially Python <I> before pip was packaged by default with the standard library via `ensurepip`. It also injects pip into the metadata of the package, to allow other tools to understand this package better.
di_pip-api
train
py
73f6a548cd8de0890d4e2dad75b432476760bd9b
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -159,7 +159,6 @@ var m = module.exports = function (options, callback) { // jshint ignore: line return }) .catch(function (err) { - console.log('caught err', err) callback(err) }) } else {
remove stray console.log this error is already returned to user.
pocketjoso_penthouse
train
js
e7dee0383e465a82e2ebddb3336ad69a364fad45
diff --git a/warc/__init__.py b/warc/__init__.py index <HASH>..<HASH> 100644 --- a/warc/__init__.py +++ b/warc/__init__.py @@ -7,7 +7,7 @@ Python library to work with WARC files. :copyright: (c) 2012 Internet Archive """ -from .arc import ARCFile +from .arc import ARCFile, ARCRecord, ARCHeader from .warc import WARCFile, WARCRecord, WARCHeader, WARCReader def detect_format(filename):
exported ARCRecord and ARCHeader from __init__.py.
internetarchive_warc
train
py
f99b258cca4974ceae7eb7fdadb820d02265b018
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -84,7 +84,7 @@ types[DINERS_CLUB] = { prefixPattern: /^(3|3[0689]|30[0-5])$/, exactPattern: /^3(0[0-5]|[689])\d*$/, gaps: [4, 10], - lengths: [14, 15, 16, 17, 18, 19], + lengths: [14, 16, 19], code: { name: CVV, size: 3 diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -256,7 +256,7 @@ describe('creditCardType', function () { expect(creditCardType('6304000000000000')[0].lengths).to.deep.equal([12, 13, 14, 15, 16, 17, 18, 19]); }); it('Diners Club', function () { - expect(creditCardType('305')[0].lengths).to.deep.equal([14, 15, 16, 17, 18, 19]); + expect(creditCardType('305')[0].lengths).to.deep.equal([14, 16, 19]); }); it('Discover', function () { expect(creditCardType('6011')[0].lengths).to.deep.equal([16, 19]);
Correct lengths for Diner's Club
braintree_credit-card-type
train
js,js
0e301966831d913ddff1582fafcb714195d6a986
diff --git a/src/ORM/Locator/LocatorAwareTrait.php b/src/ORM/Locator/LocatorAwareTrait.php index <HASH>..<HASH> 100644 --- a/src/ORM/Locator/LocatorAwareTrait.php +++ b/src/ORM/Locator/LocatorAwareTrait.php @@ -70,7 +70,7 @@ trait LocatorAwareTrait */ public function getTableLocator() { - if (!$this->_tableLocator) { + if (!isset($this->_tableLocator)) { $this->_tableLocator = TableRegistry::getTableLocator(); }
Improve initialization of table locator object
cakephp_cakephp
train
php
536014e93d46b19d203427c442aab501922f5117
diff --git a/resources/manifest.php b/resources/manifest.php index <HASH>..<HASH> 100644 --- a/resources/manifest.php +++ b/resources/manifest.php @@ -4,5 +4,5 @@ declare(strict_types=1); return [ 'name' => 'Vanilo Checkout Module', - 'version' => '3.0.0' + 'version' => '3.1-dev' ];
Started <I>-dev
vanilophp_checkout
train
php
0ce12c88e82260d2e8c24b7532fc16e846dfe4fb
diff --git a/lib/task.js b/lib/task.js index <HASH>..<HASH> 100755 --- a/lib/task.js +++ b/lib/task.js @@ -249,6 +249,18 @@ function factory( try { self.renderOwnOptions(self.options); self.instantiateJob(); + // TODO: it may better to define this in the database in the case that + // a task runner crashes, and the task is re-run, the timeout clock + // will reset. It's somewhat of a design question whether we want + // timeouts to be for each task iteration or for the max time allowed period. + if (self.definition.options.timeout) { + assert.number(self.definition.options.timeout, "Task timeout value"); + self.timer = setTimeout(function() { + var _timeoutSecs = self.definition.options.timeout / 1000; + self.cancel(new Errors.TaskTimeoutError( + "Task did not complete within " + _timeoutSecs)); + }, self.definition.options.timeout); + } } catch (e) { self.state = TaskStates.Failed; self.error = e;
Add rudimentary task timeouts
RackHD_on-tasks
train
js
335f7e776ac727e2735581ffab6a7afdb1a5f412
diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FileType.php b/src/Symfony/Component/Form/Extension/Core/Type/FileType.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FileType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FileType.php @@ -35,15 +35,14 @@ class FileType extends AbstractType public function buildForm(FormBuilder $builder, array $options) { if ($options['type'] === 'string') { - $builder->appendNormTransformer(new DataTransformerChain(array( - new ReversedTransformer(new FileToStringTransformer()), - new FileToArrayTransformer(), - ))); - } else { - $builder->appendNormTransformer(new FileToArrayTransformer()); + $builder->appendNormTransformer( + new ReversedTransformer(new FileToStringTransformer()) + ); } - $builder->addEventSubscriber(new FixFileUploadListener($this->storage), 10) + $builder + ->appendNormTransformer(new FileToArrayTransformer()) + ->addEventSubscriber(new FixFileUploadListener($this->storage), 10) ->add('file', 'field') ->add('token', 'hidden') ->add('name', 'hidden');
[Form] Simplified FileType code
symfony_symfony
train
php
c3ab8d15dbb241c28f33c1e884662f837b848c86
diff --git a/models/LoginForm.php b/models/LoginForm.php index <HASH>..<HASH> 100644 --- a/models/LoginForm.php +++ b/models/LoginForm.php @@ -57,11 +57,16 @@ class LoginForm extends Model /** * Gets all users to generate the dropdown list when in debug mode. * - * @return string + * @return array */ public static function loginList() { - return ArrayHelper::map(User::find()->where(['blocked_at' => null])->all(), 'username', function ($user) { + /** @var \dektrium\user\Module $module */ + $module = \Yii::$app->getModule('user'); + + $userModel = $module->modelMap['User']; + + return ArrayHelper::map($userModel::find()->where(['blocked_at' => null])->all(), 'username', function ($user) { return sprintf('%s (%s)', Html::encode($user->username), Html::encode($user->email)); }); }
Fix the error when the User class is mapped (#<I>) * Fix the error when the User class is mapped
dektrium_yii2-user
train
php
933ac6be83f47fb3178dd421d77e5557a893d702
diff --git a/test_setquery.py b/test_setquery.py index <HASH>..<HASH> 100644 --- a/test_setquery.py +++ b/test_setquery.py @@ -189,8 +189,11 @@ def test_daclookup(): "c.b": ["c.a"], } - # The node lookup and dependency operator + # The node lookup node_lookup = partial(strlookup, space=graph.keys()) + + # The node operators. dependency_op returns the given node and all other + # nodes up the chain from it. dependency_op = lambda nodes: set(chain(*[ node_dependencies(node, graph) for node in nodes ]))
Separate dac lookup and operator definition
icio_evil
train
py
f316e55cd8fc02206122806d8b40667fbe899e63
diff --git a/commands/clone.go b/commands/clone.go index <HASH>..<HASH> 100644 --- a/commands/clone.go +++ b/commands/clone.go @@ -29,7 +29,7 @@ var cmdClone = &Command{ The 'git:' protocol will be used for cloning public repositories, while the SSH protocol will be used for private repositories and those that you have push -acccess to. Alternatively, hub can be configured to use HTTPS protocol for +access to. Alternatively, hub can be configured to use HTTPS protocol for everything. See "HTTPS instead of git protocol" and "HUB_PROTOCOL" of hub(1). ## Examples:
commands/clone: fix typo in docs
github_hub
train
go