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
50bd0c8712b8bd46e52ad990b326573535f5d3e0
diff --git a/lib/wired/builders/facebook_builder.rb b/lib/wired/builders/facebook_builder.rb index <HASH>..<HASH> 100644 --- a/lib/wired/builders/facebook_builder.rb +++ b/lib/wired/builders/facebook_builder.rb @@ -51,16 +51,12 @@ Home pagina, show fangate: <%= @show_fangate %> copy_file 'facebook/sessions_controller.rb', 'app/controllers/sessions_controller.rb' copy_file 'facebook/cookie.html.erb', 'app/views/sessions/cookie.html.erb' facebook_cookie_fix =<<-COOKIE_FIX - helper_method :allow_iframe_requests + before_action :allow_iframe_requests helper_method :current_user - before_filter :cookie_fix - before_filter :add_global_javascript_variables - before_filter :set_origin - before_filter :set_p3p - - def cookie - # third party cookie fix - end + before_action :cookie_fix + before_action :add_global_javascript_variables + before_action :set_origin + before_action :set_p3p private def set_p3p
iframe_requests is not a helper but a method, and filters are deprecated, use actions
wirelab_wired
train
rb
ef3ca42fbf27db5355f84ece7d4b77c1e5000ff3
diff --git a/src/CacheProfiles/BaseCacheProfile.php b/src/CacheProfiles/BaseCacheProfile.php index <HASH>..<HASH> 100644 --- a/src/CacheProfiles/BaseCacheProfile.php +++ b/src/CacheProfiles/BaseCacheProfile.php @@ -24,7 +24,7 @@ abstract class BaseCacheProfile implements CacheProfile public function useCacheNameSuffix(Request $request): string { if (Auth::check()) { - return Auth::user()->id; + return Auth::id(); } return '';
Use Auth::id() instead of Auth::user()->id (#<I>) This PR allows greater flexibility when using other authentication drivers by requesting the users ID via `Authenticatable::getAuthIdentifier()` through the `Auth` facade.
spatie_laravel-responsecache
train
php
8dc032f501890d8265d727dc2471eff01e24cce2
diff --git a/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php b/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php +++ b/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php @@ -82,7 +82,7 @@ trait AuthenticatesAndRegistersUsers { } return redirect($this->loginPath()) - ->withInput($request->only('email')) + ->withInput($request->only('email', 'remember')) ->withErrors([ 'email' => 'These credentials do not match our records.', ]);
Return to login page with remember input checkbox too
laravel_framework
train
php
5fc41ecff6920f61156573335f15d37acad4575c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ here = path.abspath(path.dirname(__file__)) setup( name='wikitextparser', # Scheme: [N!]N(.N)*[{a|b|rc}N][.postN][.devN] - version='0.8.5.dev1', + version='0.8.6.dev1', description='A simple, purely python, WikiText parsing tool.', long_description=open(path.join(here, 'README.rst')).read(), url='https://github.com/5j9/wikitextparser',
Bump the version to '<I>.dev1'
5j9_wikitextparser
train
py
49d56b04912087134fc25d13ba085bad1f7e55c0
diff --git a/Application.php b/Application.php index <HASH>..<HASH> 100644 --- a/Application.php +++ b/Application.php @@ -29,6 +29,7 @@ class Application extends BaseApplication $sfRequest = SymfonyRequest::create($request->getPath(), $request->getMethod()); $sfRequest->attributes->set('react.espresso.request', $request); $sfRequest->attributes->set('react.espresso.response', $response); + return $sfRequest; } } diff --git a/ControllerCollection.php b/ControllerCollection.php index <HASH>..<HASH> 100644 --- a/ControllerCollection.php +++ b/ControllerCollection.php @@ -13,6 +13,7 @@ class ControllerCollection extends BaseControllerCollection public function match($pattern, $to) { $wrapped = $this->wrapController($to); + return parent::match($pattern, $wrapped); }
Run CS fixer on code base
friends-of-reactphp_espresso
train
php,php
e5172503928eb3c39952229ab53f038cde422cb4
diff --git a/drivers/chown.go b/drivers/chown.go index <HASH>..<HASH> 100644 --- a/drivers/chown.go +++ b/drivers/chown.go @@ -5,10 +5,10 @@ import ( "encoding/json" "fmt" "os" - "path/filepath" "github.com/containers/storage/pkg/idtools" "github.com/containers/storage/pkg/reexec" + "github.com/opencontainers/selinux/pkg/pwalk" ) const ( @@ -51,16 +51,13 @@ func chownByMapsMain() { if len(toHost.UIDs()) == 0 && len(toHost.GIDs()) == 0 { toHost = nil } - chown := func(path string, info os.FileInfo, err error) error { - if err != nil { - return fmt.Errorf("error walking to %q: %v", path, err) - } + chown := func(path string, info os.FileInfo, _ error) error { if path == "." { return nil } return platformLChown(path, info, toHost, toContainer) } - if err := filepath.Walk(".", chown); err != nil { + if err := pwalk.Walk(".", chown); err != nil { fmt.Fprintf(os.Stderr, "error during chown: %v", err) os.Exit(1) }
drivers/chown: use pwalk.Walk This is a parallel Walk implementation and we're expecting some speedup
containers_storage
train
go
896fc97ad6d9f585bd61dbff9becb28531c7f7b8
diff --git a/e2e_test/playground/transaction_service/app.js b/e2e_test/playground/transaction_service/app.js index <HASH>..<HASH> 100644 --- a/e2e_test/playground/transaction_service/app.js +++ b/e2e_test/playground/transaction_service/app.js @@ -32,21 +32,30 @@ app.directive('customDirective', function () { } } }) +function exponentialize (seed, times) { + var res = seed + for (var j = 0; j < times; j++) { + res = res.concat(res) + } + return res +} app.controller('MainCtrl', function mainCtrl ($scope, $http, $resource) { $scope.confirmation = function (conf) { $scope.confirmation = conf } - var i = 0 - $scope.repeatArray = [10] + var repeatArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + + $scope.repeatArray = repeatArray setTimeout(function () { - $scope.repeatArray.push(i++) + $scope.repeatArray.push(1) $scope.$apply() }, 0) $http.get('confirmation.json').then(function (response) { $scope.confirmation(response.data) + $scope.repeatArray = exponentialize(repeatArray, 8) }, function () { throw new Error('Confirmation failed.') })
add big datasets to e2e_test/playground
opbeat_opbeat-react
train
js
e136d4cd251d20ba9321a4f138122953915ba36b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,7 @@ setup( 'requests==2.9.1', 'gevent==1.1.2', 'gevent-websocket==0.9.5', + 'pyzmq==17.1.2' ], extras_require = {
GUI Issue #<I> - Adding pyzmq installation requirement
NASA-AMMOS_AIT-Core
train
py
78139a80bac29465d6c493a96a7f89c2394ee296
diff --git a/select2.js b/select2.js index <HASH>..<HASH> 100644 --- a/select2.js +++ b/select2.js @@ -961,12 +961,19 @@ the specific language governing permissions and limitations under the Apache Lic // mozilla and IE el.bind("propertychange.select2 DOMAttrModified.select2", sync); + + + // hold onto a reference of the callback to work around a chromium bug + if (this.mutationCallback === undefined) { + this.mutationCallback = function (mutations) { + mutations.forEach(sync); + } + } + // safari and chrome if (typeof WebKitMutationObserver !== "undefined") { if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; } - this.propertyObserver = new WebKitMutationObserver(function (mutations) { - mutations.forEach(sync); - }); + this.propertyObserver = new WebKitMutationObserver(this.mutationCallback); this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false }); } },
work around chrome and mutation observer bug. fixes #<I>
select2_select2
train
js
0cdc89f6cd66ac5b840a63bb487b766d3385b014
diff --git a/satpy/modifiers/_crefl.py b/satpy/modifiers/_crefl.py index <HASH>..<HASH> 100644 --- a/satpy/modifiers/_crefl.py +++ b/satpy/modifiers/_crefl.py @@ -118,7 +118,7 @@ class ReflectanceCorrector(ModifierBase, DataDownloadMixin): @staticmethod def _read_var_from_hdf4_file(local_filename, var_name): try: - return ReflectanceCorrector._read_var_from_hdf4_file(local_filename, var_name) + return ReflectanceCorrector._read_var_from_hdf4_file_pyhdf(local_filename, var_name) except (ImportError, OSError): return ReflectanceCorrector._read_var_from_hdf4_file_netcdf4(local_filename, var_name)
Fix typo in crefl DEM reading
pytroll_satpy
train
py
c91e3e3035813dd1be28311eda06ea6655a4c39f
diff --git a/Command/Command.php b/Command/Command.php index <HASH>..<HASH> 100644 --- a/Command/Command.php +++ b/Command/Command.php @@ -68,9 +68,13 @@ class Command extends AbstractCommand */ protected function doExecute() { + $this->input->args = array($this->name); + $output = $this->application ->getDefaultCommand() ->getArgument('help') + ->setInput($this->input) + ->setOutput($this->output) ->execute(); $this->out($output);
Add color support when default doExecute call HelpCommand
asika32764_joomla-framework-console
train
php
ed04f61dd1d14439cb48eea5d283a5734e4b91ae
diff --git a/lib/fuzzystringmatch/inline/jarowinkler.rb b/lib/fuzzystringmatch/inline/jarowinkler.rb index <HASH>..<HASH> 100644 --- a/lib/fuzzystringmatch/inline/jarowinkler.rb +++ b/lib/fuzzystringmatch/inline/jarowinkler.rb @@ -34,8 +34,8 @@ double getDistance( char *s1, char *s2 ) { char *_max; char *_min; - int _max_length = 0; - int _min_length = 0; + long _max_length = 0; + long _min_length = 0; if ( strlen(s1) > strlen(s2) ) { _max = s1; _max_length = strlen(s1); _min = s2; _min_length = strlen(s2); @@ -46,8 +46,8 @@ double getDistance( char *s1, char *s2 ) } int range = max( _max_length / 2 - 1, 0 ); - int indexes[_min_length]; - for( int i = 0 ; i < _min_length ; i++ ) { + long indexes[_min_length]; + for( long i = 0 ; i < _min_length ; i++ ) { indexes[i] = -1; }
Quiet warnings when loading into Rails <I> with Ruby <I> on Mac OSX, to the effect of 'jarowinkler.rb:<I>: warning: implicit conversion shortens <I>-bit value into a <I>-bit value'
kiyoka_fuzzy-string-match
train
rb
3f14112a62e826949b8e221c9333a58b2b0dcc58
diff --git a/core/ArrayLib.php b/core/ArrayLib.php index <HASH>..<HASH> 100755 --- a/core/ArrayLib.php +++ b/core/ArrayLib.php @@ -4,7 +4,7 @@ * @package sapphire * @subpackage misc */ -class ArrayLib extends Object { +class ArrayLib { /** * Inverses the first and second level keys of an associative
MINOR ArrayLib - removed unncessary extending of Object since this class only has a bunch of static functions (from r<I>) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
20e9a828cedd7c14e80faf199a3139cf32dbbb55
diff --git a/src/module.js b/src/module.js index <HASH>..<HASH> 100644 --- a/src/module.js +++ b/src/module.js @@ -203,9 +203,26 @@ angular.module('stormpath', [ * @return {Object} config $http config object. */ StormpathAgentInterceptor.prototype.request = function(config){ - if ($isCurrentDomain(config.url)){ + + var uriExpressions = [ + '/change$', + '/forgot$', + '/login$', + '/logout$', + '/me$', + '/oauth/token$', + '/oauth/token$', + '/register$', + '/revoke$', + '/verify$' + ]; + + if (uriExpressions.some(function(expr){ + return new RegExp(expr).test(config.url); + })) { config.headers = angular.extend(config.headers, $spHeaders); } + return config; };
Change agent header strategy to a whitelist strategy
stormpath_stormpath-sdk-angularjs
train
js
a568bca992bab8dfe4f783f4099ea038bbecc521
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from os import path here = path.abspath(path.dirname(__file__)) __author__ = 'Magnus Knutas' -VERSION = '1.3.2' +VERSION = '1.3.3' with open("README.md", "r") as fh: long_description = fh.read()
Update setup.py Update version number
kennedyshead_aioasuswrt
train
py
2a05c311e90a82ee547fa16fdcd77e12327eb5e0
diff --git a/_pytest/main.py b/_pytest/main.py index <HASH>..<HASH> 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -34,8 +34,8 @@ def pytest_addoption(parser): # "**/test_*.py", "**/*_test.py"] #) group = parser.getgroup("general", "running and selection options") - group._addoption('-x', '--exitfirst', action="store_true", default=False, - dest="exitfirst", + group._addoption('-x', '--exitfirst', action="store_const", + dest="maxfail", const=1, help="exit instantly on first error or failed test."), group._addoption('--maxfail', metavar="num", action="store", type=int, dest="maxfail", default=0, @@ -74,10 +74,10 @@ def pytest_namespace(): collect = dict(Item=Item, Collector=Collector, File=File, Session=Session) return dict(collect=collect) + def pytest_configure(config): pytest.config = config # compatibiltiy - if config.option.exitfirst: - config.option.maxfail = 1 + def wrap_session(config, doit): """Skeleton command line program"""
implement exitfirst as store_const option this makes it possible to override with a later maxfail
vmalloc_dessert
train
py
1604327513b9a3cc203f0c5f75506d27ccf4b4b3
diff --git a/packages/bonde-styleguide/src/content/Button/Button.js b/packages/bonde-styleguide/src/content/Button/Button.js index <HASH>..<HASH> 100644 --- a/packages/bonde-styleguide/src/content/Button/Button.js +++ b/packages/bonde-styleguide/src/content/Button/Button.js @@ -115,7 +115,13 @@ Button.propTypes = { /** Flat button style. */ flat: bool, /** Button text color. */ - color: string + color: string, + /** Button type. */ + type: string, +} + +Button.defaultProps = { + type: 'button', } Button.displayName = 'Button'
chore(styleguide): button component type as button by default
nossas_bonde-client
train
js
cf437f95cc7eb9500622962b03a3a71d76e7c0fd
diff --git a/choria/framework.go b/choria/framework.go index <HASH>..<HASH> 100644 --- a/choria/framework.go +++ b/choria/framework.go @@ -359,7 +359,7 @@ func (fw *Framework) MiddlewareServers() (servers srvcache.Servers, err error) { } } - if servers.Count() == 0 { + if servers.Count() == 0 && fw.Config.Choria.UseSRVRecords { servers, err = fw.QuerySrvRecords([]string{"_mcollective-server._tcp", "_x-puppet-mcollective._tcp"}) if err != nil { log.Warnf("Could not resolve Middleware Server SRV records: %s", err)
(#<I>) avoid some warning level logs
choria-io_go-choria
train
go
752121085b0397b37aab001d74522e63ee0ba452
diff --git a/ternary/plotting.py b/ternary/plotting.py index <HASH>..<HASH> 100644 --- a/ternary/plotting.py +++ b/ternary/plotting.py @@ -93,10 +93,10 @@ def triangle_coordinates(i, j, alt=False): # Alt refers to the inner triangles not covered by the default case return [(i/2. + j + 1, i * SQRT3OVER2), (i/2. + j + 1.5, (i + 1) * SQRT3OVER2), (i/2. + j + 0.5, (i + 1) * SQRT3OVER2)] -def heatmap(d, steps, cmap_name=None, boundary=True, ax=None, scientific=True): +def heatmap(d, steps, cmap_name=None, boundary=True, ax=None, scientific=False): """Plots counts in the dictionary d as a heatmap. d is a dictionary of (i,j) --> c pairs where N = i + j + k.""" if not ax: - ax = pyplot + ax = pyplot.subplot() if not cmap_name: cmap = DEFAULT_COLOR_MAP else:
Added axes parameter to heatmap to allow for imbedding into e.g. gridspec layouts.
marcharper_python-ternary
train
py
72de3315fdf81c4b515a5faf77d7e44b34f76811
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ class JPypeSetup(object): self.javaHome = os.getenv("JAVA_HOME") if self.javaHome is None: possibleHomes = ['/usr/lib/jvm/default-java', + '/usr/lib/jvm/java-6-sun/', '/usr/lib/jvm/java-1.5.0-gcj-4.4', '/usr/lib/jvm/jdk1.6.0_30', '/usr/lib/jvm/java-1.5.0-sun-1.5.0.08',
Add another linux java jdk path.
jpype-project_jpype
train
py
395eccf00867b214eb2cf6a113eea09a12fd0ae8
diff --git a/lib/beaker-hostgenerator/data.rb b/lib/beaker-hostgenerator/data.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-hostgenerator/data.rb +++ b/lib/beaker-hostgenerator/data.rb @@ -68,7 +68,7 @@ module BeakerHostGenerator 'pe_ver' => options[:pe_ver] || pe_version, 'pe_upgrade_dir' => options[:pe_upgrade_dir] || pe_dir(pe_upgrade_version), 'pe_upgrade_ver' => options[:pe_upgrade_ver] || pe_upgrade_version, - } + }.reject { |key, value| value.nil? } end # This is where all the information for all platforms lives, irrespective
Do not generate empty entries for pe_* This is not needed to specify and only increases the generated data.
puppetlabs_beaker-hostgenerator
train
rb
3dae18f1c5c6d07224f51d5179fda29d1341e01d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='citrination-client', - version='3.1.0', + version='3.2.0', url='http://github.com/CitrineInformatics/python-citrination-client', description='Python client for accessing the Citrination api', packages=find_packages(exclude=('docs')),
bump the version to <I>
CitrineInformatics_python-citrination-client
train
py
8f379dbca69d90523568bc775636124d29591cfb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -28,8 +28,6 @@ There is no GUI here. The GUI is https://github.com/jflesch/paperwork . "/archive/unstable.tar.gz"), classifiers=[ "Development Status :: 5 - Production/Stable", - "Environment :: X11 Applications :: GTK", - "Environment :: X11 Applications :: Gnome", "Intended Audience :: End Users/Desktop", ("License :: OSI Approved ::" " GNU General Public License v3 or later (GPLv3+)"),
setup.py: backend is not an X<I> application
openpaperwork_paperwork-backend
train
py
171bcaa7b040e028d7a638778765532f814ecbe1
diff --git a/c7n/resources/asg.py b/c7n/resources/asg.py index <HASH>..<HASH> 100644 --- a/c7n/resources/asg.py +++ b/c7n/resources/asg.py @@ -126,7 +126,7 @@ class LaunchInfo(object): lid = asg.get('LaunchTemplate') if lid is not None: - return (lid['LaunchTemplateId'], lid['LaunchTemplateVersion']) + return (lid['LaunchTemplateId'], lid['Version']) # we've noticed some corner cases where the asg name is the lc name, but not # explicitly specified as launchconfiguration attribute.
asg - not-encrypted filter launch template version key(#<I>)
cloud-custodian_cloud-custodian
train
py
6024c85c09f94ca94e0a197d7931492851527688
diff --git a/server/const.go b/server/const.go index <HASH>..<HASH> 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.2.1" + VERSION = "2.2.2-beta" // PROTO is the currently supported protocol. // 0 was the original
Bump to <I>-beta
nats-io_gnatsd
train
go
6869e2d3b5b3a90bcd00322676ab97ab20c90082
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -73,14 +73,12 @@ tests_require = [ 'logbook', 'mock', 'nose', - 'pycodestyle', 'pytz', 'pytest>=3.2.0,<3.3.0', - 'pytest-timeout==1.2.0', + 'pytest-timeout==1.2.1', 'pytest-xdist==1.18.2', - 'pytest-pythonpath==0.7.1', - 'pytest-sugar==0.9.0', - 'pytest-cov', + 'pytest-pythonpath==0.7.2', + 'pytest-cov==2.5.1', 'pytest-flake8==1.0.0', 'requests', 'tornado>=4.1,<5.0',
ref: Update pytest requirements (#<I>)
getsentry_raven-python
train
py
fe186b5e6377618eb17eae0d1e6429b0dcacc137
diff --git a/src/main/java/org/fit/cssbox/css/DOMAnalyzer.java b/src/main/java/org/fit/cssbox/css/DOMAnalyzer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/fit/cssbox/css/DOMAnalyzer.java +++ b/src/main/java/org/fit/cssbox/css/DOMAnalyzer.java @@ -314,7 +314,11 @@ public class DOMAnalyzer //fix the DOM tree structure according to HTML syntax HTMLNorm.normalizeHTMLTree(doc); //convert attributes to style definitions - HTMLNorm.attributesToStyles(getBody(), ""); + Element body = getBody(); + if (body != null) + HTMLNorm.attributesToStyles(body, ""); + else + log.error("No <body> element found in the DOM."); } /**
Avoid exception when there is no <body> element in the DOM.
radkovo_CSSBox
train
java
50231e30e64c1045b567adf828b2c2a9723b11d4
diff --git a/Settings.php b/Settings.php index <HASH>..<HASH> 100644 --- a/Settings.php +++ b/Settings.php @@ -2,29 +2,51 @@ /** * @file - * Contains Drupal\Component\Utility\Settings. + * Contains \Drupal\Component\Utility\Settings. */ namespace Drupal\Component\Utility; -class Settings { +/** + * Read only settings that are initialized with the class. + */ +final class Settings { /** + * Array with the settings. + * * @var array */ - protected $storage; + private $storage = array(); /** - * @var Settings + * Singleton instance. + * + * @var \Drupal\Component\Utility\Settings */ - static $singleton; + private static $instance; /** + * Returns the settings instance. + * + * A singleton is used because this class is used before the container is + * available. + * + * @return \Drupal\Component\Utility\Settings + */ + public static function getSingleton() { + return self::$instance; + } + + /** + * Constructor. + * * @param array $settings + * Array with the settings. */ function __construct(array $settings) { $this->storage = $settings; - self::$singleton = $this; + self::$instance = $this; } /**
Issue #<I> by Berdir, deviance, Lars Toomre: Make queue a container service.
drupal_core-utility
train
php
cccc76af2236163bdb4a23bcc800689914b4432a
diff --git a/views/layouts/main.php b/views/layouts/main.php index <HASH>..<HASH> 100644 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -7,7 +7,6 @@ $user = Yii::$app->adminuser->getIdentity(); $this->beginPage() ?><!DOCTYPE html> <html ng-app="zaa" ng-controller="LayoutMenuController"> - <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> @@ -29,10 +28,7 @@ $this->beginPage() <script> var authToken = '<?=$user->getAuthToken();?>'; </script> - - <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> - <body ng-cloak> <?php $this->beginBody() ?> <!-- ANGULAR SCRIPTS -->
removed materialize font from layout file.
luyadev_luya-module-admin
train
php
b81720449ce8fabcbd2d84283750d2eeebe92c35
diff --git a/src/main/java/com/postmark/java/PostmarkClient.java b/src/main/java/com/postmark/java/PostmarkClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/postmark/java/PostmarkClient.java +++ b/src/main/java/com/postmark/java/PostmarkClient.java @@ -59,6 +59,7 @@ public class PostmarkClient { gsonBuilder.registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()); gsonBuilder.setPrettyPrinting(); gsonBuilder.setExclusionStrategies(new SkipMeExclusionStrategy(Boolean.class)); + gsonBuilder.disableHtmlEscaping(); logger.addHandler(new ConsoleHandler()); logger.setLevel(Level.ALL);
Disabled HTML escaping so that trailing = in Base<I> are not encoded with \u<I>d
grobmeier_postmark4j
train
java
d88a358f39dde73ef0d604a43da8e93d8b453e21
diff --git a/src/java/com/threerings/cast/CharacterSprite.java b/src/java/com/threerings/cast/CharacterSprite.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/cast/CharacterSprite.java +++ b/src/java/com/threerings/cast/CharacterSprite.java @@ -1,5 +1,5 @@ // -// $Id: CharacterSprite.java,v 1.39 2003/01/13 22:53:04 mdb Exp $ +// $Id: CharacterSprite.java,v 1.40 2003/01/13 23:54:19 mdb Exp $ package com.threerings.cast; @@ -180,6 +180,9 @@ public class CharacterSprite extends ImageSprite // documentation inherited public void paint (Graphics2D gfx) { + // attempt to composite our action frames if necessary + compositeActionFrames(); + if (_frames != null) { decorateBehind(gfx); // paint the image using _ibounds rather than _bounds which @@ -197,7 +200,7 @@ public class CharacterSprite extends ImageSprite * their frames. This is called lazily after we have been instructed * to use a new action. */ - protected void compositeActionFrames () + protected final void compositeActionFrames () { if (_frames == null) { setFrames(_aframes.getFrames(_orient));
We need to composite our action frames because it's possible that during our tick we'll do something that invalidates our existing frames and we need to composite the new ones in paint(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
18ca81e6b698dfd811df9c239b1292823d4840b8
diff --git a/build/tasks/ci.js b/build/tasks/ci.js index <HASH>..<HASH> 100644 --- a/build/tasks/ci.js +++ b/build/tasks/ci.js @@ -1,4 +1,4 @@ var gulp = require('gulp'); -// gulp.task('ci', ['default', 'coveralls']); -gulp.task('ci', ['default']); +gulp.task('ci', ['default', 'coveralls']); +// gulp.task('ci', ['default']);
chore(ci-build-task): changed ci task to try travis
aurelia-ui-toolkits_aurelia-materialize-bridge
train
js
76de72b50c9651445aff2e98f433f73c70ad44f7
diff --git a/tests/test_connection.py b/tests/test_connection.py index <HASH>..<HASH> 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -21,7 +21,7 @@ class TestSerfConnection(object): rpc = connection.SerfConnection(port=40000) with pytest.raises(connection.SerfConnectionError) as exceptionInfo: rpc.handshake() - assert 'Error 61 connecting localhost:40000. Connection refused.' \ + assert 'connecting localhost:40000. Connection refused.' \ in str(exceptionInfo) def test_connection_to_serf_agent(self):
Don't expect that we'll always have the same error number
KushalP_serfclient-py
train
py
b3a00803022ae20936280b3bc217d573e5085f22
diff --git a/lib/model-api/utils.rb b/lib/model-api/utils.rb index <HASH>..<HASH> 100644 --- a/lib/model-api/utils.rb +++ b/lib/model-api/utils.rb @@ -408,8 +408,9 @@ module ModelApi metadata = filtered_ext_attrs(klass, opts[:operation] || :index, opts) model_metadata = opts[:model_metadata] || model_metadata(klass) includes = [] - if (metadata_includes = model_metadata[:collection_includes]).is_a?(Array) - includes += metadata_includes.map(&:to_sym) + if (metadata_includes = model_metadata[:collection_includes]).present? + meta_includes = [meta_includes] unless meta_includes.is_a?(Array) + includes += metadata_includes end metadata.each do |_attr, attr_metadata| includes << attr_metadata[:key] if attr_metadata[:type] == :association
Allow more flexibility in specifying includes (for ActiveRecord) in collection queries.
PrecisionHawk_model-api
train
rb
707639534f5c0afea853fd8c02901a20a8dff3f8
diff --git a/src/LayoutNode.js b/src/LayoutNode.js index <HASH>..<HASH> 100644 --- a/src/LayoutNode.js +++ b/src/LayoutNode.js @@ -50,11 +50,23 @@ define(function(require, exports, module) { */ LayoutNode.prototype.reset = function() { this._invalidated = false; - this._spec.transform = undefined; this.trueSizeRequested = false; }; /** + * Set the spec of the node + * + * @param {Object} spec + */ + LayoutNode.prototype.setSpec = function(spec) { + this._spec.align = spec.align; + this._spec.origin = spec.origin; + this._spec.size = spec.size; + this._spec.transform = spec.transform; + this._spec.opacity = spec.opacity; + }; + + /** * Set the content of the node * * @param {Object} set @@ -75,6 +87,9 @@ define(function(require, exports, module) { rotate: set.rotate || [0, 0, 0] }); } + else { + this._spec.transform = undefined; + } this.scrollLength = set.scrollLength; };
Added setSpec function for compatibility with FlowLayoutNode
IjzerenHein_famous-flex
train
js
a815c647c403216a29f2cf6ed06c76180d5718d1
diff --git a/lib/flex/utils.rb b/lib/flex/utils.rb index <HASH>..<HASH> 100644 --- a/lib/flex/utils.rb +++ b/lib/flex/utils.rb @@ -45,5 +45,29 @@ module Flex load File.expand_path('../../tasks/index.rake', __FILE__) end + module Delegation + + extend self + + def delegate(mod, *methods) + to = methods.pop[:to] + + file, line = caller.first.split(':', 2) + line = line.to_i + + methods.each do |method| + mod.module_eval(<<-method, file, line - 2) + def #{method}(*args, &block) # def method_name(*args, &block) + if #{to} || #{to}.respond_to?(:#{method}) # if client || client.respond_to?(:name) + #{to}.__send__(:#{method}, *args, &block) # client.__send__(:name, *args, &block) + end # end + end # end + method + end + + end + + end + end end
added simple Delegation module (used internally)
elastics_elastics
train
rb
9c889be19bae3be8a10991c2b007e350077eb1ad
diff --git a/nats.go b/nats.go index <HASH>..<HASH> 100644 --- a/nats.go +++ b/nats.go @@ -143,6 +143,7 @@ type Conn struct { pending *bytes.Buffer fch chan bool info serverInfo + _ uint32 // needed to correctly align the following ssid field on i386 systems ssid int64 subs map[int64]*Subscription mch chan *Msg
fixed issue #<I> with <I>bit numbers on <I> systems
nats-io_go-nats
train
go
7ddaab58b8a10f049abfa001b891f19c0604f443
diff --git a/public_html/profiles/social/modules/social_features/social_group/src/Plugin/Block/GroupHeroBlock.php b/public_html/profiles/social/modules/social_features/social_group/src/Plugin/Block/GroupHeroBlock.php index <HASH>..<HASH> 100644 --- a/public_html/profiles/social/modules/social_features/social_group/src/Plugin/Block/GroupHeroBlock.php +++ b/public_html/profiles/social/modules/social_features/social_group/src/Plugin/Block/GroupHeroBlock.php @@ -74,7 +74,7 @@ class GroupHeroBlock extends BlockBase { $build['#cache']['tags'] = $tags; $build['#cache'] = array( - 'max-age' => 0; + 'max-age' => 0 ); return $build;
DS-<I> - small issue
goalgorilla_open_social
train
php
d2b8419cd764f0d75fe009a032087426137f3da8
diff --git a/src/api/layers.js b/src/api/layers.js index <HASH>..<HASH> 100644 --- a/src/api/layers.js +++ b/src/api/layers.js @@ -174,7 +174,7 @@ viz.addTooltip(layerView); } if(options.legends) { - viz.addLegends([layerData], (options.mobile_layout || options.force_mobile)); + viz.addLegends([layerData], ((mobileEnabled && options.mobile_layout) || options.force_mobile)); } if(options.time_slider && layerView.model.get('type') === 'torque') { viz.addTimeSlider(layerView);
Fixes a bug that prevented showing the legends when using createLayer
CartoDB_carto.js
train
js
a23b4d1346b8e6598d517730e0f6118a77db9d53
diff --git a/db/migrate/20140131065836_create_socializer_person_places.rb b/db/migrate/20140131065836_create_socializer_person_places.rb index <HASH>..<HASH> 100644 --- a/db/migrate/20140131065836_create_socializer_person_places.rb +++ b/db/migrate/20140131065836_create_socializer_person_places.rb @@ -4,7 +4,7 @@ class CreateSocializerPersonPlaces < ActiveRecord::Migration[7.0] def change create_table :socializer_person_places do |t| t.references :person, null: false - t.string :city_name + t.string :city_name, null: false t.boolean :current, default: false t.timestamps
add `NOT NULL` to socializer_person_places.city_name - models validates its presence but it's not non-NULL in the database
socializer_socializer
train
rb
e6680a1920bd2a4e62960cc38fc8b017156a74db
diff --git a/src/extensions/parseFlex.js b/src/extensions/parseFlex.js index <HASH>..<HASH> 100644 --- a/src/extensions/parseFlex.js +++ b/src/extensions/parseFlex.js @@ -5,7 +5,7 @@ const parseFlexChar = (char) => { return 'flex: 0 0 auto;'; } - return `flex: ${char} 0 auto;` + return `flex: ${char} 0 0;` } export default (flex) => {
Fix nested FlexFields support
Bandwidth_shared-components
train
js
301ee1ffd5addce7bb84b02648b579b836edbb89
diff --git a/test/setup.rb b/test/setup.rb index <HASH>..<HASH> 100644 --- a/test/setup.rb +++ b/test/setup.rb @@ -1,4 +1,4 @@ $LOAD_PATH.unshift(File.expand_path("#{__FILE__}/../../lib")) # Add PROJECT/lib to $LOAD_PATH require 'crudtree' -require '/home/freak/coding/ruby/git-sources/baretest/lib/baretest/rr' +require 'baretest/mocha' include CRUDtree
rr doesn't work with <I> :-(
reactormonk_CRUDtree
train
rb
39e9fd37e49802b1f6b819d070fe09fe0141a816
diff --git a/components/form-ng/form-ng__update-text.js b/components/form-ng/form-ng__update-text.js index <HASH>..<HASH> 100644 --- a/components/form-ng/form-ng__update-text.js +++ b/components/form-ng/form-ng__update-text.js @@ -84,13 +84,7 @@ angular.module('Ring.form') /** * Update initial value if field has been changed outside form.input (e.g. new value from rest) */ - var viewValue = scope.form.input.$viewValue; - - if (typeof viewValue === 'string' && scope.isMultiLine() === 'list') { - viewValue = viewValue.split(multiLineSplitPattern); - } - - if (angular.isDefined(newValue) && !angular.equals(newValue, viewValue)) { + if (angular.isDefined(newValue) && !angular.equals(newValue, scope.form.input.$modelValue)) { scope.initial = newValue; scope.form.$setPristine(); } else if (scope.form.$dirty && angular.equals(scope.initial, newValue)) {
RG-<I> Save button not appears for multiline fields: proper version Former-commit-id: e5fb<I>f2c3f<I>ac<I>b1c<I>aa<I>
JetBrains_ring-ui
train
js
590a1619b7713fd1530c7f2c80e6c2b264514ea0
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -2943,7 +2943,8 @@ var CodeMirror = (function() { function e_target(e) {return e.target || e.srcElement;} function e_button(e) { - if (e.which) return e.which; + if (mac && e.ctrlKey && e.which === 1) return 3; + else if (e.which) return e.which; else if (e.button & 1) return 1; else if (e.button & 2) return 3; else if (e.button & 4) return 2;
treat mac+ctrl+click as right-click
codemirror_CodeMirror
train
js
96362649f0c41661579e78b8e53b71dd65038903
diff --git a/lib/mongo/monitoring/publishable.rb b/lib/mongo/monitoring/publishable.rb index <HASH>..<HASH> 100644 --- a/lib/mongo/monitoring/publishable.rb +++ b/lib/mongo/monitoring/publishable.rb @@ -33,18 +33,24 @@ module Mongo # # @since 2.1.0 def publish_command(messages) - start = Time.now - payload = messages.first.payload - Monitoring.started(Monitoring::COMMAND, command_started(payload)) + if monitoring? + start = Time.now + payload = messages.first.payload + Monitoring.started(Monitoring::COMMAND, command_started(payload)) + end begin result = yield(messages) - Monitoring.completed( - Monitoring::COMMAND, - command_completed(payload, result ? result.payload : nil, start) - ) + if monitoring? + Monitoring.completed( + Monitoring::COMMAND, + command_completed(payload, result ? result.payload : nil, start) + ) + end result rescue Exception => e - Monitoring.failed(Monitoring::COMMAND, command_failed(payload, e, start)) + if monitoring? + Monitoring.failed(Monitoring::COMMAND, command_failed(payload, e, start)) + end raise e end end @@ -83,6 +89,10 @@ module Mongo def duration(start) Time.now - start end + + def monitoring? + options[:monitor] != false + end end end end
SPEC-<I>: Monitoring defaults to true, allow user customization
mongodb_mongo-ruby-driver
train
rb
6f4115d17483cf97a68004cf1a3ae1cdd54db3f2
diff --git a/anyconfig/api.py b/anyconfig/api.py index <HASH>..<HASH> 100644 --- a/anyconfig/api.py +++ b/anyconfig/api.py @@ -269,7 +269,8 @@ def multi_load(paths, ac_parser=None, ac_template=False, ac_context=None, cups = single_load(path, ac_parser=ac_parser, ac_template=ac_template, ac_context=cnf, **opts) - cnf.update(cups) + if cups: + cnf.update(cups) return _maybe_validated(cnf, schema, **options)
fix: only update cnf if needed (diff is not empty)
ssato_python-anyconfig
train
py
7809796b22548cb0f1c98bb5351348b2e1c50ec0
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -45,7 +45,8 @@ module.exports = function(grunt) { waitsFor: false, runs: false, exports: false, - process: false + process: false, + setImmediate: false } } }, diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,8 @@ plugin[level].apply(plugin, args); }; - process.nextTick(compute); + // using execution deferral + setImmediate(compute); }); };
fix #1 use setImmediate instead of process next tick
micro-toolkit_logger-facade-nodejs
train
js,js
4e0ab7db6f8bfd4f0c73573c4bfac1272a644f2d
diff --git a/routes.js b/routes.js index <HASH>..<HASH> 100644 --- a/routes.js +++ b/routes.js @@ -289,7 +289,7 @@ function getSearchQuery(model, searchValue) { }).join('||'); } else { - return searchRule.replace('__value__', valueRegex); + return searchRule.replace(/__value__/g, valueRegex); } }
Support for multiple occurrences of __value__ in search string
node4good_formage
train
js
60c7c397dae6defc7ff988659932eab4459b238d
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -9,11 +9,11 @@ mockery.enable({ warnOnUnregistered: false }) global.testing = true // Run tests -const assets = require('./lib/assets'); -const deploy = require('./lib/deploy'); -const makeappx = require('./lib/makeappx'); -const makepri = require('./lib/makepri'); -const manifest = require('./lib/manifest'); -const sign = require('./lib/sign'); -const zip = require('./lib/zip'); -const utils = require('./lib/utils'); \ No newline at end of file +require('./lib/assets'); +require('./lib/deploy'); +require('./lib/makeappx'); +require('./lib/makepri'); +require('./lib/manifest'); +require('./lib/sign'); +require('./lib/zip'); +require('./lib/utils');
:wrench: Improve test code
felixrieseberg_electron-windows-store
train
js
4a1897c2592bf53e9841931685f35a79d55dea14
diff --git a/src/modules/PublicLab.MapModule.js b/src/modules/PublicLab.MapModule.js index <HASH>..<HASH> 100644 --- a/src/modules/PublicLab.MapModule.js +++ b/src/modules/PublicLab.MapModule.js @@ -13,7 +13,7 @@ module.exports = PublicLab.MapModule = PublicLab.Module.extend({ _module.options = options || _editor.options.mapModule || {}; if (_module.options === true) _module.options = {}; // so we don't make options be /true/ _module.options.name = 'map' ; - _module.options.instructions = 'Add a map to your note. Learn about <a href="https://publiclab.org/location-privacy">location privacy here</a>' ; + _module.options.instructions = 'Add a map to your note. Learn about <a href="https://publiclab.org/location-privacy" target="_blank">location privacy here »</a>' ; _module._super(_editor, _module.options) ; _module.options.required = false;
updated privacy link (#<I>)
publiclab_PublicLab.Editor
train
js
8ccaa6b0999cc86c000b7a52d585d43a335cae37
diff --git a/demos/blog/protected/models/User.php b/demos/blog/protected/models/User.php index <HASH>..<HASH> 100644 --- a/demos/blog/protected/models/User.php +++ b/demos/blog/protected/models/User.php @@ -100,11 +100,12 @@ class User extends CActiveRecord * * @param int cost parameter for Blowfish hash algorithm * @return string the salt + * @throws CException if improper cost passed */ protected function generateSalt($cost=10) { if(!is_numeric($cost)||$cost<4||$cost>31){ - throw new CException(Yii::t('Cost parameter must be between 4 and 31.')); + throw new CException('Cost parameter must be between 4 and 31.'); } // Get some pseudo-random data from mt_rand(). $rand=''; @@ -115,9 +116,9 @@ class User extends CActiveRecord // Mix the bits cryptographically. $rand=sha1($rand,true); // Form the prefix that specifies hash algorithm type and cost parameter. - $salt='$2a$'.str_pad((int)$cost,2,'0',STR_PAD_RIGHT).'$'; + $salt='$2a$'.sprintf('%02d',$cost).'$'; // Append the random salt string in the required base64 format. $salt.=strtr(substr(base64_encode($rand),0,22),array('+'=>'.')); return $salt; } -} \ No newline at end of file +}
Demo blog, User model enhancements: 1. Added EOL at the end of file. 2. Added @throws tag to the User::generateSalt() method. 3. Removed invalid and unnecessary Yii::t() translation call. 4. Fixes #<I>. `str_pad` replaced with `sprintf`.
yiisoft_yii
train
php
f24cd41e8d3dd8bd9e752fc450fff2d01afe1092
diff --git a/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py b/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py index <HASH>..<HASH> 100644 --- a/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py +++ b/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py @@ -118,7 +118,15 @@ class PWMOut(object): self._channel = None self._pwmpin = None + def _is_deinited(self): + if self._pwmpin is None: + raise ValueError("Object has been deinitialize and can no longer " + "be used. Create a new object.") + def _write_pin_attr(self, attr, value): + # Make sure the pin is active + self._is_deinited() + path = os.path.join( self._sysfs_path, self._channel_path.format(self._channel), @@ -130,6 +138,9 @@ class PWMOut(object): f_attr.write(value + "\n") def _read_pin_attr(self, attr): + # Make sure the pin is active + self._is_deinited() + path = os.path.join( self._sysfs_path, self._channel_path.format(self._channel),
add '_is_deinited()' to guard against reads/writes on an inactive pin.
adafruit_Adafruit_Blinka
train
py
ce5bc33f7c0e6899f759a8bb1f469e0911edf615
diff --git a/abydos/stemmer.py b/abydos/stemmer.py index <HASH>..<HASH> 100644 --- a/abydos/stemmer.py +++ b/abydos/stemmer.py @@ -805,9 +805,9 @@ def dutch(word): return word # lowercase, normalize, decompose, filter umlauts & acutes out, and compose - word = unicodedata.normalize('NFKD', _unicode(word.lower())) - word = ''.join([c for c in word if c not in set('̈́')]) - word = unicodedata.normalize('NFC', word.lower()) + word = unicodedata.normalize('NFC', _unicode(word.lower())) + _accented = dict(zip([ord(_) for _ in 'äëïöüáéíóú'], 'aeiouaeiou')) + word = word.translate(_accented) for i in _range(len(word)): if i == 0 and word[0] == 'y': @@ -849,7 +849,7 @@ def dutch(word): # Step 3a if word[-4:] == 'heid': - if len(word[r2_start:]) >= 4 and word[-2] != 'c': + if len(word[r2_start:]) >= 4 and word[-5] != 'c': word = word[:-4] if word[-2:] == 'en': if (len(word[r1_start:]) >= 2 and
fixed index bug error switched from removing all umlauts & acute accents to just removing those attached to aeiou
chrislit_abydos
train
py
1c5c3d0d7a0fa282f03c71d9485961c79374f18e
diff --git a/src/Plugin/CatalogInventory/Model/Stock/Item.php b/src/Plugin/CatalogInventory/Model/Stock/Item.php index <HASH>..<HASH> 100644 --- a/src/Plugin/CatalogInventory/Model/Stock/Item.php +++ b/src/Plugin/CatalogInventory/Model/Stock/Item.php @@ -22,7 +22,7 @@ class Item \Magento\CatalogInventory\Model\Stock\Item $subject, \Closure $proceed ) { - $result = $subject->get(Cfg::E_CATINV_STOCK_ITEM_A_STOCK_ID); + $result = $subject->getData(Cfg::E_CATINV_STOCK_ITEM_A_STOCK_ID); return $result; } } \ No newline at end of file
MOBI-<I> - Send PV info from Odoo to Magento
praxigento_mobi_mod_warehouse
train
php
89b9ef14eaae3f523a6f27d6edf894bc1b55405e
diff --git a/lib/document/Document.js b/lib/document/Document.js index <HASH>..<HASH> 100644 --- a/lib/document/Document.js +++ b/lib/document/Document.js @@ -104,6 +104,14 @@ class Document extends NativeMethod { return new Record(this, data, _.defaults(options, this.options)); } /** + * find and return single record + * @param {id} id + * @param {boolean} record + */ + findById(id, record = true) { + return this.findOne({ _id: id }).then(res => (record ? this.create(res) : res)); + } + /** * Return default options for document * @memberof Document */
[Document] document: added findById method
deeppatel234_mongoorm
train
js
c3ca9f7de1fed576d08739c6896aa56cc3e2be95
diff --git a/lib/her/model.rb b/lib/her/model.rb index <HASH>..<HASH> 100644 --- a/lib/her/model.rb +++ b/lib/her/model.rb @@ -40,6 +40,7 @@ module Her # Supported ActiveModel modules include ActiveModel::AttributeMethods include ActiveModel::Validations + include ActiveModel::Validations::Callbacks include ActiveModel::Conversion include ActiveModel::Dirty include ActiveModel::Naming
Adding Active model before and after validation We have method valid? which is requested from ActiveModel and don't have any callback to update values before it
remiprev_her
train
rb
8522e4f50f7c3e659200ea9093c88b25198fbd70
diff --git a/tweepy/api.py b/tweepy/api.py index <HASH>..<HASH> 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -219,7 +219,14 @@ class API(object): :allowed_param: """ f = kwargs.pop('file', None) - headers, post_data = API._pack_image(filename, 4883, + + file_type = imghdr.what(filename) + if file_type == 'gif': + max_size = 15360 + else: + max_size = 4883 + + headers, post_data = API._pack_image(filename, max_size, form_field='media', f=f) kwargs.update({'headers': headers, 'post_data': post_data})
increase max image size for gif
tweepy_tweepy
train
py
9fc4198f55de972427265197b9ca6416166b8ebd
diff --git a/vent/api/menu_helpers.py b/vent/api/menu_helpers.py index <HASH>..<HASH> 100644 --- a/vent/api/menu_helpers.py +++ b/vent/api/menu_helpers.py @@ -98,8 +98,10 @@ class MenuHelper: output = check_output(shlex.split(cmd), stderr=STDOUT) - image_attrs = d_client.images.get(image_name).attrs - image_id = image_attrs['Id'].split(':')[1][:12] + image_attrs = d_client.images.get( + image_name).attrs + image_id = image_attrs['Id'].split(':') + image_id = image_id[1][:12] if image_id: plugin_c.set_option(section,
changed line lengths to satisify codeclimate
CyberReboot_vent
train
py
9f4fc0d98f65e913e187800a6fef97f9f0480b76
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ here = path.abspath(path.dirname(__file__)) setup( name='vcf2clinvar', - version='0.1.dev2', + version='0.1.dev3', description='Match a personal genome VCF datafile to ClinVar', url='https://github.com/PersonalGenomesOrg/vcf2clinvar', author='Personal Genome Project Informatics Group', diff --git a/vcf2clinvar/__init__.py b/vcf2clinvar/__init__.py index <HASH>..<HASH> 100755 --- a/vcf2clinvar/__init__.py +++ b/vcf2clinvar/__init__.py @@ -17,7 +17,10 @@ from .genome import GenomeVCFLine def _next_line(filebuffer): - next_line = filebuffer.readline() + try: + next_line = filebuffer.readline() + except AttributeError: + next_line = filebuffer.next() try: next_line = next_line.decode('utf-8') return next_line
Fall back to "next" if no "readline"
madprime_vcf2clinvar
train
py,py
0608a7613ba4d13becdc43d8942a2f4e9949a3b6
diff --git a/lib/puppet/pops/parser/pn_parser.rb b/lib/puppet/pops/parser/pn_parser.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/pops/parser/pn_parser.rb +++ b/lib/puppet/pops/parser/pn_parser.rb @@ -164,7 +164,7 @@ class PNParser end when TYPE_DIGIT - dc = skip_decimal_digits + skip_decimal_digits c = peek_cp if c == 0x2e # '.' @pos += 1
(PUP-<I>) Remove unused variable causing rubocop failure
puppetlabs_puppet
train
rb
5ab04070583d69dcc15ff6a909f466874257a0b9
diff --git a/packages/ember-routing-handlebars/lib/helpers/query_params.js b/packages/ember-routing-handlebars/lib/helpers/query_params.js index <HASH>..<HASH> 100644 --- a/packages/ember-routing-handlebars/lib/helpers/query_params.js +++ b/packages/ember-routing-handlebars/lib/helpers/query_params.js @@ -13,7 +13,7 @@ import QueryParams from "ember-routing/system/query_params"; Example - {#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} + {{#link-to 'posts' (query-params direction="asc")}}Sort{{/link-to}} @method query-params @for Ember.Handlebars.helpers @@ -36,4 +36,4 @@ export function queryParamsHelper(options) { return QueryParams.create({ values: options.hash }); -} \ No newline at end of file +}
[DOC release] Fix invalid Handlebars syntax in query-params docs.
emberjs_ember.js
train
js
34d1c53a85cc7704a042925fef8c7460c64fc8e3
diff --git a/lib/beaker-aws/version.rb b/lib/beaker-aws/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-aws/version.rb +++ b/lib/beaker-aws/version.rb @@ -1,3 +1,3 @@ module BeakerAws - VERSION = '0.2.0' + VERSION = '0.3.0' end
(GEM) update beaker-aws version to <I>
puppetlabs_beaker-aws
train
rb
d9d579e01aed03d8104ccd1988356f9ab9e27ba2
diff --git a/app/controllers/socializer/likes_controller.rb b/app/controllers/socializer/likes_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/socializer/likes_controller.rb +++ b/app/controllers/socializer/likes_controller.rb @@ -1,6 +1,7 @@ module Socializer class LikesController < ApplicationController - before_action :set_likable, only: [:create, :destroy] + before_action :set_likable, only: [:create, :destroy] + before_action :set_activity, only: [:create, :destroy] # REFACTOR: should handle activity/tooltip as well as people likes # Used to display the Like tooltip @@ -19,7 +20,6 @@ module Socializer def create @likable.like!(current_user) unless current_user.likes?(@likable) - @activity = @likable.activitable respond_to do |format| format.js @@ -28,7 +28,6 @@ module Socializer def destroy @likable.unlike!(current_user) if current_user.likes?(@likable) - @activity = @likable.activitable respond_to do |format| format.js @@ -42,6 +41,10 @@ module Socializer @likable = ActivityObject.find(params[:id]) end + def set_activity + @activity = @likable.activitable + end + # # Never trust parameters from the scary internet, only allow the white list through. # def like_params # params.require(:like).permit(:actor_id, :activity_object_id)
dry @activity for likes_controller
socializer_socializer
train
rb
cd54e305c558a9e12b2d0938e7c502a29d507351
diff --git a/src/Serializer/JmsSerializer.php b/src/Serializer/JmsSerializer.php index <HASH>..<HASH> 100644 --- a/src/Serializer/JmsSerializer.php +++ b/src/Serializer/JmsSerializer.php @@ -134,7 +134,14 @@ class JmsSerializer implements SerializerInterface ); } - private function getSourceClassFromMapping($params) + /** + * gets the source class. + * + * @param array $params + * @return mixed + * @author Daniel Wendlandt + */ + private function getSourceClassFromMapping(array $params) { $index = $params['index']; $type = $params['type'];
typehint in class and added docblock
elastification_php-client
train
php
7fbfb55ee6b549c8e5442fbf3e2c336e3d2b26ce
diff --git a/example/image-classification/train_model.py b/example/image-classification/train_model.py index <HASH>..<HASH> 100644 --- a/example/image-classification/train_model.py +++ b/example/image-classification/train_model.py @@ -26,7 +26,7 @@ def fit(args, network, data_loader): logging.basicConfig(level=logging.DEBUG, format=head) logging.info('start with arguments %s', args) - # load model? + # load model model_prefix = args.model_prefix if model_prefix is not None: model_prefix += "-%d" % (kv.rank) @@ -37,7 +37,7 @@ def fit(args, network, data_loader): model_args = {'arg_params' : tmp.arg_params, 'aux_params' : tmp.aux_params, 'begin_epoch' : args.load_epoch} - # save model? + # save model checkpoint = None if model_prefix is None else mx.callback.do_checkpoint(model_prefix) # data
del "?" from comment "?" should not exist in comment
apache_incubator-mxnet
train
py
4a838988a8d6d45244915def26538436d8f5f99a
diff --git a/create_app.py b/create_app.py index <HASH>..<HASH> 100644 --- a/create_app.py +++ b/create_app.py @@ -252,9 +252,6 @@ for line in fileinput.input(boot_file, inplace=True): else: print(line, end='') -# To use the app's own Qt framework -subprocess.call(['macdeployqt', 'dist/%s' % MAC_APP_NAME]) - # Workaround for what appears to be a bug with py2app and Homebrew # See https://bitbucket.org/ronaldoussoren/py2app/issue/26#comment-2092445 PF_dir = get_config_var('PYTHONFRAMEWORKINSTALLDIR')
Mac app: Don't call macdeployqt because we switched to use PyQt5 wheels
spyder-ide_spyder
train
py
269ef33c67369f8a0725559f2b4a9b8088fd212a
diff --git a/lib/active_admin/orm/active_record/comments.rb b/lib/active_admin/orm/active_record/comments.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/orm/active_record/comments.rb +++ b/lib/active_admin/orm/active_record/comments.rb @@ -11,14 +11,10 @@ ActiveAdmin::Application.inheritable_setting :comments_registration_name, 'Comme # Insert helper modules ActiveAdmin::Namespace.send :include, ActiveAdmin::Comments::NamespaceHelper ActiveAdmin::Resource.send :include, ActiveAdmin::Comments::ResourceHelper - -# Add the module to the show page ActiveAdmin.application.view_factory.show_page.send :include, ActiveAdmin::Comments::ShowPageHelper # Load the model as soon as it's referenced. By that point, Rails & Kaminari will be ready -module ActiveAdmin - autoload :Comment, 'active_admin/orm/active_record/comments/comment' -end +ActiveAdmin.autoload :Comment, 'active_admin/orm/active_record/comments/comment' # Walk through all the loaded namespaces after they're loaded ActiveAdmin.after_load do |app|
code style updates to AA::Comment
activeadmin_activeadmin
train
rb
d2e186ed71f1a89df7f62afdc8f5239168ddc72a
diff --git a/lang/en/moodle.php b/lang/en/moodle.php index <HASH>..<HASH> 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -168,7 +168,7 @@ $string['forgotten'] = "Forgotten your username or password?"; $string['format'] = "Format"; $string['formathtml'] = "HTML format"; $string['formatsocial'] = "Social format"; -$string['formattext'] = "Moodle text format"; +$string['formattext'] = "Moodle auto-format"; $string['formattexttype'] = "Formatting"; $string['formattopics'] = "Topics format"; $string['formatweeks'] = "Weekly format";
Revised string for formattext to make more sense
moodle_moodle
train
php
ca81fff04a5dae963e3bc5540f1aa29391c547a3
diff --git a/test/integration/login_test.js b/test/integration/login_test.js index <HASH>..<HASH> 100644 --- a/test/integration/login_test.js +++ b/test/integration/login_test.js @@ -149,6 +149,7 @@ suite('integration - existing user flow', function(){ assert.isNull(err) }) }) + /* .waitForElementByCssSelector('.btn-success', 5000, function(err, el){ // Start a test assert.isNull(err, "error selecting success button") @@ -168,6 +169,10 @@ suite('integration - existing user flow', function(){ assert.include(url, "strider-test-robot/strider-extension-loader") done() }) + */ + .url(function(err, url){ + done() + }) }) /*
disable broken integration tests (TODO: PB)
Strider-CD_strider
train
js
9a1b1f0230727c061185f3c34f925a0633e0e0bf
diff --git a/cassandra/query.py b/cassandra/query.py index <HASH>..<HASH> 100644 --- a/cassandra/query.py +++ b/cassandra/query.py @@ -507,7 +507,8 @@ class BoundStatement(Statement): components = [] for statement_index in routing_indexes: val = self.values[statement_index] - components.append(struct.pack("HsB", len(val), val, 0)) + l = len(val) + components.append(struct.pack(">H%dsB" % l, l, val, 0)) self._routing_key = b"".join(components)
Fix routing key encoding for compound primary keys - make component size big-endian - include component string size in format string
datastax_python-driver
train
py
82bb008411ee2d2f1b9567dd392b7be869c15ccb
diff --git a/src/Provider/FileSession.php b/src/Provider/FileSession.php index <HASH>..<HASH> 100644 --- a/src/Provider/FileSession.php +++ b/src/Provider/FileSession.php @@ -25,7 +25,9 @@ class FileSession implements SessionInterface public function __destruct() { - file_put_contents($this->file, '<?php return ' . var_export($this->dataSet, true) . ';'); + if (count($this->dataSet) > 0) { + file_put_contents($this->file, '<?php return ' . var_export($this->dataSet, true) . ';'); + } } /**
fileSession write if datas are exists
Wandu_Framework
train
php
b65dff0fbe328ba4a10a0c35cede34cf93f0fb95
diff --git a/dev/TestRunner.php b/dev/TestRunner.php index <HASH>..<HASH> 100644 --- a/dev/TestRunner.php +++ b/dev/TestRunner.php @@ -37,25 +37,25 @@ class TestRunner extends Controller { 'module/$ModuleName' => 'module', 'all' => 'all', 'build' => 'build', - '$TestCase' => 'only', + '$TestCase' => 'only' ); static $allowed_actions = array( - 'index', - 'browse', - 'coverage', - 'coverageOnly', - 'startsession', - 'endsession', - 'cleanupdb', - 'module', - 'all', - 'build', - 'only' + 'index', + 'browse', + 'coverage', + 'coverageAll', + 'coverageModule', + 'coverageOnly', + 'startsession', + 'endsession', + 'cleanupdb', + 'module', + 'all', + 'build', + 'only' ); - - /** * @var Array Blacklist certain directories for the coverage report. * Filepaths are relative to the webroot, without leading slash.
BUGFIX Allowing actions related to coverage tests
silverstripe_silverstripe-framework
train
php
115ae06da6c3fba211b96e7dd9db470625d9e16d
diff --git a/angr/analyses/vfg.py b/angr/analyses/vfg.py index <HASH>..<HASH> 100644 --- a/angr/analyses/vfg.py +++ b/angr/analyses/vfg.py @@ -1665,7 +1665,11 @@ class VFG(ForwardAnalysis, Analysis): # pylint:disable=abstract-method # we are entering a new function. now it's time to figure out how to optimally traverse the control flow # graph by generating the sorted merge points - new_function = self.kb.functions[function_address] + try: + new_function = self.kb.functions[function_address] + except KeyError: + # the function does not exist + return [ ] if function_address not in self._function_merge_points: ordered_merge_points = CFGUtils.find_merge_points(function_address, new_function.endpoints,
VFG: take care of missing functiosn in _merge_points()
angr_angr
train
py
450a0223f55cba8738402c92a395e082785db904
diff --git a/HydraServer/python/HydraServer/soap_server/hydra_complexmodels.py b/HydraServer/python/HydraServer/soap_server/hydra_complexmodels.py index <HASH>..<HASH> 100644 --- a/HydraServer/python/HydraServer/soap_server/hydra_complexmodels.py +++ b/HydraServer/python/HydraServer/soap_server/hydra_complexmodels.py @@ -1060,6 +1060,7 @@ class ProjectSummary(Resource): self.cr_date = str(parent.cr_date) self.created_by = parent.created_by self.summary = parent.summary + self.status = parent.status class User(HydraComplexModel): """
#<I>: Include status in get_projects.
hydraplatform_hydra-base
train
py
ca5d37a89bdcb8d15189b9989be3417c4575a91d
diff --git a/ruby/server/lib/roma/event/handler.rb b/ruby/server/lib/roma/event/handler.rb index <HASH>..<HASH> 100644 --- a/ruby/server/lib/roma/event/handler.rb +++ b/ruby/server/lib/roma/event/handler.rb @@ -88,6 +88,8 @@ module Roma @connected = true @last_access = Time.now @fiber = Fiber.new { dispatcher } + rescue Exception =>e + @log.error("#{__FILE__}:#{__LINE__}:#{e.inspect} #{$@}") end def receive_data(data)
added a rescue block in a post_init method
roma_roma
train
rb
41a3297d5de386e46d7349df638e79ed64dcecf3
diff --git a/devices/tuya.js b/devices/tuya.js index <HASH>..<HASH> 100644 --- a/devices/tuya.js +++ b/devices/tuya.js @@ -20,7 +20,8 @@ module.exports = [ exposes: [e.temperature(), e.humidity(), e.battery()], }, { - fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_8ygsuhe1'}], + fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_8ygsuhe1'}, + {modelID: 'TS0601', manufacturerName: '_TZE200_yvx5lh6k'}], model: 'TS0601_air_quality_sensor', vendor: 'Tuya', description: 'Air quality sensor',
Add _TZE<I>_yvx5lh6k to TS<I>_air_quality_sensor (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
96cc26ac6a37b5766e6c1d10515ff917c770b076
diff --git a/auto_ml/predictor.py b/auto_ml/predictor.py index <HASH>..<HASH> 100644 --- a/auto_ml/predictor.py +++ b/auto_ml/predictor.py @@ -757,7 +757,7 @@ class Predictor(object): if orig_row_count <= 10000: num_rows_to_use = orig_row_count - X, ignored_X, y, ignored_y = train_test_split(X_transformed, y, train_size=int(num_rows_to_use * row_multiplier) ) + X, ignored_X, y, ignored_y = train_test_split(X_transformed, y, train_size=row_multiplier ) # X = X_transformed else: percent_row_count = int(self.analytics_config['percent_rows'] * orig_row_count)
handles num_rows = <I>% for train_test_split
ClimbsRocks_auto_ml
train
py
abb21d2b0f42cbd7aa5d863a19598871dfbb3b32
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ extras_require = { ], 'tests': tests_require, 'search': [ - 'invenio-search>=1.0.0a2', + 'invenio-search>=1.0.0a4', 'invenio-indexer>=1.0.0a1', ] } diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -50,7 +50,6 @@ def app(request): TESTING=True, SQLALCHEMY_DATABASE_URI=os.getenv('SQLALCHEMY_DATABASE_URI', 'sqlite://'), - SEARCH_AUTOINDEX=[], SERVER_NAME='localhost', ) Babel(app)
tests: SEARCH_AUTOINDEX removal * Removes obsolete configuration. (see inveniosoftware/invenio-search@cc<I>a<I>)
inveniosoftware_invenio-collections
train
py,py
006961c57e18a322ae30449a63bf38f5db79021e
diff --git a/spyder/widgets/sourcecode/codeeditor.py b/spyder/widgets/sourcecode/codeeditor.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/sourcecode/codeeditor.py +++ b/spyder/widgets/sourcecode/codeeditor.py @@ -1988,7 +1988,8 @@ class CodeEditor(TextEditBaseWidget): def uncomment(self): """Uncomment current line or selection.""" - self.remove_prefix(self.comment_string) + if not self.unblockcomment(): + self.remove_prefix(self.comment_string) def __blockcomment_bar(self): return self.comment_string + ' ' + '=' * (78 - len(self.comment_string)) @@ -2068,7 +2069,7 @@ class CodeEditor(TextEditBaseWidget): if cursor1.atStart(): break if not __is_comment_bar(cursor1): - return + return False def __in_block_comment(cursor): cs = self.comment_string return to_text_string(cursor.block().text()).startswith(cs) @@ -2080,7 +2081,7 @@ class CodeEditor(TextEditBaseWidget): if cursor2.block() == self.document().lastBlock(): break if not __is_comment_bar(cursor2): - return + return False # Removing block comment cursor3 = self.textCursor() cursor3.beginEditBlock()
Fix incompatibility between block comments and line comments.
spyder-ide_spyder
train
py
632c85814b47de8a2f5e234dda341205f1a6a22e
diff --git a/lib/remi.rb b/lib/remi.rb index <HASH>..<HASH> 100644 --- a/lib/remi.rb +++ b/lib/remi.rb @@ -1,5 +1,8 @@ $LOAD_PATH << File.dirname(__FILE__) +require 'rubygems' +require 'bundler/setup' + require 'remi/version' require 'remi/log' require 'remi/dataset'
Enable use of bundler gems
inside-track_remi
train
rb
1bac57a4c66868926749ddcc100f9348793078e5
diff --git a/lib/plugin.js b/lib/plugin.js index <HASH>..<HASH> 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -687,7 +687,7 @@ exports.register = function (plugin, opts, next) { // hapi wont find the local swig without this plugin.expose(api); plugin.route({ method: 'get', path: settings.relsPath, config: internals.namespacesRoute(settings.relsAuth) }); - plugin.route({ method: 'get', path: path.join(settings.relsPath, '{namespace}/{rel}'), config: internals.relRoute(settings.relsAuth) }); + plugin.route({ method: 'get', path: settings.relsPath + '/{namespace}/{rel}'), config: internals.relRoute(settings.relsAuth) }); selection.ext('onPreResponse', internals.preResponse.bind(internals, api, settings));
don't use path for URL construction path.join() uses \ instead of / and causes a hapi exception on windows
bleupen_halacious
train
js
521ef9ec535591b6324a2301e425f3c31eefd846
diff --git a/rtv/content.py b/rtv/content.py index <HASH>..<HASH> 100644 --- a/rtv/content.py +++ b/rtv/content.py @@ -374,7 +374,7 @@ class SubredditContent(Content): def from_name(cls, reddit, name, loader, order=None, query=None, listing='r', period=None): - # Strip leading, trailing and redundant backslashes + # Strip leading, trailing, and redundant backslashes n = '' n = ''.join([n + ''.join(list(g)) if k != '/' else '/' \ for k, g in groupby(name)]).strip(' /') @@ -431,8 +431,12 @@ class SubredditContent(Content): elif listing in ['u', 'user']: if '/m/' in name: multireddit = reddit.get_multireddit(*name.split('/')[::2]) - submissions = eval('multireddit.get_{0}{1}(limit=None)' \ - .format((order or 'hot'), time[period])) + if order in ['top', 'controversial']: + submissions = eval('multireddit.get_{0}{1}(limit=None)' \ + .format((order), time[period])) + else: + submissions = eval('multireddit.get_{0}(limit=None)' \ + .format((order or 'hot'))) elif name == 'me': if not reddit.is_oauth_session():
Apply time period only to appropriatly sorted multireddits
michael-lazar_rtv
train
py
6298bba7b386685aa5849daf4d37983ff564388f
diff --git a/pyradio/player.py b/pyradio/player.py index <HASH>..<HASH> 100644 --- a/pyradio/player.py +++ b/pyradio/player.py @@ -279,7 +279,7 @@ class MpPlayer(Player): if sys.platform.startswith('darwin'): config_files.append("/usr/local/etc/mplayer/mplayer.conf") elif sys.platform.startswith('win'): - pass + config_files[0] = os.path.join(os.getenv('APPDATA'), "mplayer", "config") else: # linux, freebsd, etc. config_files.append("/etc/mplayer/mplayer.conf")
implementing volume save for linux, mac, windows (4) forgot to define mplayer windows config...
coderholic_pyradio
train
py
bf27b2aa5745eb4bae29df1c737aeb41bc3c293b
diff --git a/pyaavso/utils.py b/pyaavso/utils.py index <HASH>..<HASH> 100644 --- a/pyaavso/utils.py +++ b/pyaavso/utils.py @@ -29,6 +29,7 @@ def download_observations(observer_code): 'obs_types': 'all', 'page': page_number, }) + logger.debug(response.request.url) parser = WebObsResultsParser(response.text) observations.extend(parser.get_observations()) # kinda silly, but there's no need for lxml machinery here
Log request URL in download_observations.
zsiciarz_pyaavso
train
py
f2b3240d650b670331dcd53fbfc0075bb7ab8985
diff --git a/pkg/k8s/utils/factory.go b/pkg/k8s/utils/factory.go index <HASH>..<HASH> 100644 --- a/pkg/k8s/utils/factory.go +++ b/pkg/k8s/utils/factory.go @@ -58,25 +58,25 @@ type lister func(client interface{}) func() (versioned.Map, error) // the HasSynced method with the help of our own ResourceEventHandler // implementation. type ControllerSyncer struct { - c cache.Controller - reh ResourceEventHandler + Controller cache.Controller + ResourceEventHandler ResourceEventHandler } // Run starts the controller, which will be stopped when stopCh is closed. func (c *ControllerSyncer) Run(stopCh <-chan struct{}) { - c.c.Run(stopCh) + c.Controller.Run(stopCh) } // HasSynced returns true if the controller has synced and the resource event // handler has handled all requests. func (c *ControllerSyncer) HasSynced() bool { - return c.reh.HasSynced() + return c.ResourceEventHandler.HasSynced() } // LastSyncResourceVersion is the resource version observed when last synced // with the underlying store. func (c *ControllerSyncer) LastSyncResourceVersion() string { - return c.c.LastSyncResourceVersion() + return c.Controller.LastSyncResourceVersion() } // ResourceEventHandler is a wrapper for the cache.ResourceEventHandler
k8s/utils: make the ControllerSynced fields public
cilium_cilium
train
go
b195c82191929897cfe52d9a4ec4b86b657316ad
diff --git a/src/Message/AIMResponse.php b/src/Message/AIMResponse.php index <HASH>..<HASH> 100644 --- a/src/Message/AIMResponse.php +++ b/src/Message/AIMResponse.php @@ -46,7 +46,7 @@ class AIMResponse extends AbstractResponse * A result of 0 is returned if there is no transaction response returned, e.g. a validation error in * some data, or invalid login credentials. * - * @return int 1 = Approved, 2 = Declined, 3 = Error, 4 = Held for Review, 0 = Validation Error + * @return int 1 = Approved, 2 = Declined, 3 = Error, 4 = Held for Review */ public function getResultCode() { @@ -55,9 +55,8 @@ class AIMResponse extends AbstractResponse return intval((string)$this->data->transactionResponse[0]->responseCode); } - // No transaction response, so no transaction was attempted, hence no - // transaction response code that we can return. - return 0; + // No transaction response, so return 3 aka "error". + return 3; } /**
Issue #<I> switch the "0" result code to "3" (error).
thephpleague_omnipay-authorizenet
train
php
60ddf6ad6be44aad83c333bbddde79a4df590063
diff --git a/test/org/opencms/test/OpenCmsTestProperties.java b/test/org/opencms/test/OpenCmsTestProperties.java index <HASH>..<HASH> 100644 --- a/test/org/opencms/test/OpenCmsTestProperties.java +++ b/test/org/opencms/test/OpenCmsTestProperties.java @@ -155,7 +155,6 @@ public final class OpenCmsTestProperties { return; } - String testPropPath; m_testSingleton = new OpenCmsTestProperties(); m_testSingleton.m_basePath = basePath; @@ -164,7 +163,17 @@ public final class OpenCmsTestProperties { } try { - testPropPath = OpenCmsTestProperties.getResourcePathFromClassloader("test.properties"); + String testPropPath = null; + String propertiesFileName = "test.properties"; + + if (basePath != null) { + testPropPath = CmsFileUtil.addTrailingSeparator(basePath) + propertiesFileName; + File propFile = new File(testPropPath); + if (!propFile.exists()) { + testPropPath = OpenCmsTestProperties.getResourcePathFromClassloader(propertiesFileName); + } + } + if (testPropPath == null) { throw new RuntimeException( "Test property file ('test.properties') could not be found by context Classloader.");
Fixed issue when test data was located in another Eclipse project.
alkacon_opencms-core
train
java
12b72efea6dec21a2047a62908bb0583a4caa862
diff --git a/py3status/modules/pomodoro.py b/py3status/modules/pomodoro.py index <HASH>..<HASH> 100644 --- a/py3status/modules/pomodoro.py +++ b/py3status/modules/pomodoro.py @@ -107,7 +107,7 @@ class Py3status: self.__setup('break') self.run = False - def setup_mmss_time(self, form=None): + def _setup_mmss_time(self, form=None): """ Setup the formatted time string. """ @@ -124,7 +124,7 @@ class Py3status: return time - def setup_bar(self): + def _setup_bar(self): """ Setup the process bar. """ @@ -148,10 +148,10 @@ class Py3status: Return the response full_text string """ formatters = { - 'bar': self.setup_bar(), + 'bar': self._setup_bar(), 'ss': self.timer, - 'mm': self.setup_mmss_time(form='mm'), - 'mmss': self.setup_mmss_time() + 'mm': self._setup_mmss_time(form='mm'), + 'mmss': self._setup_mmss_time() } if self.display_bar is True:
Eliminate intrusive log messages from pomodoro Py3status imports all methods of a module except those starting with an underscore and special methods. It then call these methods with self, i3s_output_list and i3s_config. Because of these rules, py3status call setup_mmss_time and setup_bar with too many arguments, causing intrusive messages in logs. This commit fix this behaviour by adding an underscore before these methods' name.
ultrabug_py3status
train
py
14d771c1059f5ac962d20e4200fd9bcd32675187
diff --git a/wandb/cli.py b/wandb/cli.py index <HASH>..<HASH> 100644 --- a/wandb/cli.py +++ b/wandb/cli.py @@ -43,6 +43,11 @@ def display_error(func): return wrapper +def _require_init(): + if __stage_dir__ is None: + print('Directory not initialized. Please run "wandb init" to get started.') + sys.exit(1) + def editor(content='', marker='# Enter a description, markdown is allowed!\n'): message = click.edit(content + '\n\n' + marker) if message is not None: @@ -360,6 +365,7 @@ RUN_CONTEXT['ignore_unknown_options'] = True help='New files in <run_dir> that match will be saved to wandb. (default: \'*\')') @display_error def run(ctx, program, args, id, dir, glob): + _require_init() env = copy.copy(os.environ) env['WANDB_MODE'] = 'run' if id is None:
Show error message if "wandb init" hasn't been run, for run. Fixes # <I>.
wandb_client
train
py
23d9ee900a527e45e24c18e549594c8b63bc60cd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from setuptools import setup, find_packages, Extension from setuptools.command.build_ext import build_ext VERSION = "2.10.1" -LIBUAST_VERSION = "v1.9.1" +LIBUAST_VERSION = "v1.9.4" SDK_VERSION = "v1.16.1" SDK_MAJOR = SDK_VERSION.split('.')[0] FORMAT_ARGS = globals()
Bump libuast dependency version
bblfsh_client-python
train
py
171eb7020aab0564093fc5a925cf5c0a1ca3cf6e
diff --git a/stats_test.go b/stats_test.go index <HASH>..<HASH> 100644 --- a/stats_test.go +++ b/stats_test.go @@ -687,7 +687,7 @@ func TestQuartile(t *testing.T) { } } - _, err := Sum([]float64{}) + _, err := Quartile([]float64{}) if err == nil { t.Errorf("Should have returned an error") }
Fix copy pasta mistake testing the wrong function
montanaflynn_stats
train
go
cb46b4799e488b7e6a2ed6c11500a752b387f958
diff --git a/glim/app.py b/glim/app.py index <HASH>..<HASH> 100644 --- a/glim/app.py +++ b/glim/app.py @@ -1,5 +1,5 @@ # application initiation script -import os +import os, sys, traceback from glim.core import Config as C, Database as D, Orm as O, App from glim.facades import Config, Database, Orm, Session, Cookie @@ -94,9 +94,10 @@ def start(host = '127.0.0.1', port = '8080', environment = 'development', use_re app = Glim(mroutes.urls) - run_simple(host, int(port), app, use_debugger = True, use_reloader = True) + run_simple(host, int(port), app, use_debugger = Config.get('glim.debugger'), use_reloader = Config.get('glim.reloader')) except Exception, e: - print e + print traceback.format_exc() + print sys.exc_info()[0] exit()
fix a bug that prevents dynamically loading facades
aacanakin_glim
train
py
2f211dcce27eaa7c739857797d98340baba8945f
diff --git a/couchdb_schematics/document.py b/couchdb_schematics/document.py index <HASH>..<HASH> 100644 --- a/couchdb_schematics/document.py +++ b/couchdb_schematics/document.py @@ -21,7 +21,8 @@ class SchematicsDocument(Model): _rev = StringType() doc_type = StringType() - def __init__(self, id=None, **kwargs): + def __init__(self, **kwargs): + id = kwargs.pop('id', None) super(SchematicsDocument, self).__init__(raw_data=kwargs) if id: self.id = id diff --git a/tests/test_schematics_document.py b/tests/test_schematics_document.py index <HASH>..<HASH> 100644 --- a/tests/test_schematics_document.py +++ b/tests/test_schematics_document.py @@ -16,8 +16,8 @@ class User1(User1Model,SchematicsDocument): class User2(User2Model,SchematicsDocument): - def __init__(self, id=None, **kwargs): - super(User2, self).__init__(id, **kwargs) + def __init__(self, **kwargs): + super(User2, self).__init__(**kwargs) if 'password' in kwargs and '_rev' not in kwargs: self.password = kwargs['password']
removed id as an optional initialization argument
ryanolson_couchdb-schematics
train
py,py
0c1b7add527475c980430e3244cf7d242a387981
diff --git a/tests/testing.py b/tests/testing.py index <HASH>..<HASH> 100644 --- a/tests/testing.py +++ b/tests/testing.py @@ -13,10 +13,20 @@ def setup_django(): 'django.contrib.auth', 'django.contrib.contenttypes', 'django_ftpserver', - ) + ), + MIDDLEWARE_CLASSES=(), ) - from django.db.models.loading import cache as model_cache - if not model_cache.loaded: - model_cache._populate() - from django.core.management import call_command - call_command('syncdb', interactive=False) + from django import VERSION as version + # In Django 1.7 or later, using "django.apps" module. + if version[0] == 1 and version[1] >= 7: + from django.apps import apps + if not apps.ready: + apps.populate(settings.INSTALLED_APPS) + from django.core.management import call_command + call_command('syncdb', interactive=False) + else: + from django.db.models.loading import cache as model_cache + if not model_cache.loaded: + model_cache._populate() + from django.core.management import call_command + call_command('syncdb', interactive=False)
modify testing utility for Django <I>
tokibito_django-ftpserver
train
py
51ca5989579ed2fbb99924eddb4efcdd207010e9
diff --git a/aiohttp/__init__.py b/aiohttp/__init__.py index <HASH>..<HASH> 100644 --- a/aiohttp/__init__.py +++ b/aiohttp/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.8.0a4" +__version__ = "3.8.0a5" from typing import Tuple
Bump to <I>a5
aio-libs_aiohttp
train
py
9d466cfce97bf6cd9fac697f1bebd5a6a15414e6
diff --git a/src/ROH/Util/Thing.php b/src/ROH/Util/Thing.php index <HASH>..<HASH> 100644 --- a/src/ROH/Util/Thing.php +++ b/src/ROH/Util/Thing.php @@ -8,7 +8,7 @@ class Thing extends Collection public function __construct($attributes) { - if (is_callable($attributes)) { + if (is_callable($attributes) || is_object($attributes)) { $this->handler = $attributes; } else { parent::__construct($attributes);
FIXED bug when create new collection with non-array param
reekoheek_php-util
train
php
1090acb35ea4ce5c8d17db716539d3354feabc12
diff --git a/nodeconductor/iaas/migrations/0038_securitygroup_state.py b/nodeconductor/iaas/migrations/0038_securitygroup_state.py index <HASH>..<HASH> 100644 --- a/nodeconductor/iaas/migrations/0038_securitygroup_state.py +++ b/nodeconductor/iaas/migrations/0038_securitygroup_state.py @@ -5,6 +5,11 @@ from django.db import models, migrations import django_fsm +def mark_security_groups_as_synced(apps, schema_editor): + SecurityGroup = apps.get_model('iaas', 'SecurityGroup') + SecurityGroup.objects.all().update(state=3) + + class Migration(migrations.Migration): dependencies = [ @@ -18,4 +23,5 @@ class Migration(migrations.Migration): field=django_fsm.FSMIntegerField(default=1, choices=[(1, 'Sync Scheduled'), (2, 'Syncing'), (3, 'In Sync'), (4, 'Erred')]), preserve_default=True, ), + migrations.RunPython(mark_security_groups_as_synced), ]
Mark all exist security groups as synced - itacloud-<I>
opennode_waldur-core
train
py
7dc2218a134f7cd75fe8839c180db378b2fec9f0
diff --git a/src/ImageHotspotBundle/mappers/TPkgImageHotspotMapper.class.php b/src/ImageHotspotBundle/mappers/TPkgImageHotspotMapper.class.php index <HASH>..<HASH> 100644 --- a/src/ImageHotspotBundle/mappers/TPkgImageHotspotMapper.class.php +++ b/src/ImageHotspotBundle/mappers/TPkgImageHotspotMapper.class.php @@ -76,7 +76,7 @@ class TPkgImageHotspotMapper extends AbstractViewMapper $oVisitor->SetMappedValue('sHeadline', $oPkgImageHotspot->fieldName); $oVisitor->SetMappedValue('sBackgroundImageId', $oActiveItemImage->id); - $oVisitor->SetMappedValue('backgroundImageCropId', $oActiveItem->fieldCmsMediaIdImageCropId); + $oVisitor->SetMappedValue('backgroundImageCropId', '' !== $oActiveItem->fieldCmsMediaIdImageCropId ? $oActiveItem->fieldCmsMediaIdImageCropId : null); $oVisitor->SetMappedValue('sBackgroundImageAlt', $oActiveItem->fieldName); $oNextItem = $oActiveItem->GetNextItem();
ref #<I>: don't auto select image preset for image hotspot background image
chameleon-system_chameleon-shop
train
php
1aa45dfe6432f44459f8c8d1047e09f3607b61eb
diff --git a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java index <HASH>..<HASH> 100644 --- a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java +++ b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java @@ -47,7 +47,8 @@ public abstract class PagedList<E> implements List<E> { * @param page the {@link Page} object. */ public PagedList(Page<E> page) { - items = page.getItems(); + this(); + items.addAll(page.getItems()); nextPageLink = page.getNextPageLink(); currentPage = page; }
Fixing UnsupportedOperation exception in PagedList
Azure_azure-sdk-for-java
train
java
36819c3eeaa1976e39355874d794432af4c62162
diff --git a/openxc-it/src/main/java/com/openxc/VehicleServiceTest.java b/openxc-it/src/main/java/com/openxc/VehicleServiceTest.java index <HASH>..<HASH> 100644 --- a/openxc-it/src/main/java/com/openxc/VehicleServiceTest.java +++ b/openxc-it/src/main/java/com/openxc/VehicleServiceTest.java @@ -2,11 +2,18 @@ package com.openxc; import com.openxc.VehicleService; +import android.content.Intent; + +import android.os.IBinder; + import android.test.ServiceTestCase; +import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; public class VehicleServiceTest extends ServiceTestCase<VehicleService> { + Intent startIntent; + public VehicleServiceTest() { super(VehicleService.class); } @@ -14,10 +21,21 @@ public class VehicleServiceTest extends ServiceTestCase<VehicleService> { @Override protected void setUp() throws Exception { super.setUp(); + startIntent = new Intent(); + startIntent.setClass(getContext(), VehicleService.class); } @SmallTest public void testPreconditions() { - assertTrue(false); + } + + @SmallTest + public void testStartable() { + startService(startIntent); + } + + @MediumTest + public void testBindable() { + IBinder service = bindService(startIntent); } }
Test that the VehicleService can be started and bound.
openxc_openxc-android
train
java