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 |
|---|---|---|---|---|---|---|---|
5f91ca32ae3d8fccb916fdf06bd6f2f546e6032c | Update dev | genie/__version__.py | genie/__version__.py | __version__ = "7.0.0-dev"
| Python | 0 | @@ -12,9 +12,9 @@
= %22
-7
+8
.0.0
|
1943daaa02b4d314c7aa722a05ae77b5586b46f1 | Add a little explanation on usage | linear_math_tests/test_motionstate.py | linear_math_tests/test_motionstate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
linear_math_tests.test_motionstate
"""
from __future__ import unicode_literals, print_function, absolute_import
import unittest
import math
import bullet
class MyMotionState(bullet.btMotionState):
def __init__(self):
self.transform = bullet.btTransform.i... | Python | 0.00003 | @@ -414,32 +414,149 @@
sform(self, t):%0A
+ # Assign basis and origin as theres no way to assign by reference%0A # as intended in the native method%0A
t.set_ba
|
d3ed9d2fbc53e53c26a604b059c374ace4671f09 | Fix FavoriteManager.create method | favit/managers.py | favit/managers.py | # -*- coding: utf-8 -*-
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import get_model
def _get_content_type_and_obj(obj, model=None):
if isinstance(model, basestring):
model = get_model(*model.split("."))
if isinstance(obj, (int, long))... | Python | 0.000006 | @@ -3405,25 +3405,8 @@
ne%0A%0A
- @classmethod%0A
@@ -3420,11 +3420,12 @@
ate(
-cls
+self
, us
@@ -3559,35 +3559,46 @@
content_type,
-obj
+content_object
= _get_content_
@@ -3614,33 +3614,32 @@
obj(obj, model)%0A
-%0A
fav = Fa
@@ -3636,22 +3636,49 @@
fav =
-Favori
+super(FavoriteManager,... |
ddd81374387c74be44dedfc5700dbf419fdc0bd2 | Make NotBlock more permissive | idiotic/util/blocks/logic.py | idiotic/util/blocks/logic.py | import logging
from idiotic import block
from collections import OrderedDict
from operator import eq, ne, gt, lt, ge, le
from functools import reduce
class MultiInputBlock(block.Block):
def __init__(self, *args, parameters=None, default=None, initial=None, **kwargs):
super().__init__(*args, **kwargs)
... | Python | 0.000016 | @@ -1849,18 +1849,17 @@
m_dict)
-!=
+%3E
1:%0A
|
ac500b059ac02ff5a104a25d2f5ff9f4848f536d | set default re subprocess timeout to 0.1, since that should be quite enough. | plugins/String/config.py | plugins/String/config.py | ###
# Copyright (c) 2003-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | Python | 0 | @@ -2837,17 +2837,19 @@
veFloat(
-5
+0.1
, %22%22%22Det
|
c481c935af42e88c0e8688ad995247b37cc96f6a | fix anyurl plugin's title parser and add googlebot UA | plugins/anyurl_plugin.py | plugins/anyurl_plugin.py | # -*- coding: utf-8 -*-
# vim: set ts=4 et
import cgi
import requests
from six.moves.html_parser import HTMLParser
from plugin import *
content_types = (
'text/html',
'text/xml',
'application/xhtml+xml',
'application/xml'
)
class TitleParser(HTMLParser):
def __init__(self):
HTMLParser._... | Python | 0 | @@ -928,17 +928,25 @@
e = data
+.strip()
%0A
-
@@ -1077,16 +1077,199 @@
, url):%0A
+ headers = %7B%0A 'User-Agent': 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Safari/537.36'%0A %7D%0A
@@ -1301,16 +1301,3... |
603bd06729a7fec937ed679bc60654457a823f30 | Save parsed source entity | afeedprocessor/afeedparser.py | afeedprocessor/afeedparser.py | import feedparser
import PyRSS2Gen
import datetime
class FeedParser:
@staticmethod
def date_tuple_to_datetime(date_tuple):
return datetime.datetime(*(date_tuple[:5])) if date_tuple else None
@staticmethod
def get_first(lst):
return lst[0] if lst and len(lst) > 0 else None
@static... | Python | 0.000001 | @@ -479,37 +479,41 @@
ntry):%0A r
-eturn
+ss_item =
PyRSS2Gen.RSSIt
@@ -1002,32 +1002,96 @@
e'),%0A )%0A%0A
+ rss_item.source_entity = entry%0A return rss_item%0A%0A
def get_rss2
@@ -1132,21 +1132,25 @@
r
-eturn
+ss_feed =
PyRSS2G
@@ -2078,24 +2078,87 @@
%0A )%0A%0... |
30e9368203c96900f5cc6dc993b1201a6face9bf | test for a logged in user implemented | features/steps.py | features/steps.py | from lettuce import before, after, world, step
import datetime
import os
from contextlib import closing
from journal import connect_db
from journal import DB_SCHEMA
from journal import INSERT_ENTRY
from pyramid import testing
TEST_DSN = 'dbname=test_learning_journal user=ndraper2'
settings = {'db': TEST_DSN}
@worl... | Python | 0 | @@ -306,16 +306,80 @@
ST_DSN%7D%0A
+INPUT_BTN = '%3Cinput type=%22submit%22 value=%22Share%22 name=%22Share%22/%3E'%0A
%0A%0A@world
@@ -582,16 +582,322 @@
sponse%0A%0A
+@world.absorb%0Adef login_helper(username, password, app):%0A %22%22%22encapsulate app login for reuse in tests%0A%0A Accept all status codes ... |
adc1691dd3fcc513def0e5a702e1f8e3473a29a3 | Set test-specific local database | getaride/settings.py | getaride/settings.py | """
Django settings for getaride project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... | Python | 0.000001 | @@ -2147,22 +2147,209 @@
es%0A%0A
-DATABASES = %7B%0A
+import sys%0A%0Aif 'test' in sys.argv:%0A DATABASES = %7B%0A 'default': %7B%0A 'ENGINE': 'django.db.backends.sqlite3',%0A 'NAME': 'testdb',%0A %7D,%0A %7D%0Aelse:%0A DATABASES = %7B%0A
@@ -2386,16 +2386,20 @@
... |
bdb78cd1bb13981a20ecb0cf9eb981d784c95b0e | Update form to handle home_lon and home_lat | fellowms/forms.py | fellowms/forms.py | from django.forms import ModelForm, widgets
from .models import Fellow, Event, Expense, Blog
class FellowForm(ModelForm):
class Meta:
model = Fellow
exclude = [
"inauguration_year",
"mentor",
]
class EventForm(ModelForm):
class Meta:
mo... | Python | 0 | @@ -168,32 +168,88 @@
exclude = %5B%0A
+ %22home_lon%22,%0A %22home_lat%22,%0A
|
7451f70fc86ab2c18b0debddde5638c5dcd34b2f | Revise doc string with complexity | alg_dijkstra_shortest_path.py | alg_dijkstra_shortest_path.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from ds_min_priority_queue_tuple import MinPriorityQueue
def dijkstra(w_graph_d, start_vertex):
"""Dijkstra algorithm for "weighted" graph.
Finds shortest path in a weighted graph... | Python | 0.000006 | @@ -255,36 +255,21 @@
for
-%22weighted%22 graph.%0A%0A Finds
+singel-source
sho
@@ -283,21 +283,35 @@
ath
+problem %0A
in a
+%22
weighted
gra
@@ -310,85 +310,78 @@
hted
+%22
graph
- from a particular %0A node to all vertices that are reachable from it
+.%0A %0A Time complexity for graph G(... |
e8343412fc65bb6a3d053e5d0d62625735761e58 | Remove unnecessary Chrome option | gettitle/gettitle.py | gettitle/gettitle.py | #!/usr/bin/env python3
import argparse
import sys
import urllib
import pyperclip
from selenium import webdriver
import gettitle.special_sites
import gettitle.exceptions
import gettitle.handles
def set_browser():
options = webdriver.ChromeOptions()
options.add_argument("user-agent=Mozilla/5.0 (Macintosh; In... | Python | 0 | @@ -254,131 +254,8 @@
s()%0A
- options.add_argument(%22user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:33.0) Gecko/20100101 Firefox/33.0')%22)%0A
|
7a7fdc5de6785c6bc37408642503e8632157fcf1 | Add sms support to pushbullet notification (#32347) | homeassistant/components/pushbullet/notify.py | homeassistant/components/pushbullet/notify.py | """Pushbullet platform for notify component."""
import logging
import mimetypes
from pushbullet import InvalidKeyError, PushBullet, PushError
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_TARGET,
ATTR_TITLE,
ATTR_TITLE_DEFAULT,
PLATFORM_SCHEMA,
BaseNoti... | Python | 0 | @@ -3194,16 +3194,22 @@
bullet,
+email=
tname)%0A
@@ -3294,32 +3294,355 @@
continue%0A%0A
+ # Target is sms, send directly, don't use a target object.%0A if ttype == %22sms%22:%0A self._push_data(%0A message, title, data, self.pushbullet, phonenumber=tn... |
2be77c20dc5f1bbe3cb1cedd62c79577a4001eab | enable passing Config object to updateUserInfo method or just use the current config | filemail/users.py | filemail/users.py | """
filemail.users
~~~~~~~~~~~~~~
Contains :User:, :Contacts: and :Company: classes
"""
from calendar import timegm
from datetime import datetime, timedelta
from urls import getURL
from config import Config
from transfer import Transfer
from http import FMConnection
from errors import hellraiser, FMBaseError
class... | Python | 0 | @@ -1997,16 +1997,21 @@
lf, info
+=None
):%0A
@@ -2142,32 +2142,142 @@
eLoginStatus()%0A%0A
+ if info is not None:%0A if isinstance(info, Config):%0A info = info.dump()%0A%0A
self.con
|
401659250f121448f202479f9a6a9647ca1631bf | Fix reference to old-fashioned settings | apps/testrunner/test_suites/simple.py | apps/testrunner/test_suites/simple.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
import ujson
from celery import group
from celery.utils.log import get_task_logger
from testrunner.tasks.deploy import Deploy
from testrunner.tasks.http_get import HttpGet
from testrunner.tasks.http_get import MWProfilerG... | Python | 0.000151 | @@ -2523,195 +2523,99 @@
-test_runner_config = settings.SPARROW_TEST_RUNNER%0A DEPLOY_HOST = test_runner_config%5B'deploy_host'%5D%5B'hostname'%5D%0A TARGET_ENV = test_runner_config%5B'target_hosts'%5D%5B0%5D%5B'hostname'
+DEPLOY_HOST = settings.DEPLOYTOOLS_MASTER%0A TARGET_ENV = settings.TES... |
ca2b02d551e9bb4c8625ae79f7878892673fa731 | Add CommCare, CommTrack filters for DomainES | corehq/apps/es/domains.py | corehq/apps/es/domains.py | from .es_query import HQESQuery
from . import filters
class DomainES(HQESQuery):
index = 'domains'
@property
def builtin_filters(self):
return [
real_domains,
commconnect_domains,
created,
] + super(DomainES, self).builtin_filters
def real_domains():
... | Python | 0 | @@ -200,30 +200,91 @@
commc
-onnect
+are_domains,%0A commconnect_domains,%0A commtrack
_domains,%0A
@@ -431,62 +431,298 @@
ommc
-onnect_domains():%0A return filters.term(%22commconnect
+are_domains():%0A return filters.AND(filters.term(%22commconnect_enabled%22, False),%0A ... |
975ebd78d26b89d1cf183264a7820859d4dc78f2 | Refactor `plot-expenditures` | tangerine-tailleferre/plot-expenditures.py | tangerine-tailleferre/plot-expenditures.py | #!/usr/bin/python3
import sys
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import datetime
# Data-carrying struct.
class IngestedData:
def __init__(self):
# Plottable data.
self.plottable_x = list()
self.plottable_y = list()
# Raw data. The plottable data ... | Python | 0 | @@ -115,135 +115,1185 @@
me%0A%0A
-# Data-carrying struct.%0Aclass IngestedData:%0A def __init__(self):%0A # Plottable data.%0A self.plottable_x = list()
+class PlottableData:%0A def __init__(self):%0A self.x = list()%0A%0A # Expenditures binned by day.%0A self.daily_y = list()... |
c6ba9edaab10492e8d24db8c28771489331b22eb | Fix spacing in adminendpoints | timpani/webserver/endpoints/adminendpoints.py | timpani/webserver/endpoints/adminendpoints.py | import flask
import os.path
import json
from ... import blog
import uuid
import magic
import mimetypes
from .. import webhelpers
FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
UPLOAD_LOCATION = os.path.abspath(os.path.join(FILE_LOCATION, "../../../static/uploads"))
blueprint = flask.Blueprint("adminEndpoi... | Python | 0.000009 | @@ -611,17 +611,16 @@
r%22: 0%7D)%0A
-%0A
%09else:%0A%09
@@ -1425,17 +1425,16 @@
Name)%7D)%0A
-%0A
%09%09else:%0A
@@ -1473,17 +1473,16 @@
%7D), 400%0A
-%0A
%09else:%0A%09
|
457ef81067b8c2468198bfcc436929f884c95cd1 | fix for Nature's prophet name | dota2info.py | dota2info.py | import site_parser as sp
class Dota2info():
"Main class responsible for obtaining info"
def __init__(self, address):
self.address = address
def get_heroes_list(self, language = 'english'): #TODO: add images
json_url = 'http://' + self.address + '/jsfeed/heropickerdata?l=' + language
data = sp.get_json(json_u... | Python | 0.000007 | @@ -1521,16 +1521,78 @@
e()%0A%09%09%7D%0A
+%09%09hero_data%5B'name'%5D = hero_data%5B'name'%5D.replace(%22'S_%22, %22's_%22)%0A
%09%09hero_p
|
28dd74ad8893d4faa952a14c9c9a395b896b77ff | update GAMA spectra to DR3 | SAGA/database/saga_database.py | SAGA/database/saga_database.py | import os
from .core import *
from .spectra import SpectraData
__all__ = ['known_google_sheets', 'Database']
known_google_sheets = {
'hosts_named': GoogleSheets('1GJYuhqfKeuJr-IyyGF_NDLb_ezL6zBiX2aeZFHHPr_s', 0, include_names=['SAGA', 'NSA', 'NGC']),
'hosts_no_flags': GoogleSheets('1b3k2eyFjHFDtmHce1xi6JKuj3A... | Python | 0 | @@ -3039,16 +3039,20 @@
tra_gama
+_dr2
': DataO
@@ -3151,32 +3151,173 @@
al_first=True),%0A
+ 'spectra_gama': DataObject(FitsTable('http://www.gama-survey.org/dr3/data/cat/SpecCat/v27/SpecObj.fits'), use_local_first=True),%0A
%7D%0A%0A
|
375d2bc5a98ecefd1e3c5f3857a6f0cc7cf777ef | Fix the startup of the TRIPS service. | indra/tools/reading/readers/trips/__init__.py | indra/tools/reading/readers/trips/__init__.py | import os
import logging
import subprocess as sp
from datetime import datetime, timedelta, timezone
from indra.tools.reading.readers.core import Reader
from indra.sources.trips import client, process_xml
logger = logging.getLogger(__name__)
startup_path = '/sw/drum/bin/startup.sh'
service_host = 'drum'
DRUM_DOCKER... | Python | 0.000508 | @@ -288,19 +288,23 @@
service_
-hos
+endpoin
t = 'dru
@@ -1190,39 +1190,35 @@
service_
-endpoin
+hos
t = 'http://loca
@@ -1532,31 +1532,27 @@
service_
-endpoin
+hos
t = 'http://
@@ -1713,16 +1713,17 @@
ode('utf
+-
8')%0A
@@ -1796,14 +1796,13 @@
== '
-r
+R
eady
-.
':%0A
@@ -1821,16 +1821,63 @... |
0552f6e8865208c6edc3a2ecbbcbae2d3c5faf03 | Update alpha_zero_policy.py (#15042) | rllib/contrib/alpha_zero/core/alpha_zero_policy.py | rllib/contrib/alpha_zero/core/alpha_zero_policy.py | import numpy as np
from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY
from ray.rllib.policy.torch_policy import TorchPolicy
from ray.rllib.contrib.alpha_zero.core.mcts import Node, RootParentNode
from ray.rllib.utils.annotations import override
from ray.rllib.utils.framework import try_import_torch
torch, ... | Python | 0 | @@ -5808,32 +5808,38 @@
ss_out.detach().
+cpu().
numpy(),%0A
@@ -5875,24 +5875,30 @@
ss.detach().
+cpu().
numpy(),%0A
@@ -5940,16 +5940,22 @@
etach().
+cpu().
numpy()%0A
|
becdb7919751db4215927ce81e971c3f87a288ce | improve doc | rna_pdb_tools/utils/rna_helix_vis/rna_helix_vis.py | rna_pdb_tools/utils/rna_helix_vis/rna_helix_vis.py | #!/usr/bin/env python
"""
Example::
$ ./rna_helix_vis.py -p test_data/rp14_farna_eloop.out.1.pdb -s test_data/rp14.ss
(((((.(((((....)))))..[.....((((((..........))))))....)))))].
from pymol.cgo import *
from pymol import cmd
color red, resi 1+2+3+4+5+55+56+57+58+59
color red, resi 7+8+9+10+11... | Python | 0.000174 | @@ -20,16 +20,281 @@
on%0A%0A%22%22%22%0A
+Usage::%0A%0A ./rna_helix_vis.py%0A usage: rna_helix_vis.py %5B-h%5D %5B-p PDB_FN%5D %5B-s SS%5D%0A%0A optional arguments:%0A -h, --help show this help message and exit%0A -p PDB_FN, --pdb_fn PDB_FN%0A pdb file%0A ... |
10fb795e22d8825d4c631de5c456b9466f8290d6 | Update process-schedules.py | cron/process-schedules.py | cron/process-schedules.py | #!/usr/bin/env python
import MySQLdb
#import datetime
#import urllib2
#import os
import datetime
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
now = datetime.datetime.now()
DOW = datetime.datetime.today().weekday()
cnx = MySQLdb.connect(host=servername, user=username, pas... | Python | 0.000001 | @@ -4843,20 +4843,8 @@
LUE,
- TIMER_TEST,
TES
|
10e86be9e8d97f2373ed9aee5925460c28f6782b | make isort happy | cron/save_laundry_data.py | cron/save_laundry_data.py | #!/usr/bin/env python
# Add the following line into the labs crontab.
# */15 * * * * /home/labs/penn-mobile-server/cron/save_laundry_data.py
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import server # noqa
server.laundry.save_data()
| Python | 0.000002 | @@ -238,16 +238,29 @@
_))))%0A%0A%0A
+if True:%0A
import s
@@ -268,16 +268,8 @@
rver
- # noqa
%0A%0A%0As
|
5438587f849742f3ff8ae7e071dd0227dea513cf | Extract the median frame | signbank/video/convertvideo.py | signbank/video/convertvideo.py | #!/usr/bin/python
try:
from django.conf import settings
FFMPEG_PROGRAM = settings.FFMPEG_PROGRAM
FFMPEG_OPTIONS = settings.FFMPEG_OPTIONS
except:
FFMPEG_PROGRAM = "/Applications/ffmpegX.app/Contents/Resources/ffmpeg"
#FFMPEG_OPTIONS = ["-vcodec", "libx264", "-an", "-vpre", "hq", "-crf", "22", "-thr... | Python | 1 | @@ -3366,16 +3366,54 @@
conds()%0A
+ position = 0.5 # Half way through%0A
targ
|
9fb1fbba0546676794535e7d79d25b10d2ad176f | Fix dtypes of erfa input arrays | astropy/coordinates/astrom_manager.py | astropy/coordinates/astrom_manager.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains a helper function to fill erfa.astrom struct and a
ScienceState, which allows to speed up coordinate transformations at the
expense of accuracy.
"""
import numpy as np
import erfa
from ..time import Time
from ..utils.state import ... | Python | 0.000012 | @@ -497,17 +497,29 @@
_dut1utc
+,%0A pav2pv
%0A
-
)%0A%0A__all
@@ -2251,18 +2251,26 @@
hape
- + (2, 3,)
+, dtype=erfa.dt_pv
)%0A
@@ -3459,16 +3459,22 @@
humidity
+.value
,%0A
@@ -3496,21 +3496,18 @@
wl.value
+,
%0A
-
@@ -4320,22 +4320,14 @@
v =
-np.concatenate
+pav2pv
(%0A
@@ -433... |
977c05163620dabedb5e843a0eefd4024bf6458a | handle case when swiftclient is not installed | cumulus/authentication.py | cumulus/authentication.py | import pyrax
try:
import swiftclient
except ImportError:
pass
from cumulus.settings import CUMULUS
class Auth(object):
connection_kwargs = {}
use_pyrax = CUMULUS["USE_PYRAX"]
use_snet = CUMULUS["SERVICENET"]
region = CUMULUS["REGION"]
username = CUMULUS["USERNAME"]
api_key = CUMULUS["... | Python | 0 | @@ -4644,17 +4644,56 @@
chObject
-,
+:%0A return None%0A except
swiftcl
|
bf488717da2aeb843907fb63f2d1d5e423481a1d | Add unit test for HVVersionsLikelySafeForMigration | test/py/ganeti.utils.version_unittest.py | test/py/ganeti.utils.version_unittest.py | #!/usr/bin/python
#
# Copyright (C) 2013 Google Inc.
# 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. Redistributions of source code must retain the above copyright notice,
# this list of... | Python | 0 | @@ -4465,16 +4465,801 @@
, 3))%0A%0A%0A
+class HVVersionsLikelySafeForMigrationTest(unittest.TestCase):%0A def testHVVersionsLikelySafeForMigration(self):%0A self.assertTrue(%0A version.HVVersionsLikelySafeForMigration(%5B4, 0%5D, %5B4, 1%5D))%0A self.assertFalse(%0A version.HVVe... |
4fcbbfe79615776a7bf308424efadb7771248334 | Fix __init__ of CClass and RClass | cupy/indexing/generate.py | cupy/indexing/generate.py | # flake8: NOQA
# "flake8: NOQA" to suppress warning "H104 File contains nothing but comments"
# class s_(object):
import numpy
import six
import cupy
from cupy import core
from cupy.creation import from_data
from cupy.manipulation import join
class AxisConcatenator(object):
"""Translates slice objects to conc... | Python | 0.000017 | @@ -2730,22 +2730,16 @@
_init__(
-self,
-1, ndmi
@@ -3618,20 +3618,16 @@
_init__(
-self
)%0A%0Ar_ =
|
f904dce3006184b464d414c0cafe930b8c10a95b | Update P03_writingExcel fixed warnings by changing depreciated methods | books/AutomateTheBoringStuffWithPython/Chapter12/P03_writingExcel.py | books/AutomateTheBoringStuffWithPython/Chapter12/P03_writingExcel.py | # This program uses the OpenPyXL module to manipulate Excel documents
# Creating and Saving Excel Documents
import openpyxl
wb = openpyxl.Workbook()
print(wb.sheetnames)
sheet = wb.active
print(sheet.title)
sheet.title = "Spam Bacon Eggs Sheet"
print(wb.sheetnames)
wb = openpyxl.load_workbook("example.xlsx")
sheet =... | Python | 0 | @@ -450,33 +450,26 @@
rint(wb.
-get_
sheet
-_
names
-()
)%0Awb.cre
@@ -489,33 +489,26 @@
rint(wb.
-get_
sheet
-_
names
-()
)%0Awb.cre
@@ -556,33 +556,26 @@
rint(wb.
-get_
sheet
-_
names
-()
)%0Awb.cre
@@ -624,33 +624,26 @@
rint(wb.
-get_
sheet
-_
names
-()
)%0A%0Awb.re
@@ -650,36 +650,12 @@
move
-_shee... |
3fa5b473280917bbeb8e5a08069e38223438e482 | test project_properties_and_docker_text, For travis test, get using name instead of get id | buildbuild/projects/tests/test_project_properties_and_docker_text.py | buildbuild/projects/tests/test_project_properties_and_docker_text.py | from django.test import TestCase
from django.test.client import Client
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError
from projects.views import MakeProjectView
from projects.models import Project
from teams.models import Team
from users.models import User
class MakeProjec... | Python | 0 | @@ -5808,32 +5808,92 @@
Language = 0%0A
+ # For travis test, get using name instead of get id%0A
project
@@ -5917,18 +5917,33 @@
.get
-_
+(name = self.
project
-(1
+_name
)%0A
|
ac4a7c96f7ceab2b6095124d82a89e6d1ff2ffe4 | Fix indices | QGL/BasicSequences/Feedback.py | QGL/BasicSequences/Feedback.py | from ..PulsePrimitives import *
from ..Compiler import compile_to_hardware
from ..PulseSequencePlotter import plot_pulse_files
from .helpers import create_cal_seqs
from itertools import product
import operator
from ..ControlFlow import *
from functools import reduce
@qfunction
def qreset(qubits, signVec, measDelay, b... | Python | 0.000037 | @@ -1346,19 +1346,35 @@
m(%5Bt*2**
-ind
+(len(qubits)-ind-1)
for ind
|
1304b1b37c7a1acc94a9feaf2b80a7e72fd17268 | Update test that was checking comment strings for new integer implementation | packages/Python/lldbsuite/test/lang/swift/printdecl/TestSwiftTypeLookup.py | packages/Python/lldbsuite/test/lang/swift/printdecl/TestSwiftTypeLookup.py | # TestSwiftTypeLookup.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONT... | Python | 0 | @@ -4537,35 +4537,39 @@
substrs=%5B'Create
+s
a
-n
+ new
instance'%5D,%0A
@@ -4688,19 +4688,23 @@
%5B'Create
+s
a
-n
+ new
instanc
|
c3b3e2e50e61738640d54a8615049757028a7f91 | Put generation of communications in jobs and allow tracking the progress | partner_communication_switzerland/wizards/generate_communication_wizard.py | partner_communication_switzerland/wizards/generate_communication_wizard.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | Python | 0 | @@ -465,16 +465,58 @@
fe_eval%0A
+from odoo.addons.queue_job.job import job%0A
%0A%0Aclass
@@ -1204,16 +1204,428 @@
%0A )%0A%0A
+ @api.multi%0A def _compute_progress(self):%0A s_wizards = self.filtered(%0A lambda w: w.res_model == 'recurring.contract')%0A for wizard in s_wizards:%0... |
ea5266ee5ec2f6fd252da28d34110867b7e4325f | fix non-int suggestion IDs | controllers/suggestions/suggest_offseason_event_review_controller.py | controllers/suggestions/suggest_offseason_event_review_controller.py | from datetime import datetime
from difflib import SequenceMatcher
from consts.account_permissions import AccountPermissions
from consts.event_type import EventType
from controllers.suggestions.suggestions_review_base_controller import \
SuggestionsReviewBaseController
from database.event_query import EventListQuer... | Python | 0.000276 | @@ -5062,28 +5062,17 @@
-suggestion_id = int(
+id_str =
self
@@ -5100,17 +5100,84 @@
ion_id%22)
-)
+%0A suggestion_id = int(id_str) if id_str.isdigit() else id_str
%0A
|
170b1d80b5c01da5326be591a742b454c193525c | Update plugins/postgres/dbt/adapters/postgres/connections.py | plugins/postgres/dbt/adapters/postgres/connections.py | plugins/postgres/dbt/adapters/postgres/connections.py | from contextlib import contextmanager
import psycopg2
import dbt.exceptions
from dbt.adapters.base import Credentials
from dbt.adapters.sql import SQLConnectionManager
from dbt.logger import GLOBAL_LOGGER as logger
from dbt.helper_types import Port
from dataclasses import dataclass
from typing import Optional
@dat... | Python | 0 | @@ -3000,33 +3000,32 @@
de:%0A
-
kwargs%5B'sslmode'
|
a27b9753969173f4e499fe93dfe3bf61b9d6482d | Test with live server | ambulances/tests/test_mqtt.py | ambulances/tests/test_mqtt.py | import subprocess, time, os
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.contrib.gis.geos import Point
from django.utils import timezone
from rest_f... | Python | 0 | @@ -3015,27 +3015,16 @@
.reload(
-ambulances.
mqttupda
|
4cea2c4f7440bddaf0bbd8982ea0fc37112d67df | Include source-[xyz] and target-[xyz]. | analysis/compress-movement.py | analysis/compress-movement.py | #!/usr/bin/env python
import climate
import joblib
import lmj.pca
import numpy as np
import os
import pandas as pd
import database
logging = climate.get_logger('compress')
MARKERS = [
'marker00-r-head-back',
'marker01-r-head-front',
'marker02-l-head-front',
'marker03-l-head-back',
'marker06-r-co... | Python | 0.000001 | @@ -1627,55 +1627,110 @@
-df = pd.DataFrame(trial.df%5B%5B'source', 'target'%5D
+init = %5Bc for c in trial.columns if c%5B:6%5D in ('source', 'target')%5D%0A df = pd.DataFrame(trial.df%5Binit
%5D, i
|
0223acdf0a5121bd6c96fb06651281f785285243 | Update settings.py | gis_csdt/settings.py | gis_csdt/settings.py | # Django settings for gis project.
import os
PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__))
DEBUG = True # False
ALLOWED_HOSTS = ['*'] ##FOR TESTING ONLY
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
# 'ENGINE': 'django.contrib.gis.db... | Python | 0.000001 | @@ -6016,289 +6016,4 @@
one%0A
-%0A# Make sure a GOOGLE_API_KEY is defined%0Atry:%0A GOOGLE_API_KEY # the key is dummy%0Aexcept NameError:%0A raise %22To use GIS, you need to define a GOOGLE_API_KEY%22%0Atry:%0A CENSUS_API_KEY # the key is dummy%0Aexcept NameError:%0A raise %22To use GIS, you need to def... |
e86bc2c780e9ba3f4008bfb19fec02dedfa81759 | 修改文案。 | src/libs/ui.py | src/libs/ui.py | # -*- coding: utf-8 -*-
import wx
import common_operations as co
class Frame(wx.Frame):
ID_HOSTS_TEXT = wx.NewId()
def __init__(
self, parent=None, id=wx.ID_ANY, title="Switch Host!", pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE,
TaskBarIcon=None
):
... | Python | 0 | @@ -2639,10 +2639,10 @@
, u%22
-%E5%85%B3%E9%97%AD
+%E9%9A%90%E8%97%8F
%22, w
|
31e081fe47c1e72d6655d3652d3107baf323f870 | Add self parameter to default() to keep PyLint happy | orges/args.py | orges/args.py | from paramspec import ParamSpec
from inspect import getargspec
import itertools
def call(f, fargs):
args, vargs, kwargs, _ = getargspec(f)
if vargs is not None:
raise CallNotPossibleError(
"Functions with variable arguments are not supported")
if kwargs is not None:
fkwargs = dict()
for f... | Python | 0 | @@ -135,19 +135,17 @@
gspec(f)
-
%0A
+
%0A if va
@@ -513,22 +513,16 @@
fargs%5D)
-
%0A%0A if
@@ -1679,16 +1679,20 @@
default(
+self
):%0A p
@@ -2708,33 +2708,32 @@
r parameter: %25s%22
-
%0A %25 (param.
@@ -2968,17 +2968,16 @@
ter: %25s%22
-
%0A %25
@@ -2991,20 +2991,16 @@
.name,... |
b3056ce838ddbc7a374436427c950cbd3667731f | Use underscores_for_vars, not camelCase. | flotype/bridge.py | flotype/bridge.py | import logging
import traceback
from collections import defaultdict
from flotype import util, connection, reference, serializer
'''
@package bridge
A Python API for bridge clients.
'''
class Bridge(object):
'''Interface to the Bridge server.'''
def __init__(self, **kwargs):
'''Initialize Bridge.
... | Python | 0.000001 | @@ -6528,17 +6528,18 @@
def get
-C
+_c
lient(se
|
c34b1d8e2d78641fbfbf7cc644a57dde04b2e6d3 | Update 03_Proximity_Indicator.py | 03_Proximity_Indicator/03_Proximity_Indicator/03_Proximity_Indicator.py | 03_Proximity_Indicator/03_Proximity_Indicator/03_Proximity_Indicator.py | import MCP3202
import wiringpi,time,os
from time import strftime
wiringpi.wiringPiSetup()
wiringpi.pinMode(1,1)
wiringpi.pinMode(21,1)
def translate(value,leftMin,leftMax,rightMin,rightMax):
# Figure out how 'wide' each range is
leftSpan = leftMax - leftMin
rightSpan = rightMax - rightMin
# Convert the left range ... | Python | 0 | @@ -748,16 +748,17 @@
o exit%22%0A
+%09
%09if map
@@ -765,16 +765,17 @@
%3C= 200:%0A
+%09
%09%09wiring
@@ -787,32 +787,33 @@
gitalWrite(1,1)%0A
+%09
%09%09wiringpi.digit
@@ -820,32 +820,33 @@
alWrite(21,1)%0A%09%09
+%09
time.sleep(map/1
@@ -846,24 +846,25 @@
p(map/1000)%0A
+%09
%09%09# Write 0
@@ -892,32 +8... |
eb8e14ce45c0742f64b7df493c37f0c2cbcf2fa1 | Fix gene_events: datetime.timedelta(..) <= 0 does not work | orgviz/cal.py | orgviz/cal.py | import time
import datetime
import orgparse.date
from .event import nodes_to_events
def summary_from_node(node):
heading = node.heading
tags = node.tags
if tags:
summary = "%s [%s]" % (heading, "|".join(tags))
return summary
else:
return heading
def dt2ut(dt):
"""Conver... | Python | 0.00479 | @@ -2293,13 +2293,8 @@
tion
- %3C= 0
:%0A
|
f6216cdd9be3db07c6f2271d7f0bbe39efa39766 | Use custom formatter in orgviz.cli | orgviz/cli.py | orgviz/cli.py | """
OrgViz command line interface.
"""
def get_parser(commands):
"""
Generate argument parser given a list of subcommand specifications.
:type commands: list of (str, function, function)
:arg commands:
Each element must be a tuple ``(name, adder, runner)``.
:param name: subcommand... | Python | 0 | @@ -33,16 +33,171 @@
e.%0A%22%22%22%0A%0A
+import argparse%0Aimport textwrap%0A%0A%0Aclass Formatter(argparse.RawDescriptionHelpFormatter,%0A argparse.ArgumentDefaultsHelpFormatter):%0A pass%0A%0A
%0Adef get
@@ -940,48 +940,8 @@
%22%22%22%0A
- import argparse%0A import textwrap%0A
@@ -1... |
71e1e09f750eac6cdf8ebb718190f07ae560f6e6 | Fix message | floyd/cli/auth.py | floyd/cli/auth.py | import click
import webbrowser
import floyd
from floyd.client.auth import AuthClient
from floyd.manager.auth_config import AuthConfigManager
from floyd.model.access_token import AccessToken
from floyd.log import logger as floyd_logger
@click.command()
def login():
"""
Log into Floyd via Auth0.
"""
cl... | Python | 0.000002 | @@ -330,19 +330,23 @@
l = %22%7B%7D/
-cli
+welcome
%22.format
@@ -388,21 +388,29 @@
nfirm('A
-ccess
+uthentication
token p
@@ -556,16 +556,25 @@
'Please
+copy and
paste th
@@ -575,20 +575,21 @@
ste the
-code
+token
here',
|
027701882a9d630d14a927a378048bd8b45bf01b | Fix a bug where content of unchecked_node_pool was overwriting node_pool | src/manager.py | src/manager.py | # -*- coding: utf-8 -*-
import base64
import logging
import pickle
import queue
import random
import threading
import time
from connection import Connection
import shared
class Manager(threading.Thread):
def __init__(self):
super().__init__(name='Manager')
self.q = queue.Queue()
self.last... | Python | 0.000246 | @@ -3829,32 +3829,42 @@
shared.
+unchecked_
node_pool = set(
|
3e3c885a42ac1422e6e1be763c4fb8cb58d51595 | remove print | shadowsocks/encrypt_rc4_md5.py | shadowsocks/encrypt_rc4_md5.py | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# 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 the rights
# to use, copy, modify, me... | Python | 0.000793 | @@ -1321,31 +1321,8 @@
st()
-%0A print len(rc4_key)
%0A%0A
|
f0d435aedbbc97fa1a0eb9d3f87207ee5e86e5cc | add Caching File Loader class not write method cache file after to render | quik.py | quik.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re, operator, os
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
xrange = range
class Template:
def __init__(self, content):
self.content = content
self.root_element = None
def merge(self, namespa... | Python | 0 | @@ -2182,12 +2182,1298 @@
text(name)%0A%0A
+%0Aclass CachingFileLoader:%0A def __init__(self, basedir, debugging=False):%0A self.basedir = basedir%0A self.known_templates = %7B%7D%0A self.debugging = debugging%0A if debugging:%0A print(%22creating caching file loader with base... |
fef5b19814adf60a64390869a9607d2db92652eb | Stop using test schema now v2 is the only supported commodities schema. | edce/eddn.py | edce/eddn.py | import sys
if sys.version_info.major < 3:
print("You need to use Python 3.x, e.g. python3 <filename>")
exit()
import json
import hashlib
import time
import datetime
import requests
import math
import edce.config
import edce.globals
import edce.error
testSchema = True
def convertCategor... | Python | 0 | @@ -287,19 +287,20 @@
chema =
-Tru
+Fals
e%0D%0A%0D%0Adef
|
6f8f9ec2d4228143b609262e19c5a231cc8bc1bb | Iterate to v0.0.5 | repl.py | repl.py | #!/usr/bin/python3
"""Command line runtime for Tea."""
import runtime.lib
from runtime import lexer, parser, env
TEA_VERSION = "0.0.4-dev"
TEA_TITLE = "Tea @" + TEA_VERSION
CLI_SYMBOL = "#> "
CLI_SPACE = " " * 3
CLI_RESULT = "<- "
def interpret(expression, context):
"""Interpret an expression by tokenizing, par... | Python | 0.999999 | @@ -131,9 +131,9 @@
0.0.
-4
+5
-dev
|
87518927344357c5905a72ebda9e78f94381e0c7 | add lecture departments while parsing lectures | itupass/utils/lectureparser.py | itupass/utils/lectureparser.py | from datetime import datetime
import re
import requests
from bs4 import BeautifulSoup
from flask import current_app
from itupass.models import Department, Lecture, LectureSchedule
def get_database():
from itupass import get_db
return get_db(current_app)
LECTURES_CODES_URL = "http://www.sis.itu.edu.tr/tr/der... | Python | 0.000196 | @@ -2239,16 +2239,109 @@
.save()%0A
+ for dep in lecture_deps:%0A new_lecture.add_department(dep)%0A
|
347d89640f6c9cdd13068152b77ab3c257f49088 | Add trait config for reports | seedsource_core/django/seedsource/report_config.py | seedsource_core/django/seedsource/report_config.py | from collections import namedtuple
Variable = namedtuple(
'Variable',
['label', 'multiplier', 'format_value', 'format_transfer', 'metric_label', 'imperial_label']
)
Constraint = namedtuple(
'Constraint',
['label', 'format_value', 'format_range']
)
def convert_to_f(value):
return value * 1.8 + 32... | Python | 0 | @@ -3554,24 +3554,324 @@
o_units, '',
+ ''),%0A 'S-atva': Variable('Survival', 1, format_no_units, format_no_units, '', ''),%0A 'PC1': Variable('PC1', 1, format_no_units, format_no_units, '', ''),%0A 'PC2': Variable('PC2', 1, format_no_units, format_no_units, '', ''),%0A 'PC3': Variable('PC3', 1, format_no... |
5a6fbaf0221f7ad5617e5222ff1058f3ca38ee1d | Fix typo | src/prometheus_async/tx/_decorators.py | src/prometheus_async/tx/_decorators.py | # Copyright 2016 Hynek Schlawack
#
# 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 writi... | Python | 0.999999 | @@ -776,17 +776,16 @@
%60%60 with
-
runtime
|
2a662d04caf68629fe357b45450e5be3f950f03e | remove typo | src/py/gopythongo/shared/aptly_base.py | src/py/gopythongo/shared/aptly_base.py | # -* encoding: utf-8 *-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from typing import Any, List
import configargparse
import gopythongo.shared.aptly_args as _aptl... | Python | 0.999999 | @@ -1822,17 +1822,16 @@
super().
-.
__init__
|
72ad1e05b15aa5740e6220e94948fac327a61642 | fix bug of tests | tests/chainer_tests/training_tests/triggers_tests/test_interval_trigger.py | tests/chainer_tests/training_tests/triggers_tests/test_interval_trigger.py | from __future__ import division
import os
import tempfile
import unittest
from chainer import serializers
from chainer import testing
from chainer import training
class DummyUpdater(training.Updater):
def __init__(self, iters_per_epoch):
self.iteration = 0
self.iters_per_epoch = iters_per_epoch... | Python | 0 | @@ -1146,16 +1146,29 @@
ation'),
+ 'resume': 4,
%0A
@@ -1300,32 +1300,45 @@
': (3, 'epoch'),
+ 'resume': 4,
%0A 'expect
@@ -1470,32 +1470,45 @@
(1.5, 'epoch'),
+ 'resume': 4,
%0A 'expect
@@ -1639,32 +1639,45 @@
': (1, 'epoch'),
+ 'resume': 3,
%0A 'expect
@@ -1811,16 +1811,29 @@
epo... |
57059d40223d6284d1b2c9f3034b30f6bd61c44f | Fix streams broker compatibility test. | tests/kafkatest/tests/streams/streams_broker_compatibility_test.py | tests/kafkatest/tests/streams/streams_broker_compatibility_test.py | # 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, Version 2.0
# (the "License"); you may not use ... | Python | 0.000181 | @@ -3266,39 +3266,37 @@
til(
-'FATAL: An unexpected exception
+%22Exception in thread %5C%22main%5C%22
org
@@ -3393,17 +3393,17 @@
OFFSETS
-'
+%22
,%0A
@@ -3487,49 +3487,36 @@
sg=%22
-Never saw 'FATAL: An unexpected exception
+Exception in thread %5C%22main%5C%22
org
@@ -3613,32 +3613,16 @@
OFFSETS
-' ... |
b068f096a529357660a83938db4dd9ba7cb70ec3 | update lines_of_code_changed endpoint to be a metric, not a timeseries | augur/datasources/githubapi/routes.py | augur/datasources/githubapi/routes.py | def create_routes(server):
github = server._augur['githubapi']()
#####################################
### DIVERSITY AND INCLUSION ###
#####################################
#####################################
### GROWTH, MATURITY, AND DECLINE ###
##################################... | Python | 0.000024 | @@ -1280,34 +1280,30 @@
server.add
-Timeseries
+Metric
(github.line
|
46a39872fb77980930f7121e9f870f3c2f3d614f | remove \\ at the end of commands | awsf/aws_upload_output_update_json.py | awsf/aws_upload_output_update_json.py | #!/usr/bin/python
import json
import sys
import os
import time
import boto3
json_old=sys.argv[1]
json_out=sys.argv[2]
logfile = sys.argv[3]
json_new=sys.argv[4]
source_directory = '/data1/out/'
def parse_command(logfile):
"""
parse commands from the log file and returns the commands as a list
of command... | Python | 0.000077 | @@ -690,16 +690,28 @@
end(line
+.strip('%5C%5C')
)%0A
|
54e618db2ef5fd226c5514dd15d8f792fd0d8320 | test org role as child for team 400s | awx/main/tests/unit/api/test_views.py | awx/main/tests/unit/api/test_views.py | import pytest
from awx.api.views import (
ApiV1RootView,
)
@pytest.fixture
def mock_response_new(mocker):
m = mocker.patch('awx.api.views.Response.__new__')
m.return_value = m
return m
class TestApiV1RootView:
def test_get_endpoints(self, mocker, mock_response_new):
endpoints = [
... | Python | 0 | @@ -1,12 +1,24 @@
+import mock%0A
import pytes
@@ -29,52 +29,215 @@
rom
-awx.api.views import (%0A ApiV1RootView,%0A)%0A
+rest_framework.test import APIRequestFactory%0Afrom rest_framework.test import force_authenticate%0A%0Afrom awx.api.views import (%0A ApiV1RootView,%0A TeamRolesList,%0A)%0A%0Afrom awx.m... |
26526e6860ad28588c77cd9c9ea376a636da53e8 | debug for method name. | daemon/database/artistrepo.py | daemon/database/artistrepo.py | import logging
from decorator.injectdbsession import inject_db_session
from .entity import Artist
from sqlalchemy.orm import lazyload
@inject_db_session()
class ArtistRepo:
logger = logging.getLogger(__name__)
def get_artists_by_pagecpp(self, index, offset):
query = self._session.query(Artist).optio... | Python | 0 | @@ -242,11 +242,8 @@
page
-cpp
(sel
|
662907504a93ce41c3543bd9eb6f2fc40ae54edf | Fix hire ratio to append only when job is being advertised in new term | data/analysis/importer.py | data/analysis/importer.py | from mongoengine import *
from datetime import datetime
from models.employer import Employer
from models.job import Job
from models.applicant import Applicant
import engine
def import_job(**kwargs):
"""Import job from Jobmine.
Keyword arguments:
employer_name -- Employer name
job_title -- Title of... | Python | 0 | @@ -3637,16 +3637,250 @@
b.term:%0A
+ # Add hire ratio for previous term%0A hire_ratio = float(job.openings - remaining) / job.openings%0A %0A job.hire_rate.add_rating(hire_ratio)%0A %0A
@@ -4628,89 +4628,8 @@
))%... |
ae1642842fb945013741d576022c85eba49033d8 | update Croydon import script for parl.2017-06-08 | polling_stations/apps/data_collection/management/commands/import_croydon.py | polling_stations/apps/data_collection/management/commands/import_croydon.py | """
Import Harrow
"""
from time import sleep
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseCsvStationsCsvAddressesImporter
from data_finder.helpers import geocode, geocode_point_only, PostcodeError
from addressbase.models import Address
class Command(BaseCsvStationsCs... | Python | 0 | @@ -1,436 +1,158 @@
-%22%22%22%0AImport Harrow%0A%22%22%22%0Afrom time import sleep%0A%0Afrom django.contrib.gis.geos import Point%0A%0Afrom data_collection.management.commands import BaseCsvStationsCsvAddressesImporter%0Afrom data_finder.helpers import geocode, geocode_point_only, PostcodeError%0Afrom addressbase.mode... |
fdca593231f0d79fe79d5dce306c80913a98359e | Create a default declarative base if app not instantiated | watson/auth/models.py | watson/auth/models.py | # -*- coding: utf-8 -*-
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Table, SmallInteger
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from watson.common import imports
from watson.framework.applications import Base
fr... | Python | 0.000009 | @@ -189,17 +189,35 @@
red_attr
+, declarative_base
%0A
-
from sql
@@ -384,16 +384,25 @@
zation%0A%0A
+try:%0A
Model =
@@ -462,16 +462,105 @@
_base')%0A
+except:%0A # Application is not instantiated%0A Model = declarative_base(name='Model')%0A
%0A%0Aclass
|
72ccb03f4dad16f5b8fabaf6ef15c7373f6318a4 | rename methods | wcpan/worker/queue.py | wcpan/worker/queue.py | import asyncio
import contextlib as cl
import multiprocessing as mp
from typing import Callable
from wcpan.logger import DEBUG, EXCEPTION
from .task import regular_call, ensure_task, MaybeTask
class AsyncQueue(object):
def __init__(self, maximum=None):
self._max = mp.cpu_count() if maximum is None else... | Python | 0.000032 | @@ -377,37 +377,16 @@
(self):%0A
- self.start()%0A
@@ -469,257 +469,17 @@
lf.s
-top()%0A%0A def start(self):%0A if self._consumer_list:%0A return%0A%0A loop = asyncio.get_event_loop()%0A self._consumer_list = %5B%0A loop.create_task(self._consume())%0A ... |
b33d3cc493496a549aaa2392b8c3014fa1347109 | Improve type hints. | tokenize_js.py | tokenize_js.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Tokenizes JavaScript.
"""
import json
import subprocess
import tempfile
from pathlib import Path
from token_utils import Token
THIS_DIRECTORY = Path(__file__).parent
TOKENIZE_JS_BIN = (str(THIS_DIRECTORY / 'tokenize-js' / 'wrapper.sh'),)
CHECK_SYNTAX_BIN = (*TOKEN... | Python | 0 | @@ -41,16 +41,623 @@
-8 -*-%0A%0A
+# Copyright 2017 Eddie Antonio Santos %3Ceasantos@ualberta.ca%3E%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.or... |
42d5553878673dcbc45e7146164c86f418312152 | Add models to Admin | tools/admin.py | tools/admin.py | from django.contrib import admin
# Register your models here.
| Python | 0 | @@ -31,33 +31,566 @@
in%0A%0A
-# Register your models here.
+%0Afrom .models import Character,CharacterNotes,CharacterNotesAnswer%0A%0A%0A# Register your models here.%0A@admin.register(Character)%0Aclass CharacterAdmin(admin.ModelAdmin):%0A list_display = ('name','owner',)%0A readonly_fields = ('owner',)%0A%0A%0... |
c61ed50bb83464c337737739a0f4d7a8c7c91bac | add select related for address | apps/schools/api_views/school.py | apps/schools/api_views/school.py | from schools.models import School, DiseInfo, MdmAgg
from schools.filters import SchoolFilter
from common.views import KLPListAPIView, KLPDetailAPIView, KLPAPIView
from common.models import SumCase
from common.mixins import CacheMixin
from schools.serializers import SchoolListSerializer, SchoolInfoSerializer,\
Schoo... | Python | 0 | @@ -1410,16 +1410,27 @@
s__type'
+, 'address'
)%0A%0A
|
c2c0e8e89f3fdac0d6c677d323b782654fbc1815 | Update trend_following_strategy.py | vnpy/app/portfolio_strategy/strategies/trend_following_strategy.py | vnpy/app/portfolio_strategy/strategies/trend_following_strategy.py | from typing import List, Dict
from datetime import datetime
from vnpy.app.portfolio_strategy import StrategyTemplate, StrategyEngine
from vnpy.trader.utility import BarGenerator, ArrayManager
from vnpy.trader.object import TickData, BarData
class TrendFollowingStrategy(StrategyTemplate):
""""""
author = "用P... | Python | 0.000002 | @@ -2955,24 +2955,69 @@
ate_bar(bar)
+%0A%0A for vt_symbol, bar in bars.items():
%0A
@@ -3058,16 +3058,17 @@
return%0A
+%0A
|
67097af3d90f03d474f2c8c10f48daded917cfc1 | Use binascii module instead of str.{en,de}code functions | BitTornado/BTcrypto.py | BitTornado/BTcrypto.py | # Written by John Hoffman
# based on code by Uoti Urpala
# see LICENSE.txt for license information
from __future__ import generators # for python 2.2
import random
try:
from os import urandom
except:
random.seed()
urandom = lambda x: ''.join([chr(random.randint(0,255)) for i in xrange(x)])
imp... | Python | 0.000001 | @@ -158,22 +158,51 @@
%0Aimport
-random
+sha%0D%0Aimport random%0D%0Aimport binascii
%0D%0Atry:%0D%0A
@@ -338,28 +338,16 @@
ge(x)%5D)%0D
-%0Aimport sha%0D
%0A%0D%0Atry:%0D
@@ -795,22 +795,26 @@
ong(
-x.encode('hex'
+binascii.hexlify(x
), 1
@@ -846,103 +846,55 @@
-x = hex(x).lstrip('0x').rstrip('Ll')%0D%0A ... |
f210f11d46d6eeee496f2cd4a19d99614787375e | Add fields attribute | web/problems/views.py | web/problems/views.py | from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, render, redirect
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.forms import Form, IntegerField, CharField, Textarea
from django.http import HttpResponse
from rest_framework.re... | Python | 0 | @@ -2709,32 +2709,55 @@
model = Problem
+%0A fields = '__all__'
%0A%0A def get_ob
|
112e9954a75427e48ede96ff623bd7d1c869968c | optimise imports | tests/maths/test_ols_sklearn_diabetes.py | tests/maths/test_ols_sklearn_diabetes.py |
from unittest import TestCase
from pytest import approx
import statsmodels.api as sm
from sklearn import datasets
import numpy as np
from fastats.maths import ols, ols_qr, ols_cholesky, ols_svd
from fastats.maths.ols import (
add_intercept, r_squared, sum_of_squared_residuals,
fitted_values, residuals, adjus... | Python | 0.000392 | @@ -29,33 +29,26 @@
se%0A%0A
-from pytest import approx
+import numpy as np
%0Aimp
@@ -73,16 +73,42 @@
i as sm%0A
+from pytest import approx%0A
from skl
@@ -127,35 +127,16 @@
datasets
-%0Aimport numpy as np
%0A%0Afrom f
|
29b8b4604460dc54331f0f10a93a6bb6803b3af3 | fix example of plot_RGB_colourspaces_gamuts | colour/examples/plotting/examples_volume_plots.py | colour/examples/plotting/examples_volume_plots.py | # -*- coding: utf-8 -*-
"""
Showcases colour models volume and gamut plotting examples.
"""
import numpy as np
from colour.plotting import (plot_RGB_colourspaces_gamuts, plot_RGB_scatter,
colour_style)
from colour.utilities import message_box
message_box('Colour Models Volume and Gamut P... | Python | 0.000008 | @@ -775,25 +775,8 @@
-style=%7B%0A '
face
@@ -775,35 +775,33 @@
face_colours
-':
+=
(None, (0.25, 0.
@@ -812,29 +812,24 @@
0.25)),%0A
- '
edge_colours
@@ -828,19 +828,17 @@
_colours
-':
+=
(None, (
@@ -861,21 +861,16 @@
)),%0A
- '
edge_alp
@@ -867,27 +867,25 @@
edge_alpha
-'... |
a55ffe79cedc75964281a50e7063a6489a56b51b | Add shutting-down state to active instances | tools/utils.py | tools/utils.py | #!/usr/bin/env python
import logging
import boto.ec2
import sys
import subprocess
import select
import time
logging.basicConfig(level=logging.INFO)
def get_active_instances(conn):
active = [instance for res in conn.get_all_instances()
for instance in res.instances
if instance.state in ... | Python | 0.000012 | @@ -401,16 +401,33 @@
stopped'
+, 'shutting-down'
%5D)%5D%0A
|
11f933e986dd9e2c62b852ca38a37f959c10145e | Fix FindDepotToolsInPath not working in some cases | tools/utils.py | tools/utils.py | #!/usr/bin/env python
''' This script provides utils for python scripts in cameo.
'''
import os
import sys
import subprocess
def TryAddDepotToolsToPythonPath():
depot_tools = FindDepotToolsInPath()
if depot_tools:
sys.path.append(depot_tools)
def FindDepotToolsInPath():
paths = os.getenv('PATH').split(os.... | Python | 0.001023 | @@ -348,16 +348,129 @@
paths:%0A
+ if os.path.basename(path) == '':%0A # path is end with os.path.pathsep%0A path = os.path.dirname(path)%0A
if o
|
d8c4384becbb094aac8efd90c5d7fa01d17b3661 | fix _get_tender | purchase_requisition_extended/model/purchase_order.py | purchase_requisition_extended/model/purchase_order.py | # -*- coding: utf-8 -*-
#
#
# Copyright 2013 Camptocamp SA
#
# 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 late... | Python | 0.998609 | @@ -1265,16 +1265,460 @@
Mode')%0A%0A
+ @api.model%0A def _get_tender_fields(self):%0A %22%22%22 Return list of field with prefix 'tender_' %22%22%22%0A return %5Bfname for fname in self._fields.keys()%0A if fname.startswith('tender_')%5D%0A @api.model%0A def _get_fields_to_cop... |
de753e0e4350091468732baf6e549277f8f5f2f6 | Update UncorrelatedUniverseSelectionModel.py | Algorithm.Framework/Selection/UncorrelatedUniverseSelectionModel.py | Algorithm.Framework/Selection/UncorrelatedUniverseSelectionModel.py | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... | Python | 0.000001 | @@ -1035,16 +1035,107 @@
ionModel
+%0Afrom QuantConnect.Indicators import RollingWindow, IndicatorDataPoint%0A%0Aimport pandas as pd
%0A%0Aclass
|
2fe47e3b26b3fc888de4dba004cb04d31a2eb97d | Remove unnecessary getter | tingbot/platform_specific/sdl_wrapper.py | tingbot/platform_specific/sdl_wrapper.py | import pygame
import os
from ..graphics import Surface,color_map
button_callback = None
class Wrapper(Surface):
def __init__(self):
self.surface = pygame.display.set_mode((470, 353))
background = pygame.image.load(os.path.join(os.path.dirname(__file__), 'bot.png'))
self.surface.blit(backgr... | Python | 0.00005 | @@ -577,62 +577,8 @@
))%0A%0A
- def get_screen(self):%0A return self.screen%0A%0A
%0Acla
@@ -1490,20 +1490,14 @@
per.
-get_
screen
-()
%0A%0Ade
|
aadbfdf1604d731c1e9a9df2ecb0650762be4614 | Remove to_absolute_path() call on a non-path value | tools/cmd_line_differ/cmd_line_differ.py | tools/cmd_line_differ/cmd_line_differ.py | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | Python | 0.00057 | @@ -4722,33 +4722,16 @@
_type =
-to_absolute_path(
flags.FL
@@ -4744,17 +4744,16 @@
put_type
-)
%0A%0A befo
|
caf4e1f1e6ff9eac2750920fc4c5b5596b97c3a6 | Update Input_csv_file.py | Code/Input_csv_file.py | Code/Input_csv_file.py |
def read_in():
import csv
import numpy
"""
Opens the ecg CSV file
:param readCSV: pointer to the file
:param times: the time from the signal
:param Voltage: the voltage from the signal
"""
# with open('ecg_data.csv') as csvfile:
# read_csv = csv.reader(csvfile, delimite... | Python | 0.000124 | @@ -1004,20 +1004,16 @@
loat64')
-
%0A ret
|
079c86d124961242b89b692d5e57964babf8c45e | Add initial support for the --quiet option. Remove unused imports. Fix arguments passed to Qt : only the remaining arguments should be passed. | PyMorphogenesis.py | PyMorphogenesis.py | #!/usr/bin/env python
# encoding: utf-8
"""
PyMorphogenesis.py
Created by Olivier Le Floch on 2009-03-17.
Program written by Thomas Deniau and Olivier Le Floch.
Copyright (c) 2009. All rights reserved.
"""
import sys
import math
from optparse import OptionParser
from PyQt4 import QtCore, QtGui
from MainWindow import... | Python | 0 | @@ -216,20 +216,8 @@
sys%0A
-import math%0A
from
@@ -352,67 +352,8 @@
er%0A%0A
-from MorphogenesisImageData import MorphogenesisImageData%0A%0A
prog
@@ -694,23 +694,136 @@
xit%22
-, metavar='FILE
+)%0A %0A parser.add_option(%0A '-q', '--quiet', dest='quiet', default=False, action='store_true',%0A help='be ... |
0d558dfc9d9cc7091ac2f50e64a7b3a7cc289d5c | fix SSLWantReadError | DDDProxy/baseServer.py | DDDProxy/baseServer.py | # -*- coding: UTF-8 -*-
'''
Created on 2015年9月3日
@author: dxw
'''
import logging
import socket
import sys
import time
import traceback
import select
import ssl
from DDDProxy.ThreadPool import ThreadPool
debuglevel = 2
class sockConnect(object):
"""
@type sock: _socketobject
"""
_filenoLoop = 0
def __init_... | Python | 0.000974 | @@ -5026,12 +5026,10 @@
.err
-code
+no
==
|
11f3320413b9746d75470e623809e5e28ebbc712 | Fix python run_webkit_tests wrapper script to work correctly regardless of whether you're running cygwin python or win32 python and regardless of where you're invoking the script from. | webkit/tools/layout_tests/run_webkit_tests.py | webkit/tools/layout_tests/run_webkit_tests.py | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Wrapper around
third_party/WebKit/WebKitTools/Scripts/new-run-webkit-tests"""
import os
import subprocess
import sys
def mai... | Python | 0.000153 | @@ -363,131 +363,24 @@
r =
-sys.argv%5B0%5D;%0A if sys.platform != 'cygwin':%0A src_dir = os.path.abspath(sys.argv%5B0%5D)%0A print src_dir%0A src_dir=
+os.path.abspath(
os.p
@@ -392,108 +392,37 @@
oin(
-o
+sy
s.path
-.dirname(os.path.dirname(os.path.dirname(%0A os.path.dirn... |
1086652e37d8f0d23199e9d2f7ed0be51e17c905 | change the update time | ScheduleAddData.py | ScheduleAddData.py | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import EventsPortal
import sys
def scheduleUpdateSolr(sourceUrl,patternUrl,solrUrl):
"""
"""
# logger.info('***Starting update every hour***')
sched = BlockingScheduler()
sched.add_job(EventsPortal.addDataTo... | Python | 0 | @@ -347,17 +347,18 @@
inutes=
-1
+60
, args=%5B
|
5a7ff93edc0c8307d3d31d71061eb5ea5a43da36 | Fix some bad three-state logic in thrift_linter. | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_linter.py | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_linter.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | Python | 0.999634 | @@ -443,16 +443,66 @@
nitLabel
+%0Afrom pants.option.ranked_value import RankedValue
%0A%0Afrom p
@@ -1069,19 +1069,20 @@
default=
-Non
+Fals
e, actio
@@ -2335,25 +2335,27 @@
# 1.
+ the
option
-s,
--%5Bno-%5D
@@ -2360,16 +2360,45 @@
-%5Dstrict
+, but only if explicitly set.
%0A # 2
@@ -2515,30 +2515,2... |
dddf42d795ef4dc6554468ae601ca03ae02753f8 | Add missing import | DistributedSocialNetworking/api/json_derulo.py | DistributedSocialNetworking/api/json_derulo.py | from urllib.request import urlopen
from urllib.error import HTTPError
import json
from Hindlebook.models import Node, Author, Settings
# Key for the Request Factories
#
# Appending .json() to the end of these gets the json
# or you can store it and get the status_code
#
# eg/ request = FriendRequestFactory(node.host)
... | Python | 0.000466 | @@ -75,16 +75,32 @@
rt json%0A
+import requests%0A
from Hin
|
6522a63d7431e5cddc59a8b04b32c3c3cdcb8352 | disable a test on skipif_circleci | _unittests/ut_dnotebooks/test_nb_coverage_2018_2019.py | _unittests/ut_dnotebooks/test_nb_coverage_2018_2019.py | # -*- coding: utf-8 -*-
"""
@brief test log(time=88s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.ipythonhelper import test_notebook_execution_coverage
from pyquickhelper.pycode import add_missing_development_version, ExtTestCase
import ensae_teaching_cs
class TestNo... | Python | 0.000001 | @@ -229,16 +229,22 @@
import
+(%0A
add_miss
@@ -279,16 +279,38 @@
TestCase
+,%0A skipif_circleci)
%0Aimport
@@ -544,16 +544,46 @@
=True)%0A%0A
+ @skipif_circleci(%22stuck%22)%0A
def
|
a04ff5a0eeb7990c6b50e051847c3f15dcacc198 | Move 'New message created in db' message to the right place. | allmychanges/management/commands/sync_with_mandrill.py | allmychanges/management/commands/sync_with_mandrill.py | import arrow
import requests
import anyjson
from django.core.management.base import BaseCommand
from django.conf import settings
from twiggy_goodies.django import LogMixin
from allmychanges.models import (
User, MandrillMessage,
UserHistoryLog)
class Command(LogMixin, BaseCommand):
help = u"""Sync all us... | Python | 0 | @@ -1045,62 +1045,8 @@
id)%0A
- print 'New message created in db'%0A
@@ -1967,16 +1967,70 @@
e(item))
+%0A print 'New message created in db'
%0A%0A
|
81229e13aa3c9c8ef277bfb24a615c367164545c | Add multi cursor support, close #21 | ExpandRegion.py | ExpandRegion.py | import sublime, sublime_plugin, os
try:
import expand_region_handler
except:
from . import expand_region_handler
class ExpandRegionCommand(sublime_plugin.TextCommand):
def run(self, edit, debug=False):
extension = ""
if (self.view.file_name()):
name, fileex = os.path.splitext(self.view.file_n... | Python | 0 | @@ -358,16 +358,21 @@
+for
region
-=
+in
sel
@@ -387,12 +387,12 @@
el()
-%5B0%5D%0A
+:%0A
@@ -458,16 +458,18 @@
)))%0A
+
+
start =
@@ -487,16 +487,18 @@
n()%0A
+
end = re
@@ -509,16 +509,18 @@
.end()%0A%0A
+
resu
@@ -584,16 +584,18 @@
ension)%0A
+
if r
@@ -607,16 +60... |
ea2bb7e4fec030997307cf0433321ed5c2654a16 | update debounce due to electrical noise | FindMyIPhone.py | FindMyIPhone.py | #!/usr/bin/python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Chen Yew Ming
#
# 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 the rights... | Python | 0 | @@ -1655,16 +1655,40 @@
y_sound(
+%22Raspberry Pi Greetings%22
)%0A%0Adef s
@@ -2246,16 +2246,61 @@
r(pin):%0A
+ sleep(0.1)%0A if isSwitchPressed():%0A
prin
@@ -2318,24 +2318,28 @@
ressed'%0A
+
+
setLedOn()%0A
@@ -2333,24 +2333,28 @@
setLedOn()%0A
+
iCloudPl
@@ -2363,24 +2363,28 ... |
91ff0fcb40d5d5318b71f0eb4b0873fb470265a0 | Add downgrade started applications migration | migrations/versions/f0c9c797c230_populate_application_settings_with_.py | migrations/versions/f0c9c797c230_populate_application_settings_with_.py | """populate application_settings with started apps
Revision ID: f0c9c797c230
Revises: 31850461ed3
Create Date: 2017-02-16 01:02:02.951573
"""
# revision identifiers, used by Alembic.
revision = 'f0c9c797c230'
down_revision = '31850461ed3'
from alembic import op
import sqlalchemy as sa
from puffin.core import docke... | Python | 0 | @@ -418,16 +418,21 @@
for
+a in
running_
@@ -442,28 +442,47 @@
lication
- in running_
+s:%0A user = a%5B0%5D%0A
applicat
@@ -476,34 +476,39 @@
application
-s:
+ = a%5B1%5D
%0A user =
@@ -504,22 +504,143 @@
-user = running
+applications.set_application_started(user, applicat... |
ee4ab950e2a6748af9aefea0dd1cd8f227d6bca8 | Fix linting issues | accelerator/migrations/0099_update_program_model.py | accelerator/migrations/0099_update_program_model.py | # Generated by Django 2.2.28 on 2022-04-20 13:05
from django.db import (
migrations,
models,
)
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0098_update_startup_update_20220408_0441'),
]
operations = [
migrations.AddField(
model_name='prog... | Python | 0 | @@ -587,16 +587,17 @@
),%0A %5D
+%0A
|
78a1f58fc8a44f35336e334fc21c3ede9c2f3413 | fix invoice delete, subcontractor work should be deleted too | account_invoice_subcontractor/subcontractor_work.py | account_invoice_subcontractor/subcontractor_work.py | # -*- coding: utf-8 -*-
###############################################################################
#
# account_invoice_subcontractor for OpenERP
# Copyright (C) 2013-TODAY Akretion <http://www.akretion.com>.
# @author Sébastien BEAU <sebastien.beau@akretion.com>
#
# This program is free software: you can r... | Python | 0 | @@ -3453,32 +3453,52 @@
required=True
+, ondelete='cascade'
),%0A 'invo
|
068722e77db726c85d7f78a1341000bdd84a537c | FIX creation of rigid with no mesh | applications/plugins/Compliant/python/Compliant/sml.py | applications/plugins/Compliant/python/Compliant/sml.py | import os.path
import math
import xml.etree.ElementTree as etree
from Compliant import StructuralAPI
import SofaPython.Tools
import SofaPython.units
from SofaPython import Quaternion
from SofaPython.Tools import listToStr as concat
import SofaPython.sml
import Flexible.sml
def insertRigid(parentNode, rigidModel, par... | Python | 0 | @@ -448,33 +448,114 @@
.density is None
-:
+ and not rigidModel.mesh is None:%0A # compute physics using mesh and density
%0A rigid.s
@@ -655,36 +655,8 @@
el
-se:%0A mass=1.%0A
if n
@@ -670,19 +670,19 @@
dModel.m
-ass
+esh
is None
@@ -695,34 +695,104 @@
- mass = rigidModel... |
beae821d6997bf8257673c391ed6a1fe7f38c682 | change sequence | IPadrDisplay.py | IPadrDisplay.py | from util7SegLED import info7seg_init, info7seg_on, info7seg_allOff
from util7SegLED import info7seg_decimalPoint
from util7SegLED import info7seg_onOff
from util7SegLED import info7seg_onDecimalPointOff
from utilNetworkIP import NetworkIP_get_ipAddress_eth0
import time
'''
v0.2 2015/11/28
- add disp_ipAddress()
... | Python | 0.000131 | @@ -282,24 +282,64 @@
2015/11/28%0A
+ - disp IP address using utilNetworkIP%0A
- add disp
@@ -811,16 +811,49 @@
init()%0A%0A
+disp_0_9_DP(0.5) # initial test%0A%0A
for loop
@@ -934,24 +934,37 @@
sleep(0.5)%0A%0A
+while True:%0A%09
disp_ipAddre
@@ -982,22 +982,41 @@
.5)%0A
-%0Adisp_0_9_DP(0.5
+%09info7seg_all... |
3d2dc3b0d4116e6a875b8f8d8878e0e82639a1d1 | update document | Lib/CPyMongo.py | Lib/CPyMongo.py | from pymongo import MongoClient
try:
from urllib.parse import quote_plus
except Exception:
from urllib import quote_plus
class CPyMongo:
def __init__(self, db_name, user=None, password=None, host=None, port=None):
if host is None or host == "":
host = 'localhost'
if port is None... | Python | 0 | @@ -86,16 +86,21 @@
xception
+ as e
:%0A fr
@@ -128,16 +128,17 @@
e_plus%0A%0A
+%0A
class CP
@@ -596,20 +596,25 @@
+ %22@%22 +
+str(
host
+)
+ %22:%22 +
@@ -614,21 +614,26 @@
+ %22:%22 +
+str(
port)
+)
%5Bdb_name
@@ -2041,13 +2041,8 @@
.drop()%0A
-%0A
|
be7263fa2efa86b3b361b0fcf2933d49ca3b4949 | Add comment note about unused code | MyInfo/views.py | MyInfo/views.py | import datetime
from django.shortcuts import render
from django.http import HttpResponseServerError, HttpResponseRedirect, HttpResponse
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse, reverse_lazy
from lib.api_calls import change_... | Python | 0 | @@ -3156,16 +3156,84 @@
session:
+ # Shouldn't happen, the above get_or_create would error out first.
%0A
|
4ef288afb497d20f31c1a8c68226b74a465f3d01 | Update piece.py | Pieces/piece.py | Pieces/piece.py | class piece(object):
def __init__(self,col):
if col in ["Black","White"]:
self.color = col
else:
raise TypeError
def __str__(self):
typ = str(type(self)).split(".")[1][:-2]
return "{} {}".format(self.color,typ)
def __repr__(self):
typ... | Python | 0 | @@ -423,16 +423,22 @@
lf,c1,c2
+,field
):%0D%0A
|
c463a55ee7cef8add72cdeefb7b6efaab5bc260a | Fix tests | custom/enikshay/tests/two_b_datamigration/test_delete_imported_drtb_cases.py | custom/enikshay/tests/two_b_datamigration/test_delete_imported_drtb_cases.py | import datetime
from django.core.management import call_command
from django.test import TestCase
from elasticsearch import ConnectionError
from casexml.apps.case.mock import CaseFactory
from corehq.apps.domain.models import Domain
from corehq.apps.es import CaseSearchES
from corehq.elastic import get_es_new, send_to_... | Python | 0.000003 | @@ -3106,24 +3106,130 @@
s are in ES%0A
+ # 30 cases per person = 25 resistance + 1 drtb + 1 sdps + 1 person + 1 episode + 1 occurrence%0A
@@ -3269,10 +3269,16 @@
(),
-54
+(2 * 30)
+ 1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.