commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
06789a319c8cffc60e6642215bd1b1bb7949f659 | Make conservative CI procedure more verbose in long-running section | Confidence.py | Confidence.py | #!/usr/bin/env python
# Generic procedures used in the construction of confidence intervals
# Daniel Klein, 2015-11-20
import numpy as np
from Utility import logsumexp
def invert_test(theta_grid, test_val, crit):
theta_l_min, theta_l_max = min(theta_grid), max(theta_grid)
C_alpha = theta_grid[test_val > cr... | Python | 0.000979 | @@ -1101,24 +1101,111 @@
ape((L, 1))%0A
+ if verbose:%0A print 'X: t_min = %25.2f, t_max = %25.2f' %25 (t_X.min(), t_X.max())%0A
%0A
@@ -1197,24 +1197,24 @@
))%0A %0A
-
# Statis
@@ -1354,33 +1354,33 @@
%5D = 0.0%0A for
-l
+k
in range(L):%0A
@@ -1365,33 +1365,33 @@
for k in... |
d006711787d018ed401ba003d3472b8a0e843437 | Add documentation for ignoring empty strings | stringinfo.py | stringinfo.py | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
Usage:
stringinfo [options] [--] [STRING]...
Options:
STRING The strings for which you want information. If none are given, read from stdin upto EOF.
--list List all plugins, with their descriptions and whether they're default or not
--all R... | Python | 0.000002 | @@ -202,16 +202,43 @@
pto EOF.
+ Empty strings are ignored.
%0A--list
|
a6ac71c7a3c1ac1fd3794a55c47ad86fe014cf73 | Update RateLimit.py | Cogs/RateLimit.py | Cogs/RateLimit.py | import asyncio
import discord
import os
import time
from datetime import datetime
from discord.ext import commands
def setup(bot):
# Add the bot and deps
settings = bot.get_cog("Settings")
bot.add_cog(RateLimit(bot, settings))
# This is the RateLimit module. It keeps users from being able to spam c... | Python | 0.000001 | @@ -1535,24 +1535,79 @@
Command%22))%0D%0A
+%09%09# None fix%0D%0A%09%09if lastTime == None:%0D%0A%09%09%09lastTime = 0%0D%0A
%09%09if not sel
|
8d4a74bd8bad2fa894e6d34a562b4b61fe8f2863 | update 2 | superClock.py | superClock.py | #This is My Nest but it will slowly be converted to superClock!
import urllib
import urllib2
import sys
import json
import time
import requests
from Adafruit_7SegmentPlus import SevenSegment
# Make sure your higher level directory has the JSON file called passwordFile.json
# The file should contain the information in... | Python | 0 | @@ -6372,17 +6372,17 @@
age temp
-
+%22
%0Aprint l
|
8cdde6aebcf7f8d5534d6e979c78950783def229 | exclude repos without a dominant language from cnt | metrics/charsheet/charsheet/views.py | metrics/charsheet/charsheet/views.py | from pyramid.httpexceptions import (
HTTPFound,
HTTPNotFound,
)
from pyramid.response import Response
from pyramid.view import view_config
import hashlib
import operator
import random
import urllib
from pygithub3 import Github
import forms
@view_config(route_name='home', renderer='home.mak')
def home_v... | Python | 0.000004 | @@ -2282,16 +2282,167 @@
ge%5D += 1
+%0A # Don't want no None languages in mah language dict%0A if None in language_count.keys():%0A del language_count%5BNone%5D
%0A%0A
|
9e7cd9f13abb29ff8458407b905d522548eaf5c9 | Refactor check_executables_have_shebangs for git ls-files reuse | pre_commit_hooks/check_executables_have_shebangs.py | pre_commit_hooks/check_executables_have_shebangs.py | """Check that executable text files have a shebang."""
import argparse
import shlex
import sys
from typing import List
from typing import Optional
from typing import Sequence
from typing import Set
from pre_commit_hooks.util import cmd_output
from pre_commit_hooks.util import zsplit
EXECUTABLE_VALUES = frozenset(('1'... | Python | 0 | @@ -107,20 +107,79 @@
import
-List
+Generator%0Afrom typing import List%0Afrom typing import NamedTuple
%0Afrom ty
@@ -632,31 +632,24 @@
if not
-_check_
has_shebang(
@@ -738,31 +738,87 @@
v%0A%0A%0A
-def _check_git
+class GitLsFile(NamedTuple):%0A mode: str%0A filename: str%0A%0A%0Adef git_ls
_file
... |
5eeab4e458e7af3895525dcc08017eb855308723 | remove extra s typo | autocms/stats.py | autocms/stats.py | """Harvesting of persistent statsitical records."""
import os
import time
import importlib
from .core import load_records
def harvest_default_stats(records, config):
"""Add a row to the long term statistics record for a given test."""
now = int(time.time())
harvest_time = now - int(config['AUTOCMS_STAT_... | Python | 0.999176 | @@ -814,33 +814,32 @@
f job.is_success
-s
())%0A failures
@@ -892,17 +892,16 @@
_success
-s
())%0A
|
a9e4954d8f34d12c9352702337d8cd5efd0134dd | Add test for status | test/test_commands.py | test/test_commands.py | import os
import pytest
from mock import patch
from workspace.commands.bump import bump, _latest_module_version
from workspace.commands.checkout import checkout
from workspace.commands.clean import clean
from workspace.commands.commit import commit
from workspace.commands.diff import diff
from workspace.commands.log ... | Python | 0.000001 | @@ -479,16 +479,61 @@
st_test%0A
+from workspace.commands.status import status%0A
from wor
@@ -841,16 +841,32 @@
temExit)
+, (status, None)
%5D)%0Adef t
@@ -873,14 +873,8 @@
est_
-basic_
sani
|
c14b5ece7446bb88959b75281ba5dd30c66843ad | Change list command to optionally accept an alternate template directory to search | scriptorium/__main__.py | scriptorium/__main__.py | #!/usr/bin/env python
#Script to build a scriptorium paper in a cross-platform friendly fashion
import scriptorium
import argparse
import subprocess
import os
import os.path
import glob
import re
import shutil
import sys
BIN_DIR = os.path.dirname(os.path.realpath(__file__))
BASE_DIR = os.path.abspath(os.path.join(BIN... | Python | 0 | @@ -1262,29 +1262,33 @@
mplates(
-TEMPLATES_DIR
+args.template_dir
)%0A fo
|
2e85a1be0e76060e86d09cb6cdbd4af36aa85bfe | Update error message in Sitebuild.build() | drupdates/sitebuild.py | drupdates/sitebuild.py | """ Drupdates Site building module. """
import git, os, subprocess
from drupdates.utils import Utils
from drupdates.settings import Settings
from drupdates.settings import DrupdatesError
from drupdates.drush import Drush
from drupdates.constructors.datastores import Datastores
from git import Repo
class DrupdatesBuild... | Python | 0 | @@ -1567,17 +1567,17 @@
Error: %7B
-2
+0
%7D%22.forma
|
2d392d8c107c9055e6b62bb365158b1001872cde | Fix deprecation warnings. | emdp/analytic.py | emdp/analytic.py | """
Tools to get analytic solutions from MDPs
"""
import numpy as np
def calculate_P_pi(P, pi):
"""
calculates P_pi
P_pi(s,t) = \sum_a pi(s,a) p(s, a, t)
:param P: transition matrix of size |S|x|A|x|S|
:param pi: matrix of size |S| x |A| indicating the policy
:return: a matrix of size |S| x |S... | Python | 0.000002 | @@ -87,36 +87,37 @@
_pi(P, pi):%0A
+r
%22%22%22%0A
-
calculates P
@@ -394,24 +394,25 @@
R, pi):%0A
+r
%22%22%22%0A calc
@@ -1018,32 +1018,33 @@
pi, gamma):%0A
+r
%22%22%22%0A Calculat
@@ -1498,16 +1498,16 @@
gamma)%0A
-
retu
@@ -1544,28 +1544,29 @@
or_representation(Phi, R_pi)
+%0A
|
c8f774ea3455af057736166757f831407711ae67 | Bump to 0.4. | emds/__init__.py | emds/__init__.py | __version__ = '0.3' | Python | 0.000001 | @@ -14,6 +14,6 @@
'0.
-3
+4
'
|
033ec1c5c7d44c54136541aa0e1bd8c73e3c1163 | update test_unitcell | test/test_unitCell.py | test/test_unitCell.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from udkm1Dsim.atoms import Atom
from udkm1Dsim.unitCell import UnitCell
from pint import UnitRegistry
u = UnitRegistry()
u.default_format = '~P'
from numpy import array
def test_unit_cell():
Fe = Atom('Fe')
uc = UnitCell('uc', 'Unit Cell', 2.86*u.angstrom, heat_... | Python | 0.000001 | @@ -1067,550 +1067,4 @@
ps)%0A
- assert uc.get_property_dict(types='phonon') == %7B'_c_axis': 2.86e-10,%0A '_mass': 2.2674165653283783e-26,%0A '_phonon_damping': 0.0,%0A ... |
b6d161e54e9b398f79f417ac14ec65e5fdb609d3 | remove pre tag in emit init | emit/__init__.py | emit/__init__.py | __version__ = '0.4.0pre'
from emit.router.core import Router
| Python | 0 | @@ -17,11 +17,8 @@
.4.0
-pre
'%0A%0Af
|
19fa44530adf1fd5456a0be93ea0dddd7e43eb8c | Remove junk import. | Cli_server_tcp.py | Cli_server_tcp.py | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistrib... | Python | 0 | @@ -1511,59 +1511,8 @@
tor%0A
-from twisted.internet.defer import inlineCallbacks%0A
from
|
04068b4f364526e9d9c023bcbc4171b3353f478a | Add shape argument | tests/cupy_tests/sparse_tests/test_dia.py | tests/cupy_tests/sparse_tests/test_dia.py | import unittest
import numpy
try:
import scipy.sparse # NOQA
scipy_available = True
except ImportError:
scipy_available = False
import cupy
import cupy.sparse
from cupy import testing
def _make(xp, sp, dtype):
data = xp.array([[0, 1, 2], [3, 4, 5]], dtype)
offsets = xp.array([0, -1], 'i')
... | Python | 0.000571 | @@ -2505,18 +2505,36 @@
)%5BNone%5D)
+, shape=self.shape
)%0A
-
%0A @te
@@ -2714,16 +2714,34 @@
ets(xp))
+, shape=self.shape
)%0A%0A @
@@ -2964,16 +2964,34 @@
offsets)
+, shape=self.shape
)%0A%0A @
@@ -3157,32 +3157,32 @@
sp.dia_matrix(%0A
-
(sel
@@ -3201,16 +3201,34 @@
offsets)
+, shape... |
fbba7f7c32f4b587efba2e72c051996d4a69f567 | Update example local_settings votigns per page | website/local_settings_example.py | website/local_settings_example.py | # user settings, included in settings.py
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True
# SECURITY WARNING: Make this unique, and don't share it with anybody.
SECRET_KEY = ''
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgre... | Python | 0 | @@ -1997,17 +1997,17 @@
PAGE = 2
-5
+0
%0ABESLUIT
|
f85e225a4e2401c40c4a97448a8fee9b23386198 | Fix python 3 import compatibility | ckanext/xroad_integration/tests/test_plugin.py | ckanext/xroad_integration/tests/test_plugin.py | """Tests for plugin.py."""
import xroad_mock.xroad_rest_adapter_mock
import pytest
import json
import os
from multiprocessing import Process
from ckanext.xroad_integration.harvesters.xroad_harvester import XRoadHarvesterPlugin
from ckantoolkit.tests.helpers import call_action
from ckanext.harvest.tests.lib import run... | Python | 0 | @@ -21,23 +21,54 @@
py.%22%22%22%0A%0A
-import
+from ckanext.xroad_integration.tests.
xroad_mo
@@ -61,33 +61,40 @@
tests.xroad_mock
-.
+ import
xroad_rest_adapt
@@ -100,17 +100,33 @@
ter_mock
-%0A
+ as adapter_mock
%0Aimport
@@ -1037,30 +1037,8 @@
p =
-xroad_mock.xroad_rest_
adap
|
5900b425b6b23e0733c140f0a509d0f9619bacd9 | Remove unnecessary check that required objects being deserialized to have a key_name. | appengine_django/serializer/python.py | appengine_django/serializer/python.py | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# 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... | Python | 0.998248 | @@ -2621,198 +2621,8 @@
ue)%0A
- if not data%5Bfield.name%5D.name():%0A raise base.DeserializationError(u%22Cannot load Reference with %22%0A %22unnamed key: '%25s'%22 %25 field_value)%0A
|
0070417e170ff67248918243d6aaea248a5d024c | Fix Q3 in exercise 6 checking code | learntools/computer_vision/ex6.py | learntools/computer_vision/ex6.py | from learntools.core import *
import tensorflow as tf
# Free
class Q1(CodingProblem):
_solution = ""
_hint = ""
def check(self):
pass
class Q2A(ThoughtExperiment):
_hint = "Remember that whatever transformation you apply needs at least to keep the classes distinct, but otherwise should more ... | Python | 0.000001 | @@ -1632,24 +1632,83 @@
ngProblem):%0A
+ _solution = %22%22%0A _hint = %22%22%0A def check(self):%0A
pass%0A%0A%0Aq
|
5b26f1441cb182b046ae559cae9817fcb2cfe1b5 | Add new action into property tests (no new bugs found) | siebenapp/tests/test_properties.py | siebenapp/tests/test_properties.py | # coding: utf-8
import os
import sqlite3
from contextlib import closing
import pytest
from hypothesis import given, note, settings
from hypothesis.strategies import lists, sampled_from, composite, choices, text
from siebenapp.enumeration import Enumeration
from siebenapp.goaltree import Goals
from siebenapp.system im... | Python | 0 | @@ -288,16 +288,22 @@
rt Goals
+, Edge
%0Afrom si
@@ -906,16 +906,87 @@
link(),%0A
+ 'toggle_child': lambda g, x: g.toggle_link(edge_type=Edge.PARENT),%0A
%7D%0A%0A%0A@com
|
f178b2378661a25cebe9753cf84d6ea9f3c081a8 | Improve doc for MultivalueEnum. | enum34_custom.py | enum34_custom.py | from enum import Enum, EnumMeta
from functools import total_ordering
class _MultiValueMeta(EnumMeta):
def __init__(self, cls, bases, classdict):
# make sure we only have tuple values, not single values
for member in self.__members__.values():
if not isinstance(member.value, tuple):
... | Python | 0 | @@ -739,17 +739,16 @@
e__))%0A%0A%0A
-%0A
class Mu
@@ -782,16 +782,21 @@
s=_Multi
+Value
Meta):%0A
@@ -833,37 +833,122 @@
ers
-are declared as tuples.
+can have multiple values.%0A You can reference a member by any of its value in the associated tuple.%0A
%22%22%22%0A%0A%0A
+%0A%0A
@tot
|
cf472cc43c4473ad7403bda64302d1170ee6874e | Save user timezone | controllers/preferences.py | controllers/preferences.py | from bo import *
from database import *
class ShowPreferences(boRequestHandler):
def get(self):
self.view('preferences', 'preferences.html', {
'person': Person().current,
'preferences': UserPreferences().current,
})
def post(self):
UserPreferences().set_languag... | Python | 0.000001 | @@ -1,12 +1,39 @@
+from pytz.gae import pytz%0A%0A
from bo impo
@@ -50,16 +50,23 @@
database
+.person
import
@@ -290,99 +290,223 @@
-%7D)%0A%0A def post(self):%0A UserPreferences().set_language(self.request.get('language')
+ 'timezones': pytz.common_timezones,%0A %7D)%0A%0A def post(se... |
ab4cc4fb85c8616de0be53d0a95ad8096ac0cc0c | set up the page and layout for Dashboard:Team Application Overview | Dashboard/urls.py | Dashboard/urls.py | from django.conf.urls import url
# View Imports
from . import views
app_name = "dashboard"
urlpatterns = [
url(r'^$', views.DashboardIndex.as_view(), name='index'),
url(r'^experts/$', views.expert_management, name='manage_experts'),
url(r'^experts/(?P<username>.+)/$', views.expert_management, name="exper... | Python | 0 | @@ -510,17 +510,21 @@
?P%3Cslug%3E
-.
+%5B-%5Cw%5D
+)/$', v
|
f0bec02a6e2516ffd11d43b089576c0463d8d51f | Update denormalizer | project/apps/api/management/commands/denormalize.py | project/apps/api/management/commands/denormalize.py | from django.core.management.base import (
BaseCommand,
)
from apps.api.models import (
Convention,
Contest,
Contestant,
Performance,
Group,
Person,
Singer,
Director,
)
class Command(BaseCommand):
help = "Command to denormailze data."
def handle(self, *args, **options):
... | Python | 0.000027 | @@ -130,16 +130,32 @@
estant,%0A
+ Appearance,%0A
Perf
@@ -178,20 +178,8 @@
up,%0A
- Person,%0A
@@ -200,16 +200,27 @@
rector,%0A
+ Judge,%0A
)%0A%0A%0Aclas
@@ -575,20 +575,20 @@
-ps = Perform
+as_ = Appear
ance
@@ -618,15 +618,16 @@
for
-p
+a
in
-ps
+as_
:%0A
@@ -636,17 +636,17 @@... |
a0027c3623dd992ec5d31a8af51e8cc825d5ecc2 | Fix page delete. | leonardo/module/web/page/views.py | leonardo/module/web/page/views.py |
from __future__ import absolute_import, unicode_literals
from django.http import HttpResponseRedirect
from django.utils.functional import cached_property
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from leonardo import messages
from leonardo.views import *
fro... | Python | 0 | @@ -7124,19 +7124,16 @@
if obj
-ect
.parent:
|
eab481546044bc995eca3dc7d3094c7917d19c20 | Remove hack to make test work on Jenkins, since it still fails. | src/zeit/content/article/edit/browser/tests/test_social.py | src/zeit/content/article/edit/browser/tests/test_social.py | import zeit.cms.testing
import zeit.content.article.edit.browser.testing
import zeit.content.article.testing
class SocialFormTest(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.article.testing.LAYER
def setUp(self):
super(SocialFormTest, self).setUp()
self.browser.open(
... | Python | 0 | @@ -2138,267 +2138,8 @@
t')%0A
- # Autosave sometimes not triggered on Jenkins unless %5Ct is typed twice%0A try:%0A s.waitForElementNotPresent('css=#form-metadata-access .dirty')%0A except AssertionError:%0A s.type('css=#form-metadata-access select', '%5Ct')%0A
|
a28e69abcbd061d1a517885d7c7522634dc89219 | fix typo | essence/world.py | essence/world.py | from sortedcontainers import SortedSet
from .entity import Entity
MISSING = object()
class World(object):
"""World coordinates the entities, components and systems."""
def __init__(self):
self._highest_id_seen = 0
self._database = {}
self._entities = []
self._entities_by_comp... | Python | 0.999991 | @@ -4957,16 +4957,17 @@
Call
+s
update
each
@@ -4962,16 +4962,19 @@
update
+on
each of
|
60e2503bde822fdcea91c3d0a8e6ddb0f67d0d79 | update scripts | scripts/deploy_repos.py | scripts/deploy_repos.py | #!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "core"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cmudbac.settings")
import django
django.setup()
from django.db.models import Q
from libr... | Python | 0.000001 | @@ -586,84 +586,8 @@
= 3)
-.filter(Q(latest_attempt__result = 'DE') %7C Q(latest_attempt__result = 'OK'))
:%0A
@@ -859,16 +859,131 @@
ontinue%0A
+ n = len(Attempt.objects.filter(repo = repo).filter(result = 'OK'))%0A if n == 0:%0A continue%0A
|
bca6f6041e9f49d1d25d7a9c4cb88080d88c45b1 | Comment concerning differences in keys per path | dumper/invalidation.py | dumper/invalidation.py | import dumper.utils
def invalidate_paths(paths):
'''
Invalidate all pages for a certain path.
'''
for path in paths:
for key in all_cache_keys_from_path(path):
dumper.utils.cache.delete(key)
def all_cache_keys_from_path(path):
return [dumper.utils.cache_key(path, method) for ... | Python | 0 | @@ -256,24 +256,375 @@
path(path):%0A
+ '''%0A Each path can actually have multiple cached entries, varying based on different HTTP%0A methods. So a GET request will have a different cached response from a HEAD request.%0A %0A In order to invalidate a path, we must first know all the different cache key... |
d649ff7c1d63c33c1ea25a1d3916b441e7ccc6ea | Add backwards compatible ctor for HttpChallange | azure-keyvault/azure/keyvault/custom/http_challenge.py | azure-keyvault/azure/keyvault/custom/http_challenge.py | #---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... | Python | 0.00025 | @@ -552,16 +552,21 @@
_headers
+=None
):%0A
@@ -1891,32 +1891,113 @@
e parameters')%0A%0A
+ # if the response headers were supplied%0A if response_headers:%0A
# get th
@@ -2062,24 +2062,28 @@
the headers%0A
+
self
@@ -2161,16 +2161,20 @@
, None)%0A
+
|
2b7dbcd01a4d208f83204fc4323ddff055e4a87e | Move common tests to a base reusable class. | test_ngram_profile.py | test_ngram_profile.py | # -*- coding: utf-8 -*-
import os
import json
import unittest
from ngram_profile import NGramProfile, CharNGramProfile
class TestNGramProfile(unittest.TestCase):
def test_init(self):
profile = NGramProfile()
self.assertEqual(len(profile), 0)
def test_json_roundtrip(self):
json_prof... | Python | 0 | @@ -61,58 +61,22 @@
st%0A%0A
-from ngram_profile import NGramProfile, CharNGramP
+import ngram_p
rofi
@@ -86,20 +86,22 @@
%0A%0Aclass
-Test
+Common
NGramPro
@@ -108,28 +108,47 @@
file
-(unittest.TestCase):
+Tests(object):%0A%0A profileClass = None
%0A%0A
@@ -184,36 +184,41 @@
profile =
-NGramP
+self.p
... |
986dd0ea53fe19d2ff9ffe7a41b71c3d8bfbd926 | Fix python build util script exception | build/android/gyp/util/build_utils.py | build/android/gyp/util/build_utils.py | # 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.
import contextlib
import fnmatch
import json
import os
import pipes
import shlex
import shutil
import subprocess
import sys
import tempfile
import zipfile
C... | Python | 0.000746 | @@ -4646,36 +4646,32 @@
onical zip path:
- %25s,
%25s' %25 name)%0A i
@@ -4736,12 +4736,8 @@
ath:
- %25s,
%25s'
|
0f8389dd997c53e729bf51685665f1092bcb5905 | Update output in test_export_best to reflect change to integration | test/command_line/test_export_best.py | test/command_line/test_export_best.py | from __future__ import absolute_import, division, print_function
import os
import procrunner
def test_export_best(dials_regression, run_in_tmpdir):
path = os.path.join(dials_regression, "centroid_test_data", "centroid_####.cbf")
result = procrunner.run(["dials.import", "template=" + path])
assert not re... | Python | 0 | @@ -2000,24 +2000,24 @@
-22.61
+15.92
1
-5.76
+7.13
%0A -2
@@ -2038,23 +2038,23 @@
6
-9.46
+4.30
1
-7.54
+8.73
%0A -2
@@ -2075,23 +2075,23 @@
-0.55
+2.79
1
-5.56
+6.43
%0A -2
@@ -2112,22 +2112,22 @@
-
-2.59
+0.50
1
-5.0
+6.6
3%0A -
@@ -2148,24 +2148,24 @@
-19.99... |
ce4b23077e7292f3bbfec4342c1f576d985ab05c | Add required to input if exists | dynamic_forms/forms.py | dynamic_forms/forms.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
import six
from django import forms
from dynamic_forms.formfields import formfield_registry
from django.forms.fields import BooleanField
import dynamic_forms
from django.utils.html import conditional_escape, format_htm... | Python | 0.000005 | @@ -1669,16 +1669,103 @@
control'
+%0A if field.required:%0A field.widget.attrs%5B'required'%5D = 'true'
%0A%0A de
|
6d4ff7baa6746b7dfa37d740ef14f1d3b334eea7 | normalize triplet loss by number of triplets | pyannote/audio/embedding/approaches/triplet_loss.py | pyannote/audio/embedding/approaches/triplet_loss.py | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | Python | 0.026411 | @@ -1637,17 +1637,19 @@
s = sigm
-a
+oid
(loss)%0A%0A
@@ -4879,16 +4879,42 @@
oss = 0.
+%0A n_comparisons = 0
%0A%0A
@@ -5756,16 +5756,70 @@
ive, :%5D)
+%0A n_comparisons = n_comparisons + 1
%0A%0A
@@ -5827,13 +5827,29 @@
return loss
+ / n_comparisons
%0A
|
d1232473ecb31eb2b85b67e54d5939093233f2bf | Print client pk in list_sessions command | ncharts/management/commands/list_sessions.py | ncharts/management/commands/list_sessions.py | from django.core.management.base import NoArgsCommand
from ncharts.models import ClientState
from ncharts import views as nc_views
from django.contrib.sessions.models import Session
class Command(NoArgsCommand):
def handle_noargs(self, **options):
sessions = Session.objects.all()
print("#session... | Python | 0 | @@ -633,18 +633,50 @@
k=%25s
-%22 %25 (sessk
+, client_id=%25d%22 %25 (sessk, sess_dict%5Bsessk%5D
))%0A%0A
|
e72da8231e7a5b05f098db1f78b66b8cb57f27ba | remove checking in autots import (#5489) | python/chronos/src/bigdl/chronos/autots/__init__.py | python/chronos/src/bigdl/chronos/autots/__init__.py | #
# Copyright 2016 The BigDL Authors.
#
# 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 ... | Python | 0 | @@ -599,65 +599,8 @@
ngs%0A
-from bigdl.nano.utils.log4Error import invalidInputError%0A
impo
@@ -661,62 +661,22 @@
-invalidInputError(False,%0A errMsg=
+warnings.warn(
%22Use
@@ -713,27 +713,16 @@
hould %22%0A
-
@@ -772,17 +772,16 @@
iables!%22
-,
%0A
@@ -79... |
07c718d52a5ddfb10bbc4d69fe6c72379a07c2e3 | Use new name for callback_class config option | networking_l2gw/services/l2gateway/plugin.py | networking_l2gw/services/l2gateway/plugin.py | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | Python | 0.836181 | @@ -3596,15 +3596,12 @@
ONF.
-default
+l2gw
_cal
|
cdb0a8549091acae220a46200d1c858b2356fd52 | Modify the help of connection-limit | neutronclient/neutron/v2_0/lb/v2/listener.py | neutronclient/neutron/v2_0/lb/v2/listener.py | # Copyright 2014 Blue Box Group, Inc.
# Copyright 2015 Hewlett-Packard Development Company, L.P.
# 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
#
# htt... | Python | 0.00006 | @@ -1682,11 +1682,16 @@
the
-vip
+listener
. Po
@@ -1711,16 +1711,34 @@
r or -1
+'%0A '
for unli
|
b52a937356f2112ecd5adcdf79ac6430169a735f | fix file close bug causing errors in pypy | new_pymtl/translation_tools/verilator_sim.py | new_pymtl/translation_tools/verilator_sim.py | #===============================================================================
# verilator_sim.py
#===============================================================================
#from verilator_cython import verilog_to_pymtl
from verilator_cffi import verilog_to_pymtl
import verilog
import os
import sys
import fil... | Python | 0 | @@ -886,147 +886,248 @@
#
-Caching avoids regeneration/recompilation%0A if os.path.exists( verilog_file ):%0A verilog.translate( model_inst, open( temp_file, 'w+' )
+Write the output to a temporary file%0A fd = open( temp_file, 'w+' )%0A verilog.translate( model_inst, fd )%0A fd.close()%0A%0A # Check if the... |
b0806c0b8b950a3007107cc58fb21e504cf09427 | Move serial device path to settings | homedisplay/control_milight/management/commands/listen_433.py | homedisplay/control_milight/management/commands/listen_433.py | from django.core.management.base import BaseCommand, CommandError
from control_milight.utils import process_automatic_trigger
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236713": "kitchen",
"7697747": "hall",
... | Python | 0.000001 | @@ -1,12 +1,105 @@
+from control_milight.utils import process_automatic_trigger%0Afrom django.conf import settings%0A
from django.
@@ -156,68 +156,8 @@
ror%0A
-from control_milight.utils import process_automatic_trigger%0A
impo
@@ -524,37 +524,28 @@
ial(
-%22/dev/tty.usbserial-A9007LzM%22
+settings.ARDUINO_433
, 9... |
67a2659848c74dabba42071538c734e6dae3058c | Check if AS connection is valid | eucaops/asops.py | eucaops/asops.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... | Python | 0.000013 | @@ -6315,16 +6315,76 @@
_groups)
+%0A self.debug(%22AS api version: %22 + self.AS.APIVersion)
%0A%0A
|
4a2dec446fe09aa66dad229efb7027cd0ad55bf4 | Add --dump option to pairwise.py | eval/pairwise.py | eval/pairwise.py | #!/usr/bin/env python
import argparse
import csv
import itertools
from concurrent.futures import ProcessPoolExecutor
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score
from collections import defaultdict
from scipy.stats import wilcoxon
parser = argparse.ArgumentParser()
parser.add_... | Python | 0.000002 | @@ -14,16 +14,17 @@
v python
+3
%0A%0Aimport
@@ -61,16 +61,30 @@
ertools%0A
+import pickle%0A
from con
@@ -125,16 +125,36 @@
Executor
+, ThreadPoolExecutor
%0Afrom sk
@@ -441,16 +441,76 @@
_true')%0A
+parser.add_argument('--dump', type=argparse.FileType('wb'))%0A
parser.a
@@ -2534,16 +2534,67 @@
s%5Bpath%5D)
+... |
f041cd9623ef06777189ecd538f5bdb30cf33722 | Fix export_v8_tarball.py to work with python2.7 | tools/export_tarball/export_v8_tarball.py | tools/export_tarball/export_v8_tarball.py | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Creates a tarball with V8 sources, but without .svn directories.
This allows easy packaging of V8, synchronized with browser re... | Python | 0.000272 | @@ -1920,16 +1920,29 @@
ude=None
+, filter=None
):%0A h
|
430799c753bf637acac84a37bae90dd4e2193bd9 | Update account_invoice_refund_reason/tests/test_account_invoice_refund_reason.py | account_invoice_refund_reason/tests/test_account_invoice_refund_reason.py | account_invoice_refund_reason/tests/test_account_invoice_refund_reason.py | # Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
import datetime
class TestAccountInvoiceRefundReason(TransactionCase):
def setUp(self):
sup... | Python | 0 | @@ -1274,24 +1274,25 @@
self.re
+a
son_id = sel
|
aa96df67f6cfc6e6532397c635533cd73ec29fe2 | Add some more debug prints to the WSclient | contrib/python/api/skydive/websocket/client.py | contrib/python/api/skydive/websocket/client.py | #
# Copyright (C) 2017 Red Hat, Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Versi... | Python | 0 | @@ -2471,59 +2471,281 @@
def
-sendWSMessage(self, msg):%0A self.sendMessage(
+debug_send(self, func, arg):%0A LOG.debug(%22Running func %25s%22, func.__name__)%0A func(arg)%0A%0A def sendWSMessage(self, msg):%0A self.factory.client.loop.call_soon(%0A functools.partial(self.de... |
be99482ac9d3395feabb34f41e8b764d7fc15663 | add elapsed time info | apps/fast_noise_seq_upstairs.py | apps/fast_noise_seq_upstairs.py | import matplotlib
matplotlib.use('agg')
import numpy as np
import time
import sys
from kid_readout.utils import data_block,roach_interface,data_file,sweeps
from kid_readout.analysis.resonator import Resonator
#from sim900 import sim900Client
ri = roach_interface.RoachBasebandWide()
#ri.initialize()
ri.set_fft_gain(4)
... | Python | 0.000002 | @@ -3283,24 +3283,96 @@
df.sync()%0A
+ print %22elapsed time:%22, ((time.time()-start_time)/60), %22minutes%22%0A
time
|
270825e739e0662c04181a68d393249acc6e59c5 | FIX reg ganancias no requerido en pagos de clientes | l10n_ar_account_withholding/models/account_payment_group.py | l10n_ar_account_withholding/models/account_payment_group.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, api, fields
class Ac... | Python | 0 | @@ -1249,81 +1249,544 @@
-related='company_id.regimenes_ganancias_ids',%0A readonly=True,%0A
+'afip.tabla_ganancias.alicuotasymontos',%0A compute='_company_regimenes_ganancias',%0A )%0A%0A @api.multi%0A @api.depends('company_id.regimenes_ganancias_ids')%0A def _company_regimenes_gana... |
78b2d04e78e9ab48b56fca3daf582465c62d0b80 | Fix wrong tick count reset | resources/lib/services/playback/progress_manager.py | resources/lib/services/playback/progress_manager.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2019 Stefano Gottardo - @CastagnaIT (original implementation module)
Manages events to send to the netflix service for the progress of the played video
SPDX-License-Identifier: MIT
See LICENSES/MIT... | Python | 0 | @@ -3428,32 +3428,35 @@
self.
-tick_elapsed = 0
+_reset_tick_count()
%0A
@@ -3883,32 +3883,35 @@
self.
-tick_elapsed = 0
+_reset_tick_count()
%0A
@@ -4162,32 +4162,35 @@
self.
-tick_elapsed = 0
+_reset_tick_count()
%0A
@@ -5431,16 +5431,113 @@
time))%0A%0A
+ def _reset_tick_count... |
a3cd9df5c807026ac78de56614d09411991d9573 | Add message limit to subscription lifecycle filtering | subscriptions/management/commands/fix_subscription_lifecycle.py | subscriptions/management/commands/fix_subscription_lifecycle.py | from datetime import datetime
from django.core.management.base import BaseCommand
from django.utils import timezone
import json
from subscriptions.models import Subscription
from subscriptions.tasks import send_next_message
class Command(BaseCommand):
help = ("This command is used when the subscription has falle... | Python | 0 | @@ -1899,16 +1899,289 @@
sets.%22))
+%0A parser.add_argument(%0A %22--messages-limit%22, dest=%22messages_limit%22, default=None, type=int,%0A help=(%22Only apply the action to subscriptions that are behind by%22%0A %22the limit or less than the limit. Defaults to no limit... |
5d083a15a71aac24c3c4d29dd753067a93c62495 | Fix id builtin being overwritten | EasyEuler/data.py | EasyEuler/data.py | import collections
import json
import os
from jinja2 import Environment, FileSystemLoader
from EasyEuler import paths
class ProblemList(collections.Sequence):
def __init__(self, problems):
self._problems = problems
def get(self, id):
if id < 1 or len(self) < id:
# We don't want ... | Python | 0.000001 | @@ -239,24 +239,32 @@
f get(self,
+problem_
id):%0A
@@ -267,16 +267,24 @@
if
+problem_
id %3C 1 o
@@ -297,16 +297,24 @@
self) %3C
+problem_
id:%0A
@@ -354,16 +354,30 @@
e index,
+%0A #
because
@@ -445,16 +445,24 @@
rn self%5B
+problem_
id%5D%0A%0A
@@ -484,16 +484,24 @@
_(sel... |
bce28c0e61a7cf14ef092473dcb195cd436a93c8 | Fix bump parameter passing | scripts/make-release.py | scripts/make-release.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: python make-release.py [bump]
bump parameter is optional, default is patch. Valid values are patch, minor, major.
Copied from: https://raw.githubusercontent.com/mitsuhiko/flask/master/scripts/make-release.py
make-release
~~~~~~~~~~~~
Helper script that perfor... | Python | 0.000001 | @@ -2730,17 +2730,17 @@
argv) %3E
-2
+1
:%0A
@@ -2761,9 +2761,9 @@
rgv%5B
-3
+1
%5D%0A
|
d095e0179befa80c03c83314c6a095d3b0d0bd70 | and , should be optional | IRCMessage.py | IRCMessage.py | # -*- coding: utf-8 -*-
import ServerInfo
from enum import Enum
import re
class TargetTypes(Enum):
CHANNEL = 1
USER = 2
class IRCChannel(object):
def __init__(self, name):
"""
@type name: str
"""
self.Name = name
self.Topic = ''
self.TopicSetBy = ''
... | Python | 0.999967 | @@ -2787,16 +2787,17 @@
('%7B%7D%5B:,%5D
+?
'.format
|
4899188e8eb0676ccf13525ed6562b85878cb0ea | Return attributes in a dictionary rather than in a list | scripts/parse_header.py | scripts/parse_header.py | #!/usr/bin/python
# parse_header.py finds all exported functions in a GDK header and writes them
# to a nice XML file. That file can be used to e.g. generate code for SA-MP natives.
import os
import re
import sys
import xml.dom.minidom
def parse_argument_list(string):
""" For each entry of the arg_list ... | Python | 0.000099 | @@ -1702,16 +1702,40 @@
%09attrs =
+ %7B%7D%0D%0A%09for name, value in
parse_a
@@ -1752,16 +1752,40 @@
comment)
+:%0D%0A%09%09attrs%5Bname%5D = value
%0D%0A%09retur
@@ -2559,16 +2559,24 @@
in attrs
+.items()
:%0D%0A%09%09%09at
|
483a66a693fd119192c12ee63c56a1da406fa3ca | fix templates path | accounts/views.py | accounts/views.py | from django.shortcuts import render
from django.urls import reverse
def profile(response, profile):
return render(response, 'accounts/profile.html')
| Python | 0.000001 | @@ -130,17 +130,16 @@
'account
-s
/profile
|
38d601c8acf8bc1b23e6919223c4d21328dc55cc | remove set_xdr_filter 2nd warning message | test/new_tests/test_set_xdr_filter.py | test/new_tests/test_set_xdr_filter.py | # -*- coding: utf-8 -*-
import pytest
import sys
from aerospike import exception as e
from .test_base_class import TestBaseClass
from aerospike_helpers.expressions import *
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
except:
print("Please install aerospike python client.")
sys.exit... | Python | 0 | @@ -1108,165 +1108,8 @@
xc:%0A
- if (%22XDR-not-configured%22 in exc.msg):%0A pytest.skip(%22Skipping set_xdr_flags because xdr is not configured.%22)%0A else:%0A
@@ -1172,16 +1172,37 @@
mespace,
+ xdr may be disabled,
skippin
|
da9bab1d15d3f54d2ac65701e533b9bc34ebfea5 | remove test skip | tests/cupy_tests/array_api_tests/test_sorting_functions.py | tests/cupy_tests/array_api_tests/test_sorting_functions.py | import pytest
from cupy import array_api as xp
@pytest.mark.parametrize(
"obj, axis, expected",
[
([0, 0], -1, [0, 1]),
([0, 1, 0], -1, [1, 0, 2]),
([[0, 1], [1, 1]], 0, [[1, 0], [0, 1]]),
([[0, 1], [1, 1]], 1, [[1, 0], [0, 1]]),
],
)
@pytest.mark.skipif(
# https://git... | Python | 0.000001 | @@ -279,144 +279,8 @@
,%0A)%0A
-@pytest.mark.skipif(%0A # https://github.com/cupy/cupy/issues/5701%0A True, reason=%22Sorting functions miss arguments kind and order%22)%0A
def
|
6231afb51f5653e210f41d47c66797c4bd4d738d | Make it possible for the user to change username | accounts/views.py | accounts/views.py | # coding: utf-8
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import UpdateView
from django.core.urlresolvers import reverse_lazy
from volunteer_planner.utils import LoginRequiredMixin
@login_required()
def user_account_detail(request):
... | Python | 0.998407 | @@ -557,16 +557,28 @@
st_name'
+, 'username'
%5D%0A te
|
0bb558351a58caaca61eb381cc9a3a4ee4b881bb | format code | accounts/views.py | accounts/views.py | from django.shortcuts import render, redirect
from accounts.models import UserProfile
def index(request):
users = UserProfile.objects.all()
message = request.session.get('message', None)
info = request.session.get('info', None)
warning = request.session.get('warning', None)
alert = request.sessio... | Python | 0.000061 | @@ -39,16 +39,17 @@
edirect%0A
+%0A
from acc
|
7c75da48d6746fc148a79051338c3cd554d75615 | Change variable name to next for logout function | accounts/views.py | accounts/views.py | from django.shortcuts import redirect
from django.contrib.auth import logout as auth_logout
from django.conf import settings
def logout(request):
"""Logs out user redirects if in request"""
r = request.GET.get('r', '')
auth_logout(request)
if r:
return redirect('{}/?r={}'.format(settings.OPEN... | Python | 0.000001 | @@ -193,17 +193,20 @@
%22%22%22%0A
-r
+next
= reque
@@ -217,17 +217,20 @@
ET.get('
-r
+next
', '')%0A
@@ -261,17 +261,20 @@
%0A if
-r
+next
:%0A
@@ -296,17 +296,20 @@
ct('%7B%7D/?
-r
+next
=%7B%7D'.for
@@ -351,17 +351,20 @@
UT_URL,
-r
+next
))%0A e
|
a1aa922643ddbe6bd2beb497d087f5ff9e6233df | Add edx needed dependencies | test-settings.py | test-settings.py | from settings import *
from path import path
from openedx.core.lib.tempdir import mkdtemp_clean
from django.conf import settings
from uuid import uuid4
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.message... | Python | 0 | @@ -412,24 +412,97 @@
nrollment',%0A
+ # Student Identity Verification%0A 'lms.djangoapps.verify_student',%0A
# ADD ED
|
9d0df01b2fd761b4a73e8f7c854e9bbdd3df92b5 | Fix some test failures on Windows because wait_for_pid() was not used. | test/_windows.py | test/_windows.py | #!/usr/bin/env python
#
# $Id$
#
import os
import unittest
import platform
import subprocess
import signal
import time
import warnings
import atexit
import psutil
from test_psutil import reap_children, get_test_subprocess
try:
import wmi
except ImportError:
atexit.register(warnings.warn, "Couldn't import wmi... | Python | 0.000001 | @@ -217,17 +217,31 @@
bprocess
+, wait_for_pid
%0A
-
try:%0A
@@ -270,16 +270,21 @@
ortError
+, err
:%0A at
@@ -326,106 +326,58 @@
n't
-import wmi module; some Windows %22%0A %22specific tests were disabled%22,
+run wmi tests: %25s%22 %25 str(err),%0A
Run... |
398d7633d3733a54a2314f3cbd143eef719d048f | Fix some issues starting the callback receiver workers | awx/main/management/commands/run_callback_receiver.py | awx/main/management/commands/run_callback_receiver.py | # Copyright (c) 2014 AnsibleWorks, Inc.
# All Rights Reserved.
# Python
import datetime
import logging
import json
from optparse import make_option
from multiprocessing import Process
# Django
from django.conf import settings
from django.core.management.base import NoArgsCommand, CommandError
from django.db import tr... | Python | 0.000015 | @@ -1014,22 +1014,53 @@
w =
-Worker
+Process(target=callback_worker, args=
(queue_p
@@ -1058,24 +1058,26 @@
=(queue_port
+,)
)%0A
@@ -2780,198 +2780,35 @@
t)%0A%0A
-%0Aclass Worker(Process):%0A '''%0A Process to validate and store save job events received via zeromq%0A '''%0A%0A def __in... |
adf62e28aef8c67409c59d0d567e4022694384f7 | Corrige issue #9 | emaula/school/views.py | emaula/school/views.py | from django.shortcuts import render, get_object_or_404
from django.utils import timezone
from django.views import generic
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import Group
from .forms import ProfessorForm, ProfileForm
from ... | Python | 0 | @@ -3277,16 +3277,25 @@
g
+, created
= Group
@@ -3306,16 +3306,26 @@
ects.get
+_or_create
(name='s
|
afbea0a55f4e727d62a521afe64e18667aa02a38 | Add on and reachable light counters for easy summing | akari/__init__.py | akari/__init__.py | import configparser
import datetime
import logging
import click
import influxdb
import phue
import akari.log_config # noqa: F401
log = logging.getLogger(__name__)
def connect_to_hue_bridge(hue_config: configparser.SectionProxy) -> phue.Bridge:
return phue.Bridge(
ip=hue_config['ip_address'],
... | Python | 0 | @@ -2732,32 +2732,156 @@
ive_brightness,%0A
+ 'on_light_counter': 1 if is_on else 0,%0A 'reachable_light_counter': 1 if is_reachable else 0,%0A
%7D%0A
|
f57326e5f5c7d64d6f7d5f204bcf388de897d5b0 | Revise palindrome function names | alg_palindrome.py | alg_palindrome.py | """Palindrome: a string that read the same forward and backward.
For example: radar, madam.
"""
from __future__ import print_function
def match_palindrome(a_str):
"""Check palindrom by front & rear match by Deque."""
from ds_deque import Deque
str_deque = Deque()
for s in a_str:
str_deque.... | Python | 0.998495 | @@ -91,16 +91,87 @@
m.%0A%22%22%22%0A%0A
+from __future__ import absolute_import%0Afrom __future__ import division%0A
from __f
@@ -202,30 +202,24 @@
ction%0A%0A%0Adef
-match_
palindrome(a
@@ -635,22 +635,16 @@
h%0A%0A%0Adef
-match_
palindro
@@ -796,22 +796,16 @@
-1%5D and
-match_
palindro
@@ -932,38 +932,32 ... |
4f2fb3ac84216096411a5b6583e4fbb22c8e5196 | bump dev version | allel/__init__.py | allel/__init__.py | # -*- coding: utf-8 -*-
# flake8: noqa
from allel import model
from allel import stats
from allel import plot
from allel import io
from allel import chunked
from allel import constants
from allel import util
# convenient shortcuts
from allel.model.ndarray import *
from allel.model.chunked import *
# experimental
tr... | Python | 0 | @@ -546,11 +546,11 @@
21.0.dev
-2
+3
'%0A
|
22b21d1773f87902015e9f1c87126f5550efb054 | Add test case for Server error | test/unittests/tts/test_mimic2_tts.py | test/unittests/tts/test_mimic2_tts.py | import unittest
from unittest import mock
from mycroft.tts.mimic2_tts import Mimic2
@mock.patch('mycroft.tts.mimic2_tts.FuturesSession')
@mock.patch('mycroft.tts.tts.PlaybackThread')
class TestMimic2(unittest.TestCase):
def test_get_tts(self, _, mock_session):
mock_session_instance = mock.Mock(name='Sess... | Python | 0 | @@ -78,16 +78,70 @@
Mimic2%0A
+from mycroft.tts.remote_tts import RemoteTTSException%0A
%0A%0A@mock.
@@ -1021,16 +1021,750 @@
alled)%0A%0A
+ def test_get_tts_backend_error(self, _, mock_session):%0A mock_session_instance = mock.Mock(name='SessionMock')%0A mock_session.return_value = mock_session_in... |
2cc8a2cace6c4a44e7280b0d2312c5aed6d68640 | check matrix condition when generating variances | mosfit/modules/outputs/lightcurve.py | mosfit/modules/outputs/lightcurve.py | """Definitions for the `LightCurve` class."""
from collections import OrderedDict
import numpy as np
from mosfit.modules.outputs.output import Output
# Important: Only define one ``Module`` class per file.
class LightCurve(Output):
"""Output a light curve to disk."""
_lc_keys = [
'magnitudes', 'e... | Python | 0 | @@ -3031,94 +3031,299 @@
-i
kmat =
-np.linalg.inv(%0A kwargs%5B'kmat'%5D +
+kwargs%5B'kmat'%5D + np.diag(kwargs%5B'kdiagonal'%5D)%0A if np.linalg.cond(kmat) %3E 1e10:%0A output%5B'model_variances'%5D =
np.
-diag(kwargs%5B'kdiagonal'%5D))%0A
+full(%0A ... |
709f807368ea7915bc5c2f7d6236b3a24df92c8c | Simplify script for recorded ctrl message injection | scripts/sc-test-cmsg.py | scripts/sc-test-cmsg.py | #!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2015 Stany MARCEL <stanypub@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | Python | 0.000001 | @@ -1179,16 +1179,28 @@
ler
-USB Dump
+Control Message test
er%22%22
@@ -1398,1570 +1398,191 @@
-sc.handleEvents()%0A sc._sendControl(struct.pack('%3E' + 'I' * 1, 0x81000000))%0A sc._sendControl(struct.pack('%3E' + 'I' * 6, 0x87153284, 0x03180000, 0x31020008, 0x07000707, 0x00301400, 0x2f010000))%... |
51c597d6ea93b27a1e2879cb1d9d250da9ecc799 | Use EventSettingProperty in CFA | indico/modules/events/abstracts/models/call_for_abstracts.py | indico/modules/events/abstracts/models/call_for_abstracts.py | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0 | @@ -864,16 +864,80 @@
ettings%0A
+from indico.modules.events.settings import EventSettingProperty%0A
from ind
@@ -1347,33 +1347,237 @@
t)%0A%0A
-@property%0A def
+start_dt = EventSettingProperty(abstracts_settings, 'start_dt')%0A end_dt = EventSettingProperty(abstracts_settings, 'end_dt')%0A modificatio... |
00ba29b01524ef9d984ac041232c4dea95b7c839 | add bgra8 image encoding. | aslam_offline_calibration/kalibr/python/kalibr_common/ImageDatasetReader.py | aslam_offline_calibration/kalibr/python/kalibr_common/ImageDatasetReader.py | import cv_bridge
import cv2
import rosbag
import os
import numpy as np
import pylab as pl
import aslam_cv as acv
import sm
class BagImageDatasetReaderIterator(object):
def __init__(self, dataset, indices=None):
self.dataset = dataset
if indices is None:
self.indices = np.arange(dataset.numImages())
... | Python | 0 | @@ -5075,16 +5075,195 @@
R2GRAY)%0A
+ elif data.encoding == %228UC4%22 or data.encoding == %22bgra8%22:%0A img_data = np.array(self.CVB.imgmsg_to_cv2(data))%0A img_data = cv2.cvtColor(img_data, cv2.COLOR_BGRA2GRAY)%0A
else
@@ -5388,16 +5388,30 @@
3 / rgb8
+, 8UC4 / bgra8
and Ima
|
172de448cc0a0903014029eca0a7eee9bbe8b0dc | Set use_middlewares to False in tasks request handlers. | source/tipfy/ext/tasks/__init__.py | source/tipfy/ext/tasks/__init__.py | # -*- coding: utf-8 -*-
"""
tipfy.ext.tasks
~~~~~~~~~~~~~~~
Task queue utilities extension.
:copyright: 2009 by tipfy.org.
:license: BSD, see LICENSE.txt for more details.
"""
import logging
from google.appengine.ext import db
from google.appengine.api.labs import taskqueue
from google.appengine.e... | Python | 0 | @@ -1040,24 +1040,53 @@
r')%0A %22%22%22%0A
+ use_middlewares = False%0A%0A
def post
@@ -2416,24 +2416,52 @@
s')%0A %22%22%22%0A
+ use_middlewares = False%0A
model =
|
52cc74c34eb29b0ecb970cd2cc32f8084c398364 | Use the new de CH tables from liblouis | documents/external.py | documents/external.py | from django.conf import settings
from os.path import join, basename, splitext
from shutil import rmtree
from subprocess import call, Popen, PIPE
from tempfile import mkdtemp, gettempdir
import os
class DaisyPipeline:
@staticmethod
def validate(file_path):
"""Validate a given file_path using the Valida... | Python | 0 | @@ -2265,18 +2265,18 @@
0 : 'de-
-de
+ch
-g0.utb'
@@ -2290,26 +2290,26 @@
1 : 'de-
-de
+ch
-g1.ctb', %0A
@@ -2311,164 +2311,8 @@
', %0A
- # FIXME: the current release of liblouis doesn't support%0A # german grade 2. Adapt this table as soon as it has support%0A # for grade 2%0A
@@ -... |
64a56dc2a8bc4af1ed68d85b37b0af7f21141e8b | Update studentclasses.py | bigbench/benchmark_tasks/word_problems_on_sets_and_graphs/studentclasses.py | bigbench/benchmark_tasks/word_problems_on_sets_and_graphs/studentclasses.py | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | Python | 0 | @@ -4805,20 +4805,26 @@
te_text(
+list(
ctx)
+)
%0A
|
058320c16cbe77f3d9abff4b6b9985547764b581 | Remove a remaining unneeded TypeVar declaration for State model | correios/models/address.py | correios/models/address.py | # Copyright 2016 Osvaldo Santana Neto
#
# 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 ... | Python | 0 | @@ -3134,55 +3134,8 @@
)%0A%0A%0A
-StateType = TypeVar(%22StateType%22, State, str)%0A%0A%0A
clas
@@ -3320,17 +3320,25 @@
te:
-StateType
+Union%5BState, str%5D
,%0A
|
4b2b59bb3676afd262596425372a4ce0053ba416 | Improve formatting in replication script. | couchdb/tools/replicate.py | couchdb/tools/replicate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Maximillian Dornseif <md@hudora.de>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""
This script replicates databases from one CouchDB server to an other.
This is mainly f... | Python | 0 | @@ -1076,16 +1076,17 @@
main():%0A
+%0A
usag
@@ -2503,24 +2503,25 @@
t_url + '/'%0A
+%0A
source_s
@@ -2855,16 +2855,17 @@
=True):%0A
+%0A
@@ -3062,32 +3062,33 @@
.stdout.flush()%0A
+%0A
body = %7B
@@ -3158,16 +3158,17 @@
= True%0A
+%0A
@@ -3551,32 +3551,33 @@
plicate', body... |
64fb1cf478580c97445362328f33dad4a2d4d0df | Update the category name for tree closing based on the tester bots. | masters/master.chromium.chromiumos/master_gatekeeper_cfg.py | masters/master.chromium.chromiumos/master_gatekeeper_cfg.py | # Copyright (c) 2011 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.
from master import gatekeeper
from master import master_utils
# This is the list of the builder categories and the corresponding critical
# steps. If on... | Python | 0.000222 | @@ -12,17 +12,17 @@
(c) 201
-1
+2
The Chr
@@ -572,17 +572,16 @@
'tester
-s
': %5B%0A
|
ed24c94842ba874e06efa162bf78bbaa166766db | Fix comment typo noticed by Rob Hooft | Lib/curses/ascii.py | Lib/curses/ascii.py | #
# ascii.py -- constants and memembership tests for ASCII characters
#
NUL = 0x00 # ^@
SOH = 0x01 # ^A
STX = 0x02 # ^B
ETX = 0x03 # ^C
EOT = 0x04 # ^D
ENQ = 0x05 # ^E
ACK = 0x06 # ^F
BEL = 0x07 # ^G
BS = 0x08 # ^H
TAB = 0x09 # ^I
HT = 0x09 # ^I
LF = 0x0a # ^J
NL = 0x0a # ^J
VT = 0x0b # ^K
FF = 0x0c # ^L
CR = 0x0d # ^... | Python | 0 | @@ -26,18 +26,16 @@
and mem
-em
bership
|
1bed007c957041ddd7260af8d0f8c56fb63b4867 | remove dead "if" block | tests/end2end_test.py | tests/end2end_test.py | # s2p (Satellite Stereo Pipeline) testing module
# Copyright (C) 2017, Carlo de Franchis <carlo.de-franchis@polytechnique.org>
# Copyright (C) 2019, Julien Michel (CNES) <julien.michel@cnes.fr>
import os
import sys
import glob
import numpy as np
import s2p
from s2p import common
from tests_utils import data_path
her... | Python | 0.00113 | @@ -4090,364 +4090,8 @@
ne%0A%0A
- if 'utm_bbx' in test_cfg:%0A bbx = test_cfg%5B'utm_bbx'%5D%0A global_xoff = bbx%5B0%5D%0A global_yoff = bbx%5B3%5D%0A global_xsize = int(np.ceil((bbx%5B1%5D-bbx%5B0%5D) / test_cfg%5B'dsm_resolution'%5D))%0A global_ysize = int(np.ceil((bbx%5B3%5D-... |
cc2b86b6313c583e018b2595d19454ce2fe4699c | use ccprogram and not shlink to test linking in conftests. | yaku/conf.py | yaku/conf.py | import copy
import sys
import os
import types
try:
from hashlib import md5
except ImportError:
from md5 import md5
from os.path \
import \
join
from cStringIO \
import \
StringIO
from yaku.errors \
import \
TaskRunFailure
from yaku.task_manager \
import \
Compi... | Python | 0 | @@ -583,16 +583,32 @@
y_libdir
+, ccprogram_task
%0A%0Aclass
@@ -3376,22 +3376,25 @@
.extend(
-shlink
+ccprogram
_task(ta
|
9f67c8330daf884dd4a349f56051e27f4f093921 | Add missing git unit tests | tests/git_unittest.py | tests/git_unittest.py | import os
import git
import time
import unittest
from roundabout.config import Config
from roundabout.git_client import Git, GitException
from tests import utils
def create_test_repo():
repo_path = utils.testdata('test_repo')
if not os.path.exists(repo_path):
repo = git.Repo.init(repo_path, mkdir=Tru... | Python | 0.000001 | @@ -2457,16 +2457,711 @@
urdir)%0A%0A
+ def test_clean_squash_merge_with_good_config_but_no_squash_message(self):%0A branch = self.repo.remote_branch%0A self.repo.repo.create_head(branch)%0A self.repo.branch(branch).checkout()%0A%0A curdir = os.getcwd()%0A os.chdir(self.repo.clone... |
6cbec939130ba8e17969e8d13b35765f9683b692 | add exception 2017/06/06 | crawler/tools/MysqlBase.py | crawler/tools/MysqlBase.py | #-*- encoding:UTF-8 -*-
import urllib2
import re
import StringIO
import gzip
import logging
import sqlite3
import logutils
import urllib
import sys
import MySQLdb
reload(sys)
sys.setdefaultencoding('utf8')
class MysqlBase:
def __init__(self,dbname):
self.conn=None
self.reconn=False
self.d... | Python | 0 | @@ -730,16 +730,33 @@
f,sql):%0A
+ try:%0A
@@ -772,32 +772,36 @@
nnect()%0A
+
cur=self.conn.cu
@@ -799,32 +799,36 @@
f.conn.cursor()%0A
+
cur.exec
@@ -843,32 +843,36 @@
%0A
+
+
self.conn.commit
@@ -874,32 +874,36 @@
ommit()%0A
+
cur.cl... |
1ceef7205121141cf3c01826a1bb5d01013e74db | clean cruft | ymir/data.py | ymir/data.py | # -*- coding: utf-8 -*-
""" ymir.data
"""
from fabric.colors import green
DEFAULT_SUPERVISOR_PORT = 9001 # supervisor WUI port
STATUS_DEAD = ['terminated', 'shutting-down']
OK = green(' ok')
| Python | 0 | @@ -71,62 +71,8 @@
een%0A
-DEFAULT_SUPERVISOR_PORT = 9001 # supervisor WUI port%0A
STAT
|
20c61a39b0f2bc35eabc41f519732e2706c6f59c | test domain is uuid | corehq/apps/data_dictionary/tests/test_util.py | corehq/apps/data_dictionary/tests/test_util.py | from django.test import TestCase
from mock import patch
from corehq.apps.data_dictionary.models import CaseType, CaseProperty
from corehq.apps.data_dictionary.util import generate_data_dictionary
class GenerateDictionaryTest(TestCase):
domain = 'data-dictionary'
def tearDown(self):
CaseType.objects.... | Python | 0.999975 | @@ -1,12 +1,25 @@
+import uuid%0A%0A
from django.
@@ -262,25 +262,20 @@
n =
-'data-dictionary'
+uuid.uuid4()
%0A%0A
|
863a0c00c6fd00d06e8d62d35506d9faae42e8d8 | use templates manipulation to add the link to open the pad form, rather than using JS | addons/piratepad/editors.py | addons/piratepad/editors.py | # -*- coding: utf-8 -*-
from openobject.widgets import JSLink
import openobject.templating
class SidebarTemplateEditor(openobject.templating.TemplateEditor):
templates = ['/openerp/widgets/templates/sidebar.mako']
BINARY_ATTACHMENTS_FORM = u'<form id="attachment-box"'
def edit(self, template, template_te... | Python | 0 | @@ -213,16 +213,67 @@
.mako'%5D%0A
+ ADD_ATTACHMENT_BUTTON = u'id=%22add-attachment%22'%0A
BINA
@@ -324,16 +324,488 @@
-box%22'%0A%0A
+ def insert_pad_link(self, output):%0A # Insert the link on the line right after the link to open the%0A # attachment form%0A form_opener_insertion = o... |
157bdcab9790a0779d56178c7d6ff595b016dc1e | Fix wrong inheritance in TickTimer | spock/plugins/core/timer.py | spock/plugins/core/timer.py | """
Provides clock-time and **SERVER** tick-timers and a convenient API for
registering them. Clock-time timers are as precise as the underlying OS
makes them, server tick-timers are based on time updates from the server
"""
import time
from spock.plugins.base import PluginBase
from spock.utils import pl_announce
c... | Python | 0.000944 | @@ -1565,37 +1565,36 @@
:%0A super(
-Event
+Tick
Timer, self).__i
|
1ade506f5408cbbe099bb83bd701472137470618 | Add extra version of py-contextlib2 (#15322) | var/spack/repos/builtin/packages/py-contextlib2/package.py | var/spack/repos/builtin/packages/py-contextlib2/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyContextlib2(PythonPackage):
"""contextlib2 is a backport of the standard library's cont... | Python | 0 | @@ -601,16 +601,112 @@
f2ad33')
+%0A version('0.5.5', sha256='613569263db0271f34c8484792360272a731f2185567c31c8118e9c994412170')
%0A%0A de
|
a4dad8a64d628a6ebebe40845b7ce40b82caf82e | Use True instead of 1 for while check | beaver/worker.py | beaver/worker.py | import errno
import os
import stat
import time
from beaver.utils import REOPEN_FILES, eglob
class Worker(object):
"""Looks for changes in all files of a directory.
This is useful for watching log file changes in real-time.
It also supports files rotation.
Example:
>>> def callback(filename, lin... | Python | 0.000002 | @@ -2780,17 +2780,20 @@
while
-1
+True
:%0A
|
71615632defe37681d1257912ea03f6e1cdeffde | add v1.1-3 (#20923) | var/spack/repos/builtin/packages/r-fitdistrplus/package.py | var/spack/repos/builtin/packages/r-fitdistrplus/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RFitdistrplus(RPackage):
"""Extends the fitdistr() function (of the MASS package) with sev... | Python | 0 | @@ -251,16 +251,95 @@
%0A %22%22%22
+Help to Fit of a Parametric Distribution to Non-Censored or Censored Data%0A%0A
Extends
@@ -1208,16 +1208,112 @@
rplus%22%0A%0A
+ version('1.1-3', sha256='776d5456e14398e44b78b3d7db526559bb7a3537e546a29c88aa192141c756de')%0A
vers
@@ -1578,16 +1578,33 @@
npsurv',
... |
3c0688262f1583bf93dac70d6e7ddddc3a8bd969 | Add missing colon | corehq/apps/userreports/expressions/getters.py | corehq/apps/userreports/expressions/getters.py | from datetime import date, datetime
from decimal import Decimal, InvalidOperation
from six import string_types
from corehq.util.dates import iso_string_to_date, iso_string_to_datetime
class TransformedGetter(object):
"""
Getter that takes in another getter and a transform function.
Returns the result of ... | Python | 0.999999 | @@ -3757,16 +3757,17 @@
%0A try
+:
%0A
|
a7a10cf40c781a8c0cb4e96bdd7077d6cbe8afce | fix batching of changes in doctypemigration continuous | corehq/doctypemigrations/continuous_migrate.py | corehq/doctypemigrations/continuous_migrate.py | import datetime
from corehq.util.couch import IterDB
from dimagi.utils.couch.database import iter_docs
from dimagi.utils.chunked import chunked
import logging
def filter_doc_ids_by_doc_type(db, doc_ids, doc_types):
for doc_ids_chunk in chunked(doc_ids, 100):
keys = [[doc_type, doc_id]
for ... | Python | 0 | @@ -1510,18 +1510,16 @@
mmit=100
-00
,%0A
@@ -1575,15 +1575,17 @@
lta(
-hours=1
+seconds=5
)):%0A
@@ -2840,17 +2840,17 @@
s_count
-%3C
+%3E
self.ma
@@ -2929,9 +2929,9 @@
mit
-%3C
+%3E
sel
|
e71161e8a42bdb4643995dec186d945c49d292eb | fix pylint issues | unit_tests/lib/events_utils.py | unit_tests/lib/events_utils.py | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | Python | 0.000002 | @@ -2425,16 +2425,73 @@
oat = 1,
+ # pylint: disable=no-self-use%0A
last_ev
|
8c29892ab43faebc8ee18ece4beedabc13ca5a72 | Use optional return value for linenumber | lib/ansiblelint/rules/__init__.py | lib/ansiblelint/rules/__init__.py | """All internal ansible-lint rules."""
import re
from ansiblelint.skip_utils import get_rule_skips_from_line
from ansiblelint.skip_utils import append_skipped_rules
from ansiblelint.errors import Match
import ansiblelint.utils
class AnsibleLintRule(object):
def __repr__(self):
"""Return a AnsibleLintRule... | Python | 0.000003 | @@ -2765,16 +2765,259 @@
essage%0A%0A
+ @staticmethod%0A def _matchplay_linenumber(play, optional_linenumber):%0A try:%0A linenumber, = optional_linenumber%0A except:%0A linenumber = play%5Bansiblelint.utils.LINE_NUMBER_KEY%5D%0A return linenumber%0A%0A
def
@@ -38... |
7ac27aa4d365d02d998c3f4c82bc740791a1b515 | Update script.py | HexChat/script.py | HexChat/script.py | from __future__ import print_function
import os
import sys
if sys.version_info[0] < 3:
import urllib as request
else:
import urllib.request as request
import hexchat
__module_name__ = 'Script'
__module_author__ = 'TingPing'
__module_version__ = '3'
__module_description__ = 'Download scripts'
script_help = 'Script: ... | Python | 0.000001 | @@ -722,24 +722,83 @@
/hexchat/',%0A
+%09%09%09%09'http://raw.github.com/Farow/hexchat-scripts/master/',%0A
%09%09%09%09'http://
|
4a10ca9895b8cfd9996e9563494dfc8d5008a263 | Support reading a program from a file | bfinterpreter.py | bfinterpreter.py | #!/usr/bin/python3
class Tape:
def __init__(self):
self.cells = [0]
self.pointer = 0
def inc_val(self):
self.cells[self.pointer] += 1
def dec_val(self):
self.cells[self.pointer] -= 1
def move_right(self):
self.pointer += 1
if self.pointer == len(self.c... | Python | 0 | @@ -2814,16 +2814,156 @@
rt sys%0A%0A
+ def read_program_file(filename):%0A with open(filename, encoding=%22utf-8%22) as program_file:%0A return program_file.read()%0A%0A
def
@@ -3392,16 +3392,107 @@
%5Bx + 1%5D%0A
+ elif arg == %22--program-file%22:%0A program = read_prog... |
d1727b7a78c3154789fc107156db9caada1e0a82 | Remove unnecessary space character when dumping recording tape | bfinterpreter.py | bfinterpreter.py | #!/usr/bin/python3
class Tape:
'''
A generic implementation of a record tape for a Turing Machine.
It's bounded on the left side and unbounded on the right side.
It stores only Python integers.
'''
def __init__(self):
self.reset()
def inc_val(self):
self.cells[self.pointer... | Python | 0.000341 | @@ -6224,18 +6224,23 @@
int(%22%5Cn%22
-,
++ str(
tape.cel
@@ -6242,16 +6242,17 @@
e.cells)
+)
%0A%0A #
|
6a899eeb5be7a8b49b45ff0fc0f490a5cad151bd | Add SourceGroup model | entity_event/models.py | entity_event/models.py | from django.db import models
class Medium(models.Model):
name = models.CharField(max_length=64, unique=True)
display_name = models.CharField(max_length=64)
description = models.TextField()
def __unicode__(self):
return self.display_name
class Source(models.Model):
name = models.CharFiel... | Python | 0 | @@ -422,32 +422,317 @@
dels.TextField()
+%0A group = models.ForeignKey('SourceGroup')%0A%0A def __unicode__(self):%0A return self.display_name%0A%0A%0Aclass SourceGroup(models.Model):%0A name = models.CharField(max_length=64, unique=True)%0A display_name = models.CharField(max_length=64)%0A descr... |
57632f895e15000b1b8c862b1c09f8a5dddc8583 | Fix one at a time iterator to not check things like the platform | cura/OneAtATimeIterator.py | cura/OneAtATimeIterator.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Scene.Iterator import Iterator
from functools import cmp_to_key
from UM.Application import Application
## Iterator that returns a list of nodes in the order that they need to be printed
# If there is no solution a... | Python | 0.000001 | @@ -129,16 +129,57 @@
terator%0A
+from UM.Scene.SceneNode import SceneNode%0A
from fun
@@ -573,32 +573,8 @@
per(
-OneAtATimeIterator, self
).__
@@ -809,24 +809,94 @@
Children():%0A
+ if not type(node) is SceneNode:%0A continue%0A%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.