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
eb357a8fbbac5d284425d93f54aea2a31c503e90
fix create settings script for windows
jonge-democraten/website,jonge-democraten/website,jonge-democraten/website,jonge-democraten/website
create_local_settings.py
create_local_settings.py
#!/usr/bin/env python3 import codecs import os import random import shutil import string import tempfile LOCAL_SETTINGS_PATH = './website/local_settings.py' LOCAL_SETTINGS_EXAMPLE_PATH = './website/local_settings_example.py' def main(): if os.path.exists(LOCAL_SETTINGS_PATH): print('ERROR: ' + LOCAL_SET...
#!/usr/bin/env python3 import codecs import os import random import shutil import string import tempfile LOCAL_SETTINGS_PATH = './website/local_settings.py' LOCAL_SETTINGS_EXAMPLE_PATH = './website/local_settings_example.py' def main(): if os.path.exists(LOCAL_SETTINGS_PATH): print('ERROR: ' + LOCAL_SET...
mit
Python
23a9c58a833d0cae6c24d3a0fb5285f76b8a75ec
Update activate-devices.py
JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub
cron/activate-devices.py
cron/activate-devices.py
#!/usr/bin/env python import MySQLdb #import datetime #import urllib2 #import os import datetime import RPi.GPIO as GPIO try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO!") servername = "localhost" username = "pi" password = "password" dbname = "pi_heating_db" GPIO.setmode(G...
#!/usr/bin/env python import MySQLdb #import datetime #import urllib2 #import os import datetime import RPi.GPIO as GPIO try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO!") servername = "localhost" username = "pi" password = "password" dbname = "pi_heating_db" cnx = MySQ...
apache-2.0
Python
218f20c29b1c9fbd1613133692c887d990f6ba86
Add basic homepage test
andela-kndungu/kevgathuku,kevgathuku/kevgathuku,andela-kndungu/kevgathuku,kevgathuku/kevgathuku,kevgathuku/kevgathuku,andela-kndungu/kevgathuku,kevgathuku/kevgathuku,andela-kndungu/kevgathuku
functional_tests/test_layout_and_styling.py
functional_tests/test_layout_and_styling.py
from .base import FunctionalTest class LayoutAndStylingTest(FunctionalTest): def test_home_page(self): self.browser.get(self.live_server_url) self.assertIn("Kevin Ndung'u", self.browser.title) self.assertIn("Home", self.browser.title) header_text = self.browser.find_element_by_t...
from .base import FunctionalTest class LayoutAndStylingTest(FunctionalTest): def test_home_page(self): self.browser.get(self.live_server_url) self.assertIn("Kevin Ndung'u", self.browser.title) header_text = self.browser.find_element_by_tag_name('h1').text self.assertIn('Kevin', h...
mit
Python
00bcddfaf4d64ac76256a50f13fbdcb9dc7a58bd
Change url namespace underscore with -
Hackfmi/Diaphanum,Hackfmi/Diaphanum
projects/urls.py
projects/urls.py
from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add-project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'), url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'), url(r'^archive...
from django.conf.urls import patterns, url urlpatterns = patterns('projects.views', url(r'^add/$', 'add_project', name='add_project'), url(r'^edit/(?P<project_id>\d+)/$', 'edit_project', name='edit-project'), url(r'^edit_status/(?P<project_id>\d+)/$', 'edit_status', name='edit-status'), url(r'^archive...
mit
Python
c8cfce2cd4820d937d10dced4472055921342582
Remove m2m fields from ctnr edit form
akeym/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,OSU-Net/cyder,OSU-Net/cyder,murrown/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,murrown/cyder,drkitty/cyder,murrown/cyder,murrown/cyder,drkitty/cyder,akeym/cyder
cyder/core/ctnr/forms.py
cyder/core/ctnr/forms.py
from django import forms from cyder.base.constants import LEVELS from cyder.base.mixins import UsabilityFormMixin from cyder.core.ctnr.models import Ctnr class CtnrForm(forms.ModelForm, UsabilityFormMixin): class Meta: model = Ctnr exclude = ('users', 'domains', 'ranges', 'workgroups') def f...
from django import forms from cyder.base.constants import LEVELS from cyder.base.mixins import UsabilityFormMixin from cyder.core.ctnr.models import Ctnr class CtnrForm(forms.ModelForm, UsabilityFormMixin): class Meta: model = Ctnr exclude = ('users',) def filter_by_ctnr_all(self, ctnr): ...
bsd-3-clause
Python
dd4015874d6e7ab377795177876fe46a934bf741
Add test to reproduce overloaded Tor guard OSSEC alert
garrettr/securedrop,ehartsuyker/securedrop,micahflee/securedrop,heartsucker/securedrop,conorsch/securedrop,garrettr/securedrop,micahflee/securedrop,conorsch/securedrop,ehartsuyker/securedrop,micahflee/securedrop,conorsch/securedrop,conorsch/securedrop,micahflee/securedrop,heartsucker/securedrop,conorsch/securedrop,garr...
testinfra/mon/test_ossec_ruleset.py
testinfra/mon/test_ossec_ruleset.py
import re alert_level_regex = re.compile(r"Level: '(\d+)'") def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo): """Check that a denied RWX mmaping produces an OSSEC alert""" test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied " "RWX mmap of <anonymous mappi...
import re alert_level_regex = re.compile(r"Level: '(\d+)'") def test_grsec_denied_rwx_mapping_produces_alert(Command, Sudo): """Check that a denied RWX mmaping produces an OSSEC alert""" test_alert = ("Feb 10 23:34:40 app kernel: [ 124.188641] grsec: denied " "RWX mmap of <anonymous mappi...
agpl-3.0
Python
597f0699f173fac842893e61f4207f8eb07b3b12
Refactor subprocess call
thombashi/tcconfig,thombashi/tcconfig
test/common.py
test/common.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import, print_function import sys from subprocrunner import SubprocessRunner from tcconfig._const import Tc from tcconfig._converter import Humanreadable, HumanReadableTime from typepy import Re...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import, print_function import sys from subprocrunner import SubprocessRunner from tcconfig._const import Tc from tcconfig._converter import Humanreadable, HumanReadableTime from typepy import Re...
mit
Python
a4f9ee51ee6cba09a59e4cf60d7c31fd3eadb8a4
Bump version
vmalloc/confetti
confetti/__version__.py
confetti/__version__.py
__version__ = "2.5.3"
__version__ = "2.5.2"
bsd-3-clause
Python
caac1f8fa6ad74764add689d8a0174ff2e77e7fd
Complete split path current stack sol w/ time/space complexity
bowen0701/algorithms_data_structures
lc0071_simplify_path.py
lc0071_simplify_path.py
"""Leetcode 71. Simplify Path Medium URL: https://leetcode.com/problems/simplify-path/ Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. In a UNIX-style file system, a period . refers to the current directory. Furthermore, a double period .. moves the d...
"""Leetcode 71. Simplify Path Medium URL: https://leetcode.com/problems/simplify-path/ Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. In a UNIX-style file system, a period . refers to the current directory. Furthermore, a double period .. moves the d...
bsd-2-clause
Python
dd9fd1b7d941dede790d04b935bcd9321dbf5341
Add descriptive comments
bowen0701/algorithms_data_structures
lc0072_edit_distance.py
lc0072_edit_distance.py
"""Leetcode 72. Edit Distance Hard URL: https://leetcode.com/problems/edit-distance/ Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitted on a word: - Insert a character - Delete a character - Replace a character Ex...
"""Leetcode 72. Edit Distance Hard URL: https://leetcode.com/problems/edit-distance/ Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitted on a word: - Insert a character - Delete a character - Replace a character Ex...
bsd-2-clause
Python
5cced79cf3fad7408ed1643ddbf368718103ddac
Allow variables to be used raw in with_nested
thaim/ansible,thaim/ansible
lib/ansible/runner/lookup_plugins/nested.py
lib/ansible/runner/lookup_plugins/nested.py
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
mit
Python
01e55b8288143849b29b9a087335af6173ba7ae1
Met à jour le numéro de version.
dezede/dezede,dezede/dezede,dezede/dezede,dezede/dezede
dezede/__init__.py
dezede/__init__.py
# coding: utf-8 from __future__ import unicode_literals from .celery import app as celery_app __version__ = 2, 0, 2, 'post' get_version = lambda: '.'.join(str(i) for i in __version__) __verbose_name__ = 'Dezède'
# coding: utf-8 from __future__ import unicode_literals from .celery import app as celery_app __version__ = 2, 0, 2 get_version = lambda: '.'.join(str(i) for i in __version__) __verbose_name__ = 'Dezède'
bsd-3-clause
Python
07dd37b09c5e9165896eb6bdbd4d784f6aaa45c9
Work on finding the subnets
ardinor/mojibake,ardinor/mojibake,ardinor/mojibake
mojibake/monitoring/views.py
mojibake/monitoring/views.py
from flask import Blueprint, render_template from sqlalchemy import func from collections import Counter import datetime from mojibake.models import BreakinAttempts, BannedIPs, IPAddr monitor = Blueprint('monitor', __name__, template_folder='templates') @monitor.route('/') def bans_list(): #displayed_time =...
from flask import Blueprint, render_template from sqlalchemy import func import datetime from mojibake.models import BreakinAttempts, BannedIPs, IPAddr monitor = Blueprint('monitor', __name__, template_folder='templates') @monitor.route('/') def bans_list(): #displayed_time = 'CET' #time_offset = '+1' ...
mit
Python
e3d90ac4ab6f29d16327b23f1bb64fe8caffda9a
Add dummy navkeys
xtfc/pyboard2,xtfc/pyboard2
pyboard/views.py
pyboard/views.py
import flask, os from flask import g, request, session from functools import wraps from pyboard.app import app from pyboard.db import Database def open_sql(filename): with open(os.path.join('sql', filename + '.sql')) as f: return f.read() def check_auth(username, password): if app.debug: user = g.db.queryone('S...
import flask, os from flask import g, request, session from functools import wraps from pyboard.app import app from pyboard.db import Database def open_sql(filename): with open(os.path.join('sql', filename + '.sql')) as f: return f.read() def check_auth(username, password): if app.debug: user = g.db.queryone('S...
mit
Python
89b39feceae96d4c29839220917b45f75d672bc3
Comment unused lines
pyecore/pyecore,aranega/pyecore
pyecore/utils.py
pyecore/utils.py
""" This module gathers utility classes and functions that can ease metamodel and model manipulation. """ from .ecore import EPackage, BadValueError from .notification import EObserver, Kind class DynamicEPackage(EObserver): """A DynamicEPackage gives the ability to directly handle metaclasses from a metamode...
""" This module gathers utility classes and functions that can ease metamodel and model manipulation. """ from .ecore import EPackage, BadValueError from .notification import EObserver, Kind class DynamicEPackage(EObserver): """A DynamicEPackage gives the ability to directly handle metaclasses from a metamode...
bsd-3-clause
Python
300916fcb986f17c1077ac26d352bff05f10e04e
Fix attachment URI regular expression
pythonology/discobot,chandler14362/disco
disco/constants.py
disco/constants.py
import re VALID_ATTACHMENT_TYPES = ('.opus', '.weba', '.ogg', '.wav', '.mp3', '.flac', '.midi') # Regular expressions RE_ATTACHMENT_URI = re.compile( '^' '(?:disco:\/\/)' '(\d+)' '(?:\/)' '([\w\-\.]+)' '$' ) RE_YOUTUBE_URL = re.compile( '^' '(?:https?:\/\/)' ...
import re VALID_ATTACHMENT_TYPES = ('.opus', '.weba', '.ogg', '.wav', '.mp3', '.flac', '.midi') # Regular expressions RE_ATTACHMENT_URI = re.compile( '^' '(?:disco:\/\/)' '(\d+)' '(?:\/)' '([\w-]+)' '$' ) RE_YOUTUBE_URL = re.compile( '^' '(?:https?:\/\/)' ...
mit
Python
e302be01096a7ea13d7234d031f4243199be75a5
fix return value of pkg-config invocation for rospack
alessandro-aglietti/rosdep,spaghetti-/rosdep,aymanim/rosdep,georgepar/rosdep,alessandro-aglietti/rosdep,ros-infrastructure/rosdep,ros-infrastructure/rosdep,allenh1/rosdep,wkentaro/rosdep,georgepar/rosdep,allenh1/rosdep,wkentaro/rosdep,aymanim/rosdep,sorki/rosdep,spaghetti-/rosdep,sorki/rosdep
src/rosdep2/rospack.py
src/rosdep2/rospack.py
# Copyright (c) 2012, Willow Garage, 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: # # * Redistributions of source code must retain the above copyright # notice, this list of cond...
# Copyright (c) 2012, Willow Garage, 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: # # * Redistributions of source code must retain the above copyright # notice, this list of cond...
bsd-3-clause
Python
71615f28efbf357985c4bb1d418f988b594ed494
Update version as patch to 0.11.2
plotly/dash,plotly/dash,plotly/dash,plotly/dash,plotly/dash
dash_renderer/version.py
dash_renderer/version.py
__version__ = '0.11.2'
__version__ = '0.11.1'
mit
Python
4d85bb2735809169ffb881291ea03dbc0368d479
Fix optimize module
raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten
nn/optimize.py
nn/optimize.py
import tensorflow as tf from . import train def minimize(loss): return tf.train.AdamOptimizer().minimize(loss, train.global_step())
import tensorflow as tf from . import train def minimize(loss): return tf.AdamOptimizer().minimize(loss, train.global_step())
unlicense
Python
1ff4796e1329663e3a685fdae140edb73b2d0b30
Update module references
DeVilhena-Paulo/Geocoding
data/activate_reverse.py
data/activate_reverse.py
import os import sys import numpy as np from index import create_dat_file from kdquery import Tree import context from geocoding.datatypes import dtypes from geocoding.datapaths import paths from geocoding.utils import pre_order, degree_to_int def node_to_tuple(node): longitude = node.point[0] latitude = n...
import os import sys import numpy as np from create_database_dat import create_dat_file from kdquery import Tree import context from geocoding.datatypes import dtypes from geocoding.datapaths import paths from geocoding.utils import pre_order, degree_to_int def node_to_tuple(node): longitude = node.point[0] ...
apache-2.0
Python
80f572dd62e22c6ce74e8ddfff3144f8783719b1
Speed up writing service instance client lists by a factor of 10.
stdweird/aquilon,stdweird/aquilon,guillaume-philippon/aquilon,quattor/aquilon,quattor/aquilon,stdweird/aquilon,quattor/aquilon,guillaume-philippon/aquilon,guillaume-philippon/aquilon
lib/python2.5/aquilon/aqdb/sy/build_item.py
lib/python2.5/aquilon/aqdb/sy/build_item.py
""" For Systems and related objects """ from datetime import datetime from sqlalchemy import (Table, Integer, DateTime, Sequence, String, select, Column, ForeignKey, UniqueConstraint) from sqlalchemy.orm import relation, deferred, backref from sqlalchemy.ext.orderinglist import ordering_list ...
""" For Systems and related objects """ from datetime import datetime from sqlalchemy import (Table, Integer, DateTime, Sequence, String, select, Column, ForeignKey, UniqueConstraint) from sqlalchemy.orm import relation, deferred, backref from sqlalchemy.ext.orderinglist import ordering_list ...
apache-2.0
Python
82fd2bc277b359d9247272e7dde899fbd5234815
Prepare 0.0.22
spulec/PyQS
pyqs/__init__.py
pyqs/__init__.py
from .decorator import task # noqa __title__ = 'pyqs' __version__ = '0.0.22'
from .decorator import task # noqa __title__ = 'pyqs' __version__ = '0.0.21'
mit
Python
f03e3c00729c3d68963d68035e11111c0795ac99
fix typo in staging settings
MuckRock/muckrock,MuckRock/muckrock,MuckRock/muckrock,MuckRock/muckrock
muckrock/settings/staging.py
muckrock/settings/staging.py
""" Settings used when deployed to the staging server Imports from the heroku settings """ # pylint: disable=wildcard-import # pylint: disable=unused-wildcard-import from muckrock.settings.heroku import * EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
""" Settings used when deployed to the staging server Imports from the heroku settings """ # pylint: disable=wildcard-import # pylint: disable=unused-wildcard-import from muckrock.settings.heroku import * EMAIL_BACKEND = 'djang.core.mail.backends.dummy.EmailBackend'
agpl-3.0
Python
edf776aeb96618267891fb2b55cc17fa33250a50
Add support for macOS Big Sur (#17236)
LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack
lib/spack/spack/operating_systems/mac_os.py
lib/spack/spack/operating_systems/mac_os.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import platform as py_platform from spack.architecture import OperatingSystem from spack.version import Version from spac...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import platform as py_platform from spack.architecture import OperatingSystem from spack.version import Version from spac...
lgpl-2.1
Python
50621ef5b141470879a786088391a516b4f63d52
Migrate to a custom User class.
LeMeteore/boomer2
note/models.py
note/models.py
from django.db import models from django.conf import settings # Create your models here. # Create your models here. class Note(models.Model): # always reference the User class using setting conf author = models.ForeignKey(settings.AUTH_USER_MODEL) value = models.IntegerField(max_length=255) def __str__...
from django.db import models from django.contrib.auth.models import User # Create your models here. # Create your models here. class Note(models.Model): # always reference the User class using setting conf author = models.ForeignKey(User) value = models.IntegerField(max_length=255) def __str__(self): ...
bsd-2-clause
Python
08d1952b9abd6d3670540132c90d6c0c24e7123a
add additional options for custom script variables
ansible/tower-cli,AlanCoding/tower-cli,AlanCoding/tower-cli,ansible/tower-cli
lib/tower_cli/resources/inventory_script.py
lib/tower_cli/resources/inventory_script.py
# Copyright 2016, Ansible by Red Hat. # Aaron Tan <sitan@redhat.com> # Alan Rominger <arominge@redhat.com> # # 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/licens...
# Copyright 2016, Ansible by Red Hat. # Aaron Tan <sitan@redhat.com> # Alan Rominger <arominge@redhat.com> # # 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/licens...
apache-2.0
Python
8ed5aa8a1e4dff53a72e917321ba5fd57bee412a
add type hint to help indicate it's a string header value and not a list
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/api/cors.py
corehq/apps/api/cors.py
ACCESS_CONTROL_ALLOW = 'Allow' ACCESS_CONTROL_ALLOW_HEADERS = 'Access-Control-Allow-Headers' ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control-Allow-Origin' ACCESS_CONTROL_ALLOW_METHODS = 'Access-Control-Allow-Methods' def add_cors_headers_to_response(response, allow_methods: str = ''): response[ACCESS_CONTROL_ALLO...
ACCESS_CONTROL_ALLOW = 'Allow' ACCESS_CONTROL_ALLOW_HEADERS = 'Access-Control-Allow-Headers' ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control-Allow-Origin' ACCESS_CONTROL_ALLOW_METHODS = 'Access-Control-Allow-Methods' def add_cors_headers_to_response(response, allow_methods=None): response[ACCESS_CONTROL_ALLOW_ORI...
bsd-3-clause
Python
3b28a1fa47d4e2339f2219eaf688b88b5901afea
Fix db migration merge conflicts
alphagov/notifications-api,alphagov/notifications-api
migrations/versions/0074_update_sms_rate.py
migrations/versions/0074_update_sms_rate.py
"""empty message Revision ID: 0074_update_sms_rate Revises: 0073_add_international_sms_flag Create Date: 2017-04-24 12:10:02.116278 """ import uuid revision = '0074_update_sms_rate' down_revision = '0073_add_international_sms_flag' from alembic import op def upgrade(): op.get_bind() op.execute("INSERT IN...
"""empty message Revision ID: 0074_update_sms_rate Revises: 0072_add_dvla_orgs Create Date: 2017-04-24 12:10:02.116278 """ import uuid revision = '0074_update_sms_rate' down_revision = '0072_add_dvla_orgs' from alembic import op def upgrade(): op.get_bind() op.execute("INSERT INTO provider_rates (id, val...
mit
Python
841f3695457292b1ef9d660ad7a3fe66b25af8ea
remove sub
StrategicalIT/pp-rjh-project
pi-light.py
pi-light.py
#!/usr/bin/env python import os import time import ADC0832 import redis import boto3 import pygame from pygame import mixer #Set AWS details from enviroment varibles #test = os.environ['MAIL'] #print test aws_access_key_id = os.environ['AWS_ACCESS_KEY_ID'], aws_secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY'], ...
#!/usr/bin/env python import os import time import ADC0832 import redis import boto3 import pygame from pygame import mixer #Set AWS details from enviroment varibles #test = os.environ['MAIL'] #print test aws_access_key_id = os.environ['AWS_ACCESS_KEY_ID'], aws_secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY'], ...
mit
Python
6f4527188abedbf5596d150195740d2d5771ac41
bump version to 2.4.1.3
pooler/electrum-ltc,pooler/electrum-ltc,pooler/electrum-ltc,vertcoin/electrum-vtc,vertcoin/electrum-vtc,pknight007/electrum-vtc,vertcoin/electrum-vtc,vialectrum/vialectrum,vialectrum/vialectrum,vertcoin/electrum-vtc,pknight007/electrum-vtc,vialectrum/vialectrum,pooler/electrum-ltc,pknight007/electrum-vtc,pknight007/ele...
lib/version.py
lib/version.py
ELECTRUM_VERSION = "2.4.1.3" # version of the client package PROTOCOL_VERSION = '0.10' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0 # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Electru...
ELECTRUM_VERSION = "2.4.1" # version of the client package PROTOCOL_VERSION = '0.10' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0 # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Electrum...
mit
Python
6145568eb84b1d66aabc3de2bb8f961025101fe4
bump version to 2.2.0.1
vialectrum/vialectrum,vertcoin/electrum-vtc,vertcoin/electrum-vtc,vertcoin/electrum-vtc,pooler/electrum-ltc,pknight007/electrum-vtc,pooler/electrum-ltc,vialectrum/vialectrum,vertcoin/electrum-vtc,pknight007/electrum-vtc,pooler/electrum-ltc,vialectrum/vialectrum,pknight007/electrum-vtc,pooler/electrum-ltc,pknight007/ele...
lib/version.py
lib/version.py
ELECTRUM_VERSION = "2.2.0.1" # version of the client package PROTOCOL_VERSION = '0.9' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0 # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Electru...
ELECTRUM_VERSION = "2.2" # version of the client package PROTOCOL_VERSION = '0.9' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0 # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Electrum...
mit
Python
6fc9ca2a4102a58a2bc9765a260ad1fd94fbf173
bump version number
cryptapus/electrum,asfin/electrum,argentumproject/electrum-arg,romanz/electrum,molecular/electrum,vialectrum/vialectrum,dabura667/electrum,vialectrum/vialectrum,dashpay/electrum-dash,FairCoinTeam/electrum-fair,aasiutin/electrum,aasiutin/electrum,cryptapus/electrum-myr,wakiyamap/electrum-mona,pooler/electrum-ltc,kyuupic...
lib/version.py
lib/version.py
ELECTRUM_VERSION = "2.0.2" # version of the client package PROTOCOL_VERSION = '0.9' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0 # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Electrum...
ELECTRUM_VERSION = "2.0.1" # version of the client package PROTOCOL_VERSION = '0.9' # protocol version requested NEW_SEED_VERSION = 11 # electrum versions >= 2.0 OLD_SEED_VERSION = 4 # electrum versions < 2.0 # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Electrum...
mit
Python
1e01ce1988d829d4d2ebda2232a529725db7b90e
fix test testOneNodeAltersAClientRequest()
evernym/plenum,evernym/zeno
plenum/test/signing/test_signing.py
plenum/test/signing/test_signing.py
import pytest import sys from plenum.test.delayers import ppDelay, ppgDelay from plenum.test.helper import sdk_json_to_request_object from stp_core.loop.eventually import eventually from plenum.common.exceptions import InsufficientCorrectSignatures from stp_core.common.log import getlogger from stp_core.common.util im...
import pytest from plenum.test.helper import sdk_json_to_request_object from stp_core.loop.eventually import eventually from plenum.common.exceptions import InsufficientCorrectSignatures from stp_core.common.log import getlogger from stp_core.common.util import adict from plenum.test import waits from plenum.test.mali...
apache-2.0
Python
e99327d8ff82b2dae1a0eefb4eb1da986cc6b345
Update __openerp__.py
adhoc-dev/account-financial-tools,ingadhoc/odoo-addons,ingadhoc/product,adhoc-dev/account-financial-tools,ingadhoc/sale,ingadhoc/account-financial-tools,ingadhoc/sale,ingadhoc/product,adhoc-dev/odoo-addons,ingadhoc/sale,bmya/odoo-addons,bmya/odoo-addons,ingadhoc/account-payment,sysadminmatmoz/ingadhoc,ingadhoc/odoo-add...
project_task_activity/__openerp__.py
project_task_activity/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
Python
11f6d2d0ecede6f79555b2fc285c4a602e516c6c
remove unnecessary imports
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/sitetree_navigation/sub_navigation/event_subnav_definition.py
accelerator/sitetree_navigation/sub_navigation/event_subnav_definition.py
from accelerator.models import NavTree from accelerator.sitetree_navigation.utils import ( add_user_roles_to_nav_items, create_items, delete_nav_tree, FLUENT_REDIRECT_URL, REGISTER_FOR_EVENTS_URL ) from accelerator_abstract.models import BaseUserRole FINALIST = BaseUserRole.FINALIST ALUMNI = BaseUs...
from accelerator.models import NavTree from accelerator.sitetree_navigation.utils import ( add_user_roles_to_nav_items, create_items, delete_nav_tree, FLUENT_REDIRECT_URL, REGISTER_FOR_EVENTS_URL ) from accelerator_abstract.models import BaseUserRole FINALIST = BaseUserRole.FINALIST ALUMNI = BaseUs...
mit
Python
529ab85ac8a25b05690f507ed67ba767d4fb53db
Check for json() ValueError with requests when raising an ApiError in check_error()
JensAstrup/pyEchosign
pyEchosign/utils/handle_response.py
pyEchosign/utils/handle_response.py
from requests import Response from exceptions.internal_exceptions import ApiError def check_error(response: Response): """ Takes a requests package response object and checks the error code and raises the proper exception """ if response.status_code == 401: raise PermissionError('Echosign API...
from requests import Response def check_error(response: Response): """ Takes a requests package response object and checks the error code and raises the proper exception """ response_json = response.json() code = response_json.get('code', None) if response.status_code == 401: raise Per...
mit
Python
7428f7e60ce1330d384a799fb5412df855934810
Add linked in link
satyaakam/satyaakam.github.io,satyaakam/satyaakam.github.io
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'Satyakam Goswami' SITENAME = u'Satyakam.net' SITEURL = '' PATH = 'content' TIMEZONE = 'Asia/Kolkata' DEFAULT_LANG = u'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = None CATEGORY_FEED_AT...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'Satyakam Goswami' SITENAME = u'Satyakam.net' SITEURL = '' PATH = 'content' TIMEZONE = 'Asia/Kolkata' DEFAULT_LANG = u'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = None CATEGORY_FEED_AT...
mit
Python
701385ad1c601af866ecaa099ffc0a79e04f78e0
Update wheel dependency to >0.26.0 (#304)
kwlzn/pex,sixninetynine/pex,snyaggarwal/pex,kwlzn/pex,pantsbuild/pex,jsirois/pex,jsirois/pex,sixninetynine/pex,pantsbuild/pex,snyaggarwal/pex
pex/version.py
pex/version.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). __version__ = '1.1.14' SETUPTOOLS_REQUIREMENT = 'setuptools>=2.2,<20.11' WHEEL_REQUIREMENT = 'wheel>=0.26.0,<0.30.0'
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). __version__ = '1.1.14' SETUPTOOLS_REQUIREMENT = 'setuptools>=2.2,<20.11' WHEEL_REQUIREMENT = 'wheel>=0.24.0,<0.30.0'
apache-2.0
Python
7ce3aafbabe86ede0e69ff9b76b5c5c90091dc48
Increase test coverage of Espresso module
GtTmy/pyeda,karissa/pyeda,cjdrake/pyeda,GtTmy/pyeda,cjdrake/pyeda,GtTmy/pyeda,karissa/pyeda,pombredanne/pyeda,pombredanne/pyeda,sschnug/pyeda,karissa/pyeda,sschnug/pyeda,cjdrake/pyeda,sschnug/pyeda,pombredanne/pyeda
pyeda/boolalg/test/test_espresso.py
pyeda/boolalg/test/test_espresso.py
""" Test the Espresso interface """ from pyeda.boolalg.espresso import espresso, EspressoError from pyeda.boolalg.table import truthtable2expr, truthtable from pyeda.boolalg.vexpr import bitvec from pyeda.boolalg.minimization import espresso_exprs, espresso_tts from pyeda.logic.addition import ripple_carry_add from n...
""" Test the Espresso interface """ from pyeda.boolalg.vexpr import bitvec from pyeda.boolalg.minimization import espresso_exprs from pyeda.logic.addition import ripple_carry_add def test_espresso(): A = bitvec('a', 16) B = bitvec('b', 16) S, C = ripple_carry_add(A, B) s0, s1, s2, s3 = espresso_exprs(...
bsd-2-clause
Python
143b050c0c5896c0bd5ffeb9fb8441d1e13a7e85
add analytics
akersten/alex-ink
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'Alex Kersten' SITENAME = 'alex ink' SITEURL = 'http://alex.ink' PATH = 'content' STATIC_PATHS = ['static'] TIMEZONE = 'America/Chicago' DEFAULT_LANG = 'en' # Feed generation is usually not desired when developing FEED...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'Alex Kersten' SITENAME = 'alex ink' SITEURL = 'http://alex.ink' PATH = 'content' STATIC_PATHS = ['static'] TIMEZONE = 'America/Chicago' DEFAULT_LANG = 'en' # Feed generation is usually not desired when developing FEED...
mit
Python
83a56bba934fcff235ccb36864c15cddc1231847
Use new setup mechanism
freedomboxtwh/Plinth,vignanl/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,kkampardi/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,vignanl/Plinth,kkampardi/Plinth,kkampardi/Plinth,harry-7/Plinth,kkampardi/Plinth,vignanl/Plinth,kkampardi/Plinth,vignanl/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,freedomboxtwh/Pl...
plinth/modules/apps/__init__.py
plinth/modules/apps/__init__.py
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
agpl-3.0
Python
5d08747d2df5b435adb6bd5142a65b95ba3807d3
add import render
dresl/django_choice_and_question,dresl/django_choice_and_question
polls/views.py
polls/views.py
from django.http import HttpResponse from django.template import RequestContext, loader from polls.models import Question from django.shortcuts import render def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] template = loader.get_template('polls/index.html') context = R...
from django.http import HttpResponse from django.template import RequestContext, loader from polls.models import Question def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] template = loader.get_template('polls/index.html') context = RequestContext(request, { 'l...
apache-2.0
Python
42e4e5e78779b4c683fc42fb4c45bb600e96afe3
Fix new name for scan tasks
hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,quarkslab/irma,hirokihamasaki/irma,quarkslab/irma,quarkslab/irma,quarkslab/irma
probe/controllers/braintasks.py
probe/controllers/braintasks.py
# Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http://...
# Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http://...
apache-2.0
Python
60d27ba803f7ecf5a3d10ea293be5a452f03c68c
use test auto pickup (re #6914)
ZeitOnline/zeit.find,ZeitOnline/zeit.find
src/zeit/find/tests.py
src/zeit/find/tests.py
# Copyright (c) 2008-2009 gocept gmbh & co. kg # See also LICENSE.txt import os import pkg_resources import unittest import zeit.cms.testing import zeit.find.search import zope.app.testing.functional product_config = """\ <product-config zeit.solr> solr-url file://%s public-solr-url file://%s </product-config...
# Copyright (c) 2008-2009 gocept gmbh & co. kg # See also LICENSE.txt import os import pkg_resources import unittest import zeit.cms.testing import zeit.find.search import zope.app.testing.functional product_config = """\ <product-config zeit.solr> solr-url file://%s public-solr-url file://%s </product-config...
bsd-3-clause
Python
fbdfbbc39c2a5b951fe8ecd467388b488880f08e
fix site config missing save
appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform
openedx/core/djangoapps/appsembler/sites/management/commands/save_active_sites.py
openedx/core/djangoapps/appsembler/sites/management/commands/save_active_sites.py
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from openedx.core.djangoapps.appsembler.sites.utils import get_active_sites from openedx.core.djangoapps.site_configuration.models import SiteConfiguration class Command(BaseCommand): """ Save all active sites ...
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from openedx.core.djangoapps.appsembler.sites.utils import get_active_sites from openedx.core.djangoapps.site_configuration.models import SiteConfiguration class Command(BaseCommand): """ Save all active sites ...
agpl-3.0
Python
2414e6cafa02e500955eb8a3af133debdfa0c408
Change comment
GustavoVS/timtec,GustavoVS/timtec,GustavoVS/timtec,GustavoVS/timtec
core/management/commands/ifuser2modeluser.py
core/management/commands/ifuser2modeluser.py
from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model from django.db import connection from django.db.utils import IntegrityError, ProgrammingError from ifs.models import IfUser ActiveUser = get_user_model() class Command(BaseCommand): args = '' help = 'Migrate d...
from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model from django.db import connection from django.db.utils import IntegrityError, ProgrammingError from ifs.models import IfUser ActiveUser = get_user_model() class Command(BaseCommand): args = '' help = 'Migrate d...
agpl-3.0
Python
78a93547b8a7fd14050abe4d1e4bdef2051d9037
Fix branch in db migration scripts
Metaswitch/calico-neutron,cloudbase/neutron,adelina-t/neutron,SmartInfrastructures/neutron,pnavarro/neutron,sajuptpm/neutron-ipam,shahbazn/neutron,redhat-openstack/neutron,antonioUnina/neutron,ntt-sic/neutron,rickerc/neutron_audit,vbannai/neutron,chitr/neutron,leeseuljeong/leeseulstack_neutron,yuewko/neutron,eayunstack...
quantum/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py
quantum/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack Foundation # # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack Foundation # # 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...
apache-2.0
Python
65893ff24086755c2ea4467bf41608fcf47fb76d
add delay of 1 sec. between testsuites exec
oVirt/ovirt-engine-sdk-tests
main.py
main.py
#!/usr/bin/python # # Copyright (c) 2010 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/python # # Copyright (c) 2010 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
Python
60c5bb9672d458305bcd2c8a5222fc019711f62c
add damnspam to load_modules
RedstonerServer/redstoner-utils,Evanus/redstoner-utils,RedstonerServer/redstoner-utils,Evanus/redstoner-utils
main.py
main.py
__plugin_name__ = "RedstonerUtils" __plugin_version__ = "3.0" __plugin_mainclass__ = "foobar" import sys from traceback import format_exc as print_traceback # damn pythonloader changed the PATH sys.path += ['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/pytho...
__plugin_name__ = "RedstonerUtils" __plugin_version__ = "3.0" __plugin_mainclass__ = "foobar" import sys from traceback import format_exc as print_traceback # damn pythonloader changed the PATH sys.path += ['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/pytho...
mit
Python
2642410559199f79d0df054024d917009d6be944
edit /api page
zyz29/yzhou9-webapps,zyz29/yzhou9-webapps,zyz29/yzhou9-webapps
main.py
main.py
import cherrypy import sys import mysql.connector from collections import OrderedDict #Define database variables DATABASE_USER = 'root' DATABASE_HOST = '127.0.0.1' DATABASE_NAME = 'feedND' #Create connection to MySQL cnx = mysql.connector.connect(user=DATABASE_USER, host=DATABASE_HOST, database=DATABASE_NAME) cursor ...
import cherrypy import sys import mysql.connector from collections import OrderedDict class ExampleApp(object): @cherrypy.expose def index(self): d = {'Subway':427.0, "O'Rourke's Public House":632.0, 'The Mark Dine & Tap':730.0} OrderedDict(sorted(d.items(), key=lambda t: t[1])) result = """ <!DOCTY...
mit
Python
35780712cecb7bf19765df30b6003538d8fd4b52
Update main.py
RoboCupULaval/UI-Debug
main.py
main.py
# Under MIT License, see LICENSE.txt import sys import argparse from PyQt5.QtWidgets import QApplication from qtpy import QtCore from Controller.MainController import MainController __author__ = 'RoboCupULaval' def argumentParser(argument): """ Argument parser """ parser = argparse.ArgumentParser(descript...
# Under MIT License, see LICENSE.txt import sys import argparse from PyQt5.QtWidgets import QApplication from qtpy import QtCore from Controller.MainController import MainController __author__ = 'RoboCupULaval' def argumentParser(argument): """ Argument parser """ parser = argparse.ArgumentParser(descript...
mit
Python
1d62e91ff1b60786c757d2587587ed051cfddf87
Add staging code
davidgasquez/continuous-lambda,davidgasquez/continuous-lambda
main.py
main.py
import requests def none(): return None def handler(event, context): r = requests.get('https://api.github.com/events') return r.json()
import requests def handler(event, context): r = requests.get('https://api.github.com/events') return r.json()
mit
Python
6b448b0fd0a24030b4999db3f5f068474ca09bc9
load env instead of loading settings.py
littleq0903/fb-python-codelab,littleq0903/fb-python-codelab
main.py
main.py
#!/usr/bin/env python """ Example for Facebook Python SDK Author: Colin Su <littleq0903@gmail.com> """ from bottle import Bottle, run, template from bottle import static_file from bottle import jinja2_template import facebook import os # setup these environment variable by adding "heroku.config" # - FACEBOOK_APP_ID #...
#!/usr/bin/env python """ Example for Facebook Python SDK Author: Colin Su <littleq0903@gmail.com> """ from bottle import Bottle, run, template from bottle import static_file from bottle import jinja2_template import facebook import os # added a file "settings.py", which contains variables named: # - FACEBOOK_APP_ID ...
mit
Python
fa06f13adfd1b7c3e319988a0997da4b38f24919
디버그 모드 활성화
if1live/twitter_user_sort,if1live/twitter_user_sort
main.py
main.py
#!/usr/bin/env python #-*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import tweepy from importd import d import os try: import config API_KEY = config.API_CLIENT_KEY SECRET_KEY = config.API_SECRET_KEY except: API_KEY = os.environ['TWITTER_API_KEY'...
#!/usr/bin/env python #-*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import tweepy from importd import d import os try: import config API_KEY = config.API_CLIENT_KEY SECRET_KEY = config.API_SECRET_KEY except: API_KEY = os.environ['TWITTER_API_KEY'...
mit
Python
5de5af09536ee4c7d877ab222a38d505b99a637a
Add space
callicles/Honeyword-generators
main.py
main.py
import pprint import argparse import mutators from algorithms.password_leaner import password_leaner from algorithms.tokeniser import tokeniser from algorithms import generators pp = pprint.PrettyPrinter(indent=1) def main(password): for i in range(10): nicolasObject = password_leaner(password) ...
import pprint import argparse import mutators from algorithms.password_leaner import password_leaner from algorithms.tokeniser import tokeniser from algorithms import generators pp = pprint.PrettyPrinter(indent=1) def main(password): for i in range(10): nicolasObject = password_leaner(password) #...
mit
Python
0e86e66b299d76c3debdd30469fd89e8a7ab153f
Test with MNIST
IshitaTakeshi/PCANet
main.py
main.py
from os.path import exists import pickle import gzip from urllib.request import urlretrieve from sklearn.datasets import load_digits from sklearn.svm import LinearSVC from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from...
from sklearn.datasets import load_digits from sklearn.svm import LinearSVC from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from pcanet import PCANet digits = load_digits() images = digits.images y = digits.target pcan...
mit
Python
5c13ccab24ecd24c9d3a8d68e704ac58fa28fc19
Add main.py - Add main.py to have a user friendly way to calculate the amount of material needed.
VictorLoren/hanging-fabric-calculator
main.py
main.py
## Import the module from tulle import *; ## Defining what unit to use unitStr = "feet" ## Defining the room to hang material in width = float(raw_input("How wide is the room (in %s)? " %unitStr)) length = float(raw_input("How long is the room (in %s)? " %unitStr)) height = float(raw_input("How high is the room (in ...
## Import the module from tulle import *; ## Defining what unit to use unitStr = "feet" ## Defining the room to hang material in width = float(raw_input("How wide is the room (in %s)? " %unitStr)) length = float(raw_input("How long is the room (in %s)? " %unitStr)) height = float(raw_input("How high is the room (in ...
mit
Python
2ce9587169bc9e6a27931bce1c14d38a07decd20
Save JSON files with slightly more accurate timestamp
dundua/IG-Downloader
main.py
main.py
import json import logging import sys import time import os import instagram def saveJSON(timestamp, type, content): dirpath = os.getcwd() path = os.path.join(dirpath, "json", str(timestamp) + "_" + type + ".json") dirpath = os.path.dirname(path) os.makedirs(dirpath, exist_ok=True) f = open(path, "...
import json import logging import sys import time import os import instagram def saveJSON(timestamp, type, content): dirpath = os.getcwd() path = os.path.join(dirpath, "json", str(timestamp) + "_" + type + ".json") dirpath = os.path.dirname(path) os.makedirs(dirpath, exist_ok=True) f = open(path, "...
mit
Python
15bbc098b7ff5a550b444fe33288aa163aa65b06
Add graphic interface to main program
Kinokoio/InferenceSimplifier
main.py
main.py
#!/usr/bin/python3 from gui import InferenceSolver from PyQt5.QtCore import * from PyQt5.QtWidgets import * import sys app = QApplication(sys.argv) screen = InferenceSolver() screen.show() sys.exit(app.exec_())
from compiler import Compiler comp = Compiler() comp.ParseStatement("pequeno v lazo ^ !lazo -> (agua <-> liquido)")
mit
Python
c6dc7ac1d37d19e5a80b0121ac95b2bfd766856b
add access control headers
franklai/lyric-get,franklai/lyric-get,franklai/lyric-get,franklai/lyric-get
main.py
main.py
#!/usr/bin/env python import json import lyric_engine import webapp2 class MainHandler(webapp2.RequestHandler): def handler(self): url = self.request.get('url') if url: try: engine = lyric_engine.Lyric(url) lyric = engine.get_lyric() outp...
#!/usr/bin/env python import json import lyric_engine import webapp2 class MainHandler(webapp2.RequestHandler): def handler(self): url = self.request.get('url') if url: try: engine = lyric_engine.Lyric(url) lyric = engine.get_lyric() outp...
mit
Python
46ff808194b3ee89b59d5e2ee1c0af8ce280a993
Update Menu.Py
Stsosz/Python-Scripts
menu.py
menu.py
#! /usr/bin/env python3 import time print ('By R00Y0ID & R00Tlabs.') print (29 * '-') time.sleep(.1) print (" P R O G R A M - M E N U") time.sleep(.1) print (29 * '-') time.sleep(.1) print ("1. About") time.sleep(.1) print ("2. Monty Python Game") time.sleep(.1) print ("3. Addition Calculator") time.sleep(.1) print...
#! /usr/bin/env python3 import time print ('By !NS!GN!A & Blackstallion Labs.') print (29 * '-') time.sleep(.1) print (" P R O G R A M - M E N U") time.sleep(.1) print (29 * '-') time.sleep(.1) print ("1. About") time.sleep(.1) print ("2. Monty Python Game") time.sleep(.1) print ("3. Addition Calculator") time.sleep...
mit
Python
5560e28eea904e4c0fb94fb6329c080d4d158339
replace sys.argv with argparse module
SanketDG/mexe
mexe.py
mexe.py
import argparse import os import stat import sys shebang = "#!/usr/bin/env python\n" def contains_shebang(f): first_line = f.readline() if first_line == shebang: return True return False def put_shebang(f): if not contains_shebang(f): f.seek(0) original_text ...
import os import stat import sys shebang = "#!/usr/bin/env python\n" def contains_shebang(f): first_line = f.readline() if first_line == shebang: return True return False def put_shebang(f): if not contains_shebang(f): f.seek(0) original_text = f.read() ...
mit
Python
6b3c31d95d9bb1a026b39d3c2f6cfa414e1d2fd2
Fix typo
liborw/oris
oris.py
oris.py
# Copyright (c) Libor Wagner - All Rights Reserved # # Author: Libor Wagner <wagnelib@cmp.felk.cvut.cz> # Created on: Dec 9, 2013 import urllib2 import urllib import json class ORIS(object): """Implementation of the ORIS API (http://oris.orientacnisporty.cz/API) """ def __init__(self, format="jso...
# Copyright (c) Libor Wagner - All Rights Reserved # # Author: Libor Wagner <wagnelib@cmp.felk.cvut.cz> # Created on: Dec 9, 2013 import urllib2 import urllib import json class ORIS(object): """Implementation of the ORIS API (http://oris.orientacnisporty.cz/API) """ def __init__(self, format="jso...
bsd-2-clause
Python
88f7808780d5e565a78405061d577a9c65c54b6b
change url route, complete twitter
karan/sopins
pins.py
pins.py
try: # Python 2 from StringIO import StringIO as BytesIO except ImportError: # Python 3 from io import BytesIO import mimetypes import simplejson as json import requests from flask import Flask, request, make_response app = Flask(__name__) Twitter_URL = "http://urls.api.twitter.com/1/urls/count.jso...
try: # Python 2 from StringIO import StringIO as BytesIO except ImportError: # Python 3 from io import BytesIO import mimetypes import simplejson as json import requests from flask import Flask, request, make_response app = Flask(__name__) Twitter_URL = "http://urls.api.twitter.com/1/urls/count.jso...
mit
Python
be4a86f6dc61e7cffe3887666b8152fec81fded6
Fix PEP8
dolaameng/keras,kemaswill/keras,keras-team/keras,keras-team/keras,kuza55/keras,daviddiazvico/keras,DeepGnosis/keras,relh/keras,nebw/keras
tests/keras/layers/test_wrappers.py
tests/keras/layers/test_wrappers.py
import pytest import numpy as np from numpy.testing import assert_allclose from keras.layers import wrappers from keras.layers import core, convolutional from keras.models import Sequential, model_from_json def test_TimeDistributed(): # first, test with Dense layer model = Sequential() model.add(wrappers...
import pytest import numpy as np from numpy.testing import assert_allclose from keras.layers import wrappers from keras.layers import core, convolutional from keras.models import Sequential, model_from_json def test_TimeDistributed(): # first, test with Dense layer model = Sequential() model.add(wrappers...
mit
Python
52c3b8370480926c58148acf2bed6c7049b18da0
Add start/stop test
beerfactory/hbmqtt
tests/mqtt/protocol/test_handler.py
tests/mqtt/protocol/test_handler.py
# Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. import unittest import asyncio from hbmqtt.plugins.manager import PluginManager from hbmqtt.session import Session from hbmqtt.mqtt.protocol.handler import ProtocolHandler from hbmqtt.adapters import BufferReader, BufferWriter c...
# Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. import unittest import asyncio from hbmqtt.plugins.manager import PluginManager from hbmqtt.session import Session from hbmqtt.mqtt.protocol.handler import ProtocolHandler class ProtocolHandlerTest(unittest.TestCase): def se...
mit
Python
3025b0e9e493db3b9ab7e3042b8ffa08cebb59e2
fix save_map test on windows
tomhughes/mapnik,sebastic/python-mapnik,mapnik/mapnik,tomhughes/mapnik,qianwenming/mapnik,lightmare/mapnik,davenquinn/python-mapnik,sebastic/python-mapnik,Uli1/mapnik,CartoDB/mapnik,mapycz/python-mapnik,stefanklug/mapnik,pramsey/mapnik,qianwenming/mapnik,stefanklug/mapnik,zerebubuth/mapnik,cjmayo/mapnik,naturalatlas/ma...
tests/python_tests/save_map_test.py
tests/python_tests/save_map_test.py
#!/usr/bin/env python from nose.tools import * from utilities import execution_path, run_all import tempfile import os, sys, glob, mapnik default_logging_severity = mapnik.logger.get_severity() def setup(): # make the tests silent to suppress unsupported params from harfbuzz tests # TODO: remove this after ...
#!/usr/bin/env python from nose.tools import * from utilities import execution_path, run_all import tempfile import os, sys, glob, mapnik default_logging_severity = mapnik.logger.get_severity() def setup(): # make the tests silent to suppress unsupported params from harfbuzz tests # TODO: remove this after ...
lgpl-2.1
Python
5b43b0bf4d6d0887ae6f38ff8e9acec3baa8e94c
use PROCESS_QUERY_INFORMATION since it's on other versions of windows
opalmer/pywincffi,opalmer/pywincffi,opalmer/pywincffi,opalmer/pywincffi
tests/test_kernel32/test_process.py
tests/test_kernel32/test_process.py
import os from pywincffi.core import dist from pywincffi.dev.testutil import TestCase from pywincffi.exceptions import WindowsAPIError from pywincffi.kernel32.io import CloseHandle from pywincffi.kernel32.process import OpenProcess class TestOpenProcess(TestCase): """ Tests for :func:`pywincffi.kernel32.Open...
import os from pywincffi.core import dist from pywincffi.dev.testutil import TestCase from pywincffi.exceptions import WindowsAPIError from pywincffi.kernel32.io import CloseHandle from pywincffi.kernel32.process import OpenProcess class TestOpenProcess(TestCase): """ Tests for :func:`pywincffi.kernel32.Open...
mit
Python
4602f499a23ec2c2e1ee696fa3c0299ca13f14dd
Remove loader module mixin, add linux paths
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/unit/modules/test_win_file.py
tests/unit/modules/test_win_file.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Shane Lee <slee@saltstack.com>` ''' # Import Python Libs from __future__ import absolute_import import os # Import Salt Testing Libs from tests.support.unit import TestCase, skipIf from tests.support.mock import ( patch, NO_MOCK, NO_MOCK_REASON ) # Import S...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Shane Lee <slee@saltstack.com>` ''' # Import Python Libs from __future__ import absolute_import import os # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipIf from tests.support.mock import ( ...
apache-2.0
Python
6c29730748bdec774023120d7b06e5a675cb67a7
update version number
xuecan/ganggu
ganggu/__init__.py
ganggu/__init__.py
# -*- coding: utf-8 -*- # Copyright (C) 2012-2016 Xue Can <xuecan@gmail.com> and contributors. # Licensed under the MIT license: http://opensource.org/licenses/mit-license __version__ = '0.9.4'
# -*- coding: utf-8 -*- # Copyright (C) 2012-2016 Xue Can <xuecan@gmail.com> and contributors. # Licensed under the MIT license: http://opensource.org/licenses/mit-license __version__ = '0.9.3'
mit
Python
7608e311a668dc3b8ba00455b4cfbbed13f63dcf
Add geomdl_version function
orbingol/NURBS-Python,orbingol/NURBS-Python
geomdl/__init__.py
geomdl/__init__.py
""" Object-oriented B-Spline and NURBS evaluation library in pure Python .. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com> """ # Library version __version__ = "5.2.9" # Author and license __author__ = "Onur Rauf Bingol" __license__ = "MIT" # Optional variables __description__ = 'Object-oriented B-Spline and ...
""" Object-oriented B-Spline and NURBS evaluation library in pure Python .. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com> """ # Library version __version__ = "5.2.9" # Author and license __author__ = "Onur Rauf Bingol" __license__ = "MIT" # Optional variables __description__ = 'Object-oriented B-Spline and ...
mit
Python
b9cf2f0daf2ca360c64d1268d50cab9c07020222
Add test_is_coord_on_board() to assert the function returns True if the coordinate is on the board and False otherwise
EyuelAbebe/gamer,EyuelAbebe/gamer
test_engine.py
test_engine.py
import engine VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)] INVALID_COORDS = [ (0, 0), (-1, -1), (96, 49), (96, 48), (105, 49), (104, 48), (96, 56), (97, 57), (105, 56), (104, 57) ] VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)] INVALID...
import engine VALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)] INVALID_COORDS = [ (0, 0), (-1, -1), (96, 49), (96, 48), (105, 49), (104, 48), (96, 56), (97, 57), (105, 56), (104, 57) ] VALID_A1 = [chr(x) + chr(y) for x in xrange(97, 105) for y in xrange(49, 57)] INVALID...
mit
Python
c0fa6960ab88439485fd5e8839c48056a1c414b2
test link session class to resources
ariebovenberg/snug,ariebovenberg/omgorm
test_omgorm.py
test_omgorm.py
import pytest import collections import omgorm as orm @pytest.fixture def session_class(): class MySiteSession(orm.Session): pass return MySiteSession class TestResource: def test_fields_linked_to_resource(self, session_class): class Post(orm.Resource, session_cls=session_class): ...
import collections import omgorm as orm def test_model_fields_definition(): class Post(orm.Resource): title = orm.Field() body = orm.Field() user = orm.Field() assert Post.title.name == 'title' assert Post.title.resource is Post expect_fields = collections.OrderedDict([ ...
mit
Python
15a9e9291e90d5f46b43dcbd020f7e451261fa63
move all imports to top of file
hugovk/Gutenberg,c-w/Gutenberg
tests/_util.py
tests/_util.py
# pylint: disable=C0103 # pylint: disable=C0111 # pylint: disable=R0921 # pylint: disable=W0212 from __future__ import absolute_import import abc import gzip import os import shutil import tempfile import gutenberg.acquire.metadata import gutenberg.acquire.text class MockTextMixin(object): def setUp(self): ...
# pylint: disable=C0103 # pylint: disable=C0111 # pylint: disable=R0921 # pylint: disable=W0212 from __future__ import absolute_import import abc import gzip import os import shutil import tempfile class MockTextMixin(object): def setUp(self): import gutenberg.acquire.text self.mock_text_cache =...
apache-2.0
Python
0cecbabd2d594bfc2ca57e522658d13eda2bc6a8
Add support for Python 3
ogt/pipdiff
pipdiff/pipdiff.py
pipdiff/pipdiff.py
#!/usr/bin/env python # Original author : Jonathan Zempel, https://github.com/jzempel # Copied from https://gist.github.com/jzempel/4624227 # Copied here for the purpose of adding it to PyPI from pkg_resources import parse_version try: from xmlrpclib import ServerProxy except ImportError: import xmlrpc.client ...
#!/usr/bin/env python # Original author : Jonathan Zempel, https://github.com/jzempel # Copied from https://gist.github.com/jzempel/4624227 # Copied here for the purpose of adding it to PyPI from pkg_resources import parse_version from xmlrpclib import ServerProxy pypi = ServerProxy("http://pypi.python.org/pypi") d...
bsd-3-clause
Python
1f6d95dd989162fa42d4d95cbc27323f4b6945c4
add view todo
Blueshoe/djangocms-workflows,Blueshoe/djangocms-workflows
pipelines/views.py
pipelines/views.py
from django.shortcuts import render # Create your views here. # TODO Views handling action creation
from django.shortcuts import render # Create your views here.
mit
Python
4f203e35998161ece24c9219cc68f8ed79d3d863
Add ModelForm for Quote
k4rtik/alpo
quotes/models.py
quotes/models.py
from django.db import models from django.forms import ModelForm # Create your models here. class Quote(models.Model): message = models.TextField() name = models.CharField(max_length=100) PROGRAM_CHOICES = ( ('BCS', 'BTech'), ('MCS', 'MTech'), ('MCA', 'MCA'), ) pr...
from django.db import models # Create your models here. class Quote(models.Model): message = models.TextField() name = models.CharField(max_length=100) PROGRAM_CHOICES = ( ('BCS', 'BTech'), ('MCS', 'MTech'), ('MCA', 'MCA'), ) program = models.CharField(max_length...
mit
Python
5cf39f746a22418c9eb3288005a29718c3152e2d
Check existence of words in translation linter
adityahase/frappe,saurabh6790/frappe,adityahase/frappe,frappe/frappe,adityahase/frappe,yashodhank/frappe,yashodhank/frappe,frappe/frappe,yashodhank/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,mhbu50/frappe,almeidapaulopt/frappe,frappe/frappe,saurabh6790/frappe,mhbu50/frappe,adityahase/frapp...
.github/helper/translation.py
.github/helper/translation.py
import re import sys errors_encounter = 0 pattern = re.compile(r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,\s*(.)*?\s*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)") start_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}.*[a-zA-Z]") # skip first argument files...
import re import sys errors_encounter = 0 pattern = re.compile(r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,\s*(.)*?\s*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)") start_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}") # skip first argument files = sys.arg...
mit
Python
c7ed6ce977d5bc7dd7e7e6150aa1654daadab037
Remove test strings and early return
yashodhank/frappe,yashodhank/frappe,adityahase/frappe,saurabh6790/frappe,mhbu50/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,adityahase/frappe,adityahase/frappe,almeidapaulopt/frappe,saurabh6790/frappe,mhbu50/frappe,saurabh6790/frappe,StrellaGroup/frappe,adityahase/frappe,almeidapaulopt/frappe,StrellaGr...
.github/helper/translation.py
.github/helper/translation.py
import re import sys errors_encounter = 0 pattern = re.compile(r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,\s*(.)*?\s*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)") words_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}.*?[a-zA-Z]") start_pattern = re.compile(...
import re import sys errors_encounter = 0 pattern = re.compile(r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,\s*(.)*?\s*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)") words_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}.*?[a-zA-Z]") start_pattern = re.compile(...
mit
Python
d6e17b6c00898f16f4d5855d1c02f962b4224c1f
Remove unnecesary else:pass
ids1024/wikicurses
src/wikicurses/htmlparse.py
src/wikicurses/htmlparse.py
import re from collections import OrderedDict from html.parser import HTMLParser def parseExtract(html): parser = _ExtractHTMLParser() parser.feed(html) return parser.sections class _ExtractHTMLParser(HTMLParser): sections = OrderedDict({'':[]}) cursection = '' inh2 = False inblockquote =...
import re from collections import OrderedDict from html.parser import HTMLParser def parseExtract(html): parser = _ExtractHTMLParser() parser.feed(html) return parser.sections class _ExtractHTMLParser(HTMLParser): sections = OrderedDict({'':[]}) cursection = '' inh2 = False inblockquote =...
mit
Python
dc6279f907fd29de0777303e2af04a9be3dc3e52
Update __init__.py to reflect new modules.
rave-engine/rave
rave/__init__.py
rave/__init__.py
# rave - a modular and extensible visual novel engine. from . import log from . import bootstrap, bootstrappers from . import filesystem from . import loader __name__ = 'rave' __version__ = '0.1.0' __version_info__ = (0, 1, 0) __author__ = 'rave developers and contributors' __license__ = 'BSD'
bsd-2-clause
Python
f7b45038bd3bbc23260736b8d48df773cba750bb
Bump version to 1.5.5
DMPwerkzeug/DMPwerkzeug,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo
rdmo/__init__.py
rdmo/__init__.py
__title__ = 'rdmo' __version__ = '1.5.5' __author__ = 'RDMO Arbeitsgemeinschaft' __email__ = 'rdmo-team@listserv.dfn.de' __license__ = 'Apache-2.0' VERSION = __version__
__title__ = 'rdmo' __version__ = '1.5.4' __author__ = 'RDMO Arbeitsgemeinschaft' __email__ = 'rdmo-team@listserv.dfn.de' __license__ = 'Apache-2.0' VERSION = __version__
apache-2.0
Python
0a844ec7d6d4b159d03259dab0dbd312aedaa14d
update doc.py to be more accurate
ZackNagaich/mandrake,hosom/mandrake
plugins/doc.py
plugins/doc.py
from oletools import olevba class Plugin: __NAME__ = 'doc' def __init__(self, args): self.args = args self.analyzed_mimes = ['application/msword', 'vnd.ms-office'] def analyze(self, afile): if afile.mime_type in self.analyzed_mimes: parser = olevba.VBA_Parser(afile.path) results = parser.a...
from oletools import olevba class Plugin: __NAME__ = 'doc' def __init__(self, args): self.args = args def analyze(self, afile): if afile.mime_type == 'application/msword': parser = olevba.VBA_Parser(afile.path) results = parser.analyze_macros() for kw_type, keyword, description in results: o...
bsd-3-clause
Python
88442a6180f3101251d92c9794cd17a2c470f005
add listing to pip wrapper
getnamo/UnrealEnginePython,getnamo/UnrealEnginePython,getnamo/UnrealEnginePython,getnamo/UnrealEnginePython,getnamo/UnrealEnginePython
Content/Scripts/pipinstall.py
Content/Scripts/pipinstall.py
import runcmd as cmd import sys from threading import Thread def pipModuleAction(command, args): return cmd.run('pip ' + command + ' ' + args, cmd.PythonHomeScriptsPath()) def install(module): t = Thread(target=pipModuleAction, args=('install',module,)) t.start() def uninstall(module): t = Thread(target=pipModul...
import runcmd as cmd import sys from threading import Thread def pipModuleAction(command, module): cmd.run('pip ' + command + ' ' + module, cmd.PythonHomeScriptsPath()) def install(module): t = Thread(target=pipModuleAction, args=('install',module,)) t.start() def uninstall(module): t = Thread(target=pipModuleAc...
mit
Python
8b5441c80202a52717dd20fcbb88fd81e12d82c1
fix import
IMIO/django-fixmystreet,IMIO/django-fixmystreet,IMIO/django-fixmystreet,IMIO/django-fixmystreet
django_fixmystreet/fixmystreet/views/main.py
django_fixmystreet/fixmystreet/views/main.py
from django.shortcuts import render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.utils.http import urlquote from django.utils.translation import get_language, activate from django.conf import settings from django_fixmystreet.fixm...
from django.shortcuts import render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.utils.http import urlquote from django.utils.translation import get_language from django.conf import settings from django_fixmystreet.fixmystreet.mo...
agpl-3.0
Python
2f67b06d86b06969120ddd7bfa8ef59e924e4791
fix DebugFlags
bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu
Cython/Compiler/DebugFlags.py
Cython/Compiler/DebugFlags.py
debug_disposal_code = 0 debug_temp_alloc = 0 debug_coercion = 0 # Write comments into the C code that show where temporary variables # are allocated and released debug_temp_code_comments = 0 # Write a call trace of the code generation phase into the C code debug_trace_code_generation = 0 # Do not replace exceptions ...
debug_disposal_code = 0 debug_temp_alloc = 0 debug_coercion = 0 # Write comments into the C code that show where temporary variables # are allocated and released debug_temp_code_comments = 0 # Write a call trace of the code generation phase into the C code debug_trace_code_generation = 0 # Do not replace exceptions ...
apache-2.0
Python
8f4c5b6a4c609e5154dfee432c567e382f69ee88
Update Layer to use ResourceInfo support class
boundlessgeo/gsconfig,garnertb/gsconfig.py,Geode/gsconfig,cristianzamar/gsconfig,scottp-dpaw/gsconfig,afabiani/gsconfig
src/geoserver/layer.py
src/geoserver/layer.py
from urllib2 import HTTPError from geoserver.support import ResourceInfo, atom_link, get_xml from geoserver.style import Style from geoserver.resource import FeatureType, Coverage class Layer(ResourceInfo): resource_type = "layers" def __init__(self, node): self.name = node.find("name").text self.href = ...
from urllib2 import HTTPError from geoserver.support import atom_link, get_xml from geoserver.style import Style from geoserver.resource import FeatureType, Coverage class Layer: def __init__(self, node): self.name = node.find("name").text self.href = atom_link(node) self.update() def update(self): ...
mit
Python
0748f5f9070245ae1b90653017f15ba2ee48b5a5
fix log exception
openstack/vitrage,openstack/vitrage,openstack/vitrage
vitrage/api/controllers/v1/event.py
vitrage/api/controllers/v1/event.py
# Copyright 2017 - Nokia 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2017 - Nokia 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
Python
edf465bd80b20f151064ac39ba4d0c1cd9643e1d
Add a unit test for deterministic ID, with unicode
oasis-open/cti-python-stix2
stix2/test/v21/test_base.py
stix2/test/v21/test_base.py
import datetime as dt import json import uuid import pytest import pytz import stix2 from stix2.base import STIXJSONEncoder def test_encode_json_datetime(): now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC) test_dict = {'now': now} expected = '{"now": "2017-03-22T00:00:00Z"}' assert json.dum...
import datetime as dt import json import pytest import pytz from stix2.base import STIXJSONEncoder def test_encode_json_datetime(): now = dt.datetime(2017, 3, 22, 0, 0, 0, tzinfo=pytz.UTC) test_dict = {'now': now} expected = '{"now": "2017-03-22T00:00:00Z"}' assert json.dumps(test_dict, cls=STIXJSO...
bsd-3-clause
Python
1217d8539e8911f2679e9bb156c0c82264bca82c
Remove sys path thingies
jonge-democraten/hellios,jonge-democraten/hellios,jonge-democraten/hellios
pmsite/wsgi.py
pmsite/wsgi.py
""" WSGI config for pmsite project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
""" WSGI config for pmsite project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
mit
Python
559ef7494ffb386a308f74b707560edbabe3f15d
Clean up test and add one for writing dedented text in tests.
da-woods/cython,scoder/cython,cython/cython,cython/cython,da-woods/cython,scoder/cython,scoder/cython,da-woods/cython,scoder/cython,da-woods/cython,cython/cython,cython/cython
Cython/Tests/TestTestUtils.py
Cython/Tests/TestTestUtils.py
# -*- coding: utf-8 -*- import os.path import unittest import tempfile import textwrap import shutil from ..TestUtils import write_file, write_newer_file class TestTestUtils(unittest.TestCase): def setUp(self): super(TestTestUtils, self).setUp() self.temp_dir = tempfile.mkdtemp() def tearDo...
# -*- coding: utf-8 -*- import os.path import unittest import tempfile import shutil from ..TestUtils import write_file, write_newer_file class TestTestUtils(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self._test_path = lambda filename: os.path.join(self.temp_dir, fil...
apache-2.0
Python
a4d6077ddf5fd2516f501b403f70f55f0e568929
Set version to v7.0.5
explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc
thinc/about.py
thinc/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = "thinc" __version__ = "7.0.5" __summary__ = "Practical Machine Learning for NLP" __uri__ = "https://github.com/explosion/thinc" __au...
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = "thinc" __version__ = "7.0.5.dev0" __summary__ = "Practical Machine Learning for NLP" __uri__ = "https://github.com/explosion/thinc"...
mit
Python
9b2e2c6341b999edc2a874707d9f956997936aee
Use os.path.join so we're not relying on knownPath ending with a /
MozillaSecurity/funfuzz,nth10sd/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz
dom/automation/detect_interesting_crashes.py
dom/automation/detect_interesting_crashes.py
#!/usr/bin/env python import os, sys, platform, signal ready = False def amiss(knownPath, logPrefix, verbose, msg): global ignoreList if not ready: readIgnoreList(knownPath) igmatch = [] fn = logPrefix + "-crash" if os.path.exists(fn): currentFile = file(fn, "r") ...
#!/usr/bin/env python import os, sys, platform, signal ready = False def amiss(knownPath, logPrefix, verbose, msg): global ignoreList if not ready: readIgnoreList(knownPath) igmatch = [] fn = logPrefix + "-crash" if os.path.exists(fn): currentFile = file(fn, "r") ...
mpl-2.0
Python
3ec4b43e0665e940be9460788fa2d5bfb44b2929
Add more messages to commandline output
josecolella/Dynatrace-Resources
portal/main.py
portal/main.py
import argparse import logging import Portal import tqdm logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) if __name__ == '__main__': parser = argparse.ArgumentParser( prog="Dynatrace Synthetic Screenshot Automation") parser.add_argument( "-u", "--username", help="T...
import argparse import logging import Portal import tqdm logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) if __name__ == '__main__': parser = argparse.ArgumentParser( prog="Dynatrace Synthetic Screenshot Automation") parser.add_argument( "-u", "--username", help="T...
mit
Python
d7fbe4521a8df39894bf9fdb777821f5f328b71c
Remove the main function from push
possel/possel,possel/possel,possel/possel,possel/possel
possel/push.py
possel/push.py
# -*- coding: utf-8 -*- from pircel import model import tornado.websocket class ResourcePusher(tornado.websocket.WebSocketHandler): def check_origin(self, origin): return True def send_line_id(self, _, line, server): self.write_message({'type': 'line', 'line': line.id}) def send_buffer_i...
#!/usr/bin/env python # -*- coding: utf-8 -*- from pircel import model import tornado.websocket class ResourcePusher(tornado.websocket.WebSocketHandler): def check_origin(self, origin): return True def send_line_id(self, _, line, server): self.write_message({'type': 'line', 'line': line.id}) ...
bsd-3-clause
Python
a4dc806f1aaea0ada3a3d115477d5393b52d847d
make basic model
zhy0216/django-todo
todo/models.py
todo/models.py
import datetime from django.db import models from django.utils import timezone # Create your models here. class TodoList(models.Model): name = models.CharField() # author = models.ForeignKey("User") create_time = models.DateTimeField(auto_now_add=True) def __unicode__(self): ret...
from django.db import models # Create your models here.
mit
Python
fabbee96adad4029082f4573a2cf36e458b989f7
Return the callers name
jimjag/ponymail,quenda/ponymail,jimjag/ponymail,Humbedooh/ponymail,jimjag/ponymail,Humbedooh/ponymail,jimjag/ponymail,quenda/ponymail,Humbedooh/ponymail,quenda/ponymail
tools/trace.py
tools/trace.py
#!/usr/bin/env python3.4 # -*- coding: utf-8 -*- # 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...
#!/usr/bin/env python3.4 # -*- coding: utf-8 -*- # 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...
apache-2.0
Python
fe85516f1771747feec857087065cbc18b9bdced
make it possible to run the training on all models defined in model zoo in one call
BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH
Utils/py/BallDetection/RegressionNetwork/experiments/rerun_training_and_compare.py
Utils/py/BallDetection/RegressionNetwork/experiments/rerun_training_and_compare.py
""" run trainings procedure multiple times and compare the best run with each other """ import pickle from pathlib import Path from inspect import getmembers, isfunction import model_zoo from train import main def start_training(test_model, num_runs=30, num_epochs=100): for i in range(num_runs): output_p...
""" run trainings procedure multiple times and compare the best run with each other """ import pickle from pathlib import Path import model_zoo from train import main def start_training(test_model, num_runs=30, num_epochs=100): for i in range(num_runs): output_path = Path(test_model.name + "_" + str(i))...
apache-2.0
Python
a9a121d5fe595f54ed482ec162dc7a9703a65c13
Fix for people without setuptools.
thousandparsec/libtpproto-py,thousandparsec/libtpproto-py
tp/__init__.py
tp/__init__.py
try: __import__('pkg_resources').declare_namespace(__name__) import modulefinder for p in __path__: modulefinder.AddPackagePath(__name__, p) except Exception, e: import warnings warnings.warn(e, RuntimeWarning)
__import__('pkg_resources').declare_namespace(__name__) try: import modulefinder for p in __path__: modulefinder.AddPackagePath(__name__, p) except Exception, e: import warnings warnings.warn(e, RuntimeWarning)
lgpl-2.1
Python
0bd2b9a02aca29d38200ae26e1a447cf82d02f92
Fix import error
econ-ark/HARK,econ-ark/HARK
HARK/tests/test_validators.py
HARK/tests/test_validators.py
import unittest, sys from HARK.validators import non_empty class ValidatorsTests(unittest.TestCase): ''' Tests for validator decorators which validate function arguments ''' def test_non_empty(self): @non_empty('list_a') def foo(list_a, list_b): pass try: ...
import unittest from HARK.validators import non_empty class ValidatorsTests(unittest.TestCase): ''' Tests for validator decorators which validate function arguments ''' def test_non_empty(self): @non_empty('list_a') def foo(list_a, list_b): pass try: f...
apache-2.0
Python