commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
643dddf3118af4675954848671e38b20cd8234fb
use config_location instead of hardwired default
BBN-Q/QGL,BBN-Q/QGL
QGL/config.py
QGL/config.py
#Package configuration information import json import os.path import sys from . import config_location # Load the configuration from the json file # and populate the global configuration dictionary QGLCfgFile = config_location.get_config_path() if not os.path.isfile(QGLCfgFile): rootFolder = os.path.dirname(os...
#Package configuration information import json import os.path import sys #Load the configuration from the json file and populate the global configuration dictionary rootFolder = os.path.dirname(os.path.abspath(__file__)) rootFolder = rootFolder.replace('\\', '/') # use unix-like convention QGLCfgFile = os.path.join(...
apache-2.0
Python
9ca92efe4b9ed99018bc2eeadca17ae71f8ac60b
Update pocs/mount/__init__.py
panoptes/POCS,panoptes/POCS,panoptes/POCS,panoptes/POCS
pocs/mount/__init__.py
pocs/mount/__init__.py
from glob import glob from pocs.mount.mount import AbstractMount # pragma: no flakes from pocs.utils import error from pocs.utils import load_module from pocs.utils.location import create_location_from_config from pocs.utils.logger import get_root_logger def create_mount_from_config(config, mount_info=None, earth_l...
from glob import glob from pocs.mount.mount import AbstractMount # pragma: no flakes from pocs.utils import error from pocs.utils import load_module from pocs.utils.location import create_location_from_config from pocs.utils.logger import get_root_logger def create_mount_from_config(config, mount_info=None, earth_l...
mit
Python
7ae97b8619e78da2d818991c03b0fd9e0e330c85
Fix python3 compat issue in propdict
theeternalsw0rd/xmms2,xmms2/xmms2-stable,six600110/xmms2,theefer/xmms2,theeternalsw0rd/xmms2,theeternalsw0rd/xmms2,chrippa/xmms2,six600110/xmms2,krad-radio/xmms2-krad,theeternalsw0rd/xmms2,chrippa/xmms2,chrippa/xmms2,chrippa/xmms2,theeternalsw0rd/xmms2,six600110/xmms2,chrippa/xmms2,theefer/xmms2,xmms2/xmms2-stable,chri...
src/clients/lib/python/xmmsclient/propdict.py
src/clients/lib/python/xmmsclient/propdict.py
#Py3k compat try: a = basestring del a except NameError: basestring = str class PropDict(dict): def __init__(self, srcs): dict.__init__(self) self._sources = srcs def set_source_preference(self, sources): """ Change list of source preference This method has been depr...
#Py3k compat try: a = basestring del a except NameError: basestring = str class PropDict(dict): def __init__(self, srcs): dict.__init__(self) self._sources = srcs def set_source_preference(self, sources): """ Change list of source preference This method has been depr...
lgpl-2.1
Python
47b8f63d318e0007abc979884f6096221775843f
Implement near returns.
haowu4682/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,haowu4682/gem5,LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem5,haowu4682/gem5
src/arch/x86/isa/insts/control_transfer/xreturn.py
src/arch/x86/isa/insts/control_transfer/xreturn.py
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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: # # The software must be used only for Non-Commercial Use which mean...
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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: # # The software must be used only for Non-Commercial Use which mean...
bsd-3-clause
Python
f31934d9317bb9f50d75a34bba2b0b16ce545a8f
Bump version
datashaman/wifidog-auth-flask,datashaman/wifidog-auth-flask,datashaman/wifidog-auth-flask,datashaman/wifidog-auth-flask
config.py
config.py
import os BASE_DIR = os.path.abspath(os.path.dirname(__file__)) APP_VERSION = '0.5.0' CSRF_SESSION_KEY = 'ABigSecretIsHardToFind' DATABASE_CONNECTION_OPTIONS = {} DEBUG = False FACEBOOK_APP_ID= '89526572170' GOOGLE_ANALYTICS_TRACKING_ID = os.environ.get('GOOGLE_ANALYTICS_TRACKING_ID', '') HOST = '0.0.0.0' PORT = 8080 ...
import os BASE_DIR = os.path.abspath(os.path.dirname(__file__)) APP_VERSION = '0.4.0' CSRF_SESSION_KEY = 'ABigSecretIsHardToFind' DATABASE_CONNECTION_OPTIONS = {} DEBUG = False FACEBOOK_APP_ID= '89526572170' GOOGLE_ANALYTICS_TRACKING_ID = os.environ.get('GOOGLE_ANALYTICS_TRACKING_ID', '') HOST = '0.0.0.0' PORT = 8080 ...
mit
Python
f7d2b4d773636a3f858e082e011e2069a064a5e4
Add __str__ on models
SaturDJang/warp,SaturDJang/warp,SaturDJang/warp,SaturDJang/warp
presentation/models.py
presentation/models.py
from django.db import models from model_utils.models import TimeStampedModel from warp.users.models import User class Presentation(TimeStampedModel): subject = models.CharField(max_length=50) author = models.ForeignKey(User, on_delete=models.CASCADE) views = models.IntegerField(default=0) is_public =...
from django.db import models from model_utils.models import TimeStampedModel from warp.users.models import User class Presentation(TimeStampedModel): subject = models.CharField(max_length=50) author = models.ForeignKey(User, on_delete=models.CASCADE) views = models.IntegerField(default=0) is_public =...
mit
Python
8c706f4f7be18c25a1209365fa780edb76341b3a
Change make_healpixdb.py to work with eg. opsim DB
rbiswas4/simlib
scripts/make_healpixdb.py
scripts/make_healpixdb.py
from __future__ import division import numpy as np import time import sqlite3 import healpy as hp from healpy import query_disc, query_polygon import opsimsummary as oss import pandas as pd from itertools import repeat import os from sqlalchemy import create_engine pkgDir = os.path.split(oss.__file__)[0] dbname = os.p...
from __future__ import division import numpy as np import time import sqlite3 import healpy as hp from healpy import query_disc, query_polygon import opsimsummary as oss import pandas as pd from itertools import repeat opsim_hdf = '/Users/rbiswas/data/LSST/OpSimData/minion_1016.hdf' OpSim_combined = pd.read_hdf(opsim_...
mit
Python
66b217efddf8ad8a2a8e4cd2384d2d994155cd7b
Fix a bug
ryuichiueda/raspimouse_ros,ryuichiueda/raspimouse_ros
scripts/rtlightsensors.py
scripts/rtlightsensors.py
#!/usr/bin/env python import sys, rospy from raspimouse_ros.msg import LightSensorValues def talker(): devfile = '/dev/rtlightsensor0' rospy.init_node('lightsensors') pub = rospy.Publisher('lightsensors', LightSensorValues, queue_size=1) rate = rospy.Rate(10) while not rospy.is_shutdown(): ...
#!/usr/bin/env python import sys, rospy from raspimouse_ros.msg import LightSensorValues def talker(): devfile = '/dev/rtlightsensor0' rospy.init_node('lightsensors') pub = rospy.Publisher('lightsensors', LightSensorValues, queue_size=1) rate = rospy.Rate(10) while not rospy.is_shutdown(): ...
mit
Python
0f452e9ae1cb3216337d062def1d3a68d8a3c16d
Update Qt.py
csparkresearch/ExpEYES17-Qt,csparkresearch/ExpEYES17-Qt,csparkresearch/ExpEYES17-Qt,csparkresearch/ExpEYES17-Qt,csparkresearch/ExpEYES17-Qt
SPARK17/Qt.py
SPARK17/Qt.py
import os if os.environ['SPARK17_QT_LIB'] == 'PyQt5': from PyQt5 import QtGui,QtCore,QtWidgets else: print ('using PyQt4') from PyQt4 import QtGui,QtCore from PyQt4 import QtGui as QtWidgets
from PyQt5 import QtGui,QtCore,QtWidgets
mit
Python
87194047d01a7321a3729e1de67a59336ae7d9cf
Add dbus_init to the public API
mitya57/secretstorage
secretstorage/__init__.py
secretstorage/__init__.py
# SecretStorage module for Python # Access passwords using the SecretService DBus API # Author: Dmitry Shachnev, 2013-2018 # License: 3-clause BSD, see LICENSE file """This file provides quick access to all SecretStorage API. Please refer to documentation of individual modules for API details. """ from jeepney.integr...
# SecretStorage module for Python # Access passwords using the SecretService DBus API # Author: Dmitry Shachnev, 2013-2018 # License: 3-clause BSD, see LICENSE file """This file provides quick access to all SecretStorage API. Please refer to documentation of individual modules for API details. """ from jeepney.integr...
bsd-3-clause
Python
d342fd7a23542e7c968dca3af76281b1d35ba352
use a better name for the test directory name in tests
geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend
osmaxx-py/osmaxx/tests/test_utils.py
osmaxx-py/osmaxx/tests/test_utils.py
import os from django.test import TestCase from osmaxx.utils import PrivateSystemStorage class PrivateSystemStorageTestCase(TestCase): def setUp(self): self.directory_name = 'OSMAXX_private-storage-directory-for-tests' def test_creates_a_new_directory_if_it_does_not_exist(self): directory_p...
import os from django.test import TestCase from osmaxx.utils import PrivateSystemStorage class PrivateSystemStorageTestCase(TestCase): def setUp(self): self.directory_name = 'OSMAXX_OjM3cRB2xgSuDXr5yBxxzds9mO8gmP' def test_creates_a_new_directory_if_it_does_not_exist(self): directory_path =...
mit
Python
b587f7833a57d1f589e14aa33a7e761552c40a5a
bump to 0.19.6
dataversioncontrol/dvc,dataversioncontrol/dvc,efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol
dvc/__init__.py
dvc/__init__.py
""" DVC ---- Make your data science projects reproducible and shareable. """ import os import warnings VERSION_BASE = '0.19.6' __version__ = VERSION_BASE PACKAGEPATH = os.path.abspath(os.path.dirname(__file__)) HOMEPATH = os.path.dirname(PACKAGEPATH) VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py') if os.path....
""" DVC ---- Make your data science projects reproducible and shareable. """ import os import warnings VERSION_BASE = '0.19.5' __version__ = VERSION_BASE PACKAGEPATH = os.path.abspath(os.path.dirname(__file__)) HOMEPATH = os.path.dirname(PACKAGEPATH) VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py') if os.path....
apache-2.0
Python
ca32f3f69db49312d65330758ccbea039937885d
append to a copy of list; var-name change
dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
corehq/apps/userreports/expressions/__init__.py
corehq/apps/userreports/expressions/__init__.py
import copy from django.conf import settings from django.utils.module_loading import import_string from corehq.apps.userreports.expressions.factory import ExpressionFactory def get_custom_ucr_expressions(): custom_ucr_expressions = copy.copy(settings.CUSTOM_UCR_EXPRESSIONS) for path_to_expression_lists in s...
from django.conf import settings from django.utils.module_loading import import_string from corehq.apps.userreports.expressions.factory import ExpressionFactory def get_custom_ucr_expressions(): custom_ucr_expressions = settings.CUSTOM_UCR_EXPRESSIONS for expression_list in settings.CUSTOM_UCR_EXPRESSION_LIS...
bsd-3-clause
Python
c8d382db5b9edd60cc98a765ca902b2365c8aee4
Revert "Add failed tests"
nvbn/coviolations_web,nvbn/coviolations_web
projects/tests/base.py
projects/tests/base.py
from mock import MagicMock from .. import models class MockGithubMixin(object): """Mock github calls mixin""" def setUp(self): self._mock_github_call() def _mock_github_call(self): """Mock github call""" self._orig_get_remote_projects =\ models.ProjectManager._get_rem...
from mock import MagicMock from .. import models class MockGithubMixin(object): """Mock github calls mixin""" def setUp(self): self._mock_github_call() def _mock_github_call(self): """Mock github call""" self._orig_get_remote_projects =\ models.ProjectManager._get_rem...
mit
Python
4e414e763c5afbd5095729b2c85a91f0ae85f375
Remove an extra comma, which breaks the following assertion
openstack/neutron-fwaas,openstack/neutron-fwaas
neutron_fwaas/tests/tempest_plugin/tests/scenario/base.py
neutron_fwaas/tests/tempest_plugin/tests/scenario/base.py
# Copyright (c) 2015 Midokura SARL # 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 require...
# Copyright (c) 2015 Midokura SARL # 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 require...
apache-2.0
Python
e744f098506b2289b4e1891dc4c510327f75f0af
Add yscale (optional)
openhumanoids/exotica,openhumanoids/exotica,openhumanoids/exotica,openhumanoids/exotica
exotica_python/src/pyexotica/publish_trajectory.py
exotica_python/src/pyexotica/publish_trajectory.py
from __future__ import print_function, division from time import sleep import matplotlib.pyplot as plt import signal __all__ = ["sig_int_handler", "publish_pose", "publish_trajectory", "publish_time_indexed_trajectory", "plot"] def sig_int_handler(signal, frame): raise KeyboardInterrupt def publish_...
from __future__ import print_function, division from time import sleep import matplotlib.pyplot as plt import signal __all__ = ["sig_int_handler", "publish_pose", "publish_trajectory", "publish_time_indexed_trajectory", "plot"] def sig_int_handler(signal, frame): raise KeyboardInterrupt def publish_...
bsd-3-clause
Python
91c8af7f2fcfbee6a63f360a6b29c8398bd71ac0
Fix missing `g++` package in pip example.
Fizzadar/pyinfra,Fizzadar/pyinfra
examples/pip.py
examples/pip.py
from pyinfra import host from pyinfra.operations import apk, apt, files, pip, python, yum SUDO = True if host.fact.linux_name in ['Alpine']: apk.packages( name='Install packages for python virtual environments', packages=[ 'gcc', 'g++', 'libffi-dev', ...
from pyinfra import host from pyinfra.operations import apk, apt, files, pip, python, yum SUDO = True if host.fact.linux_name in ['Alpine']: apk.packages( name='Install packages for python virtual environments', packages=[ 'gcc', 'libffi-dev', 'make', ...
mit
Python
cba136dff9ba3ec5074fb9a2a4082c6e7430e3d1
Add debug output for read_email.
benigls/spam,benigls/spam
spam/preprocess/preprocess.py
spam/preprocess/preprocess.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A set of function that cleans the dataset for machine learning process. """ import io import sys import re from nltk import tokenize from nltk.corpus import stopwords def regex(text): """ A function that removes non-alphanumeric, -, _ characters and the...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A set of function that cleans the dataset for machine learning process. """ import re from nltk import tokenize from nltk.corpus import stopwords def regex(text): """ A function that removes non-alphanumeric, -, _ characters and the word `Subject:`, and ...
mit
Python
78c52615d763a77d0347b0d001df21f4b23095b8
fix bug in Response.read()
aliyun/aliyun-oss-python-sdk
oss/http.py
oss/http.py
import requests import platform from . import __version__ from requests.structures import CaseInsensitiveDict from .compat import to_bytes _USER_AGENT = 'aliyun-sdk-python/{0} ({1}/{2}/{3};{4})'.format( __version__, platform.system(), platform.release(), platform.machine(), platform.python_version()) class Ses...
import requests import platform from . import __version__ from requests.structures import CaseInsensitiveDict from .compat import to_bytes _USER_AGENT = 'aliyun-sdk-python/{0} ({1}/{2}/{3};{4})'.format( __version__, platform.system(), platform.release(), platform.machine(), platform.python_version()) class Ses...
mit
Python
5c5740e1ac07303a83e509fa34175218bb2b3c96
insert missing conversion from modes to states
qutip/qutip,qutip/qutip
doc/guide/scripts/floquet_ex3.py
doc/guide/scripts/floquet_ex3.py
import numpy as np from matplotlib import pyplot import qutip delta = 0.0 * 2*np.pi eps0 = 1.0 * 2*np.pi A = 0.25 * 2*np.pi omega = 1.0 * 2*np.pi T = 2*np.pi / omega tlist = np.linspace(0.0, 20 * T, 101) psi0 = qutip.basis(2,0) H0 = - delta/2.0 * qutip.sigmax() - eps0/2.0 * qutip.sigmaz() H1 = A/2.0 * q...
import numpy as np from matplotlib import pyplot import qutip delta = 0.0 * 2*np.pi eps0 = 1.0 * 2*np.pi A = 0.25 * 2*np.pi omega = 1.0 * 2*np.pi T = 2*np.pi / omega tlist = np.linspace(0.0, 20 * T, 101) psi0 = qutip.basis(2,0) H0 = - delta/2.0 * qutip.sigmax() - eps0/2.0 * qutip.sigmaz() H1 = A/2.0 * q...
bsd-3-clause
Python
0da80053f6c5fa41d33b692e6abc7067ed100bb4
bump version
sagasurvey/saga,sagasurvey/saga
SAGA/version.py
SAGA/version.py
""" SAGA package version """ __version__ = "0.40.0a9"
""" SAGA package version """ __version__ = "0.40.0a8"
mit
Python
c694aefd2a555e0fb7e11212bfb4c412c226ea89
Fix Codacy
adityahase/frappe,frappe/frappe,vjFaLk/frappe,adityahase/frappe,mhbu50/frappe,mhbu50/frappe,StrellaGroup/frappe,RicardoJohann/frappe,RicardoJohann/frappe,almeidapaulopt/frappe,frappe/frappe,RicardoJohann/frappe,mhbu50/frappe,yashodhank/frappe,StrellaGroup/frappe,vjFaLk/frappe,adityahase/frappe,yashodhank/frappe,frappe/...
frappe/desk/doctype/route_history/route_history.py
frappe/desk/doctype/route_history/route_history.py
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class RouteHistory(Document): pass def flush_old_route_records(): """Deletes all rout...
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document import json class RouteHistory(Document): pass def flush_old_route_records(): """Dele...
mit
Python
c1ea7a007d70c2b815b4879d383af3825c74e7e8
fix flake8 violation
BrianHicks/tinyobj,BrianHicks/tinyobj
tinyobj/fields.py
tinyobj/fields.py
"""**tinyobj** implements a number of fields to do validation, etc.""" from . import _compat class Field(object): """base for other fields""" def __init__(self): self.default = None def initialize(self, value=()): """\ initialize returns a cleaned value or the default, raising Val...
"""**tinyobj** implements a number of fields to do validation, etc.""" from . import _compat class Field(object): """base for other fields""" def __init__(self): self.default = None def initialize(self, value=()): """\ initialize returns a cleaned value or the default, raising Val...
mit
Python
e15f97713aac0459dc0cd553cf36658506c47367
Make copyright perpetual
tony/tmuxp
tmuxp/__init__.py
tmuxp/__init__.py
# -*- coding: utf-8 -*- # flake8: NOQA """tmux session manager. tmuxp ~~~~~ :copyright: Copyright 2013- Tony Narlock. :license: MIT, see LICENSE for details """ from __future__ import absolute_import, unicode_literals from . import cli, config, util from .__about__ import ( __author__, __copyright__, __...
# -*- coding: utf-8 -*- # flake8: NOQA """tmux session manager. tmuxp ~~~~~ :copyright: Copyright 2013-2018 Tony Narlock. :license: MIT, see LICENSE for details """ from __future__ import absolute_import, unicode_literals from . import cli, config, util from .__about__ import ( __author__, __copyright__, ...
bsd-3-clause
Python
61255b73b93309e360f890df4057dd2bc66e3e7a
modify demo
yinkaisheng/Python-UIAutomation-for-Windows
demos/hide_window_by_hotkey.py
demos/hide_window_by_hotkey.py
#!python3 # -*- coding: utf-8 -*- # hide windows with hotkey Ctrl+1, show the hidden windows with hotkey Ctrl+2 import os import sys import time import subprocess from typing import List from threading import Event sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # not required after 'pip ...
#!python3 # -*- coding: utf-8 -*- # hide windows with hotkey Ctrl+1, show the hidden windows with hotkey Ctrl+2 import os import sys import time import subprocess from typing import List from threading import Event sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # not required after 'pip ...
apache-2.0
Python
e908a2c62be1d937a68b5c602b8cae02633685f7
Load at a distance content in updatadata command
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
csunplugged/general/management/commands/updatedata.py
csunplugged/general/management/commands/updatedata.py
"""Module for the custom Django updatedata command.""" from django.core import management class Command(management.base.BaseCommand): """Required command class for the custom Django updatedata command.""" help = "Update all data from content folders for all applications" def add_arguments(self, parser)...
"""Module for the custom Django updatedata command.""" from django.core import management class Command(management.base.BaseCommand): """Required command class for the custom Django updatedata command.""" help = "Update all data from content folders for all applications" def add_arguments(self, parser)...
mit
Python
cc16dc7d90457b045e8c5806a09b82e25ecc72d8
Create move from zero
dvitme/odoomrp-wip,xpansa/odoomrp-wip,alfredoavanzosc/odoomrp-wip-1,diagramsoftware/odoomrp-wip,agaldona/odoomrp-wip-1,jobiols/odoomrp-wip,sergiocorato/odoomrp-wip,agaldona/odoomrp-wip-1,diagramsoftware/odoomrp-wip,factorlibre/odoomrp-wip,oihane/odoomrp-wip,oihane/odoomrp-wip,Eficent/odoomrp-wip,alhashash/odoomrp-wip,i...
stock_quant_packages_moving_wizard/models/stock.py
stock_quant_packages_moving_wizard/models/stock.py
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api class StockQua...
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api class StockQua...
agpl-3.0
Python
707a1bdf98a0e0ece5afe83897901643282401c4
switch to xkcd code names
GabeIsman/securedrop,jrosco/securedrop,ehartsuyker/securedrop,jaseg/securedrop,heartsucker/securedrop,ageis/securedrop,mark-in/securedrop-prov-upstream,GabeIsman/securedrop,harlo/securedrop,jeann2013/securedrop,jrosco/securedrop,chadmiller/securedrop,ageis/securedrop,conorsch/securedrop,jaseg/securedrop,jrosco/securedr...
crypto.py
crypto.py
import hmac, hashlib, subprocess, random import gnupg import config WORDS_IN_RANDOM_ID = 2 WORD_LIST = 'wordlist' HASH_FUNCTION = hashlib.sha256 GPG_KEY_TYPE = "RSA" GPG_KEY_LENGTH = "4096" class CryptoException(Exception): pass words = file(WORD_LIST).read().split('\n') def genrandomid(): return ' '.join(random...
import hmac, hashlib, subprocess, random import gnupg import config BITS_IN_RANDOM_ID = 256 HASH_FUNCTION = hashlib.sha256 GPG_KEY_TYPE = "RSA" GPG_KEY_LENGTH = "4096" class CryptoException(Exception): pass def genrandomid(): return hex(random.getrandbits(BITS_IN_RANDOM_ID))[2:-1] def shash(s): """ >>> ...
agpl-3.0
Python
fd9dc5337587831b16e51598295c2e659ee4c824
Fix test-url
GetStream/stream-django,GetStream/stream-django
stream_django/tests/test_app/tests/test_manager.py
stream_django/tests/test_app/tests/test_manager.py
import httpretty import re from stream_django.feed_manager import feed_manager from stream_django.tests import Tweet import unittest api_url = re.compile(r'(us-east-api.)?stream-io-api.com(/api)?/*.') class ManagerTestCase(unittest.TestCase): def setUp(self): feed_manager.enable_model_tracking() d...
import httpretty import re from stream_django.feed_manager import feed_manager from stream_django.tests import Tweet import unittest api_url = re.compile(r'(us-east-api.)?stream-io-api.com/*.') class ManagerTestCase(unittest.TestCase): def setUp(self): feed_manager.enable_model_tracking() def test...
bsd-3-clause
Python
51e882394a73493aae873671b0287e6f4a873884
Add an example
jochasinga/pluto
examples/led.py
examples/led.py
''' Blink Turns on an on-board LED on for one second, and then off. Most Arduinos have an on-board LED you can control. On the Uno and Leonardo, it is attached to digital pin 13. If you're unsure what pin the on-board LED is connected to on your Arduino model, check the doc at http://arduino.cc This example code is i...
''' LED Turns on and off an on-board LED Pluto has collect some number of Arduino boards with on-board LED attached to pin 13. For these boards, Pluto can recognize automatically through the use of the board's class. If unsure, consult the doc at http://arduino.cc and use general Board class, then supply the pin numb...
mit
Python
047c95e255d6aac31651e3a95e2045de0b4888e2
Make a real json response.
talavis/kimenu
flask_app.py
flask_app.py
from flask import Flask, abort, jsonify from flask_caching import Cache from flask_cors import CORS import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) @app.route('/') def display_available(): content = ('<html>' + ...
import json from flask import abort from flask import Flask from flask_caching import Cache from flask_cors import CORS import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) @app.route('/') def display_available(): conten...
bsd-3-clause
Python
4a07285b55afebd30310af3445795490ba06d56b
bump version to 0.0.9
byteweaver/django-posts,byteweaver/django-posts
posts/__init__.py
posts/__init__.py
__version__ = '0.0.9'
__version__ = '0.0.8'
bsd-3-clause
Python
5e3fb540186c9c01105809f660491a60a8c907d6
Fix choropleth_states.py example
python-visualization/folium,QuLogic/folium,QuLogic/folium,ocefpaf/folium,shankari/folium,shankari/folium,ocefpaf/folium,QuLogic/folium,shankari/folium,python-visualization/folium
examples/choropleth_states.py
examples/choropleth_states.py
''' Choropleth map of US states ''' import folium import pandas as pd state_geo = r'us-states.json' state_unemployment = r'US_Unemployment_Oct2012.csv' state_data = pd.read_csv(state_unemployment) # Let Folium determine the scale. states = folium.Map(location=[48, -102], zoom_start=3) states.choropleth(geo_path=st...
''' Choropleth map of US states ''' import folium import pandas as pd state_geo = r'us-states.json' state_unemployment = r'US_Unemployment_Oct2012.csv' state_data = pd.read_csv(state_unemployment) # Let Folium determine the scale. states = folium.Map(location=[48, -102], zoom_start=3) states.geo_json(geo_path=stat...
mit
Python
84c9076a6bccfa4556be262d5bd5405a30d78268
Revise to clarified comments
bowen0701/algorithms_data_structures
lc0448_find_all_numbers_disappeared_in_an_array.py
lc0448_find_all_numbers_disappeared_in_an_array.py
"""Leetcode 448. Find All Numbers Disappeared in an Array Easy URL: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ Given an array of integers where 1 <= a[i] <= n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not app...
"""Leetcode 448. Find All Numbers Disappeared in an Array Easy URL: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ Given an array of integers where 1 <= a[i] <= n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not app...
bsd-2-clause
Python
8b51e515062627f344a6a6241cf5e18a103edcbe
use default address
dashford/sentinel
src/Devices/Sensors/LTR559.py
src/Devices/Sensors/LTR559.py
import logging import ltr559 from blinker import signal class LTR559: def __init__(self, address): logging.info('Initialising LTR559 sensor with address {}'.format(address)) self._sensor = ltr559.LTR559() def get_lux(self, mqtt_details): """ Return measured lux from the senso...
import logging import ltr559 from blinker import signal class LTR559: def __init__(self, address): logging.info('Initialising LTR559 sensor with address {}'.format(address)) self._sensor = ltr559.LTR559(i2c_dev=address) def get_lux(self, mqtt_details): """ Return measured lux...
mit
Python
09560bcf4ded4f9beffefbfc45e40a795d6f3883
Create a new version
emuus/hammr,segalaj/hammr,segalaj/hammr,usharesoft/hammr,MaxTakahashi/hammr,emuus/hammr,usharesoft/hammr,MaxTakahashi/hammr
src/hammr/utils/constants.py
src/hammr/utils/constants.py
# To change this template, choose Tools | Templates # and open the template in the editor. __author__="UShareSoft" import os import tempfile VERSION="0.2.4" TMP_WORKING_DIR=tempfile.gettempdir() + os.sep + "hammr-" + str(os.getpid()) HTTP_TIMEOUT=10 TEMPLATE_JSON_FILE_NAME="template.json" TEMPLATE_JSON_NEW_FILE_N...
# To change this template, choose Tools | Templates # and open the template in the editor. __author__="UShareSoft" import os import tempfile VERSION="0.2.3" TMP_WORKING_DIR=tempfile.gettempdir() + os.sep + "hammr-" + str(os.getpid()) HTTP_TIMEOUT=10 TEMPLATE_JSON_FILE_NAME="template.json" TEMPLATE_JSON_NEW_FILE_N...
apache-2.0
Python
c27ca7239280ec9f2e68c5778db1668db6e0d0c8
Fix import error
hack4impact/flask-base,hack4impact/flask-base,hack4impact/flask-base
app/main/errors.py
app/main/errors.py
from flask import render_template from app.main.views import main @main.app_errorhandler(403) def forbidden(_): return render_template('errors/403.html'), 403 @main.app_errorhandler(404) def page_not_found(_): return render_template('errors/404.html'), 404 @main.app_errorhandler(500) def internal_server_...
from flask import render_template from app.main import main @main.app_errorhandler(403) def forbidden(_): return render_template('errors/403.html'), 403 @main.app_errorhandler(404) def page_not_found(_): return render_template('errors/404.html'), 404 @main.app_errorhandler(500) def internal_server_error(...
mit
Python
8217aa21db2b29389a9b4bd110158f41b2c11a0b
write header for new csv
hatnote/montage,hatnote/montage,hatnote/montage
tools/trim_csv.py
tools/trim_csv.py
import os.path import argparse from unicodecsv import DictReader, DictWriter def main(): prs = argparse.ArgumentParser() prs.add_argument('--count', type=int, default=100) prs.add_argument('file', type=file) args = prs.parse_args() count = args.count assert count > 0 path = os.path.ab...
import os.path import argparse from unicodecsv import DictReader, DictWriter def main(): prs = argparse.ArgumentParser() prs.add_argument('--count', type=int, default=100) prs.add_argument('file', type=file) args = prs.parse_args() count = args.count assert count > 0 path = os.path.ab...
bsd-3-clause
Python
51655f84e4b8a6cfafa4e62421cdd6b4d6fd48e4
rework python3-workers for parallel execution of check coroutines
telminov/django-park-keeper
parkkeeper/task_generator.py
parkkeeper/task_generator.py
# coding: utf-8 import multiprocessing from time import sleep import zmq from django.conf import settings from django.utils.timezone import now from parkkeeper.event import emit_event from parkkeeper import models from parkworker.const import MONIT_TASK_EVENT class TaskGenerator(multiprocessing.Process): contex...
# coding: utf-8 import multiprocessing from time import sleep import zmq from django.conf import settings from django.utils.timezone import now from parkkeeper.event import emit_event from parkkeeper import models from parkworker.const import MONIT_TASK_EVENT class TaskGenerator(multiprocessing.Process): contex...
mit
Python
4c0a9db0f635e304650ff1e572f3e6766ae61434
remove log
banbanchs/pan-baidu-download,kelwang/pan-baidu-download
panbaidu.py
panbaidu.py
#!/usr/bin/env python2 #!coding=utf-8 import sys import os import re import urllib2 def getDownloadPage(url): header = { 'User-Agent':'Mozilla/5.0 (X11; Linux x86_64)\ AppleWebKit/537.36 (KHTML, like Gecko)\ Chrome/28.0.1500.95 Safari/537.36' } re...
#!/usr/bin/env python2 #!coding=utf-8 import sys import os import re import urllib2 import json import pdb def getDownloadPage(url): header = { 'User-Agent':'Mozilla/5.0 (X11; Linux x86_64)\ AppleWebKit/537.36 (KHTML, like Gecko)\ Chrome/28.0.1500.95 Safa...
mit
Python
26bc3a761d5b513513773700b2167a0fd5b58102
Add a note about [#76].
peplin/astral
astral/api/handlers/ticket.py
astral/api/handlers/ticket.py
from astral.api.handlers.base import BaseHandler from astral.models import Ticket, Node, Stream, session import logging log = logging.getLogger(__name__) class TicketHandler(BaseHandler): def _load_ticket(self, stream_slug, destination_uuid): stream = Stream.get_by(slug=stream_slug) if not destin...
from astral.api.handlers.base import BaseHandler from astral.models import Ticket, Node, Stream, session import logging log = logging.getLogger(__name__) class TicketHandler(BaseHandler): def _load_ticket(self, stream_slug, destination_uuid): stream = Stream.get_by(slug=stream_slug) if not destin...
mit
Python
36c891f4f11a7780a444894042cfd603c8fd4300
Update __init__.py
numenta/nupic.research,numenta/nupic.research
src/nupic/research/frameworks/htm/__init__.py
src/nupic/research/frameworks/htm/__init__.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2022, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2022, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Python
7958acd24d3bc3c6f91ab6ef946dd7750d119569
Reduce order to 4 from 5.
memmett/PyWENO,memmett/PyWENO,memmett/PyWENO
examples/step.py
examples/step.py
"""PyWENO smooth reconstruction example.""" import math import numpy import pyweno.grid import pyweno.weno # explicitly define the function f that we will reconstruct ... def f(x): if x <= 0.0: return 1.0 return 0.0 # build weno reconstructor x = numpy.linspace(-1.0, 1.0, 21) grid = pyweno.grid.Grid...
"""PyWENO smooth reconstruction example.""" import math import numpy import pyweno.grid import pyweno.weno # explicitly define the function f that we will reconstruct ... def f(x): if x <= 0.0: return 1.0 return 0.0 # build weno reconstructor x = numpy.linspace(-1.0, 1.0, 21) grid = pyweno.grid.Grid...
bsd-3-clause
Python
69ba9731261f79ee6ce8d44a2def2bc0e5d2809d
Set trunk RELEASE_TAG back to None after creation of 0.0a20081123rc release candidate branch.
SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange
app/soc/release.py
app/soc/release.py
# Copyright 2008 the Melange 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 ...
# Copyright 2008 the Melange 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 ...
apache-2.0
Python
ea30119d1a46d863688aa9092d316efdfd193552
Change make update to make production
webkom/chewie,webkom/chewie
deploy.py
deploy.py
""" Takes a project name as the first argument and a git-branch as the second (optional). Finds the hostname from a config file, then uses ssh to deploy the project. """ import os import sys import json from fabric.api import env, run, cd class MissingProjectNameError(Exception): def __init__(self): Exce...
""" Takes a project name as the first argument and a git-branch as the second (optional). Finds the hostname from a config file, then uses ssh to deploy the project. """ import os import sys import json from fabric.api import env, run, cd class MissingProjectNameError(Exception): def __init__(self): Exce...
mit
Python
59f66f642281daa89c347c4ce9ed97eff921c77b
Add implementation
jcollado/ftps
ftps/ftps.py
ftps/ftps.py
# -*- coding: utf-8 -*- """Python interface to FTPS using pycurl.""" import logging import os from six import BytesIO import pycurl LOGGER = logging.getLogger('ftps') class FTPS(object): """FTPS client based on pycurl. :param url: Server URL including authorization :type url: str :param connect...
# -*- coding: utf-8 -*-
mit
Python
6673faab453ccfc1f9f2aae67c1e99433ee0ee5e
Resolve #21
ChameleonTartu/neurotolge,ChameleonTartu/neurotolge,ChameleonTartu/neurotolge
translators/ut.py
translators/ut.py
#!/usr/bin/python # -*- encoding: utf-8 -*- import time import socket import sys def ut_translation(queue, text, translate_from='et', translate_to='en'): try: __HOST__ = "booster2.hpc.ut.ee" __PORT__ = 50007 __BUFFER_SIZE__ = 4096 delimiter = "|||" text_for_translation ...
#!/usr/bin/python # -*- encoding: utf-8 -*- import time import socket import sys def ut_translation(queue, text, translate_from='et', translate_to='en'): try: __HOST__ = "booster2.hpc.ut.ee" __PORT__ = 50007 __BUFFER_SIZE__ = 4096 delimiter = "|||" text_for_translation ...
mit
Python
e374abeba61df8290f3634146014ac726d8185de
handle attachments of the template.
Maspear/odoo,shingonoide/odoo,KontorConsulting/odoo,slevenhagen/odoo-npg,ygol/odoo,waytai/odoo,mlaitinen/odoo,RafaelTorrealba/odoo,cloud9UG/odoo,hassoon3/odoo,bkirui/odoo,elmerdpadilla/iv,avoinsystems/odoo,OpusVL/odoo,demon-ru/iml-crm,CopeX/odoo,rgeleta/odoo,virgree/odoo,hopeall/odoo,slevenhagen/odoo-npg,blaggacao/Open...
addons/account_product_template/models/invoice.py
addons/account_product_template/models/invoice.py
# -*- coding: utf-8 -*- from openerp.osv import osv class account_invoice(osv.Model): _inherit = 'account.invoice' def invoice_validate_send_email(self, cr, uid, ids, context=None): Composer = self.pool['mail.compose.message'] for invoice in self.browse(cr, uid, ids, context=context): ...
# -*- coding: utf-8 -*- from openerp.osv import osv class account_invoice(osv.Model): _inherit = 'account.invoice' def invoice_validate_send_email(self, cr, uid, ids, context=None): Composer = self.pool['mail.compose.message'] for invoice in self.browse(cr, uid, ids, context=context): ...
agpl-3.0
Python
2537029f18df951b9234953452290a5172f5886f
fix send_mail() when no HTML content was given In commit "remove print from subscription" the EMAIL_DEBUG setting was removed from send_mail(). The msg.send() was mistakingly moved inside the if html: body.
saifrahmed/DjangoBB,hsoft/DjangoBB,agepoly/DjangoBB,saifrahmed/DjangoBB,slav0nic/DjangoBB,slav0nic/DjangoBB,slav0nic/DjangoBB,hsoft/slimbb,saifrahmed/DjangoBB,hsoft/slimbb,hsoft/DjangoBB,agepoly/DjangoBB,agepoly/DjangoBB,hsoft/slimbb,hsoft/DjangoBB
djangobb_forum/subscription.py
djangobb_forum/subscription.py
from django.core.mail import EmailMultiAlternatives from django.conf import settings from django.core.urlresolvers import reverse from django.utils.html import strip_tags from djangobb_forum import settings as forum_settings from djangobb_forum.util import absolute_url if "mailer" in settings.INSTALLED_APPS: from...
from django.core.mail import EmailMultiAlternatives from django.conf import settings from django.core.urlresolvers import reverse from django.utils.html import strip_tags from djangobb_forum import settings as forum_settings from djangobb_forum.util import absolute_url if "mailer" in settings.INSTALLED_APPS: from...
bsd-3-clause
Python
13dac91fa6025e41e5ce56aebfde59be20fddf4a
remove blank line
jamespcole/home-assistant,Zac-HD/home-assistant,sdague/home-assistant,morphis/home-assistant,rohitranjan1991/home-assistant,sffjunkie/home-assistant,ct-23/home-assistant,keerts/home-assistant,jabesq/home-assistant,nevercast/home-assistant,oandrew/home-assistant,sanmiguel/home-assistant,betrisey/home-assistant,miniconfi...
homeassistant/components/notify/file.py
homeassistant/components/notify/file.py
""" homeassistant.components.notify.file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ File notification service. Configuration: To use the File notifier you will need to add something like the following to your config/configuration.yaml notify: platform: file filename: FILENAME timestamp: 1 or 0 Variables: filename...
""" homeassistant.components.notify.file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ File notification service. Configuration: To use the File notifier you will need to add something like the following to your config/configuration.yaml notify: platform: file filename: FILENAME timestamp: 1 or 0 Variables: filename...
apache-2.0
Python
df2bf7cc95f38d9e6605dcc91e56b28502063b6a
Fix usage of `url_title` in CategoryAdmin.
onespacemedia/cms-faqs,onespacemedia/cms-faqs
apps/faqs/admin.py
apps/faqs/admin.py
from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin from django.contrib import admin from .models import Category, Faq @admin.register(Faq) class FaqAdmin(SearchMetaBaseAdmin): """ Admin settings for the Faq model """ prepopulated_fields = {"url_title": ("question",)} filter_horizontal = ("categorie...
from cms.admin import PageBaseAdmin, SearchMetaBaseAdmin from django.contrib import admin from .models import Category, Faq @admin.register(Faq) class FaqAdmin(SearchMetaBaseAdmin): """ Admin settings for the Faq model """ prepopulated_fields = {"url_title": ("question",)} filter_horizontal = ("categorie...
mit
Python
8f02e80df367ccd3870110c069898969f20924da
Fix stupid bug
ehabkost/busmap,ehabkost/busmap,ehabkost/busmap
python/busmap/fetch.py
python/busmap/fetch.py
# -*- coding: utf-8 -* import horarios, linhas, env, dias def get_linha_hor(idhor, nome): c = env.db.cursor() # look for id horario r = c.select_onerow('linhas', ['id'], 'idhor=%s', [idhor]) if r: c.close() return r[0] # not found. look for a similar name, but with no idhor set r = c.select_onerow('linha...
# -*- coding: utf-8 -* import horarios, linhas, env, dias def get_linha_hor(idhor, nome): c = env.db.cursor() # look for id horario r = c.select_onerow('linhas', ['id'], 'idhor=%s', [idhor]) if r: c.close() return r[0] # not found. look for a similar name, but with no idhor set r = c.select_onerow('linha...
mit
Python
bbc3bc25be1d2d19e6cd0a72dba6e7e5b821cd41
Bump version
OCA/geospatial,OCA/geospatial,OCA/geospatial
base_geoengine/__openerp__.py
base_geoengine/__openerp__.py
# -*- coding: utf-8 -*- # © 2011-2015 Nicolas Bessi (Camptocamp SA) # © 2016 Yannick Vaucher (Camptocamp SA) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). {'name': 'Geospatial support for Odoo', 'version': '9.0.1.2.5', 'category': 'GeoBI', 'author': "Camptocamp,ACSONE SA/NV,Odoo Community Asso...
# -*- coding: utf-8 -*- # © 2011-2015 Nicolas Bessi (Camptocamp SA) # © 2016 Yannick Vaucher (Camptocamp SA) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). {'name': 'Geospatial support for Odoo', 'version': '9.0.1.2.2', 'category': 'GeoBI', 'author': "Camptocamp,ACSONE SA/NV,Odoo Community Asso...
agpl-3.0
Python
77ac5ccab368f9389cea2efd3cda6191d0e8d482
Remove unused import.
mlavin/fileapi,mlavin/fileapi,mlavin/fileapi
fileapi/views.py
fileapi/views.py
from django import forms from django.core.files.storage import FileSystemStorage from django.core.urlresolvers import reverse from django.http import JsonResponse, HttpResponseNotFound, HttpResponse from django.views.generic import View, TemplateView from jwt_auth.mixins import JSONWebTokenAuthMixin storage = FileSy...
import json from django import forms from django.core.files.storage import FileSystemStorage from django.core.urlresolvers import reverse from django.http import JsonResponse, HttpResponseNotFound, HttpResponse from django.views.generic import View, TemplateView from jwt_auth.mixins import JSONWebTokenAuthMixin sto...
bsd-2-clause
Python
96a46473b3c060075826c1c72e2bec1eb62d8655
update docstring of commit
evernym/plenum,evernym/zeno
plenum/server/req_handler.py
plenum/server/req_handler.py
from binascii import unhexlify from plenum.common.types import f from plenum.common.request import Request from typing import List from plenum.common.ledger import Ledger from plenum.common.state import PruningState class RequestHandler: """ Base class for request handlers Declares methods for validation...
from binascii import unhexlify from plenum.common.types import f from plenum.common.request import Request from typing import List from plenum.common.ledger import Ledger from plenum.common.state import PruningState class RequestHandler: """ Base class for request handlers Declares methods for validation...
apache-2.0
Python
6050b32ddb812e32da08fd15f210d9d9ee794a42
Print Hello World in Python
rahulbohra/Python-Basic
first-program.py
first-program.py
# Python program for Programming for Everybody (Getting Started with Python) by University of Michigan - Charles Severance # Task 1 Python code with single print statement but not print hello world print "It is a great feeling to code in Python" print "Hello World!"
# Python program for Programming for Everybody (Getting Started with Python) by University of Michigan - Charles Severance # Task 1 Python code with single print statement but not print hello world print "It is a great feeling to code in Python"
mit
Python
b203e94205eb7d614d5133f937da302c941a2b4d
check 'NotFreezed' on all transform nodes
sol-ansano-kim/medic,sol-ansano-kim/medic,sol-ansano-kim/medic
plugins/Tester/notFreezed.py
plugins/Tester/notFreezed.py
import medic from maya import OpenMaya class NotFreezed(medic.PyTester): Identity = OpenMaya.MMatrix() def __init__(self): super(NotFreezed, self).__init__() def Name(self): return "NotFreezed" def Description(self): return "Not freezed trasnform(s)" def Match(self, nod...
import medic from maya import OpenMaya class NotFreezed(medic.PyTester): Identity = OpenMaya.MMatrix() def __init__(self): super(NotFreezed, self).__init__() def Name(self): return "NotFreezed" def Description(self): return "Not freezed mesh(s)" def Match(self, node): ...
mit
Python
7182a635d270d9b816dc3f09ba6c541cc7a88b8a
Fix typo
faheempatel/aac_to_mp3
aac_to_mp3.py
aac_to_mp3.py
#!/usr/bin/env python import os import os.path import sys import subprocess #OUTPUT_DIR = '/Users/matt/Desktop/mp3/' OUTPUT_DIR = 'c:/test/' def convert_and_save(path): filenames = [ filename for filename in os.listdir(path) if filename.endswith('.m4a') ] ...
#!/usr/bin/env python import os import os.path import sys import subprocess #OUTPUT_DIR = '/Users/matt/Desktop/mp3/' OUTPUT_DIR = 'c:/test/' def covert_and_save(path): filenames = [ filename for filename in os.listdir(path) if filename.endswith('.m4a') ] ...
mit
Python
9404fd886c3fbdb180083b55cdd69788b24049e4
Add new value_types to VALUE_TYPE_CHOICES
rdmorganiser/rdmo,rdmorganiser/rdmo,rdmorganiser/rdmo
rdmo/core/constants.py
rdmo/core/constants.py
from django.utils.translation import gettext_lazy as _ VALUE_TYPE_TEXT = 'text' VALUE_TYPE_URL = 'url' VALUE_TYPE_INTEGER = 'integer' VALUE_TYPE_FLOAT = 'float' VALUE_TYPE_BOOLEAN = 'boolean' VALUE_TYPE_DATETIME = 'datetime' VALUE_TYPE_OPTIONS = 'option' VALUE_TYPE_EMAIL = 'email' VALUE_TYPE_PHONE = 'phone' VALUE_TYPE...
from django.utils.translation import gettext_lazy as _ VALUE_TYPE_TEXT = 'text' VALUE_TYPE_URL = 'url' VALUE_TYPE_INTEGER = 'integer' VALUE_TYPE_FLOAT = 'float' VALUE_TYPE_BOOLEAN = 'boolean' VALUE_TYPE_DATETIME = 'datetime' VALUE_TYPE_OPTIONS = 'option' VALUE_TYPE_EMAIL = 'email' VALUE_TYPE_PHONE = 'phone' VALUE_TYPE...
apache-2.0
Python
e11169bf85d752054563f22cfe9659b19b76299b
test for Store.get_file
startling/fsstore
fsstore/tests.py
fsstore/tests.py
# -*- coding: utf-8 -*- import unittest from tempfile import mkdtemp from fsstore.core import Store class TestInterface(unittest.TestCase): def setUp(self): "Initialize a Store with a temporary directory." self.tempdir = mkdtemp() self.fs = Store(self.tempdir) def test_save_string(se...
# -*- coding: utf-8 -*- import unittest from tempfile import mkdtemp from fsstore.core import Store class TestInterface(unittest.TestCase): def setUp(self): "Initialize a Store with a temporary directory." self.tempdir = mkdtemp() self.fs = Store(self.tempdir) def test_save_string(se...
mit
Python
6ddaac15ddb94821d12a1dd73b2a0ec3f9b8a884
Fix minor bug in gammcat/info.py
gammapy/gamma-cat
gammacat/info.py
gammacat/info.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst import subprocess import os from pathlib import Path import urllib.parse __all__ = [ 'gammacat_info', 'gammacat_tag', ] class GammaCatInfo: """Gather basic info about gammacat. """ def __init__(self): # Git version: http://s...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import subprocess import os from pathlib import Path import urllib.parse __all__ = [ 'gammacat_info', 'gammacat_tag', ] class GammaCatInfo: """Gather basic info about gammacat. """ def __init__(self): # Git version: http://s...
bsd-3-clause
Python
477c02946b05c80a11bad6c9c20464ee2e82eab4
Add constants
ianfieldhouse/number_to_words
number_to_words.py
number_to_words.py
class NumberToWords(object): """ Class for converting positive integer values to a textual representation of the submitted number for value of 0 up to 999999999. """ MAX = 999999999 SMALL_NUMBERS = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine',...
class NumberToWords(object): """ Class for converting positive integer values to a textual representation of the submitted number for value of 0 up to 999999999. """
mit
Python
c9a5f5a542712fdc3ef41dd84889af9619f93822
print original filename in flask example
siddhantgoel/streaming-form-data
examples/flask/upload-test.py
examples/flask/upload-test.py
#!/usr/bin/python3 from flask import Flask, request import time import os import tempfile from streaming_form_data import StreamingFormDataParser from streaming_form_data.targets import FileTarget app = Flask(__name__) page = ''' <!doctype html> <title>Upload new File</title> <h1>Upload new File</h1> <form method=p...
#!/usr/bin/python3 from flask import Flask, request import time import os import tempfile from streaming_form_data import StreamingFormDataParser from streaming_form_data.targets import FileTarget app = Flask(__name__) page = ''' <!doctype html> <title>Upload new File</title> <h1>Upload new File</h1> <form method=p...
mit
Python
0487f13c765020195384ad2ca737a8142970cca9
update border_fill property setting to border_fill_color
dennisobrien/bokeh,schoolie/bokeh,timsnyder/bokeh,htygithub/bokeh,htygithub/bokeh,clairetang6/bokeh,KasperPRasmussen/bokeh,ptitjano/bokeh,ericmjl/bokeh,stonebig/bokeh,justacec/bokeh,rs2/bokeh,maxalbert/bokeh,maxalbert/bokeh,aavanian/bokeh,clairetang6/bokeh,aavanian/bokeh,draperjames/bokeh,rs2/bokeh,bokeh/bokeh,ericmjl/...
examples/glyphs/choropleth.py
examples/glyphs/choropleth.py
from __future__ import print_function from bokeh.browserlib import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import Patches from bokeh.models import ( Plot, DataRange1d, ColumnDataSource, ResizeTool ) from bokeh.resources import INLINE from bokeh.sampledata...
from __future__ import print_function from bokeh.browserlib import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import Patches from bokeh.models import ( Plot, DataRange1d, ColumnDataSource, ResizeTool ) from bokeh.resources import INLINE from bokeh.sampledata...
bsd-3-clause
Python
88abdf5365977a47abaa0d0a8f3275e4635c8378
Fix OAuth integration for all wiki families
yuvipanda/paws,yuvipanda/paws
singleuser/user-config.py
singleuser/user-config.py
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'rb') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) del f # Clean up temp variables, since pwb issues a warning otherwise # to he...
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'rb') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) del f # Clean up temp variables, since pwb issues a warning otherwise # to he...
mit
Python
81323aa798770577fede8627591757aa1cee37e9
add entities (hashtags, ...)
EUMSSI/EUMSSI-platform,EUMSSI/EUMSSI-platform,EUMSSI/EUMSSI-platform
preprocess/twitter2eumssi.py
preprocess/twitter2eumssi.py
#!/usr/bin/env python import datetime from eumssi_converter import EumssiConverter import click def transf_date(x): if x.__class__ == datetime.datetime: return x else: # Twitter's weird date format return datetime.datetime.strptime(x, '%a %b %d %X +0000 %Y') def transf_coordinates(x...
#!/usr/bin/env python import datetime from eumssi_converter import EumssiConverter import click def transf_date(x): if x.__class__ == datetime.datetime: return x else: # Twitter's weird date format return datetime.datetime.strptime(x, '%a %b %d %X +0000 %Y') def transf_coordinates(x...
apache-2.0
Python
725a82a56bd6fca6942f5d5148bf1fd2572131ef
Refactor the main module
Flavien/script.buildinstaller
addon.py
addon.py
# Copyright 2016 Flavien Charlon # # 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...
# Copyright 2016 Flavien Charlon # # 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...
apache-2.0
Python
5f3c4e6bd9a35f029e9e3241e241466cff843d6c
fix Point lookup
openstates/openstates.org,openstates/openstates.org,openstates/openstates.org,openstates/openstates.org
geo/views.py
geo/views.py
import datetime from django.http import JsonResponse from django.shortcuts import get_object_or_404 from django.db.models import Q from django.contrib.gis.geos import Point from opencivicdata.core.models import Division DATE_FORMAT = "%Y-%m-%d" def division_list(request): today = datetime.datetime.strftime(datet...
import datetime from django.http import JsonResponse from django.shortcuts import get_object_or_404 from django.db.models import Q from opencivicdata.core.models import Division DATE_FORMAT = "%Y-%m-%d" def division_list(request): today = datetime.datetime.strftime(datetime.datetime.now(), DATE_FORMAT) lat ...
mit
Python
e1af389a28b5c6a7aca2766418ab14d044596b05
add base_vat to depends
OCA/l10n-belgium,OCA/l10n-belgium
l10n_be_partner_kbo_bce/__manifest__.py
l10n_be_partner_kbo_bce/__manifest__.py
# Copyright 2009-2020 Noviat. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Belgium - KBO/BCE numbers", "category": "Localization", "version": "13.0.1.0.1", "license": "AGPL-3", "author": "Noviat,Odoo Community Association (OCA)", "website": "https://github.com/OCA/...
# Copyright 2009-2020 Noviat. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Belgium - KBO/BCE numbers", "category": "Localization", "version": "13.0.1.0.1", "license": "AGPL-3", "author": "Noviat,Odoo Community Association (OCA)", "website": "https://github.com/OCA/...
agpl-3.0
Python
4dedebe76d2ec112013595dd8f72b83b3ba28abb
update to fit utf8
instagrambot/instabot,Diapostrofo/instabot,instagrambot/instabot,sudoguy/instabot,instagrambot/instapro,AlexBGoode/instabot,vkgrd/instabot,rasperepodvipodvert/instabot,misisnik/testinsta,ohld/instabot,misisnik/testinsta
examples/black-whitelist/whitelist_generator.py
examples/black-whitelist/whitelist_generator.py
""" instabot example Whitelist generator: generates a list of users which will not be unfollowed. """ import sys import os import random sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot bot = Bot() bot.login() print ("This script will generate whitelist.txt file with users"...
""" instabot example Whitelist generator: generates a list of users which will not be unfollowed. """ import sys import os import random sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot bot = Bot() bot.login() print ("This script will generate whitelist.txt file with users"...
apache-2.0
Python
bc43d899487bc5e872884c020b17da87ce01418a
Use cache in celery task
openmaraude/APITaxi,odtvince/APITaxi,openmaraude/APITaxi,odtvince/APITaxi,l-vincent-l/APITaxi,odtvince/APITaxi,odtvince/APITaxi,l-vincent-l/APITaxi
APITaxi/tasks/send_request_operator.py
APITaxi/tasks/send_request_operator.py
#coding: utf-8 from flask import current_app from flask.ext.restplus import marshal from ..models.hail import Hail from ..models.security import User from ..descriptors.hail import hail_model from ..extensions import db, celery import requests, json @celery.task() def send_request_operator(hail_id, operateur_id, env):...
#coding: utf-8 from flask import current_app from flask.ext.restplus import marshal from ..models.hail import Hail from ..models.security import User from ..descriptors.hail import hail_model from ..extensions import db, celery import requests, json @celery.task() def send_request_operator(hail_id, operateur_id, env):...
agpl-3.0
Python
294dabd8cc6bfc7e004a1a0dde9b40e9535d4b19
Raise 404 Error if no Tag exists.
jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8
organizer/views.py
organizer/views.py
from django.http.response import ( Http404, HttpResponse) from django.template import Context, loader from .models import Tag def homepage(request): tag_list = Tag.objects.all() template = loader.get_template( 'organizer/tag_list.html') context = Context({'tag_list': tag_list}) output = t...
from django.http.response import HttpResponse from django.template import Context, loader from .models import Tag def homepage(request): tag_list = Tag.objects.all() template = loader.get_template( 'organizer/tag_list.html') context = Context({'tag_list': tag_list}) output = template.render(c...
bsd-2-clause
Python
741b0e2ebad363097473c7f3750b2b852a61dcff
bump version to v3.7.3
geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx
osmaxx/__init__.py
osmaxx/__init__.py
__version__ = 'v3.7.3' __all__ = [ '__version__', ]
__version__ = 'v3.7.2' __all__ = [ '__version__', ]
mit
Python
8045c0016e6607d80687613535b5036cb826b711
Add group_hidden
chadyred/odoo_addons,odoocn/odoo_addons,chadyred/odoo_addons,odoocn/odoo_addons,tiexinliu/odoo_addons,tiexinliu/odoo_addons,bmya/odoo_addons,bmya/odoo_addons,odoocn/odoo_addons,bmya/odoo_addons,ovnicraft/odoo_addons,ovnicraft/odoo_addons,ovnicraft/odoo_addons,chadyred/odoo_addons,tiexinliu/odoo_addons
smile_base/__openerp__.py
smile_base/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
Python
3c0a181ac54f5017ace8c02ea8a3982f4e62bed4
read correct env variables
cgoldberg/githubtakeout
githubtakeout.py
githubtakeout.py
import logging import os import shutil import tarfile import git from github import Github logging.basicConfig(level=logging.INFO, format='%(message)s') logger = logging.getLogger(__name__) try: USER = os.environ['GITHUBUSER'] PASSWORD = os.environ['GITHUBPASSWORD'] except KeyError as e: raise SystemEx...
import logging import os import shutil import tarfile import git from github import Github logging.basicConfig(level=logging.INFO, format='%(message)s') logger = logging.getLogger(__name__) try: USER = os.environ['USER'] PASSWORD = os.environ['PASSWORD'] except KeyError as e: raise SystemExit('USER and...
mit
Python
a65b385769d33b606ea4b7c11c5542ea7d9394b9
Disable redirect_state in strava backend. Fixes #259
contracode/python-social-auth,mchdks/python-social-auth,henocdz/python-social-auth,alrusdi/python-social-auth,python-social-auth/social-core,firstjob/python-social-auth,msampathkumar/python-social-auth,mark-adams/python-social-auth,python-social-auth/social-storage-sqlalchemy,muhammad-ammar/python-social-auth,rsalmaso/...
social/backends/strava.py
social/backends/strava.py
""" Strava OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/strava.html """ from social.backends.oauth import BaseOAuth2 class StravaOAuth(BaseOAuth2): name = 'strava' AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize' ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token...
""" Strava OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/strava.html """ from social.backends.oauth import BaseOAuth2 class StravaOAuth(BaseOAuth2): name = 'strava' AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize' ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token...
bsd-3-clause
Python
a95c3bff0065ed5612a0786e7d8fd3e43fe71ff7
Declare immutable fields in SuperMessageNode
SOM-st/PySOM,SOM-st/PySOM,smarr/PySOM,smarr/PySOM
src/som/interpreter/ast/nodes/message/super_node.py
src/som/interpreter/ast/nodes/message/super_node.py
from .abstract_node import AbstractMessageNode class SuperMessageNode(AbstractMessageNode): _immutable_fields_ = ['_method?', '_super_class', '_selector'] def __init__(self, selector, receiver, args, super_class, source_section = None): AbstractMessageNode.__init__(self, selector, None, receiver, ar...
from .abstract_node import AbstractMessageNode class SuperMessageNode(AbstractMessageNode): def __init__(self, selector, receiver, args, super_class, source_section = None): AbstractMessageNode.__init__(self, selector, None, receiver, args, source_section) self._method = None self._super_c...
mit
Python
116f74ec0bfd574d13837ce6831bde91e8504562
simplify option handling
OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server
lava_scheduler_app/management/commands/__init__.py
lava_scheduler_app/management/commands/__init__.py
import logging from optparse import make_option import sys from django.core.management.base import BaseCommand class SchedulerCommand(BaseCommand): option_list = BaseCommand.option_list + ( make_option('-l', '--loglevel', action='store', default=None, ...
import logging from optparse import make_option import sys from django.core.management.base import BaseCommand NOTSET = object() class SchedulerCommand(BaseCommand): option_list = BaseCommand.option_list + ( make_option('-l', '--loglevel', action='store', defaul...
agpl-3.0
Python
cb94433a39be091c387bf4bc6e96a5c94e77a2c4
Fix downloading STM32 CubeMX
modm-io/modm-devices
tools/generator/raw-data-extractor/extract-stm32.py
tools/generator/raw-data-extractor/extract-stm32.py
from pathlib import Path from multiprocessing import Pool import urllib.request import zipfile import shutil import re import io import os cubeurl = "https://www.st.com/content/st_com/en/products/development-tools/"\ "software-development-tools/stm32-software-development-tools/"\ "stm32-configurators-and-code...
from pathlib import Path from multiprocessing import Pool import urllib.request import zipfile import shutil import re import io import os cubeurl = "https://www.st.com/content/st_com/en/products/development-tools/"\ "software-development-tools/stm32-software-development-tools/"\ "stm32-configurators-and-code...
mpl-2.0
Python
2cd6a49c268e1c56f819fef5f838b2e0dfafb96b
Complete extended binary search sol
bowen0701/algorithms_data_structures
lc033_search_in_rotated_sorted_array.py
lc033_search_in_rotated_sorted_array.py
"""Leetcode 33. Search in Rotated Sorted Array Medium URL: https://leetcode.com/problems/search-in-rotated-sorted-array/ Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). You are given a target value to search. If fou...
"""Leetcode 33. Search in Rotated Sorted Array Medium URL: https://leetcode.com/problems/search-in-rotated-sorted-array/ Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). You are given a target value to search. If fou...
bsd-2-clause
Python
fc5b84b56a9ee2f1a8690dad77a25d462b6e46ee
Use realpath instead of abspath for extension id calculation
catapult-project/catapult,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-project/catapult-csm,sahiljain/catapult,catapult-project/catapult,sahiljain/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,catapult-project/cat...
telemetry/telemetry/core/extension_to_load.py
telemetry/telemetry/core/extension_to_load.py
# Copyright (c) 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 os from telemetry.core.chrome import crx_id class ExtensionPathNonExistentException(Exception): pass class MissingPublicKeyException(Exception...
# Copyright (c) 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 os from telemetry.core.chrome import crx_id class ExtensionPathNonExistentException(Exception): pass class MissingPublicKeyException(Exception...
bsd-3-clause
Python
96d444d8ee07a6004b6b96eece65835a4ea9b218
Set `client_settings` in `/compare` sandbox
kdeloach/model-my-watershed,project-icp/bee-pollinator-app,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,lliss/model-my-watershed,kdeloach/model-my-watershed,kdeloach/model-my-watershed,lliss/model-my-watershed,lliss/model-my-watershed,lliss/model-my-watershed,WikiWatershed/model-my-watershed,kdeloa...
src/mmw/apps/home/views.py
src/mmw/apps/home/views.py
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import json from django.http import Http404 from django.shortcuts import render_to_response, get_object_or_404 from django.template.context_processors import csrf from django.conf impo...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import json from django.http import Http404 from django.shortcuts import render_to_response, get_object_or_404 from django.template.context_processors import csrf from django.conf impo...
apache-2.0
Python
d05473c99eaf89a42df4813a50c144859bc563fe
copy html template to the right place for gitchangelog
guardian/scala-automation
docs/buildChangelog.py
docs/buildChangelog.py
#!/usr/bin/python import os import tarfile import urllib import subprocess import shutil if not os.path.exists("local.tools/gitchangelog-2.1.3"): os.mkdir("local.tools") urllib.URLopener().retrieve("https://pypi.python.org/packages/source/g/gitchangelog/gitchangelog-2.1.3.tar.gz","local.tools/gitchangelog-2.1...
#!/usr/bin/python import os import tarfile import urllib import subprocess if not os.path.exists("local.tools/gitchangelog-2.1.3"): os.mkdir("local.tools") urllib.URLopener().retrieve("https://pypi.python.org/packages/source/g/gitchangelog/gitchangelog-2.1.3.tar.gz","local.tools/gitchangelog-2.1.3.tar.gz") ...
apache-2.0
Python
58f1c75e052f8eb540b2dd4d01297cf826ebe798
Make Searcher object template-renderable
pivotal-energy-solutions/django-appsearch,pivotal-energy-solutions/django-appsearch,pivotal-energy-solutions/django-appsearch,pivotal-energy-solutions/django-appsearch
appsearch/utils.py
appsearch/utils.py
from django.forms.formsets import formset_factory from django.core.urlresolvers import reverse from django.utils.encoding import StrAndUnicode from django.template.loader import render_to_string from appsearch.registry import search, SearchRegistry from appsearch.forms import ModelSelectionForm, ConstraintForm, Constr...
from django.forms.formsets import formset_factory from appsearch.registry import search, SearchRegistry from appsearch.forms import ModelSelectionForm, ConstraintForm, ConstraintFormset class Searcher(object): model_selection_form = None constraint_formset = None string = None results = None ...
apache-2.0
Python
6a85b89d75cbac1d408ef06cf716117e9a23f89e
Add logout view
hreeder/WHAuth,hreeder/WHAuth,hreeder/WHAuth
auth/core/views.py
auth/core/views.py
from flask import render_template, redirect, url_for, flash, request from flask.ext.login import login_required, login_user, logout_user from auth import db from auth.utils import send_email from auth.core import core from auth.core.forms import LoginForm, RegistrationForm from auth.core.models.user import User @co...
from flask import render_template, redirect, url_for, flash, request from flask.ext.login import login_required, login_user from auth import db from auth.utils import send_email from auth.core import core from auth.core.forms import LoginForm, RegistrationForm from auth.core.models.user import User @core.route("/")...
mit
Python
3f2778ebac1ecd2587d12ee2256db8068816d6c0
refactor files
N402/NoahsArk,N402/NoahsArk
ark/goal/models.py
ark/goal/models.py
from datetime import datetime from ark.exts import db class Goal(db.Model): __tablename__ = 'goal' GOAL_STATES = { 'ready': 'ready', 'doing': 'Doing', 'canceled': 'Canceled', 'finished': 'Finished', 'expired': 'Expired', } id = db.Column(db.Integer, primary_...
from datetime import datetime from ark.exts import db class Goal(db.Model): __tablename__ = 'goal' GOAL_STATES = { 'ready': 'ready', 'doing': 'Doing', 'canceled': 'Canceled', 'finished': 'Finished', 'expired': 'Expired', } id = db.Column(db.Integer, primary_...
mit
Python
677b9bdfa4bf0c2541bea04bf44c6a0ca4ab90c9
mark log jid test as flaky
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/logging/test_jid_logging.py
tests/integration/logging/test_jid_logging.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import TestsLoggingHandler, flaky import logging import salt.ext....
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import TestsLoggingHandler import logging import salt.ext.six as ...
apache-2.0
Python
102267acafeb66b417e852f2e04a345b6d77504e
Refactor web scraping. OOP coming.
NathanMH/scripts,NathanMH/scripts,NathanMH/scripts
bc_bounty_check.py
bc_bounty_check.py
"""#################### Author: Nathan Mador-House ####################""" ####################### """#################### Index: 1. Imports and Readme 2. Functions 3. Main 4. Testing ####################""" ####################### ################################################################### # ...
#!/bin/sh # Searches for new open issues from BC open government pay for pull program. from bs4 import BeautifulSoup import urllib.request url = "https://github.com/search?utf8=%E2%9C%93&q=org%3Abcgov+%241000&type=Issues&ref=searchresults" def make_html(url): html = urllib.request.Request(url) response = u...
mit
Python
305fb2b631bf9ede152995d1ba264ac58d39cea9
Improve display of exceptions
jacquev6/MockMockMock
MockMockMock/_Details/MockException.py
MockMockMock/_Details/MockException.py
# -*- coding: utf-8 -*- # Copyright 2013 Vincent Jacques # vincent@vincent-jacques.net # This file is part of MockMockMock. http://jacquev6.github.com/MockMockMock # MockMockMock is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License # as published by the ...
# -*- coding: utf-8 -*- # Copyright 2013 Vincent Jacques # vincent@vincent-jacques.net # This file is part of MockMockMock. http://jacquev6.github.com/MockMockMock # MockMockMock is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License # as published by the ...
mit
Python
71214cca77137e23b279a5495ded1fce6f37aa11
Set version to 0.2
carlospalol/django-moneyfield,generalov/django-moneyfield
moneyfield/__init__.py
moneyfield/__init__.py
from .fields import MoneyField, MoneyModelForm from .exceptions import * __version__ = '0.2'
from .fields import MoneyField, MoneyModelForm from .exceptions import * __version__ = 'experimental'
mit
Python
a61e63be1b1c6e31fd0d469962277f05db644bc4
Add dashboard URLs
PanDAWMS/panda-bigmon-lsst,kiae-grid/panda-bigmon-lsst,PanDAWMS/panda-bigmon-lsst
lsst/urls.py
lsst/urls.py
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static #from core.common.urls import * import lsst.settings import lsst.views as lsstmon_views urlpatterns = patterns('', ### url(r'^$', lsstmon_views.mainPage), ### url(r'^lsst/$', lsstm...
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static #from core.common.urls import * import lsst.settings import lsst.views as lsstmon_views urlpatterns = patterns('', ### url(r'^$', lsstmon_views.mainPage), ### url(r'^lsst/$', lsstm...
apache-2.0
Python
088c5bad2845d9f82fd712af7c4737c7fc45d0bc
Update get-relation-foreign-objects.py
agusmakmun/Some-Examples-of-Simple-Python-Script,agusmakmun/Some-Examples-of-Simple-Python-Script
Django/get-relation-foreign-objects.py
Django/get-relation-foreign-objects.py
#https://docs.djangoproject.com/en/dev/topics/db/queries/#caching-and-querysets class Data_Toko(models.Model): .... class Pengiriman(models.Model): property = models.ForeignKey(Data_Toko, related_name='pengiriman') metode_pengiriman = models.CharField(max_length=200, default='JNE', blank=True, null=True, help_tex...
#https://docs.djangoproject.com/en/dev/topics/db/queries/#caching-and-querysets class Data_Toko(models.Model): .... class Pengiriman(models.Model): property = models.ForeignKey(Data_Toko, related_name='pengiriman') metode_pengiriman = models.CharField(max_length=200, default='JNE', blank=True, null=True, help_tex...
agpl-3.0
Python
0766e7fbbb1ef5315b20814d277f44c8ec8b82fb
add 1.3-9 (#10732)
LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/r-rgdal/package.py
var/spack/repos/builtin/packages/r-rgdal/package.py
# Copyright 2013-2019 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 RRgdal(RPackage): """Provides bindings to the 'Geospatial' Data Abstraction Library ('...
# Copyright 2013-2019 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 RRgdal(RPackage): """Provides bindings to the 'Geospatial' Data Abstraction Library ('...
lgpl-2.1
Python
93767e220919ef53d011e6930d66eadf4773d779
Update MotorsControlFile.py
VitorHugoAguiar/ProBot,VitorHugoAguiar/ProBot,VitorHugoAguiar/ProBot,VitorHugoAguiar/ProBot
ProBot_BeagleBone/MotorsControlFile.py
ProBot_BeagleBone/MotorsControlFile.py
#!/usr/bin/python # Python Standart Library Imports import SabertoothFile import PWMFile import ProBotConstantsFile # Initialization of classes from local files Sabertooth = SabertoothFile.SabertoothClass() PWM = PWMFile.PWMClass() Pconst = ProBotConstantsFile.Constants() class MotorsControlClass(): def M...
#!/usr/bin/python # Python Standart Library Imports import SabertoothFile import PWMFile import ProBotConstantsFile # Initialization of classes from local files Sabertooth = SabertoothFile.SabertoothClass() PWM = PWMFile.PWMClass() Pconst = ProBotConstantsFile.Constants() class MotorsControlClass(): def Mo...
agpl-3.0
Python
6f9e935c01c77a440d1190c6148e567f1694797b
Update docker_settings_secret.py
openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore,neurodata/ndstore,openconnectome/open-connectome
setup/docker_config/django/docker_settings_secret.py
setup/docker_config/django/docker_settings_secret.py
# Secret Settings for NeuroData USER = 'neurodata' PASSWORD = 'neur0data' HOST = 'localhost' SECRET_KEY = 'nothing_as_such' AWS_ACCESS_KEY_ID = '' AWS_SECRET_ACCESS_KEY = '' SHARED_SECRET = ''
# Secret Settings for NeuroData USER = 'neurodata' PASSWORD = 'neur0data' HOST = 'localhost' SECRET_KEY = 'nothing_as_such' AWS_ACCESS_KEY_ID = '' AWS_SECRET_ACCESS_KEY = ''
apache-2.0
Python
fff8576444498fbb264c441c98302f9e45275270
Add line SUBSTITUTE
abcdw/direlog,abcdw/direlog
patterns.py
patterns.py
# -*- coding: utf-8 -*- import re pre_patterns = [ ( r'(\d{16}-[-\w]*\b)', r'REQUEST_ID_SUBSTITUTE', ), ( # r'([\dA-F]){8}-[\dA-F]{4}-4[\dA-F]{3}-[89AB][\dA-F]{3}-[\dA-F]{12}', r'([0-9A-F]){8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}', # r'[0-9A-F-]{36}', ...
# -*- coding: utf-8 -*- import re pre_patterns = [ ( r'(\d{16}-[-\w]*\b)', r'REQUEST_ID_SUBSTITUTE', ), ( # r'([\dA-F]){8}-[\dA-F]{4}-4[\dA-F]{3}-[89AB][\dA-F]{3}-[\dA-F]{12}', r'([0-9A-F]){8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}', # r'[0-9A-F-]{36}', ...
mit
Python
5bcc4ae60f89fbcadad234e0d6b9a755d28aab5d
Handle ctrl-C-ing out of palm-log
markpasc/paperplain,markpasc/paperplain
pavement.py
pavement.py
import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def ...
import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def ...
mit
Python
85eda1d8dc0774d90cc6ff0410c36c3f1119fbd0
Update calc figures
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
cla_backend/libs/eligibility_calculator/constants/disposable_income.py
cla_backend/libs/eligibility_calculator/constants/disposable_income.py
LIMIT = 73300 PARTNER_ALLOWANCE = 18191 CHILD_ALLOWANCE = 29149 CHILDLESS_HOUSING_CAP = 54500 EMPLOYMENT_COSTS_ALLOWANCE = 4500
LIMIT = 73300 PARTNER_ALLOWANCE = 17946 CHILD_ALLOWANCE = 28822 CHILDLESS_HOUSING_CAP = 54500 EMPLOYMENT_COSTS_ALLOWANCE = 4500
mit
Python
1493513ffa056c399f92ab1db70ba0bd81e3b642
move bba fields to easy_my_coop_be
OCA/l10n-belgium,OCA/l10n-belgium
easy_my_coop_be/models/coop.py
easy_my_coop_be/models/coop.py
from odoo import fields, models class SubscriptionRequest(models.Model): _inherit = 'subscription.request' company_type = fields.Selection([('scrl', 'SCRL'), ('asbl', 'ASBL'), ('sprl', 'SPRL'), ('sa...
from odoo import fields, models class SubscriptionRequest(models.Model): _inherit = 'subscription.request' company_type = fields.Selection([('scrl', 'SCRL'), ('asbl', 'ASBL'), ('sprl', 'SPRL'), ('sa...
agpl-3.0
Python
692532c762d18310ad338132a001a557b64f22d3
Remove useless test
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
nodeconductor/monitoring/tests/zabbix/test_db_client.py
nodeconductor/monitoring/tests/zabbix/test_db_client.py
from __future__ import unicode_literals import unittest from django.db import DatabaseError from mock import Mock from nodeconductor.monitoring.zabbix.db_client import ZabbixDBClient class ZabbixPublicApiTest(unittest.TestCase): def setUp(self): self.client = ZabbixDBClient() def test_get_item_st...
from __future__ import unicode_literals import unittest from django.db import DatabaseError from mock import Mock from nodeconductor.monitoring.zabbix.db_client import ZabbixDBClient class ZabbixPublicApiTest(unittest.TestCase): def setUp(self): self.client = ZabbixDBClient() def test_get_item_st...
mit
Python