text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Make output data cleaner on the eyes :) | '''
Execute overstate functions
'''
# Import salt libs
import salt.overstate
import salt.output
def over(env='base', os_fn=None):
'''
Execute an overstate sequence to orchestrate the executing of states
over a group of systems
'''
stage_num = 0
overstate = salt.overstate.OverState(__opts__, e... | '''
Execute overstate functions
'''
# Import salt libs
import salt.overstate
import salt.output
def over(env='base', os_fn=None):
'''
Execute an overstate sequence to orchestrate the executing of states
over a group of systems
'''
overstate = salt.overstate.OverState(__opts__, env, os_fn)
for... |
Fix the list tag style | module.exports = {
inputStyle: {
"backgroundColor": "white",
"border": `1px solid transparent`,
"borderRadius": `1px`,
"boxShadow": `0 2px 6px rgba(0, 0, 0, 0.3)`,
"boxSizing": `border-box`,
"MozBoxSizing": `border-box`,
"fontSize": `14px`,
"height": `... | module.exports = {
inputStyle: {
"backgroundColor": "white",
"border": `1px solid transparent`,
"borderRadius": `1px`,
"boxShadow": `0 2px 6px rgba(0, 0, 0, 0.3)`,
"boxSizing": `border-box`,
"MozBoxSizing": `border-box`,
"fontSize": `14px`,
"height": `... |
Add getter and setters for unit field | package com.kduda.battleships.models.board;
import com.kduda.battleships.models.units.Unit;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
public class Cell extends Rectangle {
public final Position POSITION;
public final CellType TYPE;
private final Board BOARD;
public boolean... | package com.kduda.battleships.models.board;
import com.kduda.battleships.models.units.Unit;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
public class Cell extends Rectangle {
public final Position POSITION;
public final CellType TYPE;
private final Board BOARD;
public Unit un... |
Fix showing UUIDs instead of player names in the grave inventory | package com.forgeessentials.afterlife;
import com.forgeessentials.util.UserIdent;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class InventoryGrave extends InventoryBasic {
private Grave grave;
public InventoryG... | package com.forgeessentials.afterlife;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.ItemStack;
public class InventoryGrave extends InventoryBasic {
private Grave grave;
public InventoryGrave(Grave grave)
{
super(grave... |
Add long description content type | # -*- coding: utf-8 -*-
"""Packaging implementation"""
from os.path import dirname, join
from setuptools import setup
def read_file(filename):
with open(join(dirname(__file__), filename)) as file:
return file.read()
setup(
name='dj-email-url',
version='1.0.4',
url='https://github.com/migonza... | # -*- coding: utf-8 -*-
"""Packaging implementation"""
from os.path import dirname, join
from setuptools import setup
def read_file(filename):
with open(join(dirname(__file__), filename)) as file:
return file.read()
setup(
name='dj-email-url',
version='1.0.4',
url='https://github.com/migonza... |
Use double instead of single quotes for doc string | import warnings
import functools
__all__ = ['deprecated']
class deprecated(object):
"""Decorator to mark deprecated functions with warning.
Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>.
Parameters
----------
alt_func : str
If given, tell user what function to use i... | import warnings
import functools
__all__ = ['deprecated']
class deprecated(object):
'''Decorator to mark deprecated functions with warning.
Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>.
Parameters
----------
alt_func : str
If given, tell user what function to use i... |
Remove dependency links for pybloom. | from setuptools import setup
setup(
name = 'fastqp',
provides = 'fastqp',
version = "0.1.6",
author = 'Matthew Shirley',
author_email = 'mdshw5@gmail.com',
url = 'http://mattshirley.com',
description = 'Simple NGS read quality assessment using Python',
l... | from setuptools import setup
setup(
name = 'fastqp',
provides = 'fastqp',
version = "0.1.5",
author = 'Matthew Shirley',
author_email = 'mdshw5@gmail.com',
url = 'http://mattshirley.com',
description = 'Simple NGS read quality assessment using Python',
l... |
Disable days before today for selection | import React from "react";
import DayPicker, {DateUtils} from "react-day-picker";
import moment from 'moment';
import "./MeetingDaysField.scss";
class MeetingDaysField extends React.Component {
static propTypes = {
days: React.PropTypes.array.isRequired,
month: React.PropTypes.object.isRequired,
onDayCha... | import React from "react";
import DayPicker, {DateUtils} from "react-day-picker";
import "./MeetingDaysField.scss";
class MeetingDaysField extends React.Component {
static propTypes = {
days: React.PropTypes.array.isRequired,
month: React.PropTypes.object.isRequired,
onDayChange: React.PropTypes.func.isR... |
Move from ps2ascii to ps2txt, for better results | # -*- coding: utf-8 -*-:
import urllib2
import hashlib
import os
def construct_body(link):
if link.content == u'˘':
# this signals that content generation previously failed
return
try:
opener = urllib2.build_opener()
opener.addheaders = [('Accept-Charset', 'utf-8'), ('User-agen... | # -*- coding: utf-8 -*-:
import urllib2
import hashlib
import os
def construct_body(link):
if link.content == u'˘':
# this signals that content generation previously failed
return
try:
opener = urllib2.build_opener()
opener.addheaders = [('Accept-Charset', 'utf-8'), ('User-agen... |
Add safety check for `console.log` on app startup. | (function () {
'use strict';
// Initialise RequireJS module loader
require.config({
urlArgs: 'm=' + (new Date()).getTime(),
baseUrl: '/app/',
paths: {
// RequireJS extensions
text: '../lib/text/text',
// Vendor libraries
knockout: '..... | (function () {
'use strict';
// Initialise RequireJS module loader
require.config({
urlArgs: 'm=' + (new Date()).getTime(),
baseUrl: '/app/',
paths: {
// RequireJS extensions
text: '../lib/text/text',
// Vendor libraries
knockout: '..... |
Error: Call to undefined function apc_clear_cache() | <?php
namespace tagadvance\gilligan\session;
use PHPUnit\Framework\TestCase;
use tagadvance\gilligan\cache\APC;
/**
*
* @author Tag <tagadvance+gilligan@gmail.com>
*/
class APCSessionHandlerTest extends TestCase {
const SESSION_ID = 'CAFEBABE';
/**
*
* @var APCSessionHandler
*/
privat... | <?php
namespace tagadvance\gilligan\session;
use PHPUnit\Framework\TestCase;
use tagadvance\gilligan\cache\APC;
/**
*
* @author Tag <tagadvance+gilligan@gmail.com>
*/
class APCSessionHandlerTest extends TestCase {
const SESSION_ID = 'CAFEBABE';
/**
*
* @var APCSessionHandler
*/
privat... |
Fix bug in checkConfirmationKey, call the model directly instead of
eval(arg) | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... | from django.contrib.sites.models import Site
from django.core.mail import send_mail
from okupy.libraries.encryption import random_string
from okupy.libraries.exception import OkupyException, log_extra_data
import logging
logger = logging.getLogger('okupy')
def sendConfirmationEmail(request, form, model):
'''
... |
Add the null check/initialization for the characteristics delegation to active as well. | package com.oath.cyclops.internal.stream.spliterators;
import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.function.Consumer;
/**
* Created by johnmcclean on 22/12/2016.
*/
public class IteratableSpliterator<T> implements Spliterator<T>, CopyableSpliterator<T>{
... | package com.oath.cyclops.internal.stream.spliterators;
import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.function.Consumer;
/**
* Created by johnmcclean on 22/12/2016.
*/
public class IteratableSpliterator<T> implements Spliterator<T>, CopyableSpliterator<T>{
... |
Fix deoplete source compete position sent to language servers. | from .base import Base
import re
CompleteOutputs = "g:LanguageClient_omniCompleteResults"
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = "LanguageClient"
self.mark = "[LC]"
self.rank = 1000
self.min_pattern_length = 0
self.filetype... | from .base import Base
import re
CompleteOutputs = "g:LanguageClient_omniCompleteResults"
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = "LanguageClient"
self.mark = "[LC]"
self.rank = 1000
self.min_pattern_length = 1
self.filetype... |
Correct location of bracket so that grouping by beta loops is done correctly. | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data, name='iterations'):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
--... | '''Utility procedures for manipulating HANDE data.'''
import numpy as np
def groupby_beta_loops(data):
'''Group a HANDE DMQMC data table by beta loop.
Parameters
----------
data : :class:`pandas.DataFrame`
DMQMC data table (e.g. obtained by :func:`pyhande.extract.extract_data`.
Returns
-------
grouped : :cl... |
Load class is return by reference rather than returning copy | <?php
if (!function_exists('loadClass'))
{
function &loadClass($className, $package='library', $vendors=[APP_PATH, SYSTEM_PATH])
{
static $instance = array();
if (!is_array($vendors))
{
$vendors = array($vendors);
}
$... | <?php
if (!function_exists('loadClass'))
{
function loadClass($className, $package='library', $vendors=[APP_PATH, SYSTEM_PATH])
{
static $instance = array();
if (!is_array($vendors))
{
$vendors = array($vendors);
}
$c... |
Rename SLURM invoices application for better Django dashoard menu item. | from django.apps import AppConfig
from django.db.models import signals
class SlurmInvoicesConfig(AppConfig):
name = 'nodeconductor_assembly_waldur.slurm_invoices'
verbose_name = 'Batch packages'
def ready(self):
from nodeconductor_assembly_waldur.invoices import registrators
from waldur_s... | from django.apps import AppConfig
from django.db.models import signals
class SlurmInvoicesConfig(AppConfig):
name = 'nodeconductor_assembly_waldur.slurm_invoices'
verbose_name = 'SLURM invoices'
def ready(self):
from nodeconductor_assembly_waldur.invoices import registrators
from waldur_s... |
Add FIXME to address removing debug information from generated shaders. | # Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import argparse
import errno
import os
import subprocess
def MakeDirectories(path):
try:
os.makedirs(path)
except OSError as exc:... | # Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import argparse
import errno
import os
import subprocess
def MakeDirectories(path):
try:
os.makedirs(path)
except OSError as exc:... |
Update UserSuForm to enhance compatibility with custom user models.
In custom user models, we cannot rely on there being a 'username'
field. Instead, we should use whichever field has been specified as
the username field. | # -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from . import get_user_model
class UserSuForm(forms.Form):
username_field = get_user_model().USERNAME_FIELD
user = forms.ModelChoiceField(
label=_('Users'), que... | # -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from . import get_user_model
class UserSuForm(forms.Form):
user = forms.ModelChoiceField(
label=_('Users'), queryset=get_user_model()._default_manager.order_by(
... |
Fix tool description in argparse help | #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Make aimpoint monitor web page')
parser.add_argument("--data-root",
default=".",
... | #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Get aimpoint drift data '
'from aspect solution files')
parser.add_argument(... |
Update method name to explain what the method does | <?php
namespace Lily\Example\Application;
use Lily\Application\MiddlewareApplication;
use Lily\Application\RoutedApplication;
use Lily\Middleware as MW;
use Lily\Util\Response;
use Lily\Example\Controller\AdminController;
class AdminApplication extends MiddlewareApplication
{
protected function middleware()
... | <?php
namespace Lily\Example\Application;
use Lily\Application\MiddlewareApplication;
use Lily\Application\RoutedApplication;
use Lily\Middleware as MW;
use Lily\Util\Response;
use Lily\Example\Controller\AdminController;
class AdminApplication extends MiddlewareApplication
{
protected function middleware()
... |
Add a note acknowledging the source of this class | """
Registry class and global node registry.
This class was adapted from the Celery Project's task registry.
"""
import inspect
class NotRegistered(KeyError):
pass
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node class in the node registry.""... | """
Registry class and global node registry.
"""
import inspect
class NotRegistered(KeyError):
pass
class NodeRegistry(dict):
NotRegistered = NotRegistered
def register(self, node):
"""Register a node class in the node registry."""
self[node.name] = inspect.isclass(node) and node or nod... |
Remove colors from REPL prompt
They weren't playing nice with Readline.
There's still an optional dependency on Blessings, but that is only
used to strip away the trailing ps2. | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
pass
def getfilefunc(mod, droplast=True):
return ... | from . import *
import readline
ps1 = '\n% '
ps2 = '| '
try:
from blessings import Terminal
term = Terminal()
ps1 = term.bold_blue(ps1)
ps2 = term.bold_blue(ps2)
def fancy_movement():
print(term.move_up() + term.clear_eol() + term.move_up())
except ImportError:
def fancy_movement():
... |
Make jumping between changes loop back around | import sublime
import sublime_plugin
try:
from GitGutter.view_collection import ViewCollection
except ImportError:
from view_collection import ViewCollection
class GitGutterBaseChangeCommand(sublime_plugin.WindowCommand):
def lines_to_blocks(self, lines):
blocks = []
last_line = -2
... | import sublime
import sublime_plugin
try:
from GitGutter.view_collection import ViewCollection
except ImportError:
from view_collection import ViewCollection
class GitGutterBaseChangeCommand(sublime_plugin.WindowCommand):
def lines_to_blocks(self, lines):
blocks = []
last_line = -2
... |
Add subdomain and context to mock | # -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
class MockFulfil(object):
"""
A Mock object that helps mock away the Fulfil API
for testing.
"""
responses = []
models = {}
context = {}
subdomain = 'mock-test'
def __init__(self, target... | # -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
class MockFulfil(object):
"""
A Mock object that helps mock away the Fulfil API
for testing.
"""
responses = []
models = {}
def __init__(self, target, responses=None):
self.target = targ... |
Add filter.rank to __all__ of filter package | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... | from .lpi_filter import inverse, wiener, LPIFilter2D
from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts , roberts_positive_diagonal,
roberts_negative_diagonal)
from ._... |
Add login functionality with test | process.env.NODE_ENV = 'test';
const supertest = require('supertest');
const chai = require('chai');
const chaiHttp = require('chai-http');
const app = require('../app.js');
const request = supertest(app);
const expect = chai.expect;
const User = require('../models').User;
// const should = chai.should();
chai.us... | process.env.NODE_ENV = 'test';
const supertest = require('supertest');
const chai = require('chai');
const chaiHttp = require('chai-http');
const app = require('../app.js');
const request = supertest(app);
const expect = chai.expect;
const User = require('../models').User;
// const should = chai.should();
chai.us... |
Use local variable instead of member variable | package fi.nls.oskari.routing;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import java.io.Reader;
public class RoutingService {
private SqlMapClient client = null;
private static String SQL_MAP_LOCATION = "ME... | package fi.nls.oskari.routing;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import java.io.Reader;
public class RoutingService {
private SqlMapClient client = null;
private static String SQL_MAP_LOCATION = "ME... |
Throw the execution error of not a 404 | package com.scoopit.example;
import com.scoopit.client.ScoopApiExecutionException;
import com.scoopit.client.ScoopClient;
import com.scoopit.model.Post;
import com.scoopit.model.Topic;
import com.scoopit.model.User;
public class GetTopicAndUser {
public static void main(String[] args) throws ScoopApiExecutionExce... | package com.scoopit.example;
import com.scoopit.client.ScoopApiExecutionException;
import com.scoopit.client.ScoopClient;
import com.scoopit.model.Post;
import com.scoopit.model.Topic;
import com.scoopit.model.User;
public class GetTopicAndUser {
public static void main(String[] args) throws ScoopApiExecutionExce... |
Add repoze.{squeeze,profile} and stompservice to our dependency list | from setuptools import setup, find_packages
setup(
name='moksha',
version='0.1',
description='',
author='',
author_email='',
#url='',
install_requires=[
"TurboGears2",
"ToscaWidgets >= 0.9.1",
"zope.sqlalchemy",
"Shove",
"feedcache",
"feedpars... | from setuptools import setup, find_packages
setup(
name='moksha',
version='0.1',
description='',
author='',
author_email='',
#url='',
install_requires=[
"TurboGears2",
"ToscaWidgets >= 0.9.1",
"zope.sqlalchemy",
"Shove",
"feedcache",
"feedpars... |
Make name of pdf the name of the file with .pdf appended | class MCProjectDatasetsViewContainerComponentController {
/*@ngInject*/
constructor(mcdsstore, $stateParams, datasetsAPI, mcStateStore, projectDatasetsViewService) {
this.mcdsstore = mcdsstore;
this.$stateParams = $stateParams;
this.datasetsAPI = datasetsAPI;
this.mcStateStore = ... | class MCProjectDatasetsViewContainerComponentController {
/*@ngInject*/
constructor(mcdsstore, $stateParams, datasetsAPI, mcprojectstore2, projectDatasetsViewService) {
this.mcdsstore = mcdsstore;
this.$stateParams = $stateParams;
this.datasetsAPI = datasetsAPI;
this.mcprojectsto... |
Fix NPE when no adding parameters or exceptions | package asteroid.nodes;
import asteroid.A;
import java.util.List;
import java.util.ArrayList;
import org.codehaus.groovy.ast.Parameter;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.ast.stmt.Statement;
/**
* Builder to create instance of type {@link... | package asteroid.nodes;
import asteroid.A;
import java.util.List;
import java.util.ArrayList;
import org.codehaus.groovy.ast.Parameter;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.ast.stmt.Statement;
/**
* Builder to create instance of type {@link... |
Add a check to ensure apiKey is included in config when using GeoCarrot’s GeoIP lookup. | export default class UserLocation {
constructor({
apiKey = null,
cacheTtl = 604800, // 7 days
fallback = 'exact', // If IP-based geolocation fails
specificity = 'general',
}) {
let coordsLoaded = false;
const coords = {
latitude: null,
longitude: null,
accuracy: null,
... | export default class UserLocation {
constructor({
apiKey,
cacheTtl = 604800, // 7 days
fallback = 'exact', // If IP-based geolocation fails
specificity = 'general',
}) {
let coordsLoaded = false;
const coords = {
latitude: null,
longitude: null,
accuracy: null,
};
... |
Expand default test years for PUDL to 2011-2015
Tests successfully passed for all EIA923 tables ingesting from 2011
through 2015 (2016 still needs some id_mapping or exhaustie ID love). | """Tests excercising the pudl module for use with PyTest."""
import pytest
import pudl.pudl
import pudl.ferc1
import pudl.constants as pc
def test_init_db():
"""Create a fresh PUDL DB and pull in some FERC1 & EIA923 data."""
pudl.ferc1.init_db(refyear=2015,
years=range(2007, 2016),
... | """Tests excercising the pudl module for use with PyTest."""
import pytest
import pudl.pudl
import pudl.ferc1
import pudl.constants as pc
def test_init_db():
"""Create a fresh PUDL DB and pull in some FERC1 & EIA923 data."""
pudl.ferc1.init_db(refyear=2015,
years=range(2007, 2016),
... |
Fix integration with premium version of PvPManager | package com.elmakers.mine.bukkit.protection;
import me.NoChance.PvPManager.PvPManager;
import me.NoChance.PvPManager.PvPlayer;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
/**
* This a manager specifically for the PvPManager plugin.
*
* This is why it has kind of a ... | package com.elmakers.mine.bukkit.protection;
import me.NoChance.PvPManager.PvPManager;
import me.NoChance.PvPManager.PvPlayer;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
/**
* This a manager specifically for the PvPManager plugin.
*
* This is why it has kind of a ... |
Configure gh-pages commit user name and email | module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.initConfig({
'connect': {
demo: {
options: {
open: {
target: 'http://localhost:8000/'... | module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.initConfig({
'connect': {
demo: {
options: {
open: {
target: 'http://localhost:8000/'... |
Add support for null values in property mapping | from types import UnicodeType, StringType
class PropertyMappingFailedException(Exception):
pass
def get_transformed_properties(source_properties, prop_map):
results = {}
for key, value in prop_map.iteritems():
if type(value) in (StringType, UnicodeType):
if value in source_properties:
... | from types import UnicodeType, StringType
class PropertyMappingFailedException(Exception):
pass
def get_transformed_properties(source_properties, prop_map):
results = {}
for key, value in prop_map.iteritems():
if type(value) in (StringType, UnicodeType):
if value in source_properties:
... |
Speed up icons module import
## What was the problem?
I observed that doing a simple import of bootstrap-vue:
```js
import BootstrapVue from 'bootstrap-vue';
```
takes hundreds of milliseconds (give or take, depending on user's CPU).
I tried to do some profiling and found out that most of the time is
spent in `ico... | import { Vue, mergeData } from '../../vue'
import { omit } from '../../utils/object'
import { kebabCase, pascalCase, trim } from '../../utils/string'
import { BVIconBase, props as BVIconBaseProps } from './icon-base'
const iconProps = omit(BVIconBaseProps, ['content'])
/**
* Icon component generator function
*
* @... | import { Vue, mergeData } from '../../vue'
import { omit } from '../../utils/object'
import { kebabCase, pascalCase, trim } from '../../utils/string'
import { BVIconBase, props as BVIconBaseProps } from './icon-base'
/**
* Icon component generator function
*
* @param {string} icon name (minus the leading `BIcon`)
... |
Change the default no of users from 9 | # created by Chirath R, chirath.02@gmail.com
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | # created by Chirath R, chirath.02@gmail.com
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... |
:bug: Fix the stupid route's bug | // Routes
import Layout from '@/components/Layout'
import Welcome from '@/components/Welcome'
import Login from '@/components/auth/Login'
import UpdateProfile from '@/components/auth/UpdateProfile'
import App from '@/components/App'
import NotFound from '@/components/errors/404'
import Firestore from '@/components/Fire... | // Routes
import Layout from '@/components/Layout'
import Welcome from '@/components/Welcome'
import Login from '@/components/auth/Login'
import UpdateProfile from '@/components/auth/UpdateProfile'
import App from '@/components/App'
import NotFound from '@/components/errors/404'
import Firestore from '@/components/Fire... |
Fix for MPLy-10287
Can now click on markers to open POIs.
Buddy: Jean |
// MarkerController is reponsible for event handling such as moving to and opening the POI when selected.
class MarkerController {
constructor(searchbar, markerController, mapController) {
this._onPoiCardClickedCallback = null;
this._eegeoPoiSourceIdMap = {};
this._markerController = mark... |
// MarkerController is reponsible for event handling such as moving to and opening the POI when selected.
class MarkerController {
constructor(searchbar, markerController, mapController) {
this._onPoiCardClickedCallback = null;
this._eegeoPoiSourceIdMap = {};
this._markerController = mark... |
Set atwho.js minLen param to 1 default was 0. | jQuery(function( $ ) {
var mOptions = $.extend({}, mOpt);
console.log(mOptions);
$('#cmessage').atwho({
at: "@",
displayTpl: "<li>${username}<small> ${name}</small></li>",
insertTpl: "${atwho-at}${username}",
callbacks: {
remoteFilter: function(query, callb... | jQuery(function( $ ) {
var mOptions = $.extend({}, mOpt);
console.log(mOptions);
$('#cmessage').atwho({
at: "@",
displayTpl: "<li>${username}<small> ${name}</small></li>",
insertTpl: "${atwho-at}${username}",
callbacks: {
remoteFilter: function(query, callb... |
:bug: Fix mixin before declaration issues
Add check for declaration node content type
Fixes #227
Fixes #230 | 'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'mixins-before-declarations',
'defaults': {
'exclude': [
'breakpoint',
'mq'
]
},
'detect': function (ast, parser) {
var result = [],
error;
ast.traverseByType('include', function (node, i, parent... | 'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'mixins-before-declarations',
'defaults': {
'exclude': [
'breakpoint',
'mq'
]
},
'detect': function (ast, parser) {
var result = [],
error;
ast.traverseByType('include', function (node, i, parent... |
Use Form::checkbox() helper instead of raw HTML in login form. | @extends('layouts.application.guest')
@section('content')
<form action="{{ route('dashboard.user.login') }}" id="loginForm" method="post">
{{ csrf_field() }}
<div>
<img src="{{ asset('images/login-dummy-avatar.png') }}" class="dummy-avatar"/>
</div>
@php($isLoginSet = ... | @extends('layouts.application.guest')
@section('content')
<form action="{{ route('dashboard.user.login') }}" id="loginForm" method="post">
{{ csrf_field() }}
<div>
<img src="{{ asset('images/login-dummy-avatar.png') }}" class="dummy-avatar"/>
</div>
@php($isLoginSet = ... |
Fix incorrect attributes in ARGparams class | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ARG parameters class
"""
from __future__ import print_function, division
class ARGparams(object):
"""Class for ARG model parameters.
Attributes
----------
scale : float
rho : float
delta : float
beta : float
theta : list
Raises
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ARG parameters class
"""
from __future__ import print_function, division
class ARGparams(object):
"""Class for ARG model parameters.
Attributes
----------
scale : float
rho : float
delta : float
Methods
-------
convert_to_theta
... |
Switch state immediately to DEAD state/do not schedule it | package org.zalando.nakadi.service.subscription.state;
import org.zalando.nakadi.service.subscription.StreamingContext;
import javax.annotation.Nullable;
import java.io.IOException;
public class CleanupState extends State {
private final Exception exception;
public CleanupState(@Nullable final Exception e) ... | package org.zalando.nakadi.service.subscription.state;
import org.zalando.nakadi.service.subscription.StreamingContext;
import javax.annotation.Nullable;
import java.io.IOException;
public class CleanupState extends State {
private final Exception exception;
public CleanupState(@Nullable final Exception e) ... |
Add a backward-compatibility shim to lessen the burden upgrading from 0.4 to 0.5 |
class TypeRegistered(type):
"""
As classes of this metaclass are created, they keep a registry in the
base class of all handler referenced by the keys in cls._handles.
"""
def __init__(cls, name, bases, namespace):
super(TypeRegistered, cls).__init__(name, bases, namespace)
if not h... |
class TypeRegistered(type):
"""
As classes of this metaclass are created, they keep a registry in the
base class of all handler referenced by the keys in cls._handles.
"""
def __init__(cls, name, bases, namespace):
super(TypeRegistered, cls).__init__(name, bases, namespace)
if not h... |
[DDW-212] Fix missing application menu on Windows build | export default (app, window, openAbout) => (
[{
label: 'Daedalus',
submenu: [{
label: 'About',
click() {
openAbout();
}
}, {
label: 'Close',
accelerator: 'Ctrl+W',
click() {
app.quit();
}
}]
}, {
label: 'Edit',
submenu: [{
label... | export const winLinuxMenu = (app, window, openAbout) => (
[{
label: 'Daedalus',
submenu: [{
label: 'About',
click() {
openAbout();
}
}, {
label: 'Close',
accelerator: 'Ctrl+W',
click() {
app.quit();
}
}]
}, {
label: 'Edit',
submenu: [... |
Add missing import to FTP module | """
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.aut... | """
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers impo... |
Fix styles for centering button in app | import React from 'react';
const styles = {
container: {
backgroundColor: '#EEE',
display: 'flex',
alignItems: 'center',
flexDirection: 'column',
flexWrap: 'wrap',
height: '100%',
width: '100%'
},
header: {
fontSize: '65px',
color: '#333',
textAlign: 'center',
width: '... | import React from 'react';
const styles = {
container: {
backgroundColor: '#EEE',
display: 'flex',
alignItems: 'center',
flexDirection: 'column',
flexWrap: 'wrap',
height: '100%',
width: '100%'
},
header: {
fontSize: '65px',
color: '#333',
textAlign: 'center',
fontWeig... |
Add parameter restriction from tempKey | import { applyMiddleware, compose, createStore } from 'redux'
import thunk from 'redux-thunk'
import { browserHistory } from 'react-router'
import makeRootReducer from './reducers'
import { updateLocation } from './location'
import { fetchApiKey } from './auth'
export default (initialState = {}) => {
// ============... | import { applyMiddleware, compose, createStore } from 'redux'
import thunk from 'redux-thunk'
import { browserHistory } from 'react-router'
import makeRootReducer from './reducers'
import { updateLocation } from './location'
import { fetchApiKey } from './auth'
export default (initialState = {}) => {
// ============... |
Update product listing test to use product ids rather than index | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class ListProductTestCase(TestCase):
fixtures = ['test_fixtures']
def test_url_endpoint(self):
url = reverse('entry-list-products')
... | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class ListProductTestCase(TestCase):
fixtures = ['test_fixtures']
def test_url_endpoint(self):
url = reverse('entry-list-products')
... |
Add filter for tags autocomplete for creating a new bookmark | (function(){
'use strict'
const New = {
templateUrl: 'pages/new/new.html',
controllerAs: 'model',
controller: function(BookmarkFactory, TagFactory, $state, $q){
const model = this;
model.saveBookmark = saveBookmark;
model.loadTags = loadTags;
model.validationClass = validationC... | (function(){
'use strict'
const New = {
templateUrl: 'pages/new/new.html',
controllerAs: 'model',
controller: function(BookmarkFactory, TagFactory, $state){
const model = this;
model.saveBookmark = saveBookmark;
model.loadTags = loadTags;
model.validationClass = validationClass... |
Add phpstorm meta for packages
Former-commit-id: 2d54f8adf92c1a82f7c3d5a02fd0fd18af88ca26 | <?php
namespace Concrete\Core\Support\Symbol;
use Core;
class MetadataGenerator
{
public function render()
{
$file = '<?php namespace PHPSTORM_META { $STATIC_METHOD_TYPES = array(\\Core::make(\'\') => array(' . PHP_EOL;
$bindings = Core::getBindings();
foreach ($bindings as $name => ... | <?php
namespace Concrete\Core\Support\Symbol;
use Core;
class MetadataGenerator
{
public function render()
{
$file = '<?php namespace PHPSTORM_META { $STATIC_METHOD_TYPES = array(\\Core::make(\'\') => array(' . PHP_EOL;
$bindings = Core::getBindings();
foreach ($bindings as $name => ... |
CRM-2628: Optimize Static segments
- fix migration for mySQL | <?php
namespace Oro\Bundle\SegmentBundle\Migrations\Schema\v1_3;
use Psr\Log\LoggerInterface;
use Oro\Bundle\EntityBundle\ORM\DatabaseDriverInterface;
use Oro\Bundle\MigrationBundle\Migration\ArrayLogger;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedMigrationQuery;
class UpdateSegmentSnapshotDataQuery exten... | <?php
namespace Oro\Bundle\SegmentBundle\Migrations\Schema\v1_3;
use Psr\Log\LoggerInterface;
use Oro\Bundle\EntityBundle\ORM\DatabaseDriverInterface;
use Oro\Bundle\MigrationBundle\Migration\ArrayLogger;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedMigrationQuery;
class UpdateSegmentSnapshotDataQuery exten... |
Remove post method from CommandInterceptor binding | <?php
declare(strict_types=1);
namespace BEAR\QueryRepository;
use BEAR\RepositoryModule\Annotation\AbstractCacheControl;
use BEAR\RepositoryModule\Annotation\Cacheable;
use BEAR\RepositoryModule\Annotation\Purge;
use BEAR\RepositoryModule\Annotation\Refresh;
use Ray\Di\AbstractModule;
class QueryRepositoryAopModul... | <?php
declare(strict_types=1);
namespace BEAR\QueryRepository;
use BEAR\RepositoryModule\Annotation\AbstractCacheControl;
use BEAR\RepositoryModule\Annotation\Cacheable;
use BEAR\RepositoryModule\Annotation\Purge;
use BEAR\RepositoryModule\Annotation\Refresh;
use Ray\Di\AbstractModule;
class QueryRepositoryAopModul... |
Fix access denied page styling | import React from 'react';
import AuthStore from '../stores/AuthStore';
import AlertPanel from './AlertPanel';
import Config from '../config/Config';
import MetadataStore from '../stores/MetadataStore';
const METHODS_TO_BIND = [
'handleUserLogout'
];
module.exports = class AccessDeniedPage extends React.Component ... | import React from 'react';
import AuthStore from '../stores/AuthStore';
import AlertPanel from './AlertPanel';
import Config from '../config/Config';
import MetadataStore from '../stores/MetadataStore';
const METHODS_TO_BIND = [
'handleUserLogout'
];
module.exports = class AccessDeniedPage extends React.Component ... |
Add getCartByUser in shared cart. | "use strict";
angular.module("piadinamia").factory("sharedCartService",
["cartService", "$firebase", "Firebase", "FBURL",
function (cartService, $firebase, Firebase, FBURL) {
var myCustomers = [],
myCatalogName,
fburl;
return {
init: function (customers, cat... | "use strict";
angular.module("piadinamia").factory("sharedCartService",
["$firebase", "Firebase", "FBURL",
function ($firebase, Firebase, FBURL) {
var myCustomers = [],
fburl;
return {
init: function (customers, catalogName, userId) {
var customersRef;
... |
Add relationship to user show view | <?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Ramsey\Uuid\Uuid;
class UserController extends Controller
{
public function icon($user)
{
if (!Uuid::isValid($user)) {
abort(422);
}... | <?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Ramsey\Uuid\Uuid;
class UserController extends Controller
{
public function icon($user)
{
if (!Uuid::isValid($user)) {
abort(422);
}... |
Use current user for tests | from .settings import * # noqa
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite',
},
'volatile': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
# Non root user, ROOT for current... | from .settings import * # noqa
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite',
},
'volatile': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
# Non root user (root under devel... |
Fix area order. Algorithm is direction sensitive | iD.svg.Areas = function(projection) {
return function drawAreas(surface, graph, entities, filter) {
var areas = [];
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
if (entity.geometry(graph) === 'area') {
var points = graph.childNodes(en... | iD.svg.Areas = function(projection) {
return function drawAreas(surface, graph, entities, filter) {
var areas = [];
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
if (entity.geometry(graph) === 'area') {
var points = graph.childNodes(en... |
Fix supertest to not overwrite request | var assert = require('chai').assert;
var http = require('http');
var mathServer = require('../lib/mathServer.js');
var request = require('supertest');
process.env.NODE_ENV = 'test';
describe.only('Acceptance test', function () {
var port = 8006;
var server;
before(function () {
server = mathServe... | var assert = require('chai').assert;
var http = require('http');
var mathServer = require('../lib/mathServer.js');
var request = require('supertest');
process.env.NODE_ENV = 'test';
describe('Acceptance test', function () {
var port = 8006;
var server;
before(function () {
process.on('stdout', fu... |
Use ES5 syntax for getter | var get_system_locale_name = require('../build/Release/get_system_locale_name')
module.exports = {
get name() {
var systemLocaleName = get_system_locale_name()
return parseLocaleName(systemLocaleName)
}
}
//
// PRIVATE
//
/**
* POSIX specifies the following format:
* [language[_territory][.codeset][... | var get_system_locale_name = require('../build/Release/get_system_locale_name')
module.exports.__defineGetter__('name', function getSystemLocaleName() {
var systemLocaleName = get_system_locale_name()
return parseLocaleName(systemLocaleName)
})
//
// PRIVATE
//
/**
* POSIX specifies the following format:
* ... |
Fix to improperly disabled docs | #!/usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
main_py = open('flatcat/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
requires = [
'morfessor',
]
setup(name='Morfessor FlatCat',
version=metadata[... | #!/usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
main_py = open('flatcat/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
requires = [
'morfessor',
]
setup(name='Morfessor FlatCat',
version=metadata[... |
CRM-1659: Implement DoctrineExtensions for Oro - fixed php 5.3 incompatible test | <?php
namespace Oro\Tests\DBAL\Types;
use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Types\Type;
use Oro\DBAL\Types\PercentType;
use Oro\Tests\Connection\TestUtil;
class PercentTypeTest extends \PHPUnit_Framework_TestCase
{
/**
* @var PercentType
*/
protected $percentType;
prote... | <?php
namespace Oro\Tests\DBAL\Types;
use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Types\Type;
use Oro\DBAL\Types\PercentType;
use Oro\Tests\Connection\TestUtil;
class PercentTypeTest extends \PHPUnit_Framework_TestCase
{
/**
* @var PercentType
*/
protected $percentType;
prote... |
Add link to Google Scholar page. | <html>
<head>
<title>Papers</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="dvmaincontainer">
<?php include 'menu.php'; ?>
<div id="d... | <html>
<head>
<title>Papers</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="dvmaincontainer">
<?php include 'menu.php'; ?>
<div id="d... |
Add name and id to success action | import _ from 'lodash'
import { take, put, spawn, call, select } from 'redux-saga/effects'
import {
TASK__START,
TASK__PROGRESS,
TASK__ERROR,
TASK__CLEAR,
} from '../../actions'
function* taskSaga(task, action) {
yield put({ ...action, type: TASK__PROGRESS })
try {
const result = yield call(task, acti... | import _ from 'lodash'
import { take, put, spawn, call, select } from 'redux-saga/effects'
import {
TASK__START,
TASK__PROGRESS,
TASK__SUCCESS,
TASK__ERROR,
TASK__CLEAR,
} from '../../actions'
function* taskSaga(task, action) {
yield put({ ...action, type: TASK__PROGRESS })
try {
const result = yiel... |
Fix problems in displaying common style of some article components
Fix problems in displaying common style of some article components | /*eslint no-unused-vars:0*/
'use strict'
import _ from 'lodash'
import React, { Component } from 'react'
import classNames from 'classnames'
import commonStyles from './Common.scss'
import getArticleComponent from './getArticleComponent'
import styles from './Body.scss'
export class Body extends Component {
construc... | /*eslint no-unused-vars:0*/
'use strict'
import _ from 'lodash'
import React, { Component } from 'react'
import classNames from 'classnames'
import commonStyles from './Common.scss'
import getArticleComponent from './getArticleComponent'
import styles from './Body.scss'
export class Body extends Component {
construc... |
Save a bit of space when saving logs | define("game-manager", ["game"], function(Game) {
function GameManager() {
this.games = this.load() || [];
this.next_id = this.getNextId();
}
GameManager.prototype = {
addGame: function() {
var game = new Game(this.next_id++);
this.games.push(game);
... | define("game-manager", ["game"], function(Game) {
function GameManager() {
this.games = this.load() || [];
this.next_id = this.getNextId();
}
GameManager.prototype = {
addGame: function() {
var game = new Game(this.next_id++);
this.games.push(game);
... |
Remove unused if statement for error handling
Producer was trying to catch an error that could not been tested so this
line was removed to avoid dead code. | <?php
namespace MicroQueue;
class Producer
{
private $queue = null;
const ERROR_PRODUCER_QUEUE_IS_FULL = 'Queue reached max number of messages';
const ERROR_PRODUCER_SEND_UNKNOWN_ERROR = 'Unknown error';
const PRODUCER_DEFAULT_MESSAGE_TYPE = 1;
const ERROR_PRODUCER_MESSAGE_BUFFER_OVERFLOW = 'Mess... | <?php
namespace MicroQueue;
class Producer
{
private $queue = null;
const ERROR_PRODUCER_QUEUE_IS_FULL = 'Queue reached max number of messages';
const ERROR_PRODUCER_SEND_UNKNOWN_ERROR = 'Unknown error';
const PRODUCER_DEFAULT_MESSAGE_TYPE = 1;
const ERROR_PRODUCER_MESSAGE_BUFFER_OVERFLOW = 'Mess... |
Include mask size on docker CIDR. | 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... |
Fix layer model serialize method to use new organization | cinema.models.LayerModel = Backbone.Model.extend({
constructor: function (defaults, options) {
Backbone.Model.call(this, {}, options);
if (typeof defaults === 'string') {
this.setFromString(defaults);
} else if (defaults) {
this.set('state', defaults);
}
... | cinema.models.LayerModel = Backbone.Model.extend({
constructor: function (defaults, options) {
Backbone.Model.call(this, {}, options);
if (typeof defaults === 'string') {
this.setFromString(defaults);
} else if (defaults) {
this.set('state', defaults);
}
... |
Add actions to start vs computer
Change onClick action handlers for buttons | import React from "react";
import Container from "./Container.js";
import Button from "./../Shared/Button.js";
import setCurrentScreenAction from "../../actions/ScreenActions.js";
import { GAME_SCREEN } from "../../actions/ScreenActions.js";
import {setGameModeAction} from "../../actions/GameActions.js";
import {VS_... | import React from "react";
import Container from "./Container.js";
import Button from "./../Shared/Button.js";
import setCurrentScreenAction from "../../actions/ScreenActions.js";
import { GAME_SCREEN } from "../../actions/ScreenActions.js";
const screenTitle = "Tic Tac Toe React";
const MenuScreen = React.createCl... |
Fix Pipeline Args Bug on dict length | #!/usr/bin/python
# -*- coding: utf-8 -*-
import random
from EmeraldAI.Entities.BaseObject import BaseObject
class PipelineArgs(BaseObject):
def __init__(self, input):
# Original Input
self.Input = input
self.Normalized = input
# Input Language | List of EmeraldAI.Entities.BaseOb... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import random
from EmeraldAI.Entities.BaseObject import BaseObject
class PipelineArgs(BaseObject):
def __init__(self, input):
# Original Input
self.Input = input
self.Normalized = input
# Input Language | List of EmeraldAI.Entities.BaseOb... |
Fix for the jobqueue task. | <?php
namespace BasilFX\JobQueue\Contrib;
use Phalcon\CLI\Task;
use BasilFX\JobQueue\Job;
use BasilFX\JobQueue\Exception;
/**
* Phalcon JobQueue related tasks.
*/
class PhalconTask extends Task
{
/**
* Start the job broker loop.
*/
public function mainAction()
{
$running = true;
... | <?php
namespace BasilFX\JobQueue\Contrib;
use Phalcon\CLI\Task;
use BasilFX\JobQueue\Job;
use BasilFX\JobQueue\Exception;
/**
* @description("Job queue tasks runner")
*/
class JobQueueTask extends Task
{
/**
* Start the job broker loop.
*
* @description("Spawn a new worker process to handle que... |
Add tension support to the Line series component | (function(d3, fc) {
'use strict';
fc.series.line = function() {
// convenience functions that return the x & y screen coords for a given point
var x = function(d) { return line.xScale.value(line.xValue.value(d)); };
var y = function(d) { return line.yScale.value(line.yValue.value(d)); ... | (function(d3, fc) {
'use strict';
fc.series.line = function() {
// convenience functions that return the x & y screen coords for a given point
var x = function(d) { return line.xScale.value(line.xValue.value(d)); };
var y = function(d) { return line.yScale.value(line.yValue.value(d)); ... |
Index forks only after their description has been set | <?php
namespace phorkie;
class Forker
{
public function forkLocal($repo)
{
$new = $this->fork($repo->gitDir);
\copy($repo->gitDir . '/description', $new->gitDir . '/description');
$this->index($new);
return $new;
}
public function forkRemote($cloneUrl, $originalUrl)
... | <?php
namespace phorkie;
class Forker
{
public function forkLocal($repo)
{
$new = $this->fork($repo->gitDir);
\copy($repo->gitDir . '/description', $new->gitDir . '/description');
return $new;
}
public function forkRemote($cloneUrl, $originalUrl)
{
$new = $this->for... |
Trim whitespace from podcast titles | if (!cbus.hasOwnProperty("server")) { cbus.server = {} }
(function() {
const request = require("request");
const x2j = require("xml2js");
const path = require("path");
cbus.server.getPodcastInfo = function(podcastUrl, callback) {
var podcastData = {};
request({
url: podcastUrl,
... | if (!cbus.hasOwnProperty("server")) { cbus.server = {} }
(function() {
const request = require("request");
const x2j = require("xml2js");
const path = require("path");
cbus.server.getPodcastInfo = function(podcastUrl, callback) {
var podcastData = {};
request({
url: podcastUrl,
... |
Update user roles in store after owner transfer
Closes #3466
- Transferring the owner role is now done via a separate
endpoint and not through Ember-Data. As a result the
user role data needs to be updated manually.
- Updated the owner endpoint to return a response body
containing the updated user objects.
- Up... | var TransferOwnerController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var user = this.get('model'),
url = this.get('ghostPaths.url').api('users', 'owner'),
self = this;
self.get('popover').closePopovers();
ic.aja... | var TransferOwnerController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var user = this.get('model'),
url = this.get('ghostPaths.url').api('users', 'owner'),
self = this;
self.get('popover').closePopovers();
ic.aja... |
Use __destruct to validate implicitly. | <?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
* @var AssertionBuilder
*/
pro... | <?php namespace Essence;
use Closure;
class Essence
{
/**
* @var array
*/
protected $configuration = [
"exception" => "Essence\Exceptions\AssertionException",
];
/**
* @var array
*/
protected $defaultConfiguration;
/**
* @return Essence
*/
public fu... |
Increase version so that my tests can run... :-] | from setuptools import setup, find_packages
setup(
name='tw2.wysihtml5',
version='0.3',
description='WYSIHTML5 widget for ToscaWidgets2',
author='Moritz Schlarb',
author_email='mail@moritz-schlarb.de',
url='https://github.com/toscawidgets/tw2.wysihtml5',
install_requires=[
"tw2.core... | from setuptools import setup, find_packages
setup(
name='tw2.wysihtml5',
version='0.2',
description='WYSIHTML5 widget for ToscaWidgets2',
author='Moritz Schlarb',
author_email='mail@moritz-schlarb.de',
url='https://github.com/toscawidgets/tw2.wysihtml5',
install_requires=[
"tw2.core... |
Send methods need to return the result
Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de> | class AbstractObject(object):
def __init__(self):
pass
def send(self, frame, selector_string, arguments, universe):
# Turn the selector string into a selector
selector = universe.symbol_for(selector_string)
invokable = self.get_class(universe).lookup_invokable(selec... | class AbstractObject(object):
def __init__(self):
pass
def send(self, frame, selector_string, arguments, universe):
# Turn the selector string into a selector
selector = universe.symbol_for(selector_string)
invokable = self.get_class(universe).lookup_invokable(selec... |
Add verbose name for SLURM package [WAL-1141] | from decimal import Decimal
from django.db import models
from django.core.validators import MinValueValidator
from django.utils.translation import ugettext_lazy as _
from nodeconductor.structure import models as structure_models
from nodeconductor_assembly_waldur.common import mixins as common_mixins
class SlurmPac... | from decimal import Decimal
from django.db import models
from django.core.validators import MinValueValidator
from django.utils.translation import ugettext_lazy as _
from nodeconductor.structure import models as structure_models
from nodeconductor_assembly_waldur.common import mixins as common_mixins
class SlurmPac... |
Handle single param definition (following Yahoo! changes) | # pipeurlbuilder.py
#
import urllib
from pipe2py import util
def pipe_urlbuilder(context, _INPUT, conf, **kwargs):
"""This source builds a url and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
BASE -- base
PATH -- path elements
... | # pipeurlbuilder.py
#
import urllib
from pipe2py import util
def pipe_urlbuilder(context, _INPUT, conf, **kwargs):
"""This source builds a url and yields it forever.
Keyword arguments:
context -- pipeline context
_INPUT -- not used
conf:
BASE -- base
PATH -- path elements
... |
Add index and rename foreign key. | <?php
declare(strict_types=1);
return [
[
'table' => 'schema_generator_comment',
'columns' => [
'id' => ['type' => 'integer'],
'title' => ['type' => 'string', 'null' => true],
],
],
[
'table' => 'schema_generator',
'columns' => [
'... | <?php
declare(strict_types=1);
return [
[
'table' => 'schema_generator_comment',
'columns' => [
'id' => ['type' => 'integer'],
'title' => ['type' => 'string', 'null' => true],
],
],
[
'table' => 'schema_generator',
'columns' => [
'... |
Implement hashCode() corresponding to the equals() implementation | package org.bouncycastle.crypto.params;
public class GOST3410ValidationParameters
{
private int x0;
private int c;
private long x0L;
private long cL;
public GOST3410ValidationParameters(
int x0,
int c)
{
this.x0 = x0;
this.c = c;
}
public GOST3410Val... | package org.bouncycastle.crypto.params;
public class GOST3410ValidationParameters
{
private int x0;
private int c;
private long x0L;
private long cL;
public GOST3410ValidationParameters(
int x0,
int c)
{
this.x0 = x0;
this.c = c;
}
public GOST3410Val... |
Revert "cleaned up code a little"
This reverts commit 7ddff91c9736bcedb7c03bb036ade86776885079. | package com.lagopusempire.lagopuscommandsystem.parsing;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author MrZoraman
*/
public abstract class SyntaxParserBase
{
private final String script;
private final StringBuilder builder = new StringBuilder();
private final List<String> elemen... | package com.lagopusempire.lagopuscommandsystem.parsing;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author MrZoraman
*/
public abstract class SyntaxParserBase
{
private final String script;
private final StringBuilder builder = new StringBuilder();
private final List<String> elemen... |
Fix scoper code not working on PHP < 8 | <?php
declare( strict_types=1 );
use Isolated\Symfony\Component\Finder\Finder;
$symfonyPolyfills = ( static function (): array {
$files = [];
foreach (
Finder::create()
->files()
->in( __DIR__ . '/vendor/symfony/polyfill-*' )
->name( 'bootstrap.php' )
->name( 'bootstrap80.php' ) a... | <?php
declare( strict_types=1 );
use Isolated\Symfony\Component\Finder\Finder;
$polyfillsBootstrap = Finder::create()
->files()
->in( __DIR__ . '/vendor/symfony/polyfill-*' )
->name( 'bootstrap.php' )
->na... |
Fix header comparison debug output | <?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyrig... | <?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyrig... |
Remove indentation level for easier review | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
def copycode(template, changes):
if hasattr(code, "replace"):
return template.replace(**{"co_" + k : v for k, v in changes.items()})
names = [
"argcount", "nlocals", "stacksize", "flags", "code"... | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
def copycode(template, changes):
if hasattr(code, "replace"):
return template.replace(**{"co_" + k : v for k, v in changes.items()})
else:
names = [
"argcount", "nlocals", "stacksize... |
Lib: Move things, clean up stuff... | /*
* tuxedo
* https://github.com/goliatone/tuxedo
* Created with gbase.
* Copyright (c) 2014 goliatone
* Licensed under the MIT license.
*/
/* jshint strict: false, plusplus: true */
/*global define: false, require: false, module: false, exports: false */
var Handlebars = require('handlebars'),
helpers = requ... | /*
* tuxedo
* https://github.com/goliatone/tuxedo
* Created with gbase.
* Copyright (c) 2014 goliatone
* Licensed under the MIT license.
*/
/* jshint strict: false, plusplus: true */
/*global define: false, require: false, module: false, exports: false */
var Handlebars = require('handlebars'),
helpers = requ... |
Change if statement to method call instead compare | <?php
namespace Furniture\UserBundle\Killer\Subscriber;
use Furniture\UserBundle\Killer\Killer;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInt... | <?php
namespace Furniture\UserBundle\Killer\Subscriber;
use Furniture\UserBundle\Killer\Killer;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInt... |
Update cancel old job message | from __future__ import unicode_literals, absolute_import
from django.core.management.base import BaseCommand
from ci import models, views, TimeUtils
from datetime import timedelta
class Command(BaseCommand):
help = 'Cancel old Civet jobs. When a specific civet client is no longer running, it can leave jobs lying a... | from __future__ import unicode_literals, absolute_import
from django.core.management.base import BaseCommand
from ci import models, views, TimeUtils
from datetime import timedelta
class Command(BaseCommand):
help = 'Cancel old Civet jobs. When a specific civet client is no longer running, it can leave jobs lying a... |
Make comment about time accuracy more universal | import time
from influxdb import InfluxDBClient
from influxdb import SeriesHelper
from . import config
# expects Cozify devices type json data
def getMultisensorData(data):
out = []
for device in data:
state=data[device]['state']
devtype = state['type']
if devtype == 'STATE_MULTI_SEN... | import time
from influxdb import InfluxDBClient
from influxdb import SeriesHelper
from . import config
# expects Cozify devices type json data
def getMultisensorData(data):
out = []
for device in data:
state=data[device]['state']
devtype = state['type']
if devtype == 'STATE_MULTI_SEN... |
Add annotations about expected outcomes | package sfBugsNew;
import edu.umd.cs.findbugs.annotations.Confidence;
import edu.umd.cs.findbugs.annotations.DesireNoWarning;
import edu.umd.cs.findbugs.annotations.NoWarning;
public class Bug1242 {
public static class Child extends Parent<Something> {
@Override
@DesireNoWarning("BC_UNCONFIRMED_C... | package sfBugsNew;
import java.io.Serializable;
public class Bug1242 {
public static class Child extends Parent<Something>
{
@Override
public Something getDuplicateValue()
{
Something value = super.getDuplicateValue();
System.err.println("getValue... |
Prepare for Yii2 2.0 RC | <?php
namespace gilek\gtreetable;
use yii\web\AssetBundle;
class GTreeTableAsset extends AssetBundle {
/**
* @inheritdoc
*/
public $sourcePath = '@gilek/gtreetable/gtreetable';
/**
* @inheritdoc
*/
public $jsOptions = [
'position' => \yii\web\View::POS_HEAD
]; ... | <?php
namespace gilek\gtreetable;
use yii\web\AssetBundle;
class GTreeTableAsset extends AssetBundle {
/**
* @inheritdoc
*/
public $sourcePath = '@gilek/gtreetable/gtreetable';
/**
* @inheritdoc
*/
public $jsOptions = [
'position' => \yii\web\View::POS_HEAD
]; ... |
Access the shiro username (aka "principal") from the vaadin UI. | package no.priv.bang.ukelonn.impl;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.UI;
import... | package no.priv.bang.ukelonn.impl;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
public class UkelonnUI extends UI {
private s... |
Use production mode for stockflux components build | const path = require('path');
module.exports = {
mode: 'production',
entry: path.resolve('src', 'index.js'),
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
library: 'stockflux-components',
libraryTarget: 'umd'
},
module: {
rules: [
... | const path = require('path');
module.exports = {
mode: 'development', // TODO: production mode
entry: path.resolve('src', 'index.js'),
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
library: 'stockflux-components',
libraryTarget: 'umd'
},
modu... |
[api] Allow for `construct` to be a function. | var assert = require('assert');
module.exports = function (options) {
options = options || {};
var Transport = options.Transport;
var name = Transport.name || options.name;
var construct = options.construct;
var instance;
beforeEach(function () {
var create = typeof construct === 'function'
? c... | var assert = require('assert');
module.exports = function (options) {
options = options || {};
var Transport = options.Transport;
var name = Transport.name || options.name;
var construct = options.construct;
var instance;
beforeEach(function () {
instance = new Transport(construct);
});
// TODO ... |
Remove call to method MemberId::any. | <?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace Hexagonal\DomainEvents;
use Ewallet\DataBuilders\A;
use DateTime;
use Ewallet\Accounts\MemberId;
use Hexagonal\Fakes\DomainEvents\InstantaneousEvent;
use Hexagonal\JmsSeria... | <?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace Hexagonal\DomainEvents;
use Ewallet\DataBuilders\A;
use DateTime;
use Ewallet\Accounts\MemberId;
use Hexagonal\Fakes\DomainEvents\InstantaneousEvent;
use Hexagonal\JmsSeria... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.