text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix bug in exception handling
from django.utils.translation import get_language from django.db.models import Model from django.conf import settings from django.core.exceptions import ObjectDoesNotExist try: from django.utils.translation import override except ImportError: from django.utils.translation import activate, deactivate class ...
from django.utils.translation import get_language from django.db.models import Model from django.conf import settings try: from django.utils.translation import override except ImportError: from django.utils.translation import activate, deactivate class override(object): def __init__(self, language,...
Make learn more link clickable.
package com.battlelancer.seriesguide.ui; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.wid...
package com.battlelancer.seriesguide.ui; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import com.actionbarsherlock.app.SherlockFragment; import com.uw...
Simplify SimpleAlarmSerializer to improve the performance of the graph_data endpoint
from rest_framework import serializers from measurement.models import Measurement from threshold_value.models import ThresholdValue from calendar import timegm from alarm.models import Alarm class GraphSeriesSerializer(serializers.ModelSerializer): x = serializers.SerializerMethodField('get_time') y = seriali...
from rest_framework import serializers from measurement.models import Measurement from threshold_value.models import ThresholdValue from calendar import timegm from alarm.models import Alarm class GraphSeriesSerializer(serializers.ModelSerializer): x = serializers.SerializerMethodField('get_time') y = seriali...
Use a single database for all air quality measurements
# coding=utf-8 from local_settings import * from utils import SensorConsumerBase import redis import datetime import sys class Bathroom(SensorConsumerBase): def __init__(self): SensorConsumerBase.__init__(self, "indoor_air_quality") def run(self): self.subscribe("bathroom-pubsub", self.pubsub...
# coding=utf-8 from local_settings import * from utils import SensorConsumerBase import redis import datetime import sys class Bathroom(SensorConsumerBase): def __init__(self): SensorConsumerBase.__init__(self, "bathroom") def run(self): self.subscribe("bathroom-pubsub", self.pubsub_callback)...
Change scale range to normalization with source and target min max
import numpy as np import skimage.io import skimage.util import os def extract_region_from_image(image, region_bounding_box): return image[region_bounding_box[0]:region_bounding_box[2], region_bounding_box[1]:region_bounding_box[3]] def isolate_sprite(image_region_path, output_file_path): result_image = N...
import numpy as np import skimage.io import skimage.util import os def extract_region_from_image(image, region_bounding_box): return image[region_bounding_box[0]:region_bounding_box[2], region_bounding_box[1]:region_bounding_box[3]] def isolate_sprite(image_region_path, output_file_path): result_image = N...
Use Schema for updating the OnlineUser-Entry to use the doc validation Unfortunately, the `update` method of our schema class does not support the `upsert`-option. So we check if the entry already exists and perform an insert or an update depending on the findOne result.
import { Meteor } from 'meteor/meteor'; import { OnlineUsersSchema } from './onlineusers.schema'; import moment from 'moment/moment'; if (Meteor.isServer) { Meteor.publish('onlineUsersForRoute', function (route) { return OnlineUsersSchema.find({activeRoute: route}); }); } const checkRouteParamAndAutho...
import { Meteor } from 'meteor/meteor'; import { OnlineUsersSchema } from './onlineusers.schema'; import moment from 'moment/moment'; if (Meteor.isServer) { Meteor.publish('onlineUsersForRoute', function (route) { return OnlineUsersSchema.find({activeRoute: route}); }); } const checkRouteParamAndAutho...
Add missing spaces, re-indent HTML
<?php echo $head; ?> <div class="pure-g"> <h2><?php echo _('Facebook login successful!') ?></h2> <div class="pure-u-1 pure-u-md-1-3"> <p> <?php echo _('The last step.'); echo ' '; echo _('You can add a message to your check-in.'); ...
<?php echo $head; ?> <div class="pure-g"> <h2><?php echo _('Facebook login successful!') ?></h2> <div class="pure-u-1 pure-u-md-1-3"> <p> <?php echo _('The last step.'); echo _('You can add a message to your check-in.'); ?> </p> </div> ...
Use of @component for buttons in form
@component('core::admin._buttons-form', ['model' => $model]) @endcomponent {!! BootForm::hidden('id') !!} <div class="row"> @if ($model->id) <div class="col-sm-6 container-menulinks"> <p> <a href="{{ route('admin::create-menulink', $model->id) }}"> <i class="fa fa-fw fa-pl...
@include('core::admin._buttons-form') {!! BootForm::hidden('id') !!} <div class="row"> @if ($model->id) <div class="col-sm-6 container-menulinks"> <p> <a href="{{ route('admin::create-menulink', $model->id) }}"> <i class="fa fa-fw fa-plus-circle"></i>@lang('menus::global.N...
Revert - Fix route parameters for a row action
<?php /* * This file is part of the DataGridBundle. * * (c) Stanislav Turza <sorien@mail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sorien\DataGridBundle\Grid\Column; use Sorien\DataGridBundle\Grid\Action\Row...
<?php /* * This file is part of the DataGridBundle. * * (c) Stanislav Turza <sorien@mail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sorien\DataGridBundle\Grid\Column; use Sorien\DataGridBundle\Grid\Action\Row...
Read the files again upon deletion
<?php namespace Kibo\Phast\Cache\File; use Kibo\Phast\Common\ObjectifiedFunctions; class DiskCleanup extends ProbabilisticExecutor { /** * @var integer */ private $maxSize; /** * @var float */ private $portionToFree; public function __construct(array $config, ObjectifiedF...
<?php namespace Kibo\Phast\Cache\File; use Kibo\Phast\Common\ObjectifiedFunctions; class DiskCleanup extends ProbabilisticExecutor { /** * @var integer */ private $maxSize; /** * @var float */ private $portionToFree; public function __construct(array $config, ObjectifiedF...
Use Window instead of JFrame to find top-level parent.
/* * Copyright (c) 2009 Kathryn Huxtable and Kenneth Orr. * * This file is part of the SeaGlass Pluggable Look and Feel. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:...
/* * Copyright (c) 2009 Kathryn Huxtable and Kenneth Orr. * * This file is part of the SeaGlass Pluggable Look and Feel. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:...
Create lcov report so that it can be uploaded to Codeclimate
const path = require('path'); module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine'], preprocessors: { 'src/testception-spec.js': ['webpack'] }, files: ['src/testception-spec.js'], webpack: { mode: 'none', module: { rules: [ { ...
const path = require('path'); module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine'], preprocessors: { 'src/testception-spec.js': ['webpack'] }, files: ['src/testception-spec.js'], webpack: { mode: 'none', module: { rules: [ { ...
Return http status code 301 when api version is wrong
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER, API_VERSION def API(method=None): if method is None: return partial(API) @wraps(method) def decorated...
# -*- coding: utf-8 -*- from functools import wraps, partial from flask import request from flask_api import status from flask.wrappers import Response from app.config import API_ACCEPT_HEADER def API(method=None): if method is None: return partial(API) @wraps(method) def decorated(*args, **kwa...
Remove user-content- link prefix from the generated html
var fs = require('fs'), path = require('path'), hogan = require('hogan.js'), Client = require('github'); var html = fs.readFileSync('base.html', 'utf8'); template = hogan.compile(html); var client = new Client({ version: '3.0.0' }); var dpath = path.resolve(__dirname, '../markdown/'), files...
var fs = require('fs'), path = require('path'), hogan = require('hogan.js'), Client = require('github'); var html = fs.readFileSync('base.html', 'utf8'); template = hogan.compile(html); var client = new Client({ version: '3.0.0' }); var dpath = path.resolve(__dirname, '../markdown/'), files...
Fix accidental logic error in argument checking
/* @flow */ /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ i...
/* @flow */ /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ i...
Test modified according to refactorings
package org.jlib.core.collection; import java.util.HashMap; import java.util.Map; import com.google.common.collect.ForwardingMap; import org.junit.Test; public class CachingMapTest { @Test public void performance() { final Map<String, String> hashMap = new HashMap<>(); hashMap.put("ja", "nei...
package org.jlib.core.collection; import java.util.HashMap; import java.util.Map; import org.junit.Test; public class CachingMapTest { @Test public void performance() { final Map<String, String> hashMap = new HashMap<>(); hashMap.put("ja", "nein"); hashMap.put("gut", "schlecht"); ...
Update test suite. Works great :rainbows:
describe('Landing page', function() { it('should have the correct title', function(done, server, client) { var title = client.evalSync(function() { var titleText = $('title').text(); emit('return', titleText); }); title.should.equal('NEBUL4'); done(); }); }); describe('Gameplay', fun...
describe('Landing page', function() { it('should have the correct title', function(done, server, client) { var title = client.evalSync(function() { var titleText = $('title').text(); emit('return', titleText); }); title.should.equal('NEBUL4'); done(); }); }); describe('Gameplay', fun...
Update TrampolinedParser a little for my purposes.
from ometa.interp import TrampolinedGrammarInterpreter, _feed_me class TrampolinedParser: """ A parser that incrementally parses incoming data. """ def __init__(self, grammar, receiver, bindings): """ Initializes the parser. @param grammar: The grammar used to parse the incomin...
from ometa.interp import TrampolinedGrammarInterpreter, _feed_me class TrampolinedParser: """ A parser that incrementally parses incoming data. """ def __init__(self, grammar, receiver, bindings): """ Initializes the parser. @param grammar: The grammar used to parse the incomin...
Introduce additional empty array check.
<?php class BinaryGap { private $number; /** * BinaryGap constructor. * @param $number */ public function __construct($number) { $this->number = $number; } /** * @return mixed */ public function getNumber() { return $this->number; } private...
<?php class BinaryGap { private $number; /** * BinaryGap constructor. * @param $number */ public function __construct($number) { $this->number = $number; } /** * @return mixed */ public function getNumber() { return $this->number; } private...
Add test for default values.
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import knot class TestContainer(unittest.TestCase): def test_wrapper_looks_like_service(self): c = knot.Container() @c.service('service') def service(container): """Docstring.""" pass self.asse...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import knot class TestContainer(unittest.TestCase): def test_wrapper_looks_like_service(self): c = knot.Container() @c.service('service') def service(container): """Docstring.""" pass self.asse...
Add support for Python 2.6
import subprocess nagiosPluginsCommandLines = [ "/usr/lib64/nagios/plugins/check_sensors", "/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix", ] class NagiosWrapper: def __init__(self, agentConfig, checksLogger, rawConfig): self.agentConfig = agentConfig self.checksLogger = ch...
import subprocess nagiosPluginsCommandLines = [ "/usr/lib64/nagios/plugins/check_sensors", "/usr/lib64/nagios/plugins/check_mailq -w 10 -c 20 -M postfix", ] class NagiosWrapper: def __init__(self, agentConfig, checksLogger, rawConfig): self.agentConfig = agentConfig self.checksLogger = ch...
Fix the Operating System classifier, it was invalid
from setuptools import setup, find_packages from suponoff import __version__ as version if __name__ == '__main__': with open("README.rst") as f: long_description = f.read() setup( name="suponoff", version=version, author="Gambit Research", author_email="opensource@gambi...
from setuptools import setup, find_packages from suponoff import __version__ as version if __name__ == '__main__': with open("README.rst") as f: long_description = f.read() setup( name="suponoff", version=version, author="Gambit Research", author_email="opensource@gambi...
Add ability to define band create function for geotiff images This commit makes defining bands for custom geotiffs more flexible by allowing passing custom functions for defining bands for different datasources or other variables - subsequent commits for MODIS take advantage of this
import os from rf.models import Image from rf.utils.io import Visibility from .io import get_geotiff_size_bytes, get_geotiff_resolution from .create_bands import create_geotiff_bands def create_geotiff_image(organizationId, tif_path, sourceuri, filename=None, visibility=Visibility.PRIVATE, ...
import os from rf.models import Image from rf.utils.io import Visibility from .io import get_geotiff_size_bytes, get_geotiff_resolution from .create_bands import create_geotiff_bands def create_geotiff_image(organizationId, tif_path, sourceuri, filename=None, visibility=Visibility.PRIVATE, ...
Add support for html emails and extra headers
from django.core.mail import ( EmailMessage, EmailMultiAlternatives, get_connection ) from django.conf import settings try: from froide.bounce.utils import make_bounce_address except ImportError: make_bounce_address = None HANDLE_BOUNCES = settings.FROIDE_CONFIG['bounce_enabled'] def get_mail_connection...
from django.core.mail import EmailMessage, get_connection from django.conf import settings try: from froide.bounce.utils import make_bounce_address except ImportError: make_bounce_address = None HANDLE_BOUNCES = settings.FROIDE_CONFIG['bounce_enabled'] def get_mail_connection(**kwargs): return get_conne...
Update task controller to update its content after task edition
/* eslint no-shadow: ["error", { "allow": ["$scope"] }] */ /* eslint no-underscore-dangle: ["error", { "allow": ["_id",] }] */ angular.module('MainApp') .controller('TaskControl', ($scope, $mdDialog, db) => { $scope.current = undefined; $scope.isShown = true; $scope.do = false; $scope.delete = false;...
/* eslint no-shadow: ["error", { "allow": ["$scope"] }] */ /* eslint no-underscore-dangle: ["error", { "allow": ["_id",] }] */ angular.module('MainApp') .controller('TaskControl', ($scope, $mdDialog, db) => { $scope.current = undefined; $scope.isShown = true; $scope.do = false; $scope.delete = false;...
Load ratings in reviews for customer users
<?php /** * Customers may only see approved reviews and any they posted themselves * * @author Daniel Deady <daniel@clockworkgeek.com> * @license MIT */ class Clockworkgeek_Extrarestful_Model_Api2_Review_Rest_Customer_V1 extends Clockworkgeek_Extrarestful_Model_Api2_Review { /** * Hides ID and Status fo...
<?php /** * Customers may only see approved reviews and any they posted themselves * * @author Daniel Deady <daniel@clockworkgeek.com> * @license MIT */ class Clockworkgeek_Extrarestful_Model_Api2_Review_Rest_Customer_V1 extends Clockworkgeek_Extrarestful_Model_Api2_Review { /** * Hides ID and Status fo...
Revert "update to remove client type hinting" This reverts commit a73a6e688d7bcaa17b6c3ba2688291dfa878ea5d.
<?php namespace hceudevs\RateLimitBundle\Service\Storage; use Noxlogic\RateLimitBundle\Service\RateLimitInfo; use Predis\Client; class Redis implements StorageInterface { /** * @var \Predis\Client */ protected $client; public function __construct(Client $client) { $this->client = $...
<?php namespace hceudevs\RateLimitBundle\Service\Storage; use Noxlogic\RateLimitBundle\Service\RateLimitInfo; use Predis\Client; class Redis implements StorageInterface { /** * @var \Predis\Client */ protected $client; public function __construct($client) { $this->client = $client;...
Add a subclass for the dot graph
""" Python in Astronomy 2016 is the second iteration of the Python in Astronomy conference series. This is the docstring for the pyastro module, this gets included as the description for the module. """ import numpy as np def times(a, b): """ Multiply a by b. Parameters ---------- a : `numpy.n...
""" Python in Astronomy 2016 is the second iteration of the Python in Astronomy conference series. This is the docstring for the pyastro module, this gets included as the description for the module. """ import numpy as np def times(a, b): """ Multiply a by b. Parameters ---------- a : `numpy.n...
Use Docker config pointing at the correct interface/subnect for networking.
from pyinfra import inventory, state from pyinfra_docker import deploy_docker from pyinfra_etcd import deploy_etcd from pyinfra_kubernetes import deploy_kubernetes_master, deploy_kubernetes_node SUDO = True FAIL_PERCENT = 0 def get_etcd_nodes(): return [ 'http://{0}:2379'.format( etcd_node.f...
from pyinfra import inventory, state from pyinfra_docker import deploy_docker from pyinfra_etcd import deploy_etcd from pyinfra_kubernetes import deploy_kubernetes_master, deploy_kubernetes_node SUDO = True FAIL_PERCENT = 0 def get_etcd_nodes(): return [ 'http://{0}:2379'.format( etcd_node.f...
Change to semantic version number
from setuptools import setup, find_packages setup( name = "django-ajax-utilities", version = '1.2.0', url = 'https://github.com/citylive/django-ajax-utilities', license = 'BSD', description = "Pagination, xhr and tabbing utilities for the Django framework.", long_description = open('README','r'...
from setuptools import setup, find_packages setup( name = "django-ajax-utilities", url = 'https://github.com/citylive/django-ajax-utilities', license = 'BSD', description = "Pagination, xhr and tabbing utilities for the Django framework.", long_description = open('README','r').read(), author = ...
Refactor out function to call digest only when safe
ngGridDirectives.directive('ngViewport', [function() { return function($scope, elm) { var isMouseWheelActive; var prevScollLeft; var prevScollTop = 0; var ensureDigest = function() { if (!$scope.$root.$$phase) { $scope.$digest(); } }; ...
ngGridDirectives.directive('ngViewport', [function() { return function($scope, elm) { var isMouseWheelActive; var prevScollLeft; var prevScollTop = 0; elm.bind('scroll', function(evt) { var scrollLeft = evt.target.scrollLeft, scrollTop = evt.target.scrollT...
Check getRootNode method exists for older Symfony versions
<?php namespace AshleyDawson\SimplePaginationBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * Class Configuration * * @package AshleyDawson\SimplePaginationBundle\DependencyInjection * @author Ashley Daw...
<?php namespace AshleyDawson\SimplePaginationBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * Class Configuration * * @package AshleyDawson\SimplePaginationBundle\DependencyInjection * @author Ashley Daw...
Add `:=` as a relevance booster for Go
/* Language: Go Author: Stephan Kountso aka StepLg <steplg@gmail.com> Contributors: Evgeny Stepanischev <imbolk@gmail.com> Description: Google go language (golang). For info about language see http://golang.org/ Category: system */ function(hljs) { var GO_KEYWORDS = { keyword: 'break default func interface...
/* Language: Go Author: Stephan Kountso aka StepLg <steplg@gmail.com> Contributors: Evgeny Stepanischev <imbolk@gmail.com> Description: Google go language (golang). For info about language see http://golang.org/ Category: system */ function(hljs) { var GO_KEYWORDS = { keyword: 'break default func interface...
Improve invalid request exception message.
<?php namespace League\Glide\Requests; use Symfony\Component\HttpFoundation\Request; class RequestFactory { /** * Create a request instance. * @param max $args The request object or path/params combination. * @param array $defaultManipulations The default image manipulation...
<?php namespace League\Glide\Requests; use Symfony\Component\HttpFoundation\Request; class RequestFactory { /** * Create a request instance. * @param max $args The request object or path/params combination. * @param array $defaultManipulations The default image manipulation...
Make FontMetrics available to inline script as $fontMetrics Since the FontMetrics class is no longer designed to be used statically a user must instantiate their own copy or reuse the one instantiated by dompdf. While not overly difficult to instantiate (see load_font.php) there will be less friction and easier migrat...
<?php /** * @package dompdf * @link http://dompdf.github.com/ * @author Benj Carson <benjcarson@digitaljunkies.ca> * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace Dompdf; use Dompdf\Frame; /** * Executes inline PHP code during the rendering process * * @pa...
<?php /** * @package dompdf * @link http://dompdf.github.com/ * @author Benj Carson <benjcarson@digitaljunkies.ca> * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace Dompdf; use Dompdf\Frame; /** * Executes inline PHP code during the rendering process * * @pa...
Make the default rules as string
<?php namespace GeniusTS\Preferences\Models; use Illuminate\Contracts\View\View; /** * Class Element * * @package GeniusTS\Preferences * @property string $name * @property string $namespace * @property string $rules * @property View $view */ class Element { /** * @var string */ protecte...
<?php namespace GeniusTS\Preferences\Models; use Illuminate\Contracts\View\View; /** * Class Element * * @package GeniusTS\Preferences * @property string $name * @property string $namespace * @property string $rules * @property View $view */ class Element { /** * @var string */ protecte...
Switch to head requests rather than get requests.
#!/usr/bin/env python from __future__ import division import requests import json import sys from requests.exceptions import SSLError, InvalidSchema, ConnectionError def get_link_status_code(link): headers = {'User-agent':'Mozilla/5.0'} try: r = requests.head(link, headers=headers, allow_redirects=Tru...
#!/usr/bin/env python from __future__ import division import requests import json import sys from requests.exceptions import SSLError, InvalidSchema, ConnectionError def get_link_status_code(link): headers = {'User-agent':'Mozilla/5.0'} try: r = requests.get(link, headers = headers) return r.s...
Add test for required registration.
# -*- coding: utf-8 -*- import unittest from flask import Flask from flask.ext.knot import Knot, get_container def create_app(): app = Flask(__name__) app.config['TESTING'] = True return app class TestKnot(unittest.TestCase): def test_acts_like_container(self): app = create_app() di...
# -*- coding: utf-8 -*- import unittest from flask import Flask from flask.ext.knot import Knot, get_container def create_app(): app = Flask(__name__) app.config['TESTING'] = True return app class TestKnot(unittest.TestCase): def test_acts_like_container(self): app = create_app() di...
Add test to ensure write_xyz does not directly take in compound
import numpy as np import pytest import mbuild as mb from mbuild.formats.xyz import write_xyz from mbuild.utils.io import get_fn from mbuild.tests.base_test import BaseTest from mbuild.exceptions import MBuildError class TestXYZ(BaseTest): def test_load_no_top(self, ethane): ethane.save(filename='ethane....
import numpy as np import pytest import mbuild as mb from mbuild.utils.io import get_fn from mbuild.tests.base_test import BaseTest from mbuild.exceptions import MBuildError class TestXYZ(BaseTest): def test_load_no_top(self, ethane): ethane.save(filename='ethane.xyz') ethane_in = mb.load('ethane...
Update for compatibility with pesto==14 Ignore-this: 7a596766eb3deedefb2c9ba36ce5ecfc darcs-hash:20100419210717-8e352-6286dc43ea83998229ccdcd619ff1f4990ff82ee.gz
from setuptools import setup, find_packages import sys, os def read(*path): """ Read and return content from ``path`` """ f = open( os.path.join( os.path.dirname(__file__), *path ), 'r' ) try: return f.read().decode('UTF-8') finally: ...
from setuptools import setup, find_packages import sys, os def read(*path): """ Read and return content from ``path`` """ f = open( os.path.join( os.path.dirname(__file__), *path ), 'r' ) try: return f.read().decode('UTF-8') finally: ...
Switch from scanner to tokenizer.
import verify import tokenizer class Tree: def __init__(self, elements): self._elements = elements def count(self): return len(self._elements) def elements(self): result = [] for element in self._elements: if element.__class__ == Tree: result += [element.elements()] else: ...
import verify class Tree: def __init__(self, elements): self._elements = elements def count(self): return len(self._elements) def elements(self): result = [] for element in self._elements: if element.__class__ == Tree: result += [element.elements()] else: result += [...
Remove redundant and incorrect test
<?php namespace Mockery\Generator\StringManipulation\Pass; use Mockery as m; use Mockery\Generator\StringManipulation\Pass\ClassNamePass; use Mockery\Generator\MockConfiguration; class ClassNamePassTest extends \PHPUnit_Framework_TestCase { const CODE = "namespace Mockery; class Mock {}"; public functio...
<?php namespace Mockery\Generator\StringManipulation\Pass; use Mockery as m; use Mockery\Generator\StringManipulation\Pass\ClassNamePass; use Mockery\Generator\MockConfiguration; class ClassNamePassTest extends \PHPUnit_Framework_TestCase { const CODE = "namespace Mockery; class Mock {}"; public functio...
Exclude user field from form
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "user", "home_lon", "home_lat", "inauguration_year", "fun...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "home_lon", "home_lat", "inauguration_year", "funding_notes", ...
Add skip argument to `bulk:all`
<?php namespace App\Console\Commands\Bulk; use Aic\Hub\Foundation\AbstractCommand as BaseCommand; class BulkAll extends BaseCommand { protected $signature = 'bulk:all {skip?}'; protected $description = "Reset database and import everything"; public function handle() { $shouldSkipTo = $this...
<?php namespace App\Console\Commands\Bulk; use Aic\Hub\Foundation\AbstractCommand as BaseCommand; class BulkAll extends BaseCommand { protected $signature = 'bulk:all'; protected $description = "Reset database and import everything"; public function handle() { // Import all bulkable resour...
conan: Copy find modules to root of module path
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class IWYUCTargetCmakeConan(ConanFile): name = "iwyu-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cmake...
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class IWYUCTargetCmakeConan(ConanFile): name = "iwyu-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cmake...
Fix create account validation, Dashboard filters
<ul> <?php foreach($pager->getResults() as $flight): ?> <li> <?php if($flight->getDrafted() && $flight->getStatus() == "new"): ?> <?php if($flight->getTripNumber()): ?> <span><?php echo $flight->getTripNumber() ?>(Drafted)</span> <?php else: ?>...
<ul> <?php foreach($pager->getResults() as $flight): ?> <li> <?php if($flight->getDrafted() && $flight->getStatus() == "new"): ?> <span>Drafted</span> <span><?php echo $flight->getId() ?></span> <a href="<?php echo url_for("@edit_flight?account_id=...
Add nullable validation rule to software version field
<?php namespace RadDB\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class UpdateMachineRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** ...
<?php namespace RadDB\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class UpdateMachineRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** ...
Implement Twittter; fix aggregate scores
<?php namespace Metrics\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Input; use Metrics\Http\Requests; use Metrics\Http\Controllers\Controller; use Metrics\Idol\Idol; class IdolController extends Controller { private $idol; public function __construct(Idol $idol) { ...
<?php namespace Metrics\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Input; use Metrics\Http\Requests; use Metrics\Http\Controllers\Controller; use Metrics\Idol\Idol; class IdolController extends Controller { private $idol; public function __construct(Idol $idol) { ...
Add comments to every method.
function InputManager() { this.km; this.notify; this.newGame; this.quitGame; this.pauseGame; } /* Store the game-related keycodes to listen for */ InputManager.prototype.setKeyMap = function(keyMap) { this.km = keyMap; } /* Defines the comm pipeline to take when a relavent event is captu...
function InputManager() { this.km; this.notify; this.newGame; this.quitGame; this.pauseGame; } InputManager.prototype.setKeyMap = function(keyMap) { this.km = keyMap; } InputManager.prototype.register = function(event, callback) { switch(event) { case 'action': this.noti...
Add exit code to exception
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool; use \Symfony\Component\Process\Process; abstract class Exiftool ...
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool; use \Symfony\Component\Process\Process; abstract class Exiftool ...
Add `strict` mode to consider warnings as errors This is a first approach to fix issue #38. It would be good improve output to make it more uniform with `mocha` errors, but at least it does the job :-)
var CLIEngine = require('eslint').CLIEngine; var chalk = require('chalk'); var globAll = require('glob-all'); var replaceAll = require("replaceall"); var cli = new CLIEngine({}); function test(p, opts) { it('should have no errors in ' + p, function () { var format, warn; if (opts && opts.timeout) { t...
var CLIEngine = require('eslint').CLIEngine; var chalk = require('chalk'); var globAll = require('glob-all'); var replaceAll = require("replaceall"); var cli = new CLIEngine({}); function test(p, opts) { it('should have no errors in ' + p, function () { var format, warn; if (opts && opts.timeout) { t...
Fix bug with 'all' argument
from copy import copy import argparse from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage, ExplanationStorage def generate_asset(resource, out_storage: ExplanationStorage): out_storage.clear() for explanation in resource: r = copy(expla...
from copy import copy import argparse from preparation.resources.Resource import names_registered, resource_by_name from hb_res.storage import get_storage, ExplanationStorage def generate_asset(resource, out_storage: ExplanationStorage): out_storage.clear() for explanation in resource: r = copy(expla...
Add Max priority for queue declare
<?php namespace VladimirYuldashev\LaravelQueueRabbitMQ\Console; use Exception; use Illuminate\Console\Command; use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\RabbitMQConnector; class QueueDeclareCommand extends Command { protected $signature = 'rabbitmq:queue-declare {name...
<?php namespace VladimirYuldashev\LaravelQueueRabbitMQ\Console; use Exception; use Illuminate\Console\Command; use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\RabbitMQConnector; class QueueDeclareCommand extends Command { protected $signature = 'rabbitmq:queue-declare {name...
Fix latent bug in proxied XMLRPC that broke adding 5.8.x rUS (RBL-7945)
# # Copyright (c) 2005-2009 rPath, Inc. # # All rights reserved # import urllib from conary.repository import transport class ProxiedTransport(transport.Transport): """ Transport class for contacting rUS through a proxy """ def __init__(self, *args, **kw): # Override transport.XMLOpener with o...
# # Copyright (c) 2005-2009 rPath, Inc. # # All rights reserved # import urllib from conary.repository import transport class ProxiedTransport(transport.Transport): """ Transport class for contacting rUS through a proxy """ def __init__(self, *args, **kw): # Override transport.XMLOpener with o...
Fix dependency reference to autoprefixer.
var autoprefixer = require('autoprefixer'); var postcss = require('postcss'); module.exports = function(less) { function AutoprefixProcessor(options) { this.options = options || {}; }; AutoprefixProcessor.prototype = { process: function (css, extra) { var options = this.options...
var autoprefixer = require('autoprefixer-core'); var postcss = require('postcss'); module.exports = function(less) { function AutoprefixProcessor(options) { this.options = options || {}; }; AutoprefixProcessor.prototype = { process: function (css, extra) { var options = this.op...
Add length validation to string form field
<?php namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes; use Doctrine\ORM\Mapping as ORM; use Kunstmaan\FormBundle\Entity\FormSubmissionField; use Kunstmaan\FormBundle\Form\StringFormSubmissionType; use Symfony\Component\Validator\Constraints as Assert; /** * The StringFormSubmissionField can be used t...
<?php namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes; use Doctrine\ORM\Mapping as ORM; use Kunstmaan\FormBundle\Entity\FormSubmissionField; use Kunstmaan\FormBundle\Form\StringFormSubmissionType; /** * The StringFormSubmissionField can be used to store string values to a FormSubmission * * @ORM\En...
chore(tests): Fix false positive test result
import { moduleFor, test } from 'ember-qunit'; moduleFor('service:client', 'Unit | Service | Client', { // Specify the other units that are required for this test. //needs: ['service:server'] }); // Replace this with your real tests. test('it exists', function(assert) { assert.expect(3); let name = 'Foo'; ...
import { moduleFor, test } from 'ember-qunit'; moduleFor('service:client', 'Unit | Service | Client', { // Specify the other units that are required for this test. //needs: ['service:server'] }); // Replace this with your real tests. test('it exists', function(assert) { assert.expect(3); let name = 'Foo'; ...
Fix bug in Element to allow subclassing
class Button(object): """Button object, used for creating button messages""" def __init__(self, type=None, title="", payload=""): # Type: request param key valid_types = { 'web_url': 'url', 'postback': 'payload' } assert type in valid_types, "Type %s i...
class Button(object): """Button object, used for creating button messages""" def __init__(self, type=None, title="", payload=""): # Type: request param key valid_types = { 'web_url': 'url', 'postback': 'payload' } assert type in valid_types, "Type %s i...
Increase test timeout again for Travis
'use strict'; var assert = require('assert'); var path = require('path'); var execFileSync = require('child_process').execFileSync; var root = path.resolve(__dirname, '..'); var hook = path.relative(root, 'bin/commit-msg'); var validFile = path.relative(root, path.resolve(__dirname, 'resources/COMMIT_EDITMSG')); ...
'use strict'; var assert = require('assert'); var path = require('path'); var execFileSync = require('child_process').execFileSync; var root = path.resolve(__dirname, '..'); var hook = path.relative(root, 'bin/commit-msg'); var validFile = path.relative(root, path.resolve(__dirname, 'resources/COMMIT_EDITMSG')); ...
Make sure we remember to which the user was merged
from django.db.models.functions import Lower from django.db.models import Count from bluebottle.members.models import Member from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant from bluebottle.activities.models import Activity, Contributor from bluebottle.initiatives.models ...
from django.db.models.functions import Lower from django.db.models import Count from bluebottle.members.models import Member from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant from bluebottle.activities.models import Activity, Contributor from bluebottle.initiatives.models ...
Revert "hide worker and coordinator" This reverts commit d2fc4b1fb37d8b687d7a5561be74a1e04fa0d57c.
#!/usr/bin/env python import os from setuptools import setup, find_packages name = 'Mikko Korpela' # I might be just a little bit too much afraid of those bots.. address = name.lower().replace(' ', '.')+chr(64)+'gmail.com' setup(name='robotframework-pabot', version='1.2.0', description='Parallel test run...
#!/usr/bin/env python import os from setuptools import setup, find_packages name = 'Mikko Korpela' # I might be just a little bit too much afraid of those bots.. address = name.lower().replace(' ', '.')+chr(64)+'gmail.com' setup(name='robotframework-pabot', version='1.2.0', description='Parallel test run...
Remove `Profiler` functions from demo
<?php namespace Demo\Application\Adapter; use Colonel\Configuration; use Twig_Loader_Filesystem; use Twig_Environment; class TwigAdapter { private $twig; private $loader; public function __construct( Configuration $configuration ) { $this->configuration = $configuration; $th...
<?php namespace Demo\Application\Adapter; use Colonel\Configuration; use Colonel\Profiler; use Twig_Loader_Filesystem; use Twig_Environment; class TwigAdapter { private $twig; private $loader; public function __construct( Configuration $configuration ) { $this->configuration = $conf...
Modify public contribute form definition
<?php /** * ProTalk * * Copyright (c) 2012-2013, ProTalk * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Protalk\MediaBundle\Form\Media; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderIn...
<?php /** * ProTalk * * Copyright (c) 2012-2013, ProTalk * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Protalk\MediaBundle\Form\Media; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderIn...
Set table engine to MyISAM explicitly (for fulltext support)
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreatePostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('posts', function (Blueprint $table) { $tabl...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use DB; class CreatePostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('posts', function (Blueprint $table) { ...
Fix login success status code
(function () { 'use strict'; var jsonfile = require('jsonfile'); var path = require('path'); var authcontroller = require('./../src/authcontroller'); authcontroller.authorize() .then(function (response) { var config; var configFilePath = path.join(__dirname, './../cli-config.js...
(function () { 'use strict'; var jsonfile = require('jsonfile'); var path = require('path'); var authcontroller = require('./../src/authcontroller'); authcontroller.authorize() .then(function (response) { var config; var configFilePath = path.join(__dirname, './../cli-config.js...
Change delimiter for repository regex '#' is the default delimiter for route regexes in `Symfony\Component\Routing\RouteCompiler`, so use this.
<?php namespace Gitlist\Util; use Silex\Application; class Routing { protected $app; public function __construct(Application $app) { $this->app = $app; } public function getRepositoryRegex() { static $regex = null; if ($regex === null) { $app = $this->ap...
<?php namespace Gitlist\Util; use Silex\Application; class Routing { protected $app; public function __construct(Application $app) { $this->app = $app; } public function getRepositoryRegex() { static $regex = null; if ($regex === null) { $app = $this->ap...
Add failsafe to HTTP request
<?php namespace Laito; /** * Http class * * @package default * @author Mangolabs */ class Http extends Core { /** * @var array Fixed parameters array */ private $params = []; /** * Sets fixed parameters to be sent in all calls * * @param array $params Parameters * @ret...
<?php namespace Laito; /** * Http class * * @package default * @author Mangolabs */ class Http extends Core { /** * @var array Fixed parameters array */ private $params = []; /** * Sets fixed parameters to be sent in all calls * * @param array $params Parameters * @ret...
Mark payment cancelled if id is presented
<?php namespace Czende\GoPayPlugin\Action; use Czende\GoPayPlugin\GoPayWrapper; use Payum\Core\Action\ActionInterface; use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Request\GetStatusInterface; /** * @author Jan Czernin <jan.czernin@gmail.com> */ final...
<?php namespace Czende\GoPayPlugin\Action; use Czende\GoPayPlugin\GoPayWrapper; use Payum\Core\Action\ActionInterface; use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Request\GetStatusInterface; /** * @author Jan Czernin <jan.czernin@gmail.com> */ final...
Fix webdriver user creation bug
from apps.webdriver_testing.webdriver_base import WebdriverTestCase from apps.webdriver_testing import data_helpers from apps.webdriver_testing.data_factories import UserFactory class WebdriverTestCaseSubtitlesUpload(WebdriverTestCase): """TestSuite for uploading subtitles via the api. """ def setUp(s...
from apps.webdriver_testing.webdriver_base import WebdriverTestCase from apps.webdriver_testing import data_helpers from apps.webdriver_testing.data_factories import UserFactory class WebdriverTestCaseSubtitlesUpload(WebdriverTestCase): """TestSuite for uploading subtitles via the api. """ def setUp(s...
Rewrite OL+ legend to be non-drupaly.
var OpenLayersPlusLegend = function(opts) { var self = this; this.map = $(opts[0]).data('map'); this.setLegend = function(layer) { // The layer param may vary based on the context from which we are called. layer = layer.object ? layer.object : layer; if ('legend' in layer) { ...
var OpenLayersPlusLegend = {}; OpenLayersPlusLegend = {}; OpenLayersPlusLegend.attach = function(context) { var data = $(context).data('openlayers'); if (data && data.map.behaviors.openlayers_plus_behavior_legend) { var layer, i; for (i in data.openlayers.layers) { layer = data.openlayers.layers[i];...
Revert default webdriver to Firefox Chrome doesn't yet work, anyway... :-(
from threading import RLock, local from multiprocessing.pool import ThreadPool from os import environ as ENV import logging.config from flask import Flask, request from selenium import webdriver logging.basicConfig() app = Flask(__name__) Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Firefox")) class Retr...
from threading import RLock, local from multiprocessing.pool import ThreadPool from os import environ as ENV import logging.config from flask import Flask, request from selenium import webdriver logging.basicConfig() app = Flask(__name__) Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome")) class Retry...
Add more explicit jumpToFrame during frontend load
(function() { 'use strict'; angular.module('nin').directive('demo', function($interval, demo) { return { restrict: 'E', template: '<div class=demo-container></div>', link: function(scope, element) { demo.setContainer(element[0].children[0]); setTimeout(function() { d...
(function() { 'use strict'; angular.module('nin').directive('demo', function($interval, demo) { return { restrict: 'E', template: '<div class=demo-container></div>', link: function(scope, element) { demo.setContainer(element[0].children[0]); setTimeout(function() { d...
Remove false comment about ajax_start and ajax_stop
import {Locale} from 'Framework/Locale' import {Flash} from 'Framework/Flash' const locale = new Locale() export class Ajax { initAjax () { /* set some defaults for AJAX-request */ $.ajaxSetup( { cache: false, type: 'POST', dataType: 'json', timeout: 5000 } ) ...
import {Locale} from 'Framework/Locale' import {Flash} from 'Framework/Flash' const locale = new Locale() export class Ajax { initAjax () { /* set some defaults for AJAX-request */ $.ajaxSetup( { cache: false, type: 'POST', dataType: 'json', timeout: 5000 } ) ...
Add method for getting random neighbor
package maze; import java.util.LinkedList; import java.util.List; import java.util.Random; /** * @author Nick Hirakawa */ public class Cell { private int x; private int y; private boolean visited; private List<Cell> neighbors; private Random random; public Cell(int x, int y){ this....
package maze; import java.util.LinkedList; import java.util.List; /** * @author Nick Hirakawa */ public class Cell { private int x; private int y; private boolean visited; private List<Cell> neighbors; public Cell(int x, int y){ this.x = x; this.y = y; this.setVisited(...
Print statement was breaking python 3 builds
import nose from nose.tools import raises import dpath.path import dpath.exceptions import dpath.options @raises(dpath.exceptions.InvalidKeyName) def test_path_paths_invalid_keyname(): tdict = { "I/contain/the/separator": 0 } for x in dpath.path.paths(tdict): pass @raises(dpath.excepti...
import nose from nose.tools import raises import dpath.path import dpath.exceptions import dpath.options @raises(dpath.exceptions.InvalidKeyName) def test_path_paths_invalid_keyname(): tdict = { "I/contain/the/separator": 0 } for x in dpath.path.paths(tdict): pass @raises(dpath.excepti...
Fix unit tests failing if sqlite is not present
<?php namespace Exporter\Test\Source; use Exporter\Source\PDOStatementSourceIterator; class PDOStatementSourceIteratorTest extends \PHPUnit_Framework_TestCase { protected $dbh; public function setUp() { if (!in_array('sqlite', \PDO::getAvailableDrivers())) { $this->markTestSkipped('...
<?php namespace Exporter\Test\Source; use Exporter\Source\PDOStatementSourceIterator; class PDOStatementSourceIteratorTest extends \PHPUnit_Framework_TestCase { protected $dbh; public function setUp() { if (is_file('foo.db')) { unlink('foo.db'); } $this->dbh = new \...
Increase tool priority, to keep space between cherrypy builtin tools like `json_out`.
import cherrypy from mako.lookup import TemplateLookup class Tool(cherrypy.Tool): _lookups = {} def __init__(self): cherrypy.Tool.__init__(self, 'before_handler', self.callable, priority=40) def callable(self, filenam...
import cherrypy from mako.lookup import TemplateLookup class Tool(cherrypy.Tool): _lookups = {} def __init__(self): cherrypy.Tool.__init__(self, 'before_handler', self.callable, priority=20) def callable(self, filenam...
Make fetch URL less specific
/* global fetch document */ import React from 'react'; import TotalWidget from './TotalWidget'; import NextTripWidget from './NextTripWidget'; import TripTable from './TripTable'; import Map from './Map'; import './scss/overview.scss'; class Overview extends React.Component { constructor() { super(); this....
/* global fetch */ import React from 'react'; import TotalWidget from './TotalWidget'; import NextTripWidget from './NextTripWidget'; import TripTable from './TripTable'; import Map from './Map'; import './scss/overview.scss'; class Overview extends React.Component { constructor() { super(); this.loading =...
Set curl ssl verify to false.
<?php namespace Yusef\Channels; use GuzzleHttp\Client; use Illuminate\Notifications\Notification; /** * Class FirebaseChannel * @package Yusef\Channels */ class FirebaseChannel { /** * @const The API URL for Firebase */ const API_URI = 'https://fcm.googleapis.com/fcm/send'; /** * @var ...
<?php namespace Yusef\Channels; use GuzzleHttp\Client; use Illuminate\Notifications\Notification; /** * Class FirebaseChannel * @package Yusef\Channels */ class FirebaseChannel { /** * @const The API URL for Firebase */ const API_URI = 'https://fcm.googleapis.com/fcm/send'; /** * @var ...
Include the version number in the plugin spec.
/*global Uint8Array*/ var exifParser = require('exif-parser'), fs = require('fs'); module.exports = { name: 'unexpected-exif', version: require('../package.json').version, installInto: function (expect) { expect.installPlugin(require('magicpen-media')); expect.addAssertion(['string', '...
/*global Uint8Array*/ var exifParser = require('exif-parser'), fs = require('fs'); module.exports = { name: 'unexpected-exif', installInto: function (expect) { expect.installPlugin(require('magicpen-media')); expect.addAssertion(['string', 'Buffer'], 'to have (exif|EXIF) data satisfying', ...
Allow ls to pass arguments
from cmd2 import Cmd, options, make_option import h5_wrapper import sys import os class CmdApp(Cmd): def do_ls(self, args, opts=None): if len(args.strip()) > 0: for g in self.explorer.list_groups(args): print(g+"/") for ds in self.explorer.list_dataset...
from cmd2 import Cmd, options, make_option import h5_wrapper import sys import os class CmdApp(Cmd): def do_ls(self, args, opts=None): for g in self.explorer.list_groups(): print(g+"/") for ds in self.explorer.list_datasets(): print(ds) def do_cd(self, args, o...
Put that editor in a div, editors love divs. 2011-12 Called, they want their meme back.
@section('content') <div class="container"> <div class="row"> <!-- Dummy Add post box --> <div class="box"> <div class="col-lg-12 text-center"> <form> <h2><span id="post-title" contenteditable="true">Test</span><br><small id="post-date">{{ \Carbon\Car...
@section('content') <div class="container"> <div class="row"> <!-- Dummy Add post box --> <div class="box"> <div class="col-lg-12 text-center"> <form> <h2><span id="post-title" contenteditable="true">Test</span><br><small id="post-date">{{ \Carbon\Car...
Fix a test that should've been fixed long ago with the others
package forklift.integration; import forklift.Forklift; import forklift.connectors.ConnectorException; import forklift.consumer.Consumer; import forklift.exception.StartupException; import forklift.producers.ForkliftProducerI; import forklift.producers.ProducerException; import org.junit.Test; public class ConsumerAc...
package forklift.integration; import forklift.Forklift; import forklift.connectors.ConnectorException; import forklift.consumer.Consumer; import forklift.exception.StartupException; import forklift.producers.ForkliftProducerI; import forklift.producers.ProducerException; import org.junit.Test; public class ConsumerAc...
Replace tabs with spaces to match style
function scrobble (artist, title, duration) { chrome.runtime.sendMessage({type: 'validate', artist: artist, track: title}, function (response) { if (response !== false) { chrome.runtime.sendMessage({ type: 'nowPlaying', artist: response.artist, tra...
function scrobble (artist, title, duration) { chrome.runtime.sendMessage({type: 'validate', artist: artist, track: title}, function (response) { if (response !== false) { chrome.runtime.sendMessage({ type: 'nowPlaying', artist: response.artist, tra...
BUGFIX: Remove pre-PHP7 code and avoid __toString deprecation warning
<?php namespace Neos\Flow\Reflection; /* * This file is part of the Neos.Flow package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed with this * source code. *...
<?php namespace Neos\Flow\Reflection; /* * This file is part of the Neos.Flow package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed with this * source code. *...
Fix path to .sql files
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Custom managers for working with CAL-ACCESS processed data models. """ from __future__ import unicode_literals import os from django.db import models, connection class ProcessedDataManager(models.Manager): """ Utilities for loading raw CAL-ACCESS data into proc...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Custom managers for working with CAL-ACCESS processed data models. """ from __future__ import unicode_literals import os from django.db import models, connection class ProcessedDataManager(models.Manager): """ Utilities for loading raw CAL-ACCESS data into proc...
Fix bug: trying to call .replace on NoneType
import re import xml.etree.ElementTree as ET from os import path from tmc.exercise_tests.basetest import BaseTest, TestResult class CheckTest(BaseTest): def __init__(self): super().__init__("Check") def applies_to(self, exercise): return path.isfile(path.join(exercise.path(), "Makefile")) ...
import re import xml.etree.ElementTree as ET from os import path from tmc.exercise_tests.basetest import BaseTest, TestResult class CheckTest(BaseTest): def __init__(self): super().__init__("Check") def applies_to(self, exercise): return path.isfile(path.join(exercise.path(), "Makefile")) ...
Replace route template with XML style closing tags
// @ngInject module.exports = function($stateProvider, $urlRouterProvider, $provide) { $stateProvider .state('root', { abstract: true, url: '', template: '<dm-layout />', }) .state('root.mail', { abstract: true, url: '', views: { header: {template: '<dm-header ...
// @ngInject module.exports = function($stateProvider, $urlRouterProvider, $provide) { $stateProvider .state('root', { abstract: true, url: '', template: '<dm-layout></dm-layout>', }) .state('root.mail', { abstract: true, url: '', views: { header: {template: '<...
Fix bug in GoogleTokenVerifier causing it never to work. Apparently, I was horribly misusing constants. Comprehensive tests would have uncovered this. I'm not convinced that I'm doing the right thing by injecting services inside the verification function, and this particular section (the verification function and ho...
'use strict'; /** * A module to include instead of `angularOauth` for a service preconfigured * for Google OAuth authentication. * * Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent */ angular.module('googleOauth', ['angularOauth']). constant('GoogleTokenVerifier', function(config, accessToke...
'use strict'; /** * A module to include instead of `angularOauth` for a service preconfigured * for Google OAuth authentication. * * Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent */ angular.module('googleOauth', ['angularOauth']). constant('GoogleTokenVerifier', function($http) { retur...
Clean up OK alarm links
/** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ const urls = require('./urls'); module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @param {AWS.CloudWatch.DescribeAlarmsOutput} desc * @param {AWS.CloudWatch.DescribeAlarmHistoryOut...
/** @typedef {import('./index').EventBridgeCloudWatchAlarmsEvent} EventBridgeCloudWatchAlarmsEvent */ const urls = require('./urls'); module.exports = { /** * @param {EventBridgeCloudWatchAlarmsEvent} event * @param {AWS.CloudWatch.DescribeAlarmsOutput} desc * @param {AWS.CloudWatch.DescribeAlarmHistoryOut...
Fix create action for key value pair
from st2actions.runners.pythonrunner import Action from st2client.client import Client from st2client.models.datastore import KeyValuePair class KVPAction(Action): def run(self, key, action, st2host='localhost', value=""): st2_endpoints = { 'action': "http://%s:9101" % st2host, 'r...
from st2actions.runners.pythonrunner import Action from st2client.client import Client from st2client.models.datastore import KeyValuePair class KVPAction(Action): def run(self, key, action, st2host='localhost', value=""): st2_endpoints = { 'action': "http://%s:9101" % st2host, 'r...
Make sure we don't have a import namespace clash with DRF For python 2.7 you need to add from __future__ import absolute_import
from __future__ import absolute_import import logging from django.contrib.auth import authenticate from rest_framework import exceptions from rest_framework.authentication import ( BaseAuthentication, get_authorization_header ) logger = logging.getLogger(__name__) class AdfsAccessTokenAuthentication(BaseAuthen...
import logging from django.contrib.auth import authenticate from rest_framework import exceptions from rest_framework.authentication import ( BaseAuthentication, get_authorization_header ) logger = logging.getLogger(__name__) class AdfsAccessTokenAuthentication(BaseAuthentication): """ ADFS access Token...
Write a correct postal address
const request = require('supertest'); const app = require('../app'); describe('name to point', function () { it('should return JSON object with geolocation', function (done) { request(app) .get('/point?name=OldCity&lat=53.66&lon=23.83') .expect(200) .expect({ lat: '53.70177...
const request = require('supertest'); const app = require('../app'); describe('name to point', function () { it('should return JSON object with geolocation', function (done) { request(app) .get('/point?name=OldCity&lat=53.66&lon=23.83') .expect(200) .expect({ lat: '53.70177...
Fix social links at the bottom of posts
import React from 'react' import Helmet from 'react-helmet' import { graphql } from 'gatsby' import Layout from '../components/Layout' import PostTemplateDetails from '../components/PostTemplateDetails' class PostTemplate extends React.Component { render() { const { title, subtitle } = this.props.data.site.siteM...
import React from 'react' import Helmet from 'react-helmet' import { graphql } from 'gatsby' import Layout from '../components/Layout' import PostTemplateDetails from '../components/PostTemplateDetails' class PostTemplate extends React.Component { render() { const { title, subtitle } = this.props.data.site.siteM...
Print messages for prepare upload.
import sys import olrcdb import os # Globals COUNT = 0 class FileParser(object): '''Object used to parse through a directory for all it's files. Collects the paths of all the files and stores a record of these in a new table in the database. The Schema of the database is: NewTable(path, uploade...
import sys import olrcdb import os # Globals COUNT = 0 class FileParser(object): '''Object used to parse through a directory for all it's files. Collects the paths of all the files and stores a record of these in a new table in the database. The Schema of the database is: NewTable(path, uploade...
Fix to_bool to accept 0.
__all__ = ('to_bool', 'ConfigPropertyList') from kivy.properties import ConfigParserProperty from re import compile, split to_list_pat = compile('(?:, *)?\\n?') def to_bool(val): ''' Takes anything and converts it to a bool type. ''' if val == 'False' or val == '0': return False return ...
__all__ = ('to_bool', 'ConfigPropertyList') from kivy.properties import ConfigParserProperty from re import compile, split to_list_pat = compile('(?:, *)?\\n?') def to_bool(val): ''' Takes anything and converts it to a bool type. ''' if val == 'False': return False return not not val ...
Delete Minutes: Popup dialog shows concerning minutes date.
import { MeetingSeries } from '/imports/meetingseries' Template.minutesList.helpers({ buttonBackground: function () { return (this.isFinalized) ? "default" : "info"; }, addMinutesPath: function () { let ms = new MeetingSeries(this.meetingSeriesId); return (ms.addNewMinutesAllowed(...
import { MeetingSeries } from '/imports/meetingseries' Template.minutesList.helpers({ buttonBackground: function () { return (this.isFinalized) ? "default" : "info"; }, addMinutesPath: function () { let ms = new MeetingSeries(this.meetingSeriesId); return (ms.addNewMinutesAllowed(...
Remove suppress() as it's no longer required
# -*- coding: utf-8 -*- import contextlib import sys try: import fcntl except ImportError: fcntl = None from ipybind.common import is_kernel from ipybind.ext.wurlitzer import Wurlitzer _fwd = None class Forwarder(Wurlitzer): def __init__(self, handler=None): self._data_handler = handler if han...
# -*- coding: utf-8 -*- import contextlib import sys try: import fcntl except ImportError: fcntl = None from ipybind.common import is_kernel from ipybind.ext.wurlitzer import Wurlitzer _fwd = None class Forwarder(Wurlitzer): def __init__(self, handler=None): self._data_handler = handler if han...
Use charCode instead of keyCode
;(function(){ var G = dijkstra.hexGrid(2); var view = new dijkstra.GraphView(G, document.getElementById('graph'), { placement: function(position){ return { 'x': 100 * position.x, 'y': 100 * position.y }}, radius: 20, between: 0.3, vertex: { ...
;(function(){ var G = dijkstra.hexGrid(2); var view = new dijkstra.GraphView(G, document.getElementById('graph'), { placement: function(position){ return { 'x': 100 * position.x, 'y': 100 * position.y }}, radius: 20, between: 0.3, vertex: { ...
Convert Non-strict to strict equality checking Convert non-strict equality checking, using `==`, to the strict version, using `===`.
var SolidityUtils = { getCharacterOffsetToLineAndColumnMapping: function(source) { var mapping = []; source = source.split(""); var line = 0; var column = 0; source.forEach(function(character) { if (character === "\n") { line += 1; column = -1; mapping.push({ ...
var SolidityUtils = { getCharacterOffsetToLineAndColumnMapping: function(source) { var mapping = []; source = source.split(""); var line = 0; var column = 0; source.forEach(function(character) { if (character == "\n") { line += 1; column = -1; mapping.push({ ...