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
11281719a3f1b0e18d986906a312c68c9d84e57f
add missing dependency for tr_barcode
gurneyalex/stock-logistics-barcode,damdam-s/stock-logistics-barcode
tr_barcode/__openerp__.py
tr_barcode/__openerp__.py
# -*- coding: utf-8 -*- #/############################################################################# # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>). # # This program is free software: you can redistribute it and/or modify # it unde...
# -*- coding: utf-8 -*- #/############################################################################# # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>). # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
Python
af8b9fdeb144279b35abcf7de9f0538d88ac7a5d
Add field mapping to tuid provider
d120/pyophase,d120/pyophase,d120/pyophase,d120/pyophase
tuid_provider/provider.py
tuid_provider/provider.py
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth_cas.providers import CASProvider class TUIDAccount(ProviderAccount): pass class TUIDProvider(CASProvider): id = 'tuid' # Choose an identifier for your provider name = 'TU-ID CAS Pro...
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth_cas.providers import CASProvider class TUIDAccount(ProviderAccount): pass class TUIDProvider(CASProvider): id = 'tuid' # Choose an identifier for your provider name = 'TU-ID CAS Pro...
agpl-3.0
Python
7bdfa64277889ac1db6b1bba11829b8e61a2445d
Increment version to 0.4.2
dgwartney-io/import-io-api-python,dgwartney-io/import-io-api-python
importio2/version.py
importio2/version.py
# # Copyright 2017 Import.io # # 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 writing, ...
# # Copyright 2017 Import.io # # 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 writing, ...
apache-2.0
Python
158e3b384a3368c94f3fd4c231bbe688b6628e1a
add use flag for gdbm
sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary
build/use.py
build/use.py
# # Copyright (c) 2004 Specifix, Inc. # All rights reserved # """ Provides the build configuration as special dictionaries that directly export their namespaces. Should read, or be provided, some sort of configuration information relative to the build being done. For now, we'll intialize a static configuration suffi...
# # Copyright (c) 2004 Specifix, Inc. # All rights reserved # """ Provides the build configuration as special dictionaries that directly export their namespaces. Should read, or be provided, some sort of configuration information relative to the build being done. For now, we'll intialize a static configuration suffi...
apache-2.0
Python
a19efd8fdaa4fa2f03b608b7cbac330b2cd53c76
Reduce tweet period to 300 seconds.
kkwteh/twinyewest
twinsies/onewordtweets.py
twinsies/onewordtweets.py
import tweepy import json from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream from datetime import datetime from memory_profiler import profile import os CONSUMER_KEY = os.environ['OWT_API_KEY'] CONSUMER_SECRET = os.environ['OWT_API_SECRET'] ACCESS_TOKEN = os.environ...
import tweepy import json from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream from datetime import datetime from memory_profiler import profile import os CONSUMER_KEY = os.environ['OWT_API_KEY'] CONSUMER_SECRET = os.environ['OWT_API_SECRET'] ACCESS_TOKEN = os.environ...
mit
Python
fe0847f11b6aac70013eaf4aaf4360dad3e18892
Replace if-statement in cc_upload for phone check with str.replace()
deadlyraptor/reels
cc_upload.py
cc_upload.py
import os import requests import xlrd import constantcontact as cc from credentials import general_list_id, after_hours_list_id # Assumes directory with the workbook is relative to script's location. directory = 'workbooks/' workbook = '' for dirpath, dirnames, filenames in os.walk(directory): for files in filena...
import os import requests import xlrd import constantcontact as cc from credentials import general_list_id, after_hours_list_id # Assumes directory with the workbook is relative to script's location. directory = 'workbooks/' workbook = '' for dirpath, dirnames, filenames in os.walk(directory): for files in filena...
mit
Python
b7836720994530678875a724be9a6742c9a3dd02
patch manage.py for eventlet
mbanje/ureport_uganda,unicefuganda/ureport,unicefuganda/ureport,mbanje/ureport_uganda,unicefuganda/ureport
ureport_project/manage.py
ureport_project/manage.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 from django.core.management import execute_manager import settings import eventlet import eventlet.debug import os #patch for eventlet os.environ["EVENTLET_NOPATCH"] = 'True' eventlet.monkey_patch() eventlet.debug.hub_prevent_multiple_readers(False) if...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 from django.core.management import execute_manager import settings if __name__ == "__main__": execute_manager(settings)
bsd-3-clause
Python
2c62a20305117b8d9b6c98ad048dea48c9b52efc
use python built in for updating a dict
revsys/django-fack,howiworkdaily/django-faq,revsys/django-fack
faq/views.py
faq/views.py
from django.views.generic.list_detail import object_detail, object_list from models import Question import datetime def question_detail(request, slug, template_name='faq/question_detail.html', extra_context={}): """ Displays an invidual question. """ return object_detail( request, ...
from django.views.generic.list_detail import object_detail, object_list from models import Question import datetime def dict_to_dict(origin, new): """ A utility method to add items from one dictionary to an already existing dictionary. Primary use is for extra_context population. """ for...
bsd-3-clause
Python
506a5821b57672a11d4aaf03735a8ce3a72a92f8
save command
PJB3005/MoMMI,PJB3005/MoMMI,PJB3005/MoMMI
MoMMI/Modules/bot_administration.py
MoMMI/Modules/bot_administration.py
import asyncio from typing import Match import aiohttp from discord import Message from MoMMI.commands import command from MoMMI.master import master from MoMMI.server import MChannel from MoMMI.role import MRoleType @command("reload", "reload", roles=[MRoleType.OWNER]) async def reload(channel: MChannel, match: Matc...
import asyncio from typing import Match import aiohttp from discord import Message from MoMMI.commands import command from MoMMI.master import master from MoMMI.server import MChannel from MoMMI.role import MRoleType @command("reload", "reload", roles=[MRoleType.OWNER]) async def reload(channel: MChannel, match: Matc...
mit
Python
8f0a4fd16a9365aa2de9b75583cc9200860e2ed1
update secret_key
zheng-zy/flask_weixin,zheng-zy/flask_weixin,zheng-zy/flask_weixin,zheng-zy/flask_weixin
__init__.py
__init__.py
#!usr/bin/env python # coding=utf-8 # Created by zhezhiyong@163.com on 2017/3/22. import logging from flask import Flask logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) logger = logging.getLogger() app = Flask(__name__) app.config['WECHAT_APPID'] = 'wx3b602e650c2c8dda' a...
#!usr/bin/env python # coding=utf-8 # Created by zhezhiyong@163.com on 2017/3/22. import logging from flask import Flask logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) logger = logging.getLogger() app = Flask(__name__) app.config['WECHAT_APPID'] = 'wx3b602e650c2c8dda' a...
apache-2.0
Python
2be45cb0eb4e92543b5c3975796f73f96f059aa8
return data
eivl/fsfflan-innslipp,eivl/fsfflan-innslipp,eivl/fsfflan-innslipp
__init__.py
__init__.py
#!/usr/bin/env python3 # -*- coding: utf-8 -* from flask import Flask, render_template, send_from_directory from flask.ext.mysql import MySQL from mysecret import DATABASE_USER, DATABASE_PASS, DATABASE_HOST from werkzeug import generate_password_hash, check_password_hash app = Flask(__name__) @app.route('/') def ho...
#!/usr/bin/env python3 # -*- coding: utf-8 -* from flask import Flask, render_template, send_from_directory from flask.ext.mysql import MySQL from mysecret import DATABASE_USER, DATABASE_PASS, DATABASE_HOST from werkzeug import generate_password_hash, check_password_hash app = Flask(__name__) @app.route('/') def ho...
mit
Python
d705799b745a2de8ff404476485310a390aea9b2
Switch to Python 3.
brendancsmith/cohort-facebook,brendancsmith/cohort-facebook
__main__.py
__main__.py
#!/usr/bin/env python3 import facebook import os from getpass import getpass PRINGUS_DINGUS = '1475782379372580' def get_token(): # Read the FACEBOOK_TOKEN environment variable, # or ask for it if none is set. # On Mac OS X, this can be temporarily set via: # launchctl setenv FACEBOOK_TOKEN <use...
import facebook import os from getpass import getpass PRINGUS_DINGUS = '1475782379372580' def get_token(): # Read the FACEBOOK_TOKEN environment variable, # or ask for it if none is set. # On Mac OS X, this can be temporarily set via: # launchctl setenv FACEBOOK_TOKEN <user access token here> ...
mit
Python
5cefd2c2b37763fe7756913757d9730a2e092de0
Update hello.py
amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning
Python/pip_editable/sample/hello.py
Python/pip_editable/sample/hello.py
def main(): return 'Hello called'
def main(): return 'Hello called again.'
unlicense
Python
e9fbd541b3fcb84c6d2de9ba1de53886730a67fa
Add new changes to th branch
nvthanh1/Skypybot
common.py
common.py
import os def get_project_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir def get_yourproject_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir
import os def get_project_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir
mit
Python
5ddea6f1280fa2420f5266e01704bceed7ce3afd
update concat.py
inada-s/autocut
concat.py
concat.py
# coding: UTF-8 import os import subprocess from datetime import datetime import sys def main(): os.chdir(os.path.dirname(os.sys.argv[0])) print os.getcwd() movie_list = os.sys.argv[1:] print movie_list for i in xrange(len(movie_list)): movie_list[i] = os.path.abspath(movie_list[i]) wit...
# coding: UTF-8 import os import subprocess def main(): movie_list = os.sys.argv[1:] command = [ 'ffmpeg', '-i', r'concat:"' + '|'.join(movie_list) + r'"', '-c:v', 'copy', '-c:a', 'copy', 'concat_' + movie_list[0] ] p = subprocess.call(' '.join(command), shell=T...
mit
Python
ae0ac504e01667df8729fa062f7806c61c9d2433
Correct HOME expansion.
graag/lgogwebui,graag/lgogwebui,graag/lgogwebui
config.py
config.py
#!/usr/bin/env python3 import os #: Path to lgogdownloader config lgog_config = os.path.expanduser(os.environ.get("LGOG_CONFIG", "~/.config/lgogdownloader")) #: Path to lgogdownloader cache lgog_cache = os.path.expanduser(os.environ.get("LGOG_CACHE", "~/.cache/lgogdownloader")) #: Path to GOG game library lgog_librar...
#!/usr/bin/env python3 import os #: Path to lgogdownloader config lgog_config = os.path.realpath(os.environ.get("LGOG_CONFIG", "~/.config/lgogdownloader")) #: Path to lgogdownloader cache lgog_cache = os.path.realpath(os.environ.get("LGOG_CACHE", "~/.cache/lgogdownloader")) #: Path to GOG game library lgog_library = ...
bsd-2-clause
Python
30cc6bf4daae62b4c5c7c6f0096820f4877de711
Fix daemon
PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas
daemon.py
daemon.py
import argparse import logging import logging.handlers import os import time from daemonize import Daemonize pid = '/var/log/prodtasklog/prodtask-messaging.pid' def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'atlas.settings') import django django.setup() from atlas.messaging.manager i...
import argparse import logging import logging.handlers import os import time from daemonize import Daemonize pid = '/tmp/prodtask-messaging.pid' def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'atlas.settings') import django django.setup() from atlas.messaging.manager import start_proc...
apache-2.0
Python
3fd04af45c5979cf28672d5ad115e256fc702f64
bump version
andyfangdz/django-asyncmailer,andyfangdz/django-asyncmailer
asyncmailer/__init__.py
asyncmailer/__init__.py
# -*- coding: utf-8 -*- __version__ = '1.0' # pragma: no cover
# -*- coding: utf-8 -*- __version__ = '0.1' # pragma: no cover
mit
Python
d483c00875ce59ce4bdcee0119b2d8d3ded959ea
use get_processor in test_vamp_simple_host
Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide
tests/test_vamp_simple_host.py
tests/test_vamp_simple_host.py
#! /usr/bin/env python import unittest from unit_timeside import TestRunner from timeside.core.tools.test_samples import samples from timeside.core import get_processor FileDecoder = get_processor('file_decoder') try: VampSimpleHost = get_processor('vamp_simple_host') except: VampSimpleHost = None @unittest...
#! /usr/bin/env python import unittest from unit_timeside import TestRunner from timeside.plugins.decoder.file import FileDecoder from timeside.core import get_processor from timeside.core import _WITH_VAMP from timeside.core.tools.test_samples import samples @unittest.skipIf(not _WITH_VAMP, 'vamp-simple-host librar...
agpl-3.0
Python
42a54411634ef395ca3c2dfbfeefd7cea2d55101
Update to v3 of the auth0 client for the exception handling
bretth/auth0plus
auth0plus/exceptions.py
auth0plus/exceptions.py
try: from auth0.v3.exceptions import Auth0Error except ImportError: # pragma: no cover class Auth0Error(Exception): def __init__(self, status_code, error_code, message): self.status_code = status_code self.error_code = error_code self.message = message def ...
try: from auth0.v2.exceptions import Auth0Error except ImportError: # pragma: no cover class Auth0Error(Exception): def __init__(self, status_code, error_code, message): self.status_code = status_code self.error_code = error_code self.message = message def ...
isc
Python
86258f714ecd3649873f744f60f2d796d304d4c1
Fix indentation in `query_rfc_is_also()`
lafrenierejm/ietf-cli
ietf/utility/query_is_also.py
ietf/utility/query_is_also.py
from ietf.sql.bcp import Bcp from ietf.sql.rfc import IsAlso, Rfc from ietf.utility.query_doc import (query_bcp, query_fyi, query_rfc, query_std,) from ietf.xml.enum import DocumentType def query_bcp_is_also(Session, number): docs = [] # List of docs to return rfcs = Sessi...
from ietf.sql.bcp import Bcp from ietf.sql.rfc import IsAlso, Rfc from ietf.utility.query_doc import (query_bcp, query_fyi, query_rfc, query_std,) from ietf.xml.enum import DocumentType def query_bcp_is_also(Session, number): docs = [] # List of docs to return rfcs = Sessi...
isc
Python
3a983c2a53dee0c56ba67b248bea2e1cd0cf1cd6
Make strategy test proper URL (https, %s)
esarafianou/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dionyziz/rupture,dimkarakostas/rupture,dionyziz/rupture,dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dimkarakostas/rupture,dim...
backend/breach/tests.py
backend/breach/tests.py
from django.test import TestCase from mock import patch from breach.models import SampleSet, Victim, Target, Round from breach.strategy import Strategy from breach.analyzer import decide_next_world_state @patch('sniffer.Sniffer') class RuptureTestCase(TestCase): def setUp(self): target = Target.objects.cr...
from django.test import TestCase from mock import patch from breach.models import SampleSet, Victim, Target, Round from breach.strategy import Strategy from breach.analyzer import decide_next_world_state @patch('sniffer.Sniffer') class RuptureTestCase(TestCase): def setUp(self): target = Target.objects.cr...
mit
Python
ef9216ba4650d4e04b8c92c7e3d7b49edd1fe92d
Remove deprecated comment in breach views
esarafianou/rupture,dimriou/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,dimkarakostas/rupture,dimkarakostas/rupture,di...
backend/breach/views.py
backend/breach/views.py
from django.http import Http404, JsonResponse from django.views.decorators.csrf import csrf_exempt from breach.strategy import Strategy from breach.models import Victim import json def get_work(request, victim_id=0): assert(victim_id) try: victim = Victim.objects.get(pk=victim_id) except: ...
from django.http import Http404, JsonResponse from django.views.decorators.csrf import csrf_exempt from breach.strategy import Strategy from breach.models import Victim import json def get_work(request, victim_id=0): assert(victim_id) try: victim = Victim.objects.get(pk=victim_id) except: ...
mit
Python
a4fdaefacbceccd63ab41a62ea53cfcbed352bac
Update version.py
CGATOxford/UMI-tools
umi_tools/version.py
umi_tools/version.py
__version__ = "0.5.4"
__version__ = "0.5.3"
mit
Python
d2fbdf9ad14891c68f5590e43c54383658b5a122
Fix indentation/line continuation problem introduced with style fix
craigbruce/awacs,cloudtools/awacs
tools/gen.py
tools/gen.py
#!/usr/bin/env python # # Generate Actions from AWS static configuration # import json import os import urllib2 from slimit.parser import Parser from slimit.visitors import nodevisitor from slimit.visitors.ecmavisitor import ECMAVisitor from slimit import ast aws_url = \ "https://awsiamconsole.s3.amazonaws.com/iam...
#!/usr/bin/env python # # Generate Actions from AWS static configuration # import json import os import urllib2 from slimit.parser import Parser from slimit.visitors import nodevisitor from slimit.visitors.ecmavisitor import ECMAVisitor from slimit import ast aws_url = "https://awsiamconsole.s3.amazonaws.com/iam/asset...
bsd-2-clause
Python
e1c657ab19990a034eca381c67cf74f4ffe05425
add newline after transformation
KingPixil/ice,KingPixil/ice
transform.py
transform.py
import png import src.loader import src.seed import src.pixel # Intro print("\x1b[36mIce\x1b[0m Transforming Image 💡") # Seed seedText = src.seed.generateSeed() # Read f = open("somecoolwaterfalls.png", "rb") r = png.Reader(f) info = r.read() width = info[0] height = info[1] data = list(info[2]) alpha = info[3]["al...
import png import src.loader import src.seed import src.pixel # Intro print("\x1b[36mIce\x1b[0m Transforming Image 💡") # Seed seedText = src.seed.generateSeed() # Read f = open("art.png", "rb") r = png.Reader(f) info = r.read() width = info[0] height = info[1] data = list(info[2]) alpha = info[3]["alpha"] skip = 4 ...
mit
Python
a69c482fded8bf84c0228b904cc9bd667d63f909
update docstrings
peastman/deepchem,deepchem/deepchem,deepchem/deepchem,peastman/deepchem
deepchem/feat/molecule_featurizers/roberta_tokenizer.py
deepchem/feat/molecule_featurizers/roberta_tokenizer.py
from deepchem.feat import MolecularFeaturizer from transformers import RobertaTokenizerFast from deepchem.utils.typing import RDKitMol from typing import Dict, List class RobertaFeaturizer(RobertaTokenizerFast, MolecularFeaturizer): def __init__(self, **kwargs): super().__init__(**kwargs) return def _f...
from deepchem.feat import MolecularFeaturizer from transformers import RobertaTokenizerFast from deepchem.utils.typing import RDKitMol class RobertaFeaturizer(RobertaTokenizerFast, MolecularFeaturizer): def __init__(self, **kwargs): super().__init__(**kwargs) return def _featurize(self, mol: RDKitMol, *...
mit
Python
f6b3950a956116570a4bc2d9310555805a8b29a2
Enable result backend
UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine
upol_search_engine/celery_app.py
upol_search_engine/celery_app.py
# from __future__ import absolute_import from celery import Celery from kombu import Exchange, Queue from upol_search_engine import settings class Config(object): broker_url = 'amqp://guest:guest@localhost:5672//' result_backend = 'amqp://guest:guest@localhost:5672//' task_queues = ( Queue( ...
# from __future__ import absolute_import from celery import Celery from kombu import Exchange, Queue from upol_search_engine import settings class Config(object): broker_url = 'amqp://guest:guest@localhost:5672//' task_queues = ( Queue( 'crawler', exchange=Exchange('crawler')...
mit
Python
64f04ee05de166d0c9197bd17eb661f76862804b
Fix version character replacement.
Emberwalker/LibFTB
libftb/ftb.py
libftb/ftb.py
__author__ = 'Arkan' import urllib.request import os.path import time import xml.etree.ElementTree as ET import libftb.internal.parser as parser CDN_ROOT = "http://ftb.cursecdn.com/FTB2" def get_packs(): root = __get_or_create_cache() return parser.packs_xml_to_dict(root) def get_pack_url(pack_dict, vers...
__author__ = 'Arkan' import urllib.request import os.path import time import xml.etree.ElementTree as ET import libftb.internal.parser as parser CDN_ROOT = "http://ftb.cursecdn.com/FTB2" def get_packs(): root = __get_or_create_cache() return parser.packs_xml_to_dict(root) def get_pack_url(pack_dict, vers...
mit
Python
9e8a7538e7242167572f888d99d2903464fc5f6e
Make variables class members
handrake/brainfuck
brainfuck.py
brainfuck.py
import sys from getch import getch commands = '><+-.,[]' class BrainfuckInterpreter: def __init__(self): self.i = 0 self.p = 0 self.cells = [0] @staticmethod def find_matching_paren(source, c): paren = 0 d = {'[':']', ']':'['} for k in range(len(source)): ...
import sys from getch import getch commands = '><+-.,[]' class BrainfuckInterpreter: @staticmethod def find_matching_paren(source, c): paren = 0 d = {'[':']', ']':'['} for k in range(len(source)): if source[k]==c: paren += 1 elif source[k]==d[c]:...
bsd-3-clause
Python
59f29688d45916be81206201dd314ce140b8a154
Improve handling of non-ASCII chars (fixes #3).
andialbrecht/runsqlrun
rsr/cmd.py
rsr/cmd.py
import os import signal import sys from argparse import ArgumentParser from gi.repository import Gio, GLib from rsr import __version__ from rsr.app import Application parser = ArgumentParser(prog='runsqlrun', description='Run SQL statements') parser.add_argument( '--version', action='version', version='%(prog)s ...
import signal import sys from argparse import ArgumentParser from gi.repository import Gio, GLib from rsr import __version__ from rsr.app import Application parser = ArgumentParser(prog='runsqlrun', description='Run SQL statements') parser.add_argument( '--version', action='version', version='%(prog)s ' + __vers...
mit
Python
c8085fda4afba86ca102c29019302e3dd778031b
Return creds in HTML
everett-toews/rackspace-user-management
rum/rum.py
rum/rum.py
import threading from flask import Flask from users import users api = Flask(__name__) lock = threading.Lock() user_num = 0 @api.route('/') def index(): return 'Rackspace User Management' @api.route('/user') def get_user(): global user_num with lock: if user_num < len(users): html...
import threading from flask import Flask from users import users api = Flask(__name__) lock = threading.Lock() user_num = 0 @api.route('/') def index(): return 'Rackspace User Management' @api.route('/user') def get_user(): global user_num with lock: if user_num < len(users): bash...
mit
Python
07f1a36b30c35dee40a82ae1a6b6ab4635f7cf39
Move constant
kbd/setup,kbd/setup,kbd/setup,kbd/setup,kbd/setup
bootstrap.py
bootstrap.py
#!/usr/bin/env python """Bootstrap the setup tool. This assumes Python is installed on the target os, but not specifically Python3. What this does (only intended for Mac atm): * installs Homebrew * Homebrew installs a core set of packages (git and python3) * git check out the project into ~/setup * run - setup (w...
#!/usr/bin/env python """Bootstrap the setup tool. This assumes Python is installed on the target os, but not specifically Python3. What this does (only intended for Mac atm): * installs Homebrew * Homebrew installs a core set of packages (git and python3) * git check out the project into ~/setup * run - setup (w...
mit
Python
9336c9383eb3cd0c9b92e6524cccb2b7aa4a3ea6
fix model inheritence
amboycharlie/Child-Friendly-LCMS,django-leonardo/django-leonardo,amboycharlie/Child-Friendly-LCMS,amboycharlie/Child-Friendly-LCMS,django-leonardo/django-leonardo,django-leonardo/django-leonardo,amboycharlie/Child-Friendly-LCMS,django-leonardo/django-leonardo
leonardo/module/nav/mixins.py
leonardo/module/nav/mixins.py
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ ORIENTATION_CHOICES = ( ('vertical', 'Vertical'), ('horizon', 'Horizon'), ) class NavigationWidgetMixin(models.Model): display_active = models.NullBooleanField( verbose...
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ ORIENTATION_CHOICES = ( ('vertical', 'Vertical'), ('horizon', 'Horizon'), ) class NavigationWidgetMixin(object): display_active = models.NullBooleanField( verbose_name=...
apache-2.0
Python
f752df6eece63a9ab6b806c0f24779f88e19ccd9
Use test site in item tests
veeti/vasara
vasara/tests/test_item.py
vasara/tests/test_item.py
from unittest import TestCase from vasara.item import Item from vasara.tests.common import build_test_site TEST_ITEM = """--- { "name": "Test", "list": [1, 2, 3] } --- Hello, world! This is the actual content.""" class TestItem(TestCase): def setUp(self): self.site = build_test_site() se...
from unittest import TestCase from vasara.item import Item TEST_ITEM = """--- { "name": "Test", "list": [1, 2, 3] } --- Hello, world! This is the actual content.""" class TestItem(TestCase): def setUp(self): self.site = None # TODO self.item = Item(key="test", site=self.site, raw=TEST_IT...
mit
Python
f916fe1715ab891ded093c9adb9a6d0a4d2b30eb
add more complex example
mrocklin/unification
unification/tests/test_match.py
unification/tests/test_match.py
from unification.match import * from unification.utils import raises from unification.core import var def inc(x): return x + 1 def dec(x): return x - 1 def add(x, y): return x + y def mul(x, y): return x * y def foo(*args): return args def test_simple(): d = Dispatcher('d') d.add...
from unification.match import * from unification.utils import raises def inc(x): return x + 1 def dec(x): return x - 1 def test_simple(): d = Dispatcher('d') d.add((1,), inc) d.add((10,), dec) assert d(1) == 2 assert d(10) == 9 def test_raises_error(): d = Dispatcher('d') a...
bsd-3-clause
Python
73e7b6b4c9393c60a4d30ec9def7513e4ac0e2f2
add --skip
sspickle/sci-comp-notebooks
buildPDFs.py
buildPDFs.py
""" Build pdfs from student notebooks. You need a 'report_rubric.pdf' in the same directory as this file. """ import sys import os import glob if len(sys.argv)>1: paths=sys.argv[1:] else: paths=[os.curdir] files = [] skiprubric = False for path in paths: if path.startswith('--skip'): skiprubric =...
""" Build pdfs from student notebooks. You need a 'report_rubric.pdf' in the same directory as this file. """ import sys import os import glob if len(sys.argv)>1: paths=sys.argv[1:] else: paths=[os.curdir] files = [] for path in paths: if os.path.isdir(path): files += glob.glob(os.path.join(path,...
mit
Python
ffa8b40530c1be118a230312141cfb8ee4165bae
Add utils for shortcutting error responses
igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool
virtool/handlers/utils.py
virtool/handlers/utils.py
from aiohttp import web async def unpack_json_request(req): return req.app["db"], await req.json() def not_found(): return web.json_response({"message": "Not found"}, status=404) def requires_login(): return web.json_response({"message": "Requires login"}, status=400) def invalid_input(errors): ...
async def unpack_json_request(req): return req.app["db"], await req.json()
mit
Python
6cdd22b746f901c1d8de5356f78452e491411829
use 6 inputs
yasokada/python-160423_footInput
footInput.py
footInput.py
#!/usr/bin/env python ''' v0.5 2016 Apr 23 - use 6 inputs v0.4 2016 Apr 23 - add UDP_procCommand() v0.3 2016 Apr 23 - add UDP_recvData() - add UDP_setup() - add GPIO_setup() v0.2 2016 Apr 23 - define main() - change interval to 10 msec base for UDP comm v0.1 2016 Apr 23 - can check 5 GPIO input ''' im...
#!/usr/bin/env python ''' v0.4 2016 Apr 23 - add UDP_procCommand() v0.3 2016 Apr 23 - add UDP_recvData() - add UDP_setup() - add GPIO_setup() v0.2 2016 Apr 23 - define main() - change interval to 10 msec base for UDP comm v0.1 2016 Apr 23 - can check 5 GPIO input ''' import RPi.GPIO as GPIO import socke...
mit
Python
b19380e26e005d4ab71baaac1ee0158a82f64cf3
fix encode
lffsantos/itindublin.github.io,lffsantos/itindublin.github.io,lffsantos/itindublin.github.io,ITinDublin/ITinDublin.github.io,ITinDublin/ITinDublin.github.io,ITinDublin/ITinDublin.github.io,lffsantos/itindublin.github.io,ITinDublin/ITinDublin.github.io
functions.py
functions.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # import io import hashlib import functools import os import posixpath import random def GET_WIKI_PAGES(): content = 'content/pages/wiki' wiki_pages = [] for page in os.listdir(content): ler_arquivo = io.open(content+'/'+page, 'r', encoding='utf-8') ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # import hashlib import functools import os import posixpath import random def GET_WIKI_PAGES(): content = 'content/pages/wiki' wiki_pages = [] for page in os.listdir(content): ler_arquivo = open(content+'/'+page, 'r', encoding='utf-8') titulo...
mit
Python
a592dcdf1126867588753c2503a469f8cebb492a
Write out constructors and interfaces.
nanaze/jsdoctor,Prachigarg1/Prachi,Prachigarg1/Prachi,Prachigarg1/Prachi,nanaze/jsdoctor,nanaze/jsdoctor
generator.py
generator.py
from xml.dom import minidom import symboltypes def GenerateDocs(namespace_map): for namespace, symbols in namespace_map.iteritems(): filepath = '%s.html' % namespace doc = _GenerateDocument(namespace, symbols) content = doc.documentElement.toprettyxml(indent=' ') yield filepath, content def _Make...
from xml.dom import minidom def GenerateDocs(namespace_map): for namespace, symbols in namespace_map.iteritems(): filepath = '%s.html' % namespace doc = _GenerateDocument(namespace, symbols) content = doc.documentElement.toprettyxml(indent=' ') yield filepath, content def _MakeTextNode(content): ...
apache-2.0
Python
53ad3866b8dfbd012748e4ad7d7ed7025d491bd0
REVERT remove application id validation
mauriceyap/ccm-assistant
src/alexa-main.py
src/alexa-main.py
import handlers.events as events APPLICATION_ID = "amzn1.ask.skill.dd677950-cade-4805-b1f1-ce2e3a3569f0" def lambda_handler(event, context): # Make sure only this Alexa skill can use this function if event['session']['application']['applicationId'] != APPLICATION_ID: raise ValueError("Invalid Applica...
import handlers.events as events APPLICATION_ID = "amzn1.ask.skill.dd677950-cade-4805-b1f1-ce2e3a3569f0" def lambda_handler(event, context): if event['session']['new']: events.on_session_started({'requestId': event['request']['requestId']}, event['session']) request...
mit
Python
c1f826d5a807c50c49d56620934f83db9e514192
Add (ugly) simplfiier for IterativeLoops
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
thinglang/parser/simplifier.py
thinglang/parser/simplifier.py
from thinglang.lexer.tokens.base import LexicalIdentifier from thinglang.parser.symbols import Transient from thinglang.parser.symbols.arithmetic import ArithmeticOperation from thinglang.parser.symbols.base import AssignmentOperation from thinglang.parser.symbols.functions import MethodCall, Access, ArgumentList from ...
from thinglang.parser.symbols import Transient from thinglang.parser.symbols.arithmetic import ArithmeticOperation from thinglang.parser.symbols.base import AssignmentOperation from thinglang.parser.symbols.functions import MethodCall from thinglang.parser.symbols.types import CastOperation from thinglang.utils.tree_ut...
mit
Python
d36f16e804180c402f32a7e0e29d822592254a68
Integrate LLVM at llvm/llvm-project@54cc7de4bc01
gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "54cc7de4bc01e6178213e4487d6ab49b809ba2b0" LLVM_SHA256 = "a939c493893b2d27ea87d0d28efc79f33cdee4c56ac5954bc19ca2222a29af9d" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "077f90315bec29443784a1bb2c55f3d7fc2eab64" LLVM_SHA256 = "b8204098753a27847e6084c95d7aa62083cc752ba29899b55058e38ea3f1c4f6" tf_http_archive( ...
apache-2.0
Python
0b8eec703df52d94ca683cc962110c81951f5900
Integrate LLVM at llvm/llvm-project@72f89556413f
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "72f89556413f9c1fb1fb9138d6d53e13499ce545" LLVM_SHA256 = "8b2a612f73a8dc54c76a2b40debc5b2464a55c91dac0f3b6c607009ba637311b" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "e07a7040d9c6dbdd71e55d1153bfe1357079e511" LLVM_SHA256 = "004147901d4725b45eaa724b2cb511989eb2d031146f876ba1b4327b5a5e053f" tfrt_http_archive( ...
apache-2.0
Python
77abacb3887c35712ac47dd7685cfa2ce33c3695
Add domain to __init__
kolanos/vaporize
vaporize/__init__.py
vaporize/__init__.py
__title__ = 'vaporize' __author__ = 'Michael Lavers' __version__ = '0.1.0' __license__ = 'MIT' __copyright__ = 'Copyright 2012 Michael Lavers' from . import domain, flavor, image, ipgroup, loadbalancer, server from .core import connect
__title__ = 'vaporize' __author__ = 'Michael Lavers' __version__ = '0.1.0' __license__ = 'MIT' __copyright__ = 'Copyright 2012 Michael Lavers' from . import flavor, image, ipgroup, loadbalancer, server from .core import connect
mit
Python
5b58b88784771e1e8f39c21872fd109a09eec141
Integrate LLVM at llvm/llvm-project@f116107f2d93
google/tsl,google/tsl,google/tsl
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "f116107f2d9342dabf8f1ccecb3f33f9b85d9b48" LLVM_SHA256 = "0db5a61f8d1d0435d278fd19c7a0a47dc8170a99fa365993718d3912417b5940" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "65644125beb76066171ce586e13bdff918140c0e" LLVM_SHA256 = "3e3afa5504c3de889a56a1678d016300dc6c45611c28a199adb487d4fc50653f" tf_http_archive( ...
apache-2.0
Python
c4262eb68366c705aec08fdc0b20b54d58dcdb19
Integrate LLVM at llvm/llvm-project@caea37b37e6a
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "caea37b37e6aa8b0c1bb21526ad2d216b46a4b10" LLVM_SHA256 = "91c38b69bfb9cd03b7bbe967d7d75ab7c6a8d289378180b1f30948a8432ec39e" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "91d3f73937b603b168a2be40f57a81efcc37da86" LLVM_SHA256 = "500fe116e7bfc8c50d3ac873211b3700d479d710d9f2ac8171bfa903d085ba5c" tfrt_http_archive( ...
apache-2.0
Python
1a28370b26c23d9d7c9399896ea5eba23bec029f
Integrate LLVM at llvm/llvm-project@4821508d4db7
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "4821508d4db75a535d02b8938f81fac6de66cc26" LLVM_SHA256 = "4138bb3f83bfb822f3ce795cd7e3e7a7018709d8af4e7b54194cbd81931cc93c" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "6f258c0fd34cf4001ffa08c61f6e4e0f1254c50f" LLVM_SHA256 = "9464c454c66b0c33f0e431fd24c5e35cd5db02c4983377b88d386cd0ad94130e" tfrt_http_archive( ...
apache-2.0
Python
c9d54bd013f60f580942b0b93c94168ec772f49e
Integrate LLVM at llvm/llvm-project@892260d7f352
paolodedios/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "892260d7f3526c429047b645f22401635a7df368" LLVM_SHA256 = "20c04584b188e4f39e88e607453f62b76faf7430dd770e2a9bf6b56c6c0822b2" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "eda9fdc493e5f06c59f29f520255ada23901b3b4" LLVM_SHA256 = "1db526f68751d8ad0258a7692d7c0ad997e1ed33262fb771f8c5fb1a5a25bb1b" tf_http_archive( ...
apache-2.0
Python
b163018fa478e792b66da6e5de71f87ad24858b6
Integrate LLVM at llvm/llvm-project@c6013f71a455
Intel-tensorflow/tensorflow,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,yon...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "c6013f71a4555f6d9ef9c60e6bc4376ad63f1c47" LLVM_SHA256 = "644a1f9db6e55ba28fba1e03fe6c2d28514d47e1e02210b4b281868d7a7af70c" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "43d6991c2a4cc2ac374e68c029634f2b59ffdfdf" LLVM_SHA256 = "6be97e134eab943941bbb06ad0c714070dc24cb4418a104813c1e9a2ca6655f7" tf_http_archive( ...
apache-2.0
Python
2d602aaa83cac1fa3397ceefb39d36dd814d1165
Integrate LLVM at llvm/llvm-project@93f54fae9dda
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "93f54fae9dda7d5d89711eb97f1ee44de6ce1ff7" LLVM_SHA256 = "02e569a27548632ba083addbc9223bc5246e433c9eda72746c947dc17a5b0117" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "49cbf4cd85a9ae6b53947fb8cf39ccfb56becc57" LLVM_SHA256 = "b48235a81cf29ad0e25f5029602eb2dfa092bd0c3a0e4ca785da595415fe29e2" tfrt_http_archive( ...
apache-2.0
Python
d574bf6871219e7c1232d0f39a145878a23b8cd8
Integrate LLVM at llvm/llvm-project@f79214d1e1fd
tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorf...
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "f79214d1e1fd79f684b53a8a1d34efeb37a33a28" LLVM_SHA256 = "5e36dc179188c453034b47c205704f645b874f33a81899fd4713b0f07b2a229d" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "540a13652fda8b91b62b73fb9ae1e34879e8e36c" LLVM_SHA256 = "928551015dbc884488d7cda367989bc65f6ec702233cd61148426854d34d7080" tf_http_archive( ...
apache-2.0
Python
bcc7475b0028a7d07fd0c2398742f09f61377949
Integrate LLVM at llvm/llvm-project@1f06398e96d4
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "1f06398e96d4508d22f42b760f70eb5d4e7b1dc9" LLVM_SHA256 = "84bd02a75966a1af45bf4556484817f9c4621a045686f7d1f32b034dc1c784c0" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "6edbdf80cac119f8f30d2ae6fa2972d9e778510b" LLVM_SHA256 = "dd7ca82116dbfc1ddd7159425965318dfbe7a39e5f150a19880f7f40c6118001" tfrt_http_archive( ...
apache-2.0
Python
5cd674ec764be72bb3e94c0b56fdf733a4a1c885
Remove Audio Already Done error
Harmon758/Harmonbot,Harmon758/Harmonbot
Discord/utilities/errors.py
Discord/utilities/errors.py
from discord.ext.commands.errors import CommandError class NotServerOwner(CommandError): '''Not Server Owner''' pass class VoiceNotConnected(CommandError): '''Voice Not Connected''' pass class PermittedVoiceNotConnected(VoiceNotConnected): '''Permitted, but Voice Not Connected''' pass class NotPermittedVoice...
from discord.ext.commands.errors import CommandError class NotServerOwner(CommandError): '''Not Server Owner''' pass class VoiceNotConnected(CommandError): '''Voice Not Connected''' pass class PermittedVoiceNotConnected(VoiceNotConnected): '''Permitted, but Voice Not Connected''' pass class NotPermittedVoice...
mit
Python
dd3a8bfa195f07e60d6c7c8c53d86d2a9405bf9d
Update test.py
madhurilalitha/Python-Projects
EntityExtractor/src/test.py
EntityExtractor/src/test.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created by Lalitha Madhuri Putchala on Dec 10 2017 """ import unittest from entity_main import Entity from docx import Document import docx2txt class TestEntity(unittest.TestCase): '''The below function verifies the basic sanity functionality of the pr...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created by Lalitha Madhuri Putchala on Dec 10 2017 """ import unittest from entity_main import Entity from docx import Document import docx2txt class TestEntity(unittest.TestCase): '''The below function verifies the basic sanity functionality of the pr...
mit
Python
c9bf706c0b7394b2bb5b9268d1c699aef97dfb14
fix __openerp__.py
OCA/connector,OCA/connector
connector_base_product/__openerp__.py
connector_base_product/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: David BEAL, Copyright Akretion, 2014 # # 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...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publish...
agpl-3.0
Python
92d8f60188b6c9df57c1a250ce92efe8755c7c81
replace slug display in admin with full slug
noxan/django-mini-cms
cms/admin.py
cms/admin.py
from django.contrib import admin from models import Page class PageAdmin(admin.ModelAdmin): model = Page list_display = ('headline', 'parent', 'get_full_slug', 'public') admin.site.register(Page, PageAdmin)
from django.contrib import admin from models import Page class PageAdmin(admin.ModelAdmin): model = Page list_display = ('headline', 'parent', 'slug', 'public') admin.site.register(Page, PageAdmin)
bsd-3-clause
Python
2838e70c20bb177b85ba0f6b96b80889e6c97de7
Change form to form(s) in logging statement
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py
corehq/apps/users/management/commands/gdpr_scrub_user_from_forms.py
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from django.core.management.base import BaseCommand from corehq.apps.users.models import CommCareUser from corehq.form_processor.interfaces.dbaccessors import FormAccessors from io import StringIO from l...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from django.core.management.base import BaseCommand from corehq.apps.users.models import CommCareUser from corehq.form_processor.interfaces.dbaccessors import FormAccessors from io import StringIO from l...
bsd-3-clause
Python
199e09408c252c703cdc6668e0bd4593c3642b55
Allow to pass different codecs
torbenbrodt/smarthome,torbenbrodt/smarthome,torbenbrodt/smarthome,torbenbrodt/smarthome
cast/cast.py
cast/cast.py
# pip install -r requirements.txt from __future__ import print_function from ConfigParser import ConfigParser from os.path import expanduser import time import pychromecast import argparse parser = argparse.ArgumentParser(description='Chromecast toolset.') parser.add_argument('--url', help='url of the video') parser....
# pip install -r requirements.txt from __future__ import print_function from ConfigParser import ConfigParser from os.path import expanduser import time import pychromecast import argparse parser = argparse.ArgumentParser(description='Chromecast toolset.') parser.add_argument('--url', help='url of the video') parser....
apache-2.0
Python
737d069c57c3cb2d6305f8e5d1f7d88402ef1327
Add support for v2 endpoints in config.
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/apps/jsbox/definition.py
go/apps/jsbox/definition.py
import json from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class ViewLogsAction(ConversationAction): action_name = 'view_logs' action_display_name = 'View Sandbox Logs' redirect_to = 'jsbox_logs' class ConversationDefinition(ConversationDefinition...
import json from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class ViewLogsAction(ConversationAction): action_name = 'view_logs' action_display_name = 'View Sandbox Logs' redirect_to = 'jsbox_logs' class ConversationDefinition(ConversationDefinition...
bsd-3-clause
Python
2d81c83545703359ab13652997bdffffc2b0f62b
Fix TOC
tensorflow/examples,tensorflow/examples,tensorflow/examples,tensorflow/examples,tensorflow/examples,tensorflow/examples,tensorflow/examples,tensorflow/examples,tensorflow/examples
lite/tools/build_model_maker_api_docs.py
lite/tools/build_model_maker_api_docs.py
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
# Lint as: python3 # Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
Python
b595f5c67cd9ed99233df3524b41f6ca972dc22d
change default
kiyukuta/string_recorder,kiyukuta/string_recorder
string_recorder/__init__.py
string_recorder/__init__.py
from string_recorder.string_recorder_pil import StringRecorder
from string_recorder.string_recorder import StringRecorder
mit
Python
5b27973ef242ef949b292f03e8320c31ac1a62a1
Disable testing when dev scope isn't set.
amarburg/apriltags,amarburg/apriltags,amarburg/apriltags,amarburg/apriltags,amarburg/apriltags
conanfile.py
conanfile.py
from conans import ConanFile, CMake class ApriltagsConan(ConanFile): name = "apriltags" version = "master" settings = "os", "compiler", "build_type", "arch" generators = "cmake" options = {"opencv_dir": "ANY", "use_openmp": [True,False], "shared": [True,False]} default_options = "...
from conans import ConanFile, CMake class ApriltagsConan(ConanFile): name = "apriltags" version = "master" settings = "os", "compiler", "build_type", "arch" generators = "cmake" options = {"opencv_dir": "ANY", "use_openmp": [True,False], "shared": [True,False]} default_options = "...
lgpl-2.1
Python
72793a2fe309e296e37b39174178825db93f5641
Bump version: 0.0.3 -> 0.0.4
polysquare/cmake-unit
conanfile.py
conanfile.py
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.4" class CMakeUnitConan(ConanFile): name = "cmake-unit" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cmake-include-guard...
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.3" class CMakeUnitConan(ConanFile): name = "cmake-unit" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspillaz/cmake-include-guard...
mit
Python
e57aef65510e367fadd4776e2ed4cd247c43e8c1
update conanfile to export pakage
NTNU-IHB/FMI4cpp,NTNU-IHB/FMI4cpp,NTNU-IHB/FMI4cpp
conanfile.py
conanfile.py
from conans import ConanFile, CMake class FMI4cppConan(ConanFile): name = "FMI4cpp" version = "0.5.4" license = "MIT" author = "Lars Ivar Hatledal [larsivarhatledal@gmail.com]" url = "https://github.com/NTNU-IHB/FMI4cpp" description = "FMI 2.0 implementation written in modern C++." topics...
from conans import ConanFile, CMake class FMI4cppConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "virtualrunenv" requires = ( "boost/1.66.0@conan/stable", "libzip/1.5.1@bincrafters/stable", "spdlog/1.3.1@bincrafters/stable" ) opti...
mit
Python
676638ede872decf0d037a7edaf13b0b9bad047a
Fix ceilometer-test-event.py script
openstack/ceilometer,idegtiarov/ceilometer,ityaptin/ceilometer,openstack/ceilometer,ityaptin/ceilometer,idegtiarov/ceilometer
tools/ceilometer-test-event.py
tools/ceilometer-test-event.py
#!/usr/bin/env python # # Copyright 2013 Rackspace Hosting. # # 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/env python # # Copyright 2013 Rackspace Hosting. # # 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
cef1a4ff0da96741a560889de73f8c4529ad9404
remove empty line
demianw/dipy,jyeatman/dipy,rfdougherty/dipy,sinkpoint/dipy,JohnGriffiths/dipy,samuelstjean/dipy,oesteban/dipy,matthieudumont/dipy,rfdougherty/dipy,nilgoyyou/dipy,FrancoisRheaultUS/dipy,nilgoyyou/dipy,mdesco/dipy,Messaoud-Boudjada/dipy,StongeEtienne/dipy,jyeatman/dipy,villalonreina/dipy,Messaoud-Boudjada/dipy,samuelstje...
doc/examples/reconst_shore.py
doc/examples/reconst_shore.py
""" ==================================================== Continuous and analytical diffusion signal modelling ==================================================== We show how to model the diffusion signal as a linear combination of continuous functions from the SHORE basis (Ozarslan et al. ISMRM 2009). We also compute...
""" ==================================================== Continuous and analytical diffusion signal modelling ==================================================== We show how to model the diffusion signal as a linear combination of continuous functions from the SHORE basis (Ozarslan et al. ISMRM 2009). We also compute...
bsd-3-clause
Python
c97e5cf11fc21e2ef4ee04779a424e4d6a2b96ae
Add CustomizeBrowserOptions method to Metric base class
mogoweb/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,M4sse/chr...
tools/perf/metrics/__init__.py
tools/perf/metrics/__init__.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethin...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethin...
bsd-3-clause
Python
bafb9e91958a122ebd8ee623c8c623c72617f1aa
Fix scanning class.
lnls-fac/apsuite
apsuite/optimization/scanning.py
apsuite/optimization/scanning.py
"""Multidimensional Simple Scan method for Minimization.""" import numpy as _np from .base import OptimizeParams as _OptimizeParams, Optimize as _Optimize class SimpleScanParams(_OptimizeParams): """.""" def __init__(self): """.""" super().__init__() self.number_of_steps = 10 d...
"""Multidimensional Simple Scan method for Minimization.""" from threading import Thread as _Thread import numpy as _np class SimpleScan: """.""" def __init__(self): """.""" self._position = _np.array([]) self._delta = _np.array([]) self._curr_dim = 0 self._stop = Fa...
mit
Python
8d15f88e8c1e400a5f28622aa16e18587aea8a3c
Handle absent email key
pennersr/django-allauth,rsalmaso/django-allauth,rsalmaso/django-allauth,pennersr/django-allauth,pennersr/django-allauth,rsalmaso/django-allauth
allauth/socialaccount/providers/amazon/provider.py
allauth/socialaccount/providers/amazon/provider.py
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class AmazonAccount(ProviderAccount): def to_str(self): return self.account.extra_data.get("name", super(AmazonAccount, self).to_str()) class AmazonProvider(OAuth2P...
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class AmazonAccount(ProviderAccount): def to_str(self): return self.account.extra_data.get("name", super(AmazonAccount, self).to_str()) class AmazonProvider(OAuth2P...
mit
Python
59a1047d4105b94181a75b1d496469f0efe2989f
add admin action test
inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree
InvenTree/plugin/test_api.py
InvenTree/plugin/test_api.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.urls import reverse from InvenTree.api_tester import InvenTreeAPITestCase class PluginDetailAPITest(InvenTreeAPITestCase): """ Tests the plugin AP I endpoints """ roles = [ 'admin.add', 'admin.view', ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.urls import reverse from InvenTree.api_tester import InvenTreeAPITestCase class PluginDetailAPITest(InvenTreeAPITestCase): """ Tests the plugin AP I endpoints """ roles = [ 'admin.add', 'admin.view', ...
mit
Python
f9c7a911411429972929bb4372b370192bd4cf8a
Update crossfilter to gray/blue scheme
altair-viz/altair,jakevdp/altair
altair/examples/interactive_layered_crossfilter.py
altair/examples/interactive_layered_crossfilter.py
""" Interactive Crossfilter ======================= This example shows a multi-panel view of the same data, where you can interactively select a portion of the data in any of the panels to highlight that portion in any of the other panels. """ # category: interactive charts import altair as alt from vega_datasets impor...
""" Interactive Crossfilter ======================= This example shows a multi-panel view of the same data, where you can interactively select a portion of the data in any of the panels to highlight that portion in any of the other panels. """ # category: interactive charts import altair as alt from vega_datasets impor...
bsd-3-clause
Python
1a52a28c5864f82edd19febba14b861d5f3efef1
fix gibbs ensemble unit test
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
hoomd/hpmc/test-py/gibbs.py
hoomd/hpmc/test-py/gibbs.py
from __future__ import division from hoomd import * from hoomd import hpmc import unittest import math # this script needs to be run on two ranks # initialize with one rank per partitions context.initialize(args="--nrank=1") class gibbs_ensemble_test(unittest.TestCase): def setUp(self): p = comm.get_pa...
from __future__ import division from hoomd import * from hoomd import hpmc import unittest import math # this script needs to be run on two ranks # initialize with one rank per partitions context.initialize(args="--nrank=1") class gibbs_ensemble_test(unittest.TestCase): def setUp(self): p = comm.get_pa...
bsd-3-clause
Python
d1911e9c545a88c5924d7d631d278e1c225edcf8
Add log message about unknown couch exception
openprocurement/openprocurement.auction,openprocurement/openprocurement.auction
openprocurement/auction/helpers/couch.py
openprocurement/auction/helpers/couch.py
import socket from random import sample from urlparse import urlparse from couchdb import Server, Session from time import sleep import sys import logging CONSTANT_IS_TRUE = True LOGGER = logging.getLogger(__name__) def couchdb_dns_query_settings(server_url, database_name): parsed_url = urlparse(server_url) ...
import socket from random import sample from urlparse import urlparse from couchdb import Server, Session from time import sleep CONSTANT_IS_TRUE = True def couchdb_dns_query_settings(server_url, database_name): parsed_url = urlparse(server_url) all_ips = set([str(i[4][0]) for i in socket.getaddrinfo(urlpars...
apache-2.0
Python
3e312180c1d3a0df2a5ba193cb75961166e92cc6
Add SignedCertificateTimestamp namedtuple
theno/ctutlz,theno/ctutlz
ctutlz/sct/scrape/tls_extension_18.py
ctutlz/sct/scrape/tls_extension_18.py
import collections from utlz import flo from utlz import StructContext _SctListEntry = collections.namedtuple( typename='SctListEntry', field_names=[ 'sct_len', 'sct_der', ] ) _TlsExtension18 = collections.namedtuple( typename='TlsExtension18', field_names=[ 'tls_extens...
import collections from utlz import flo from utlz import StructContext _SctListEntry = collections.namedtuple( typename='SctListEntry', field_names=[ 'sct_len', 'sct_der', ] ) _TlsExtension18 = collections.namedtuple( typename='TlsExtension18', field_names=[ 'tls_extens...
mit
Python
97e81e53ac068927f41e4045bc05002831d2c408
fix url patterns
tpeek/Copy-n-Haste,tpeek/Copy-n-Haste,kaka0525/Copy-n-Haste,kaka0525/Copy-n-Haste,tpeek/Copy-n-Haste,kaka0525/Copy-n-Haste
CopyHaste/CopyHaste/urls.py
CopyHaste/CopyHaste/urls.py
from django.conf.urls import include, url from django.contrib import admin from .views import home_view urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', home_view, name='homepage'), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^profile/', include('cnh_pr...
from django.conf.urls import patterns, include, url from django.contrib import admin from .views import home_view urlpatterns = patterns( '', url(r'^admin/', include(admin.site.urls)), url(r'^$', home_view, name='homepage'), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^...
mit
Python
4f3376d2803a4f158d44b59811e9f953895db0b3
Fix Line constructor
MorganR/gaussian-processes,MorganR/gaussian-processes
data/line.py
data/line.py
# This class will be used to generate random straight lines import random def generate_line(d_min, d_max): random.seed() d = random.randint(d_min, d_max) theta = random.randint(0, 359) return Line(d, theta) class Line: """Represents a straight line as distance 'd' from the origin and angle 'theta' from the x-ax...
# This class will be used to generate random straight lines import random def generate_line(d_min, d_max): random.seed() d = random.randint(d_min, d_max) theta = random.randint(0, 359) return Line(d, theta) class Line: """Represents a straight line as distance 'd' from the origin and angle 'theta' from the x-ax...
mit
Python
d564a5402b4818b3d87639a0a6d245460df73e5a
Add sphinx.ext.autosectionlabel extension
JonathonReinhart/scuba,JonathonReinhart/scuba,JonathonReinhart/scuba
docs/conf.py
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
mit
Python
c2abb41906a6e1fca8194175f7f59f120d868166
remove timezonefinder import
MrMinimal64/timezonefinder,MrMinimal64/timezonefinder
docs/conf.py
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
mit
Python
d1896b357d4840c3c2c46291df06ae223b97115e
Prepare official version bump
troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit
docs/conf.py
docs/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.abspath('../executor/')) # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.abspath('../executor/')) # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx...
agpl-3.0
Python
de8f7df034e5313d94e84ebc4951335eec0667c4
Complete version of exercise 2 and questions.
alyhashahrukh/inf1340_2015_asst1
exercise2.py
exercise2.py
#!/usr/bin/env python """ Assignment 1, Exercise 2, INF1340, Fall, 2015. Name that shape. This module contains one function name_that_shape(). It prompts the user to input the number of sides in a shape and outputs the name of the shape. """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = ...
#!/usr/bin/env python """ Assignment 1, Exercise 2, INF1340, Fall, 2015. Name that shape. This module contains one function name_that_shape(). It prompts the user to input the number of sides in a shape and outputs the name of the shape. """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = ...
mit
Python
801f7103c860af740cafabeb84e9e594d32db11e
Update docstrings in fsictools module
ChrisThoung/fsic
fsictools.py
fsictools.py
# -*- coding: utf-8 -*- """ fsictools ========= Supporting tools for FSIC-based economic models. See the individual docstrings for dependencies additional to those of `fsic`. """ # Version number keeps track with the main `fsic` module from fsic import __version__ import re from typing import List from fsic import B...
# -*- coding: utf-8 -*- """ fsictools ========= Supporting tools for FSIC-based economic models. """ # Version number keeps track with the main `fsic` module from fsic import __version__ from typing import List from fsic import BaseModel, Symbol def symbols_to_dataframe(symbols: List[Symbol]) -> 'DataFrame': ""...
mit
Python
10645b8d26f883312f0411f2b0bd79345556a5e2
correct syntax for hasattr
Sage-Bionetworks/nbviewer,franblas/beaker-sharing-server,iamjakob/nbviewer,AlfiyaZi/nbviewer,christophelec/nbviewer,AlfiyaZi/nbviewer,bollwyvl/nbviewer,Jay-Oh-eN/nbviewer,thomasyu888/nbviewer,twosigma/beaker-sharing-server,roxyboy/nbviewer,Sage-Bionetworks/nbviewer,iamjakob/nbviewer,franblas/beaker-sharing-server,twosi...
githubapp.py
githubapp.py
import os import base64 from flask import Flask , request, render_template import nbconvert.nbconvert as nbconvert import requests from nbformat import current as nbformat from flask import Flask, redirect, abort import re import github as gh from gist import render_content app = Flask(__name__) github = gh.Github() ...
import os import base64 from flask import Flask , request, render_template import nbconvert.nbconvert as nbconvert import requests from nbformat import current as nbformat from flask import Flask, redirect, abort import re import github as gh from gist import render_content app = Flask(__name__) github = gh.Github() ...
bsd-3-clause
Python
8f326164a1f8503b357eadcbba7a29c75caebf2e
Fix xml feed extraction.
fake-name/ReadableWebProxy,fake-name/ReadableWebProxy,fake-name/ReadableWebProxy,fake-name/ReadableWebProxy
WebMirror/processor/XmlProcessor.py
WebMirror/processor/XmlProcessor.py
from . import ProcessorBase import bs4 class XmlProcessor(ProcessorBase.PageProcessor): wanted_mimetypes = ['text/xml', 'application/xml'] want_priority = 40 loggerPath = "Main.Text.XmlProcessor" # def __init__(self, pageUrl, loggerPath, content, pbLut, **kwargs): def __init__(self, baseUrls, pageUrl...
from . import ProcessorBase import bs4 class XmlProcessor(ProcessorBase.PageProcessor): wanted_mimetypes = ['text/xml', 'application/xml'] want_priority = 50 loggerPath = "Main.Text.XmlProcessor" # def __init__(self, pageUrl, loggerPath, content, pbLut, **kwargs): def __init__(self, baseUrls, pageUrl...
bsd-3-clause
Python
3c776540b0774679af6a27bea1b9958a6769e48f
update worker.py
ojengwa/gfe
scraper.py
scraper.py
import re from dateutil.parser import parse from xml.sax.saxutils import unescape import requests import bs4 from celery import Celery from app import app, db from models import Result base_scraper_url = app.config.get('SCRAPER_BASE_URL') base_url = app.config.get('BASE_URL') base_dict = {} celery = Celery(app.na...
import re from dateutil.parser import parse from xml.sax.saxutils import unescape import requests import bs4 from app import app, db from models import Result base_scraper_url = app.config.get('SCRAPER_BASE_URL') base_url = app.config.get('BASE_URL') base_dict = {} def clean_html(html): return ' '.join(re.fin...
mit
Python
f0f20089bc1c68c6547156f4f7b20116a5128dc7
Update RegisterHandler.py
emeric254/gala-stri-website,emeric254/gala-stri-website,emeric254/gala-stri-website
Handlers/RegisterHandler.py
Handlers/RegisterHandler.py
# -*- coding: utf-8 -*- import logging from tornado import escape from Handlers.BaseHandler import BaseHandler from Tools import PostgreSQL, VerifyFields logger = logging.getLogger(__name__) class RegisterHandler(BaseHandler): """handle / endpoint""" def get(self): """Serve Get and return main page...
# -*- coding: utf-8 -*- import logging from Handlers.BaseHandler import BaseHandler from Tools import PostgreSQL, VerifyFields logger = logging.getLogger(__name__) class RegisterHandler(BaseHandler): """handle / endpoint""" def get(self): """Serve Get and return main page""" self.render('re...
mit
Python
e71c5a488106c3eecf7deb9099797e714e44b498
Change status detection
UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine
upol_search_engine/__main__.py
upol_search_engine/__main__.py
from time import sleep from upol_search_engine.upol_crawler import tasks def main(): crawler_settings = {'limit_domain': 'trnecka.inf.upol.cz', 'max_depth': 10, 'connect_max_timeout': 3.05, 'read_max_timeout': 10, 'frequency_per_server': 0.5, ...
from time import sleep from upol_search_engine.upol_crawler import tasks def main(): crawler_settings = {'limit_domain': 'trnecka.inf.upol.cz', 'max_depth': 10, 'connect_max_timeout': 3.05, 'read_max_timeout': 10, 'frequency_per_server': 0.5, ...
mit
Python
764913ba1b2e492eb1d966ab30c91229afab1893
Update config variable name
mattstibbs/blockbuster-server,mattstibbs/blockbuster-server
blockbuster/example_config_files/example_config.py
blockbuster/example_config_files/example_config.py
# General Settings timerestriction = False debug_mode = True log_directory = './logs' # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Servi...
# General Settings timerestriction = False debug_mode = True log_directory = './logs' # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Servi...
mit
Python
f5bd8b400e93e33666212a3558c05741ebef037d
Implement consume_token method
randomic/aniauth-tdd,randomic/aniauth-tdd
accounts/token.py
accounts/token.py
"""module containing generator for login tokens """ import base64 from django.core.signing import TimestampSigner class LoginTokenGenerator(object): """Generator for the timestamp signed tokens used for logging in. """ def __init__(self): self.signer = TimestampSigner( salt='aniauth...
"""module containing generator for login tokens """ import base64 from django.core.signing import TimestampSigner class LoginTokenGenerator(object): """Generator for the timestamp signed tokens used for logging in. """ def __init__(self): self.signer = TimestampSigner( salt='aniauth...
mit
Python
6064db3000f2aeec66a775345d22b8a2b421497f
Fix gzip test for Python 2.6
tbabej/astropy,bsipocz/astropy,lpsinger/astropy,MSeifert04/astropy,StuartLittlefair/astropy,larrybradley/astropy,DougBurke/astropy,stargaser/astropy,pllim/astropy,stargaser/astropy,MSeifert04/astropy,tbabej/astropy,lpsinger/astropy,joergdietrich/astropy,astropy/astropy,joergdietrich/astropy,dhomeier/astropy,kelle/astro...
astropy/utils/tests/test_gzip.py
astropy/utils/tests/test_gzip.py
import io import os from ...tests.helper import pytest from .. import gzip pytestmark = pytest.mark.skipif("sys.version_info < (3,0)") def test_gzip(tmpdir): fd = gzip.GzipFile(str(tmpdir.join("test.gz")), 'wb') fd = io.TextIOWrapper(fd, encoding='utf8')
import io import os from ...tests.helper import pytest from .. import gzip def test_gzip(tmpdir): fd = gzip.GzipFile(str(tmpdir.join("test.gz")), 'wb') fd = io.TextIOWrapper(fd, encoding='utf8')
bsd-3-clause
Python
1ec6da18d7906246380401c13496fdef3c80a27a
Address PR comments
ciena/afkak,ciena/afkak
afkak/protocol.py
afkak/protocol.py
# -*- coding: utf-8 -*- # Copyright (C) 2015 Cyan, Inc. from __future__ import absolute_import import logging from twisted.internet.error import ConnectionDone from twisted.protocols.basic import Int32StringReceiver from twisted.python.failure import Failure log = logging.getLogger(__name__) log.addHandler(logging....
# -*- coding: utf-8 -*- # Copyright (C) 2015 Cyan, Inc. from __future__ import absolute_import import logging from twisted.internet.error import ConnectionDone from twisted.protocols.basic import Int32StringReceiver from twisted.python.failure import Failure log = logging.getLogger(__name__) log.addHandler(logging....
apache-2.0
Python
7869d1004dd58263926515ad196d5423b77ee251
Fix verify_gravatars after downgrade to Python 2.7
SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas
apps/profiles/management/commands/verify_gravatars.py
apps/profiles/management/commands/verify_gravatars.py
import datetime import urllib2 from django.core.management.base import BaseCommand from django.utils.timezone import now from apps.profiles.models import User class Command(BaseCommand): help = 'Tries to verify gravatar for recently joined users.' def handle(self, *args, **options): users_verified ...
import datetime import urllib from django.core.management.base import BaseCommand from django.utils.timezone import now from apps.profiles.models import User class Command(BaseCommand): help = 'Tries to verify gravatar for recently joined users.' def handle(self, *args, **options): users_verified =...
mit
Python
f09a04158ecea7c0d4ef7f34319e3a94e1e01340
Fix seo description
apihackers/wapps,apihackers/wapps,apihackers/wapps,apihackers/wapps
wapps/templatetags/seo.py
wapps/templatetags/seo.py
import jinja2 from django_jinja import library from jinja2.ext import Extension from ..models import IdentitySettings class Metadata(object): ''' Extract metadata from a Page object ''' def __init__(self, context, **kwargs): self.context = context self.kwargs = kwargs self.p...
import jinja2 from django_jinja import library from jinja2.ext import Extension from ..models import IdentitySettings class Metadata(object): ''' Extract metadata from a Page object ''' def __init__(self, context, **kwargs): self.context = context self.kwargs = kwargs self.p...
mit
Python
4f7cd1c6f48fec9be34af049f3b91f0e895a36f1
Bump version to 0.1.1
gst/amqpy,veegee/amqpy
amqpy/__init__.py
amqpy/__init__.py
VERSION = (0, 1, 1) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/amqpy' __docformat__ = 'restructuredtext' from .message import Message from .channel import Channel from ....
VERSION = (0, 1, 0) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/amqpy' __docformat__ = 'restructuredtext' from .message import Message from .channel import Channel from ....
mit
Python
a1fb04e1ba961149eaa5ced9e2017cd0c865373f
Bump version
veegee/amqpy
amqpy/__init__.py
amqpy/__init__.py
from __future__ import absolute_import, division, print_function, unicode_literals __metaclass__ = type VERSION = (0, 12, 2) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/...
from __future__ import absolute_import, division, print_function, unicode_literals __metaclass__ = type VERSION = (0, 12, 1) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/...
mit
Python
c762009732f2e09a90982b1b429fad6a79a7ef40
Fix exception handling of default fields loader
vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks
backend/globaleaks/db/appdata.py
backend/globaleaks/db/appdata.py
# -*- coding: UTF-8 # datainit.py: database initialization # ****************** import json import os from globaleaks import models from globaleaks.orm import transact #from globaleaks.handlers.submission import db_assign_submission_sequence from globaleaks.handlers.admin.field import db_create_field from globaleak...
# -*- coding: UTF-8 # datainit.py: database initialization # ****************** import json import os from globaleaks import models from globaleaks.orm import transact #from globaleaks.handlers.submission import db_assign_submission_sequence from globaleaks.handlers.admin.field import db_create_field from globaleak...
agpl-3.0
Python
99b7db8defaa98feaa64cd3ba3d7f104ebcc43e5
Change repr(irNull) to output 'irNull' instead of the db-representation
kata198/indexedredis,kata198/indexedredis
IndexedRedis/fields/null.py
IndexedRedis/fields/null.py
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # null - The irNull singleton and IRNullType # # vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : import sys __all__ = ('IR_NULL_STR', 'IR_NULL_BYTES', 'IR_NULL_UNICODE', 'IR_NULL_STRINGS', 'IRNul...
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # null - The irNull singleton and IRNullType # # vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : import sys __all__ = ('IR_NULL_STR', 'IR_NULL_BYTES', 'IR_NULL_UNICODE', 'IR_NULL_STRINGS', 'IRNul...
lgpl-2.1
Python
6c5b2183479ff6d6f68ef6e2a71fba4bc4fb6f60
Move hard-coded panels into `fetch_panels`
nrejack/redi,nrejack/redi,nrejack/redi,nrejack/redi,nrejack/redi,nrejack/redi,nrejack/redi
config/preproc/preproc.py
config/preproc/preproc.py
#!/usr/bin/env python # Contributors: # Nicholas Rejack <nrejack@ufl.edu> # Kevin Hanson <hansonks@gmail.com> # Copyright (c) 2014-2015, University of Florida # All rights reserved. # # Distributed under the BSD 3-Clause License # For full text of the BSD 3-Clause License see http://opensource.org/licenses/BSD-3-Claus...
#!/usr/bin/env python # Contributors: # Nicholas Rejack <nrejack@ufl.edu> # Kevin Hanson <hansonks@gmail.com> # Copyright (c) 2014-2015, University of Florida # All rights reserved. # # Distributed under the BSD 3-Clause License # For full text of the BSD 3-Clause License see http://opensource.org/licenses/BSD-3-Claus...
bsd-3-clause
Python
cd09540f41ee34b360248aa4637b063c82c23e35
add update_gemspec (#276)
googleapis/synthtool,googleapis/synthtool,googleapis/synthtool,googleapis/synthtool,googleapis/synthtool
synthtool/languages/ruby.py
synthtool/languages/ruby.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python