text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Add SITE_ID to test settings setup for Django 1.3.
#!/usr/bin/env python import os import sys from django.conf import settings if not settings.configured: settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'test.db', } }, INSTALLED_APPS=( ...
#!/usr/bin/env python import os import sys from django.conf import settings if not settings.configured: settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'test.db', } }, INSTALLED_APPS=( ...
Remove import which does not seem to be used any more It seems like since we don't need ti inject batching strategy, we would not need this import?
import IsomorphicRouter from 'isomorphic-relay-router'; import path from 'path'; import React from 'react'; import ReactDOMServer from 'react-dom/server'; import Relay from 'react-relay'; import {match} from 'react-router'; import routes from './routes'; const GRAPHQL_URL = `http://localhost:8080/graphql`; Relay.inje...
import IsomorphicRouter from 'isomorphic-relay-router'; import path from 'path'; import React from 'react'; import ReactDOMServer from 'react-dom/server'; import Relay from 'react-relay'; import RelayStoreData from 'react-relay/lib/RelayStoreData'; import {match} from 'react-router'; import routes from './routes'; con...
Use more reliable JS source mapping technique
const path = require("path"); const merge = require("webpack-merge"); const webpack = require("webpack"); const common = require("./webpack.common.js"); const postCSSPlugins = [ require("postcss-easy-import")({ prefix: "_" }), require("postcss-mixins"), require("postcss-simple-vars"), require("postcss-nested")...
const path = require("path"); const merge = require("webpack-merge"); const webpack = require("webpack"); const common = require("./webpack.common.js"); const postCSSPlugins = [ require("postcss-easy-import")({ prefix: "_" }), require("postcss-mixins"), require("postcss-simple-vars"), require("postcss-nested")...
Update classifiers through Python 3.6
import codecs import os import re from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() def read(*parts): here = os.path.abspath(os.path.dirname(__file__)) return codecs.open(os.path.join(here, *parts), 'r').read() def find_version(*file_paths): version_file = ...
import codecs import os import re from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() def read(*parts): here = os.path.abspath(os.path.dirname(__file__)) return codecs.open(os.path.join(here, *parts), 'r').read() def find_version(*file_paths): version_file = ...
Use whatever is default open mode.
import logging import json import py from fields import Namespace from pytest_benchmark.plugin import BenchmarkSession class MockSession(BenchmarkSession): def __init__(self): self.histogram = True me = py.path.local(__file__) self.storage = me.dirpath(me.purebasename) self.benc...
import logging import json import py from fields import Namespace from pytest_benchmark.plugin import BenchmarkSession class MockSession(BenchmarkSession): def __init__(self): self.histogram = True me = py.path.local(__file__) self.storage = me.dirpath(me.purebasename) self.benc...
Remove use statements that are no longer needed
<?php namespace App\Providers; use App\Tag; use App\Note; use Validator; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { // Validate photos for a m...
<?php namespace App\Providers; use App\Tag; use App\Note; use Validator; use App\WebMention; use App\Observers\WebMentionObserver; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ publi...
Fix variable + change event
let formId, formValidationFields; window.addEventListener('load', function() { let $_form = $('form#' + formId + '-form'), $_formInputs = $_form.find(':input'), _formHasCheckboxes = false; $_formInputs.each(function () { $(this).removeAttr('required minlength maxlength'); if (...
let formId, formValidationFields; window.addEventListener('DOMContentLoaded', function() { let $_form = $('form#' + formId + '-form'), $_formInputs = $_form.find(':input'), _formHasCheckboxes = false; $_formInputs.each(function () { $(this).removeAttr('required minlength maxlength'); ...
Change hdu[0] to hdu for optional indexing
""" Some very beta tools for IRIS """ import sunpy.io import sunpy.time import sunpy.map __all__ = ['SJI_to_cube'] def SJI_to_cube(filename, start=0, stop=None, hdu=0): """ Read a SJI file and return a MapCube ..warning:: This function is a very early beta and is not stable. Further work is ...
""" Some very beta tools for IRIS """ import sunpy.io import sunpy.time import sunpy.map __all__ = ['SJI_to_cube'] def SJI_to_cube(filename, start=0, stop=None): """ Read a SJI file and return a MapCube ..warning:: This function is a very early beta and is not stable. Further work is ...
Fix np array issues again
import logging import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from ..utils import Timer __all__ = ['PureTransformer', 'identity'] logger = logging.getLogger(__name__) # Helper class. A transformer that only does transformation and does not need to fit any internal parameters. class ...
import logging import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from ..utils import Timer __all__ = ['PureTransformer', 'identity'] logger = logging.getLogger(__name__) # Helper class. A transformer that only does transformation and does not need to fit any internal parameters. class ...
Add new bucket list item
import React from 'react'; import Layout from '@theme/Layout'; function BucketList() { return ( <Layout> <div className="container padding-vert--lg"> <div className="row"> <div className="col col--8 col--offset-2 markdown"> <h1>Bucket List</h1> <h3>TODO</h3> ...
import React from 'react'; import Layout from '@theme/Layout'; function BucketList() { return ( <Layout> <div className="container padding-vert--lg"> <div className="row"> <div className="col col--8 col--offset-2 markdown"> <h1>Bucket List</h1> <h3>TODO</h3> ...
Make psr test more verbose
<?php namespace phpSmug\Tests; /** * @class * Test properties of our codebase rather than the actual code. */ class PsrComplianceTest extends \PHPUnit_Framework_TestCase { /** * @test */ public function testPSR() { // If we can't find the command-line tool, we mark the test as skipped...
<?php namespace phpSmug\Tests; /** * @class * Test properties of our codebase rather than the actual code. */ class PsrComplianceTest extends \PHPUnit_Framework_TestCase { /** * @test */ public function testPSR() { // If we can't find the command-line tool, we mark the test as skipped...
[DAT-12296] Remove redundant PATHSCHEMAS from where part of SQL statement looking for a view definition to make query return unique only results
package liquibase.sqlgenerator.core; import liquibase.CatalogAndSchema; import liquibase.database.Database; import liquibase.database.core.AbstractDb2Database; import liquibase.database.core.Db2zDatabase; import liquibase.sql.Sql; import liquibase.sql.UnparsedSql; import liquibase.sqlgenerator.SqlGenerator; import liq...
package liquibase.sqlgenerator.core; import liquibase.CatalogAndSchema; import liquibase.database.Database; import liquibase.database.core.AbstractDb2Database; import liquibase.database.core.Db2zDatabase; import liquibase.sql.Sql; import liquibase.sql.UnparsedSql; import liquibase.sqlgenerator.SqlGenerator; import liq...
feat(shop): Update admin order index page Update admin order index page see #369
@extends('layouts.admin') @section('content') <div class="container"> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> List of orders </div> <div class="panel-body"> ...
@extends('layouts.admin') @section('content') <div class="container"> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> List of orders </div> <div class="panel-body"> ...
Fix response for testing errors
from werkzeug.exceptions import HTTPException import sys from six import reraise class Handler(object): """ The Exception handler """ def __init__(self, app): """ Initiate :param app: The application :type app: Edmunds.Application """ self.ap...
from werkzeug.exceptions import HTTPException import sys from six import reraise class Handler(object): """ The Exception handler """ def __init__(self, app): """ Initiate :param app: The application :type app: Edmunds.Application """ self.ap...
Add backward compatibility on constants init.
<?php namespace FrosyaLabs\Lang; /** * Class used for formatting the month * * @author Nanang F. Rozi * @since 1.0.2 */ class MonthFormatter { const LONG_MONTH = [ 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus',...
<?php namespace FrosyaLabs\Lang; /** * Class used for formatting the month * * @author Nanang F. Rozi * @since 1.0.2 */ class MonthFormatter { private const LONG_MONTH = [ 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'A...
Make it out of p tag for reg
@extends('theme/main') @section('title') Login - Researchew @endsection @section('content') <div class="am-container"> <div class="am-u-sm-8 am-u-sm-centered"> @if(Session::has('message')) <div class="am-alert am-alert-success" data-am-alert>{{ Session::get('message') }}</div> @endif ...
@extends('theme/main') @section('title') Login - Researchew @endsection @section('content') <div class="am-container"> <div class="am-u-sm-8 am-u-sm-centered"> @if(Session::has('message')) <div class="am-alert am-alert-success" data-am-alert>{{ Session::get('message') }}</div> @endif ...
Fix flaky logout on FF 45
""" End to end tests for Studio Login """ import os from bok_choy.web_app_test import WebAppTest from regression.pages.studio.studio_home import DashboardPageExtended from regression.pages.studio.login_studio import StudioLogin from regression.pages.studio.logout_studio import StudioLogout class StudioUserLogin(Web...
""" End to end tests for Studio Login """ import os from flaky import flaky from bok_choy.web_app_test import WebAppTest from regression.pages.studio.studio_home import DashboardPageExtended from regression.pages.studio.login_studio import StudioLogin from regression.pages.studio.logout_studio import StudioLogout cla...
Use logging instead of print logs.
import logging class Prioritize(object): ''' Class which convert dependency relationship to priority level ''' def __init__(self): self._priorityLevel = {} def getPrioritizeLevel(self, item): if item in self._priorityLevel: return self._priorityLevel[item] retur...
class Prioritize(object): ''' Class which convert dependency relationship to priority level ''' def __init__(self): self._priorityLevel = {} def getPrioritizeLevel(self, item): if item in self._priorityLevel: return self._priorityLevel[item] return -1 def re...
Fix navigation ACL issue when db is not initialized
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD Lic...
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD Lic...
Add test for 1d array arguments for Wrapper
import numpy as np from functools import partial from elfi.wrapper import Wrapper class Test_wrapper(): def test_echo_exec_arg(self): command = "echo {0}" wrapper = Wrapper(command, post=int) ret = wrapper("1") assert ret == 1 def test_echo_default_arg(self): command ...
import numpy as np from functools import partial from elfi.wrapper import Wrapper class Test_wrapper(): def test_echo_exec_arg(self): command = "echo {0}" wrapper = Wrapper(command, post=int) ret = wrapper("1") assert ret == 1 def test_echo_default_arg(self): command ...
Add data status to container view
<h1>Container: <?php echo $cont['NAME'] ?></h1> <p class="help">This page shows the contents of the selected container. Samples can be added and edited by clicking the pencil icon, and removed by clicking the x</p> <div class="form"> <ul> <li> <span class="label">Shipme...
<h1>Container: <?php echo $cont['NAME'] ?></h1> <p class="help">This page shows the contents of the selected container. Samples can be added and edited by clicking the pencil icon, and removed by clicking the x</p> <div class="form"> <ul> <li> <span class="label">Shipme...
Add actual hostname tag to datadog The datadog daemon may run on different host so the host tag will be incorrect (mainly on k8s deployment).
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Http\Middleware; use ChaseConey\LaravelDatadogHelper\Middleware\LaravelDatadogMiddleware; use Datadog; use Symfony\Compon...
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Http\Middleware; use ChaseConey\LaravelDatadogHelper\Middleware\LaravelDatadogMiddleware; use Datadog; use Symfony\Compon...
Add CORS on service endpoint.
var express = require('express'); var cors = require('cors'); var situations = require('../controllers/situations'); var teleservices = require('../controllers/teleservices'); module.exports = function(api) { api.route('/situations').post(situations.create); var route = new express.Router({ mergeParams: true...
var express = require('express'); var cors = require('cors'); var situations = require('../controllers/situations'); var teleservices = require('../controllers/teleservices'); module.exports = function(api) { api.route('/situations').post(situations.create); var route = new express.Router({ mergeParams: true...
Add logging statement for debugging Travis CI
import {exec} from 'node-promise-es6/child-process'; import fs from 'node-promise-es6/fs'; async function run() { const {linkDependencies = {}} = await fs.readJson('package.json'); for (const dependencyName of Object.keys(linkDependencies)) { const dependencyPath = linkDependencies[dependencyName]; const ...
import {exec} from 'node-promise-es6/child-process'; import fs from 'node-promise-es6/fs'; async function run() { const {linkDependencies = {}} = await fs.readJson('package.json'); for (const dependencyName of Object.keys(linkDependencies)) { const dependencyPath = linkDependencies[dependencyName]; const ...
Fix case of "nose" in tests_require.
import sys from setuptools import setup, find_packages extra_setup = {} if sys.version_info >= (3,): extra_setup['use_2to3'] = True setup( name='blessings', version='1.4', description='A thin, practical wrapper around terminal coloring, styling, and positioning', long_description=open('README.rs...
import sys from setuptools import setup, find_packages extra_setup = {} if sys.version_info >= (3,): extra_setup['use_2to3'] = True setup( name='blessings', version='1.4', description='A thin, practical wrapper around terminal coloring, styling, and positioning', long_description=open('README.rs...
Update the regular express to be less strict. And remove duplicate definition.
( function () { var isDebugging = false; var re = /saas.hp(.*).com\//; function isAgmSite(url){ return re.test(url); } function onCopyClicked(tab) { if (!isAgmSite(tab.url)) { console.log("Nothing to copy, since the URL doe...
( function () { var isDebugging = false; var re = /saas.hp(.*).com\/agm/; function isAgmSite(url){ return re.test(url); } function onCopyClicked(tab) { var re = /saas.hp(.*).com\//; if (!isAgmSite(tab.url)) { c...
Optimize perf by replacing call_user_func with dynamic vars
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Iterator; /** * CustomFilterIterator filters ...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Iterator; /** * CustomFilterIterator filters ...
Disable stage "unit" test for Hibernate Reactive See #14812 Signed-off-by: Yoann Rodière <be2a24d2f52a7ba2aca48263378b2614d5b68cd6@hibernate.org>
package io.quarkus.hibernate.reactive.singlepersistenceunit; import static org.assertj.core.api.Assertions.assertThat; import javax.enterprise.context.control.ActivateRequestContext; import javax.inject.Inject; import org.hibernate.reactive.stage.Stage; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.sh...
package io.quarkus.hibernate.reactive.singlepersistenceunit; import static org.assertj.core.api.Assertions.assertThat; import javax.enterprise.context.control.ActivateRequestContext; import javax.inject.Inject; import org.hibernate.reactive.stage.Stage; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.sh...
Update magic links for dweet and user links
import re from django import template register = template.Library() def to_link(m): text = m.group('text') dweet_id = m.group('dweet_id') username = m.group('username') if username is None: url = 'd/' + dweet_id else: url = 'u/' + username result = '<a href="/{0}">{0}</a>'.f...
import re from django import template register = template.Library() def to_link(m): text = m.group('text') dweet_id = m.group('dweet_id') username = m.group('username') if username is None: path = '/d/' + dweet_id # hardcode for speed! # path = reverse('dweet_show', kwargs={'dweet_i...
Revert 232670 "Fix script after r232641" Needs to be out to speculatively revert r232641. > Fix script after r232641 > > BUG=314253 > TBR=pfeldman@chromium.org > > Review URL: https://codereview.chromium.org/49753004 TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/57293002 git-svn-id: 239fca9...
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper script that invokes test-webkitpy.""" import optparse import os import sys from common import chromium_utils from slave ...
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper script that invokes test-webkitpy.""" import optparse import os import sys from common import chromium_utils from slave ...
Add test control for number of threads Enable over saturated testing
package org.jctools.util; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.LockSupport; public class TestUtil { public static final int CONCURRENT_TEST_DURATION = Integ...
package org.jctools.util; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.LockSupport; public class TestUtil { public static final int CONCURRENT_TEST_DURATION = Integ...
Create sections for htmlhead and scripts Make it possible to inject additional files from other views
<!DOCTYPE html> <!-- This is a starter template page. Use this page to start your new project from scratch. This page gets rid of all links and provides the needed markup only. --> <html lang="en"> @section('htmlheader') @include('layouts.partials.htmlheader') @show <!-- BODY TAG OPTIONS: ================= Apply ...
<!DOCTYPE html> <!-- This is a starter template page. Use this page to start your new project from scratch. This page gets rid of all links and provides the needed markup only. --> <html lang="en"> @include('layouts.partials.htmlheader') <!-- BODY TAG OPTIONS: ================= Apply one or more of the following clas...
Fix ArrayOutOfBoundsException when relativizing path elements
package com.sourcegraph.javagraph; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.SystemUtils; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; public class PathUtil { public static final Path CWD = SystemUtils.getUserDir().toPath().toAbsolutePath().norma...
package com.sourcegraph.javagraph; import org.apache.commons.lang3.SystemUtils; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; public class PathUtil { public static final Path CWD = SystemUtils.getUserDir().toPath().toAbsolutePath().normalize(); public static String normalize(S...
Remove if(this.viewHeight){} since block is empty.
class MCShowSampleComponentController { /*@ngInject*/ constructor($stateParams, samplesService, toast, $mdDialog) { this.projectId = $stateParams.project_id; this.samplesService = samplesService; this.toast = toast; this.$mdDialog = $mdDialog; this.viewHeight = this.viewH...
class MCShowSampleComponentController { /*@ngInject*/ constructor($stateParams, samplesService, toast, $mdDialog) { this.projectId = $stateParams.project_id; this.samplesService = samplesService; this.toast = toast; this.$mdDialog = $mdDialog; this.viewHeight = this.viewH...
Remove explicit inheritance from object
""" Hook wrapper "result" utilities. """ import sys def _raise_wrapfail(wrap_controller, msg): co = wrap_controller.gi_code raise RuntimeError( "wrap_controller at %r %s:%d %s" % (co.co_name, co.co_filename, co.co_firstlineno, msg) ) class HookCallError(Exception): """ Hook was calle...
""" Hook wrapper "result" utilities. """ import sys def _raise_wrapfail(wrap_controller, msg): co = wrap_controller.gi_code raise RuntimeError( "wrap_controller at %r %s:%d %s" % (co.co_name, co.co_filename, co.co_firstlineno, msg) ) class HookCallError(Exception): """ Hook was calle...
Switch breadcrumb store to ConcurrentLinkedQueue to prevent concurrency issues
package com.bugsnag.android; import android.support.annotation.NonNull; import java.io.IOException; import java.util.Date; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; class Breadcrumbs implements JsonStream.Streamable { private static class Breadcrumb { private static final...
package com.bugsnag.android; import android.support.annotation.NonNull; import java.io.IOException; import java.util.Date; import java.util.LinkedList; import java.util.List; class Breadcrumbs implements JsonStream.Streamable { private static class Breadcrumb { private static final int MAX_MESSAGE_LENGTH...
Document year filter spec and only attempt to use it with 4 digit values
'use strict'; angular.module('occupied.filters', ['occupied.services']) /** * Filter to insert adjusted/ filled-in values for {city}, {population|...}, {area|...}, {year|...}. * * Year must be a full 4-digit value. * Population must be an integer with no commas. * Area must be an int ...
'use strict'; angular.module('occupied.filters', ['occupied.services']) /** * Filter to insert adjusted/ filled-in values for {city}, {population|...}, {area|...}, {year|...}. * * Population must be an integer with no commas. * Area must be an int or float with no commas. * Area will ...
Improve perfomance on large DOMs when container is not whole document.
(function(ns) { var namespaces = [this]; var attachBehavior = function($element, behavior) { var fn = namespaces; behavior.replace(/([^.]+)/g, function(object) { if(fn === namespaces) { for(var nextFn, index = 0; index < fn.length; ++index) { ne...
(function(ns) { var namespaces = [this]; var attachBehavior = function($element, behavior) { var fn = namespaces; behavior.replace(/([^.]+)/g, function(object) { if(fn === namespaces) { for(var nextFn, index = 0; index < fn.length; ++index) { ne...
Remove impossible todo about loc status enum validation
const geom = require('./geom'); const time = require('./time'); const objectid = require('./objectid'); module.exports = { type: 'object', properties: { _id: objectid, createdAt: time, creator: { type: 'string', }, deleted: { type: 'boolean', }, geom: geom, name: { ...
const geom = require('./geom'); const time = require('./time'); const objectid = require('./objectid'); module.exports = { type: 'object', properties: { _id: objectid, createdAt: time, creator: { type: 'string', }, deleted: { type: 'boolean', }, geom: geom, name: { ...
Remove the comment (line already fixed)
$(window).load(function () { var Ector = require('ector'); ector = new Ector(); var previousResponseNodes = null; var user = { username: "Guy"}; var msgtpl = $('#msgtpl').html(); var lastmsg = false; $('#msgtpl').remove(); var message; $('#send').on('click', function () { va...
$(window).load(function () { var Ector = require('ector'); ector = new Ector(); var previousResponseNodes = null; var user = { username: "Guy"}; var msgtpl = $('#msgtpl').html(); var lastmsg = false; $('#msgtpl').remove(); var message; $('#send').on('click', function () { va...
CRM-6121: Disable emails as a feature - Removed unused service argument
<?php namespace Oro\Bundle\SidebarBundle\Model; use Doctrine\Common\Collections\ArrayCollection; use Oro\Bundle\FeatureToggleBundle\Checker\FeatureChecker; class WidgetDefinitionRegistry { const SIDEBAR_WIDGET_FEATURE_NAME = 'sidebar_widgets'; /** * @var ArrayCollection */ protected $widgetDef...
<?php namespace Oro\Bundle\SidebarBundle\Model; use Doctrine\Common\Collections\ArrayCollection; use Oro\Bundle\FeatureToggleBundle\Checker\FeatureChecker; class WidgetDefinitionRegistry { const SIDEBAR_WIDGET_FEATURE_NAME = 'sidebar_widgets'; /** * @var ArrayCollection */ protected $widgetDef...
Add prop-types as a peer dependency This further reduces the bundle size to 8k
import path from 'path'; import UglifyJSPlugin from 'uglifyjs-webpack-plugin'; import ExtractTextPlugin from 'extract-text-webpack-plugin'; const config = [ { name: 'react-redux-spinner', entry: [ './src/nprogress.css', './src/index.js' ], externals: { react: 'react', 'react-d...
import path from 'path'; import UglifyJSPlugin from 'uglifyjs-webpack-plugin'; import ExtractTextPlugin from 'extract-text-webpack-plugin'; const config = [ { name: 'react-redux-spinner', entry: [ './src/nprogress.css', './src/index.js' ], externals: { react: 'react', 'react-d...
Exclude tests from installed packages Fixes #453.
#!/usr/bin/env python from setuptools import find_packages, setup setup( name='django-mptt', description='''Utilities for implementing Modified Preorder Tree Traversal with your Django Models and working with trees of Model instances.''', version=__import__('mptt').__version__, author='Craig ...
#!/usr/bin/env python from setuptools import find_packages, setup setup( name='django-mptt', description='''Utilities for implementing Modified Preorder Tree Traversal with your Django Models and working with trees of Model instances.''', version=__import__('mptt').__version__, author='Craig ...
Set height and width for Sub Ebook Embed iframe
import m from 'mithril'; import h from '../h'; import userVM from '../vms/user-vm'; import projectVM from '../vms/project-vm'; import youtubeLightbox from '../c/youtube-lightbox'; const I18nScope = _.partial(h.i18nScope, 'projects.dashboard_start'); const projectEditStart = { controller(args) { }, view(ct...
import m from 'mithril'; import h from '../h'; import userVM from '../vms/user-vm'; import projectVM from '../vms/project-vm'; import youtubeLightbox from '../c/youtube-lightbox'; const I18nScope = _.partial(h.i18nScope, 'projects.dashboard_start'); const projectEditStart = { controller(args) { }, view(ct...
Remove GDAL as a dependency
from setuptools import setup setup( name='centerline', version='0.1', description='Calculate the centerline of a polygon', long_description='README.rst', classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python...
from setuptools import setup setup( name='centerline', version='0.1', description='Calculate the centerline of a polygon', long_description='README.rst', classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python...
Fix typos in French translation of the example
export const messages = { post: { name: 'Article', all: 'Articles', list: { search: 'Recherche', title: 'Titre', published_at: 'Publié le', commentable: 'Commentable', views: 'Vues', }, form: { title: 'Ti...
export const messages = { post: { name: 'Article', all: 'Articles', list: { search: 'Recherche', title: 'Titre', published_at: 'Publié le', commentable: 'Commentable', views: 'Vues', }, form: { title: 'Ti...
Install beautifulsoup4 with lxml parser
import subprocess from codecs import open from setuptools import setup, find_packages from setuptools.command import develop, build_py def readme(): with open("README.md", "r", "utf-8") as f: return f.read() class CustomDevelop(develop.develop, object): """ Class needed for "pip install -e ." ...
import subprocess from codecs import open from setuptools import setup, find_packages from setuptools.command import develop, build_py def readme(): with open("README.md", "r", "utf-8") as f: return f.read() class CustomDevelop(develop.develop, object): """ Class needed for "pip install -e ." ...
Fix promises params and this references
'use strict'; var request = require('request'); class CartoDBMapClient { constructor(user, apiKey) { this.user = user; this.apiKey = apiKey; this.baseURL = 'https://' + this.user + '.cartodb.com/'; } createNamedMap(options) { this.existsNamedMap(options.name).then(function() { }); } ex...
'use strict'; var request = require('request'); class CartoDBMapClient { constructor(user, apiKey) { this.user = user; this.apiKey = apiKey; this.baseURL = 'https://' + this.user + '.cartodb.com/'; } createNamedMap(options) { this.existsNamedMap(options.name).then(function() { }); } ex...
Allow codes for owned entities in the api models
package org.marsik.elshelves.api.entities; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.Getter; import lombok.Setter; import...
package org.marsik.elshelves.api.entities; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.Getter; import lombok.Setter; import...
Use the correct path for the database file
async function sql( args ) { /* description("This will execute sql on the internal SQLite database") base_component_id("systemFunctionAppSql") load_once_from_file(true) */ var getSqlResults = new Promise(returnResult => { var dbPath = path.join(userData, args.base_component_id + '.visi') console.l...
async function sql( args ) { /* description("This will execute sql on the internal SQLite database") base_component_id("systemFunctionAppSql") load_once_from_file(true) */ var getSqlResults = new Promise(returnResult => { var dbPath = path.join(userData, args.base_component_id + '.visi.db') consol...
Fix stacktrace.js always used even if disabled `$config['use_stacktrace_js']` is always defined, `$config['use_stacktrace_js']['enabled']` must be tested instead.
<?php namespace Nelmio\JsLoggerBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; /** * This is the class that loads and ma...
<?php namespace Nelmio\JsLoggerBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; /** * This is the class that loads and ma...
Fix fetchAll yet again - getting sloppy here
<?php class Model_Tag extends Model_Record { protected $_user; protected function _getTable() { return 'tags'; } protected function _getTableIdFieldname() { return 'tag_id'; } protected function _getColumns() { return array('tag_text'); } /** * @var Model_LocalConfig */ ...
<?php class Model_Tag extends Model_Record { protected $_user; protected function _getTable() { return 'tags'; } protected function _getTableIdFieldname() { return 'tag_id'; } protected function _getColumns() { return array('tag_text'); } /** * @var Model_LocalConfig */ ...
Revert "dependency removed from bundle test" This reverts commit 119a99ec1947f49803e913e0220a1edc633feb6e.
<?php namespace Devhelp\PiwikBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; class DevhelpPiwikBundleTest extends \PHPUnit_Framework_TestCase { /** * @var DevhelpPiwikBundle */ private $bundle; /** * @var ContainerBuilder */ private $container; protected...
<?php namespace Devhelp\PiwikBundle; class DevhelpPiwikBundleTest extends \PHPUnit_Framework_TestCase { /** * @var DevhelpPiwikBundle */ private $bundle; /** * @var \PHPUnit_Framework_MockObject_MockObject */ private $container; protected function setUp() { $thi...
Add small test for crop parameter to pipe
import os import pytest import tempfile import pandas from skan import pipe @pytest.fixture def image_filename(): rundir = os.path.abspath(os.path.dirname(__file__)) datadir = os.path.join(rundir, 'data') return os.path.join(datadir, 'retic.tif') def test_pipe(image_filename): data = pipe.process_im...
import os import pytest import tempfile import pandas from skan import pipe @pytest.fixture def image_filename(): rundir = os.path.abspath(os.path.dirname(__file__)) datadir = os.path.join(rundir, 'data') return os.path.join(datadir, 'retic.tif') def test_pipe(image_filename): data = pipe.process_im...
Fix fade of slickslider clashing with bootstrap 4
/** * global: jsFrontend */ (function ($) { /** * Create responsive media slider, which uses "slick" slider */ $.fn.mediaLibrarySlider = function () { // loop for all sliders return this.each(function () { // define slider var $slider = $(this) // define show controls or not ...
/** * global: jsFrontend */ (function ($) { /** * Create responsive media slider, which uses "slick" slider */ $.fn.mediaLibrarySlider = function () { // loop for all sliders return this.each(function () { // define slider var $slider = $(this) // define show controls or not ...
Add full calendar for staff
<div id="sidebar"> <ul class="clearfix"> <li class="help"><a href="#">Help</a></li> <li><a href="/">Upcoming Visits</a> <?php if ($this->staff): ?> <ul> <li><a href="/dc">Calendar</a></li> </ul> <?ph...
<div id="sidebar"> <ul class="clearfix"> <li class="help"><a href="#">Help</a></li> <li><a href="/">Upcoming Visits</a></li> <li><a href="/cell">Unit Cell Search</a> <?php if ($this->staff): ?> <ul> <li><a href="/cell/b...
Fix create dashboard not working
import React from 'react' import Modal from 'app/components/modal' import Flash from 'app/flash' import i18n from 'app/utils/i18n' import rpc from 'app/rpc' class CreateDashboard extends React.Component{ handleCreateDashboard(){ const props = this.props let name = this.refs.name.value rpc.call("dashboard...
import React from 'react' import Modal from 'app/components/modal' import Flash from 'app/flash' import i18n from 'app/utils/i18n' import rpc from 'app/rpc' class CreateDashboard extends React.Component{ handleCreateDashboard(){ const props = this.props let name = this.refs.name.value rpc.call("dashboard...
Support in-addon and in-engine options
'use strict'; module.exports = { name: require('./package').name, options: { autoImport: { webpack: { module: { rules: [ /* fixes issue with graphql-js's mjs entry */ /* see: https://github.com/graphql/graphql-js/issues/1272#issuecomment-393903706 */ ...
'use strict'; module.exports = { name: require('./package').name, options: { autoImport: { webpack: { module: { rules: [ /* fixes issue with graphql-js's mjs entry */ /* see: https://github.com/graphql/graphql-js/issues/1272#issuecomment-393903706 */ ...
Allow protocol to also be specified.
'use strict'; var request = require('../request') ; var token = {}; var Authenticatable = { token: { get: function () { return token; } }, authenticate: { value: function (user, password) { if (!user) { throw { name: 'ArgumentError', message: user + ' is n...
'use strict'; var request = require('../request') ; var token = {}; var Authenticatable = { token: { get: function () { return token; } }, authenticate: { value: function (user, password) { if (!user) { throw { name: 'ArgumentError', message: user + ' is n...
Fix to account for casing diffs between Mac OS X and Linux
from django.test import TestCase from core import utils class SlugifyOC(TestCase): def test_oc_slugify(self): lst = ( ('test.this.value', 'test-this-value'), ('Plone.OpenComparison', 'plone-opencomparison'), ('Run from here', 'run-from-here'), ('Jump_the ...
from django.test import TestCase from core import utils class SlugifyOC(TestCase): def test_oc_slugify(self): lst = ( ('test.this.value', 'test-this-value'), ('Plone.OpenComparison', 'plone-opencomparison'), ('Run from here', 'run-from-here'), ('Jump_the ...
Use empty value with grid
<?php declare(strict_types=1); namespace Psi\Component\Grid\Filter; use Psi\Component\Grid\FilterInterface; use Psi\Component\ObjectAgent\Query\Comparison; use Psi\Component\ObjectAgent\Query\Expression; use Psi\Component\ObjectAgent\Query\Query; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony...
<?php declare(strict_types=1); namespace Psi\Component\Grid\Filter; use Psi\Component\Grid\FilterInterface; use Psi\Component\ObjectAgent\Query\Comparison; use Psi\Component\ObjectAgent\Query\Expression; use Psi\Component\ObjectAgent\Query\Query; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony...
Add README as long_description to package
from setuptools import setup with open("README.md", 'r') as f: long_description = f.read() setup(name='fortdepend', version='0.1.0', description='Automatically generate Fortran dependencies', long_description=long_description, long_description_content_type="test/markdown", author='Pe...
from setuptools import setup setup(name='fortdepend', version='0.1.0', description='Automatically generate Fortran dependencies', author='Peter Hill', author_email='peter@fusionplasma.co.uk', url='https://github.com/ZedThree/fort_depend.py/', download_url='https://github.com/ZedThre...
Verify job config is not deleted when scheduled job is deleted
<?php namespace SimplyTestable\ApiBundle\Tests\Services\ScheduledJob\Delete; use SimplyTestable\ApiBundle\Entity\ScheduledJob; class SingleUserTest extends ServiceTest { /** * @var ScheduledJob */ private $scheduledJob; public function setUp() { parent::setUp(); $user = $this...
<?php namespace SimplyTestable\ApiBundle\Tests\Services\ScheduledJob\Delete; use SimplyTestable\ApiBundle\Entity\ScheduledJob; class SingleUserTest extends ServiceTest { /** * @var ScheduledJob */ private $scheduledJob; public function setUp() { parent::setUp(); $user = $this...
Use get_the_archive_title() for archive pages
<?php $page_title = ''; $page_subtitle = ''; if (is_author()) : $page_title = __('Content by:', 'keitaro'); elseif (is_search()): global $wp_query; $page_title = __('Search results:', 'keitaro') . ' ' . highlight(get_search_query()); $page_subtitle = __('Found', 'keitaro') . ' ' . highlight($wp_query...
<?php $page_title = ''; $page_subtitle = ''; if (is_author()) : $page_title = __('Content by:', 'keitaro'); elseif (is_search()): global $wp_query; $page_title = __('Search results:', 'keitaro') . ' ' . highlight(get_search_query()); $page_subtitle = __('Found', 'keitaro') . ' ' . highlight($wp_query...
Refactor filter out none to method
import string import math import itertools class CryptoSquare: @classmethod def encode(cls, msg): if len(cls.normalize(msg)) == 0: return '' return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg)))) @classmethod def squarify(cls, msg): return [msg[i:...
import string import math import itertools class CryptoSquare: @classmethod def encode(cls, msg): if len(cls.normalize(msg)) == 0: return '' return ' '.join(cls.transpose_square(cls.squarify(cls.normalize(msg)))) @classmethod def squarify(cls, msg): return [msg[i:...
Add a shortcut method on node to add to frame
(function () { "use strict"; var Frame = function (elem) { if (typeof elem === 'string') { elem = document.getElementById(elem); } var height = elem.scrollHeight; var width = elem.scrollWidth; var viewAngle = 45; var aspect = width / (1.0 * height);...
(function () { "use strict"; var Frame = function (elem) { if (typeof elem === 'string') { elem = document.getElementById(elem); } var height = elem.scrollHeight; var width = elem.scrollWidth; var viewAngle = 45; var aspect = width / (1.0 * height);...
Fix example outside the admin
try: from django.urls import reverse_lazy except ImportError: from django.core.urlresolvers import reverse_lazy from django.forms import inlineformset_factory from django.views import generic from select2_many_to_many.forms import TForm from select2_many_to_many.models import TModel class UpdateView(generic....
try: from django.urls import reverse_lazy except ImportError: from django.core.urlresolvers import reverse_lazy from django.forms import inlineformset_factory from django.views import generic from select2_many_to_many.forms import TForm from select2_many_to_many.models import TModel class UpdateView(generic....
Fix bug in changeling title fix - it used to remove some lines on the way...
import json import logging if __name__ == "__main__": input = sys.argv[1] output = sys.argv[2] processor = fix_changeline_budget_titles().process(input,output,[]) class fix_changeline_budget_titles(object): def process(self,inputs,output): out = [] budgets = {} changes_json...
import json import logging if __name__ == "__main__": input = sys.argv[1] output = sys.argv[2] processor = fix_changeline_budget_titles().process(input,output,[]) class fix_changeline_budget_titles(object): def process(self,inputs,output): out = [] budgets = {} changes_json...
Fix help message of --min_eval_frequency flag
import tensorflow as tf from .flag import FLAGS, FlagAdder from .estimator import def_estimator from .inputs import def_def_train_input_fn, def_def_eval_input_fn def def_def_experiment_fn(batch_inputs=True, prepare_filename_queues=True, distributed=False): adde...
import tensorflow as tf from .flag import FLAGS, FlagAdder from .estimator import def_estimator from .inputs import def_def_train_input_fn, def_def_eval_input_fn def def_def_experiment_fn(batch_inputs=True, prepare_filename_queues=True, distributed=False): adde...
Make urlencode load properly in python 3.
#! /usr/bin/env python # encoding: utf-8 from __future__ import absolute_import from .base import AuthenticationMixinBase from . import GrantFailed # We need to get urlencode from urllib.parse in Python 3, but fall back to # urllib in Python 2 try: from urllib.parse import urlencode except ImportError: from ...
#! /usr/bin/env python # encoding: utf-8 from __future__ import absolute_import import urllib from .base import AuthenticationMixinBase from . import GrantFailed try: basestring except NameError: basestring = str class AuthorizationCodeMixin(AuthenticationMixinBase): """Implement helpers for the Authori...
Handle app-name validation failures better.
from .command import Command from ..api.errors import BadRequest import logging import sys log = logging.getLogger(__name__) class AppsCommand(Command): """ Manage Orchard apps. Usage: apps COMMAND [ARGS...] Commands: ls List apps (default) create Add a new app rm ...
from .command import Command from ..api.errors import BadRequest import logging import sys log = logging.getLogger(__name__) class AppsCommand(Command): """ Manage Orchard apps. Usage: apps COMMAND [ARGS...] Commands: ls List apps (default) create Add a new app rm ...
Use np.inf for max/min limit values
import random import numpy as np from ..player import Player from ..utils import utility class AlphaBeta(Player): name = 'Alpha-Beta' def __init__(self, eval_func=utility, max_depth=np.inf): self._eval = eval_func self._max_depth = max_depth def __str__(self): return self.name ...
import random from ..player import Player from ..utils import utility class AlphaBeta(Player): name = 'Alpha-Beta' def __init__(self, eval_func=utility, max_depth=1000): self._eval = eval_func self._max_depth = max_depth def __str__(self): return self.name def __repr__(self...
Remove unnecessary table headers in tags page
import React, { Component, PropTypes } from 'react' import { Table } from 'semantic-ui-react' import TagTableRow from './TagTableRow' const propTypes = { dispatch: PropTypes.func.isRequired, isAuthenticated: PropTypes.bool.isRequired, tagNames: PropTypes.array.isRequired, tags: PropTypes.object.isRequired, ...
import React, { Component, PropTypes } from 'react' import { Table } from 'semantic-ui-react' import TagTableRow from './TagTableRow' const propTypes = { dispatch: PropTypes.func.isRequired, isAuthenticated: PropTypes.bool.isRequired, tagNames: PropTypes.array.isRequired, tags: PropTypes.object.isRequired, ...
Remove clean function of gulp default
var gulp = require('gulp'), sass = require('gulp-sass'), rename = require('gulp-rename'), minifyCss = require('gulp-minify-css'), autoprefixer = require('gulp-autoprefixer'), browserSync = require('browser-sync').create(); gulp.task('dependencies', function() { gulp.src('bower_components/normali...
var gulp = require('gulp'), sass = require('gulp-sass'), rename = require('gulp-rename'), minifyCss = require('gulp-minify-css'), autoprefixer = require('gulp-autoprefixer'), browserSync = require('browser-sync').create(); gulp.task('dependencies', function() { gulp.src('bower_components/normali...
Sort Gulp tasks in executing order
'use strict'; var gulp = require('gulp'); var eslint = require('gulp-eslint'); var excludeGitignore = require('gulp-exclude-gitignore'); var jsonlint = require("gulp-jsonlint"); var mocha = require('gulp-mocha'); var istanbul = require('gulp-istanbul'); var plumber = require('gulp-plumber'); gulp.task('set-test-env',...
'use strict'; var gulp = require('gulp'); var eslint = require('gulp-eslint'); var excludeGitignore = require('gulp-exclude-gitignore'); var jsonlint = require("gulp-jsonlint"); var mocha = require('gulp-mocha'); var istanbul = require('gulp-istanbul'); var plumber = require('gulp-plumber'); gulp.task('static', funct...
Rename variable to javascriptExecutor in unit test
package com.saucelabs.common; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; public class SauceHelperTest { private SauceHelper sauceHelper; @Before public void runBeforeEveryTest() { sauceHelper = new SauceHe...
package com.saucelabs.common; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; public class SauceHelperTest { private SauceHelper sauceHelper; @Before public void runBeforeEveryTest() { sauceHelper = new SauceHe...
Call frame scripts immediately. This is just temporary for testing purposes.
function MovieClip() { this.currentFrame = 0; this.framesLoaded = 0; this.totalFrames = 0; this.trackAsMenu = false; this.scenes = []; this.currentScene = null; this.currentLabel = null; this.currentFrameLabel = null; this.enabled = false; this.isPlaying = false; } var p = MovieClip.prototype = new...
function MovieClip() { this.currentFrame = 0; this.framesLoaded = 0; this.totalFrames = 0; this.trackAsMenu = false; this.scenes = []; this.currentScene = null; this.currentLabel = null; this.currentFrameLabel = null; this.enabled = false; this.isPlaying = false; } var p = MovieClip.prototype = ne...
Use get_or_create instead of catching exception
from django.core.management.base import BaseCommand from utils.create_random_data import create_items, create_users, create_orders from saleor.userprofile.models import User class Command(BaseCommand): help = 'Populate database with test objects' placeholders_dir = r'saleor/static/placeholders/' def ad...
from django.core.management.base import BaseCommand from django.db import IntegrityError from utils.create_random_data import create_items, create_users, create_orders from saleor.userprofile.models import User class Command(BaseCommand): help = 'Populate database with test objects' placeholders_dir = r'sal...
Clean up how UI works
'use strict'; var Q = require('q'), scorer = require('./scorer'), print = require('./board/print'); module.exports = { play: function(board, player_x, player_o) { var self = this; return Q.promise(function(resolve) { self .get_play(board, player_x, player_o) ...
'use strict'; var Q = require('q'), scorer = require('./scorer'), print = require('./board/print'); module.exports = { play: function(board, player_x, player_o) { var self = this; return Q.promise(function(resolve) { self .get_play(board, player_x, player_o) ...
CRM-2199: Create search handler for A/CI field autocomplete -revert changes
<?php namespace Oro\Bundle\MigrationBundle\Migration; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\Persistence\ObjectManager; use Oro\Bundle\MigrationBundle\Entity\DataFixture; class UpdateDataFixturesFixture extends AbstractFixture { /** * @var array * key - class name ...
<?php namespace Oro\Bundle\MigrationBundle\Migration; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\Persistence\ObjectManager; use Oro\Bundle\MigrationBundle\Entity\DataFixture; class UpdateDataFixturesFixture extends AbstractFixture { /** * @var array * key - class name ...
Add link to interest group info page
// @flow import styles from './InterestGroup.css'; import React from 'react'; import InterestGroupComponent from './InterestGroup'; import Button from 'app/components/Button'; import { Content } from 'app/components/Content'; import { Link } from 'react-router'; import NavigationTab, { NavigationLink } from 'app/compo...
// @flow import styles from './InterestGroup.css'; import React from 'react'; import InterestGroupComponent from './InterestGroup'; import Button from 'app/components/Button'; import { Content } from 'app/components/Content'; import { Link } from 'react-router'; import NavigationTab, { NavigationLink } from 'app/compo...
Allow use of Check-And-Set option and raise exception if status is 4xx or 5xx
import json import re import requests class KeyValue(object): def __init__(self, url): self._url = "%s/kv" % url def _get(self, key, recurse=None, keys=None): url = self._url + '/' + key params = dict() if recurse is not None: params['recurse'] = True if k...
import json import re import requests class KeyValue(object): def __init__(self, url): self._url = "%s/kv" % url def _get(self, key, recurse=None, keys=None): url = self._url + '/' + key params = dict() if recurse is not None: params['recurse'] = True if k...
Remove docblock injected by phpstorm
<?php namespace PhpXmlRpc\Helper; class Logger { protected static $instance = null; /** * This class is singleton, so that later we can move to DI patterns. * * @return Logger */ public static function instance() { if (self::$instance === null) { self::$instanc...
<?php /** * Created by PhpStorm. * User: gg * Date: 12/04/2015 * Time: 12:11 */ namespace PhpXmlRpc\Helper; class Logger { protected static $instance = null; /** * This class is singleton, so that later we can move to DI patterns. * * @return Logger */ public static function ins...
Change "Main Menu" button to an "Agree" button
function initScenes(Q) { Q.scene("mainMenu", function(stage) { stage.insert(new Q.UI.Button( { asset: "play_button.png", x: Q.width / 2 - 55, y: 500 }, function() { Q.stageScene('game'); })); stage.insert(new Q.HoverSprite({ asset: "title.png", cx: 0, ...
function initScenes(Q) { Q.scene("mainMenu", function(stage) { stage.insert(new Q.UI.Button( { asset: "play_button.png", x: Q.width / 2 - 55, y: 500 }, function() { Q.stageScene('game'); })); stage.insert(new Q.HoverSprite({ asset: "title.png", cx: 0, ...
Clean up language, center answer button.
@extends('layouts.app') @section('content') <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading"> Trio {{ $trio->id }} </div> <div class="panel-body"> ...
@extends('layouts.app') @section('content') <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading"> Single trio {{ $trio->id }} </div> <div class="panel-body"> ...
Update denon device mock to reflect mixer changes
import unittest import os from mopidy.mixers.denon import DenonMixer class DenonMixerDeviceMock(object): def __init__(self): self._open = True self.ret_val = bytes('MV00\r') def write(self, x): if x[2] != '?': self.ret_val = bytes(x) def read(self, x): return s...
import unittest import os from mopidy.mixers.denon import DenonMixer class DenonMixerDeviceMock(object): def __init__(self): self._open = True self.ret_val = bytes('00') def write(self, x): pass def read(self, x): return self.ret_val def isOpen(self): return se...
Fix typo on the cleaning loop
module.exports = function(data, Bot, Config, Helpers) { var value = Helpers.getCommandPart(data.message, '2', Config); if(Config.admin.indexOf(data.userID) == -1) { var message = ''; message += '@'; message += data.user; message += ' '; message += 'Vous n\'avez pas la permission d\'effectue...
module.exports = function(data, Bot, Config, Helpers) { var value = Helpers.getCommandPart(data.message, '2', Config); if(Config.admin.indexOf(data.userID) == -1) { var message = ''; message += '@'; message += data.user; message += ' '; message += 'Vous n\'avez pas la permission d\'effectue...
Handle case for error formatting where errors are a list of dictionaries (as you would see in bulk create).
from rest_framework import status from rest_framework.exceptions import APIException def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is loaded without Django from rest_framework.view...
from rest_framework import status from rest_framework.exceptions import APIException def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is loaded without Django from rest_framework.view...
Clean up the profiles activation action
<?php namespace Frontend\Modules\Profiles\Actions; /* * This file is part of Fork CMS. * * For the full copyright and license information, please view the license * file that was distributed with this source code. */ use Frontend\Core\Engine\Base\Block as FrontendBaseBlock; use Frontend\Modules\Profiles\Engine\...
<?php namespace Frontend\Modules\Profiles\Actions; /* * This file is part of Fork CMS. * * For the full copyright and license information, please view the license * file that was distributed with this source code. */ use Frontend\Core\Engine\Base\Block as FrontendBaseBlock; use Frontend\Core\Engine\Navigation a...
Use only lowercase letters in the source link as well
"""Simple blueprint.""" import os from flask import Blueprint, current_app, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods=['GET']) def get_simple(): """List all packages.""" packages = os.listdir(c...
"""Simple blueprint.""" import os from flask import Blueprint, current_app, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods=['GET']) def get_simple(): """List all packages.""" packages = os.listdir(c...
Return the assignment value instead of for DummyConfigResource.app's setter
var _ = require('lodash'); var resources = require('../dummy/resources'); var DummyResource = resources.DummyResource; var DummyConfigResource = DummyResource.extend(function(self, name, store) { /**class:DummyConfigResource(name) Handles api requests to the config resource from :class:`DummyApi`. ...
var _ = require('lodash'); var resources = require('../dummy/resources'); var DummyResource = resources.DummyResource; var DummyConfigResource = DummyResource.extend(function(self, name, store) { /**class:DummyConfigResource(name) Handles api requests to the config resource from :class:`DummyApi`. ...
Move the init/event methods to the private scope
var Gificiency = (function() { 'use strict'; var searchField = $('.search'), items = $('li'), links = $('a'); var init = function() { if ( getHash() ) { search( getHash() ); } events(); }; var events = function() { searchField.on('keyup', function() { search( $(this)...
var Gificiency = (function() { 'use strict'; var searchField = $('.search'), items = $('li'), links = $('a'); var search = function(filter) { links.each(function() { var elem = $(this); if (elem.text().search( new RegExp(filter, 'i') ) < 0) { elem.hide(); } else { ...
[model] Add ability to get ISO4217 info. add a request and action for that. Simply payment interface.
<?php namespace Payum\AuthorizeNet\Aim\Action; use Payum\Core\Action\ActionInterface; use Payum\Core\Action\GatewayAwareAction; use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Model\PaymentInterface; use Payum\Core\Request\Convert; use Payum\Core\Request\Get...
<?php namespace Payum\AuthorizeNet\Aim\Action; use Payum\Core\Action\ActionInterface; use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; use Payum\Core\Model\PaymentInterface; use Payum\Core\Request\Convert; class ConvertPaymentAction implements ActionInterface { /** ...
FIX partner internal code compatibility with sign up
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class pa...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class pa...
Add css during search loading
$(function() { function doSearch() { var keywords = $('input[name="q"]').val().toLowerCase(); $.get("search.php", {q: keywords}, function(data) { $('#count').text(data['count']); $('#time').text(data['time']); var html = ''; $.each(data['results'], function(k, v) { html += '<...
$(function() { function doSearch() { var keywords = $('input[name="q"]').val().toLowerCase(); $.get("search.php", {q: keywords}, function(data) { $('#count').text(data['count']); $('#time').text(data['time']); var html = ''; $.each(data['results'], function(k, v) { html += '<...
Fix user role filtered namespace
""" Copyright 2016 ElasticBox All rights reserved. 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://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
""" Copyright 2016 ElasticBox All rights reserved. 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://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
Add users to Project angular ressource
// -*- coding: utf-8 -*- // // (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> // // See LICENSE comming with the source of 'trex' for details. // 'use strict'; var trexServices = angular.module('trex.services', ['ngResource']); trexServices.factory('Conf', function($location) { function getRootUrl() { va...
// -*- coding: utf-8 -*- // // (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> // // See LICENSE comming with the source of 'trex' for details. // 'use strict'; var trexServices = angular.module('trex.services', ['ngResource']); trexServices.factory('Conf', function($location) { function getRootUrl() { va...
Feature: Fix when there are multiple datetime pickers on same page
<style> .datepicker input { width: 40%; } .datepicker .btn { border: 1px solid #dadada; border-left: none; font-size:1.125em; padding: 0.7em 0.8em; } </style> <div class="form-group" for="{{$name}}"> <span class="form-group-content"> <label for="" cla...
<style> .datepicker input { width: 40%; } .datepicker .btn { border: 1px solid #dadada; border-left: none; font-size:1.125em; padding: 0.7em 0.8em; } </style> <div class="form-group" for="{{$name}}"> <span class="form-group-content"> <label for="" cla...
Add maps link to menu
<?php namespace FoodFlow\WebBundle\Menu; use Knp\Menu\FactoryInterface; use Symfony\Component\DependencyInjection\ContainerAware; class Builder extends ContainerAware { public function mainMenu(FactoryInterface $factory, array $options) { $menu = $factory->createItem('root'); $menu->addChild...
<?php namespace FoodFlow\WebBundle\Menu; use Knp\Menu\FactoryInterface; use Symfony\Component\DependencyInjection\ContainerAware; class Builder extends ContainerAware { public function mainMenu(FactoryInterface $factory, array $options) { $menu = $factory->createItem('root'); $menu->addChild...
Add workaround for electron webview issue with disappearing cursors
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { observer } from 'mobx-react'; import ElectronWebView from 'react-electron-web-view'; import ServiceModel from '../../../models/Service'; @observer class ServiceWebview extends Component { static propTypes = { service: PropTyp...
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { observer } from 'mobx-react'; import ElectronWebView from 'react-electron-web-view'; import ServiceModel from '../../../models/Service'; @observer class ServiceWebview extends Component { static propTypes = { service: PropTyp...