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
d46c0ea86c29a6c832f0bc92bc58b2b8f6ca0335
Add some logging in notifier module
rab206/self-proj-pi,syardumi/jasper-client,sunu/jasper-client,Brandon32/jasper-client,DarrenRainey/jasper-client,brad999/nikita-client,clumsical/hackthehouse-marty,benhoff/jasper-client,densic/HomeAutomation,joekinley/jasper-client,jskye/voicehud-jasper,aish9r/jasper-client,rab206/self-proj-pi,ajay-gandhi/jasper-client...
client/notifier.py
client/notifier.py
# -*- coding: utf-8-*- import Queue from modules import Gmail from apscheduler.scheduler import Scheduler import logging logging.basicConfig() class Notifier(object): class NotificationClient(object): def __init__(self, gather, timestamp): self.gather = gather self.timestamp = ti...
# -*- coding: utf-8-*- import Queue from modules import Gmail from apscheduler.scheduler import Scheduler import logging logging.basicConfig() class Notifier(object): class NotificationClient(object): def __init__(self, gather, timestamp): self.gather = gather self.timestamp = ti...
mit
Python
306d6808179bb3b8c7d1619291447502000f0947
Standardize variable names on outermost app
flubstep/foxgami.com,flubstep/foxgami.com
py/app.py
py/app.py
import json import functools from flask import Flask, Response, request from foxgami.red import Story from foxgami.user import User, Session app = Flask(__name__) @app.after_request def add_content_headers(response): response.headers['Access-Control-Allow-Origin'] = '*' return response def return_as_json(in...
import json import functools from flask import Flask, Response, request from foxgami.red import Story from foxgami.user import User, Session app = Flask(__name__) @app.after_request def add_content_headers(response): response.headers['Access-Control-Allow-Origin'] = '*' return response def return_as_json(in...
mit
Python
99bd55917e998b7f51c7fd41069cd62eb5e9749a
Fix typing for cred parameter.
showell/zulip,showell/zulip,punchagan/zulip,shubhamdhama/zulip,eeshangarg/zulip,zulip/zulip,eeshangarg/zulip,eeshangarg/zulip,hackerkid/zulip,shubhamdhama/zulip,brainwane/zulip,shubhamdhama/zulip,rht/zulip,rht/zulip,andersk/zulip,rht/zulip,eeshangarg/zulip,kou/zulip,timabbott/zulip,hackerkid/zulip,showell/zulip,eeshang...
zerver/views/zephyr.py
zerver/views/zephyr.py
from django.conf import settings from django.http import HttpResponse, HttpRequest from django.utils.translation import ugettext as _ from zerver.decorator import authenticated_json_view from zerver.lib.ccache import make_ccache from zerver.lib.request import has_request_variables, REQ from zerver.lib.response import j...
from django.conf import settings from django.http import HttpResponse, HttpRequest from django.utils.translation import ugettext as _ from zerver.decorator import authenticated_json_view from zerver.lib.ccache import make_ccache from zerver.lib.request import has_request_variables, REQ from zerver.lib.response import j...
apache-2.0
Python
b4721daecfeb4c415a9130e1330a66a08d496c1e
bump version
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
cupy/_version.py
cupy/_version.py
__version__ = '5.0.0rc1'
__version__ = '5.0.0b4'
mit
Python
12c02b41324c7679efdbe80c0b69c5e3c18fcfed
fix notifier to work on Python 3.6
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
.pfnci/flexci_notify.py
.pfnci/flexci_notify.py
#!/usr/bin/env python3 # Note: keep this script runnable Python 3.6 until FlexCI Python update import sys import os def main(argv): # Slack config: "HOOK_URL1,HOOK_URL2,HOOK_URL3,..." slack_config = os.environ.get('CUPY_CI_SLACK_CONFIG', None) # Gitter config: "TOKEN:ROOM1,ROOM2,ROOM3,..." gitter_c...
#!/usr/bin/env python import sys import os def main(argv): # Slack config: "HOOK_URL1,HOOK_URL2,HOOK_URL3,..." slack_config = os.environ.get('CUPY_CI_SLACK_CONFIG', None) # Gitter config: "TOKEN:ROOM1,ROOM2,ROOM3,..." gitter_config = os.environ.get('CUPY_CI_GITTER_CONFIG', None) desc = os.envir...
mit
Python
4335c06fdd6fb8d60c7cee6215e7d1da9ab36d18
remove debugging print
CenterForOpenScience/modular-file-renderer,rdhyee/modular-file-renderer,felliott/modular-file-renderer,mfraezz/modular-file-renderer,Johnetordoff/modular-file-renderer,haoyuchen1992/modular-file-renderer,TomBaxter/modular-file-renderer,erinspace/modular-file-renderer,erinspace/modular-file-renderer,mfraezz/modular-file...
mfr_pdb/render.py
mfr_pdb/render.py
from mfr.core import RenderResult from mako.lookup import TemplateLookup template = TemplateLookup( directories=['mfr_pdb/templates'] ).get_template('pdb.mako') def render_html(fp, **kwargs): content = template.render(pdb_file=fp.read()) # assets must be loaded in this order assets = { 'js':...
from mfr.core import RenderResult from mako.lookup import TemplateLookup template = TemplateLookup( directories=['mfr_pdb/templates'] ).get_template('pdb.mako') def render_html(fp, **kwargs): print kwargs content = template.render(pdb_file=fp.read()) # assets must be loaded in this order assets ...
apache-2.0
Python
7ef0db81ab71d79519ebd37aa6650d0544f015df
Add code documentation and author information.
geektoni/Influenza-Like-Illness-Predictor,geektoni/Influenza-Like-Illness-Predictor
data_analysis/generate_weekly_data.py
data_analysis/generate_weekly_data.py
#!/usr/bin/env python # Given a complete year files with data in the form (page, week, visits) # this script will generate a convenient csv file which will store for # each page and for each years's week the total number of visits. # # Written by Giovanni De Toni (2017) # Email: giovanni.det at gmail.com import filein...
import fileinput import pandas as pd # Set up a dictionary all_data={} number=0 # Read from standard input for line in fileinput.input(): # Split the line given result = str.split(line) # Print the line number analyzed print(number) # Set up an empty list if the key # is null if all_d...
mit
Python
a3d7ca17e32457a8479a540b970baa101dcb1720
Update version to next release
NitishT/minio-py,minio/minio-py,minio/minio-py,NitishT/minio-py
minio/__init__.py
minio/__init__.py
# -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017 MinIO, 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.ap...
# -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017 MinIO, 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.ap...
apache-2.0
Python
f72da8ec96dfc4d3d31e628a35896c9044f9b438
Update version
mechaxl/mixer,suriya/mixer
mixer/__init__.py
mixer/__init__.py
""" Mixer is a module that adds object generation tool for your application. It's supported Django_ ORM, SQLAlchemy_ ORM, Pony_ ORM, Peewee_ ORM, Mongoengine_ ODM and etc. Mixer is very useful for testing and fixtures replacement. :copyright: 2013 by Kirill Klenov. :license: BSD, see LICENSE for more details. """ f...
""" Mixer is a module that adds object generation tool for your application. It's supported Django_ ORM, SQLAlchemy_ ORM, Pony_ ORM, Peewee_ ORM, Mongoengine_ ODM and etc. Mixer is very useful for testing and fixtures replacement. :copyright: 2013 by Kirill Klenov. :license: BSD, see LICENSE for more details. """ f...
bsd-3-clause
Python
e9a0ec7398708a1ecea5c03405a143bf5101afe9
make sure specs_path is protected by assertion
gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty
dusty/config.py
dusty/config.py
"""Module for handling the daemon config file stored at CONFIG_PATH. This file determines the bundles the user currently wants active, as well as the location of the Dusty specifications on disk.""" import yaml from . import constants def _load(filepath): with open(filepath, 'r') as f: return yaml.load(f...
"""Module for handling the daemon config file stored at CONFIG_PATH. This file determines the bundles the user currently wants active, as well as the location of the Dusty specifications on disk.""" import yaml from . import constants def _load(filepath): with open(filepath, 'r') as f: return yaml.load(f...
mit
Python
5c711b4e5e13036d137d02ec7beae6a4c3bbdef7
comment back things that should be commented
manzaigit/ntulearndownloader,manzaigit/ntulearndownloader
ntudownloader.py
ntudownloader.py
import os, requests from bs4 import BeautifulSoup from urllib.parse import urlparse, urljoin from settings import NTULEARN_URL # insert loginmethod here def ntu_login(username, password): values = {'username': username, 'password': password} r = requests.post(NTULEARN_URL, data=values) prin...
import os, requests from bs4 import BeautifulSoup from urllib.parse import urlparse, urljoin from settings import NTULEARN_URL # insert loginmethod here def ntu_login(username, password): values = {'username': username, 'password': password} r = requests.post(NTULEARN_URL, data=values) prin...
mit
Python
b82c575d1d2f89d79ca39e4a3e6a82af1919f51f
update setup
zhenzhai/edx-platform,zhenzhai/edx-platform,zhenzhai/edx-platform,zhenzhai/edx-platform,zhenzhai/edx-platform
common/lib/sandbox-packages/setup.py
common/lib/sandbox-packages/setup.py
from setuptools import setup setup( name="sandbox-packages", version="0.2.69", packages=[ "loncapa", "verifiers", "hint", "hint.hint_class_helpers", "hint.hint_class_helpers.expr_parser", "hint.hint_class", "hint.hint_class.first_Universal", "...
from setuptools import setup setup( name="sandbox-packages", version="0.2.68", packages=[ "loncapa", "verifiers", "hint", "hint.hint_class_helpers", "hint.hint_class_helpers.expr_parser", "hint.hint_class", "hint.hint_class.first_Universal", "...
agpl-3.0
Python
6da5a808ff3412b37445cd2aa26ff3b17d0fa05c
Bump version
getweber/weber-cli
cob/__version__.py
cob/__version__.py
__version__ = "0.0.6"
__version__ = "0.0.5"
bsd-3-clause
Python
d5810d7595f8970aba1cb48ce705247188bb0f3a
Fix type_list
eagafonov/json_schema_helpers
json_schema_helpers/helpers.py
json_schema_helpers/helpers.py
# Simple types type_string = dict(type="string") type_null = dict(type="null") type_integer = dict(type="integer") type_number = dict(type="number") type_object = dict(type="object") type_list = dict(type="array") # Python clashed with JavaScript :-) type_boolean = dict(type="boolean") # Simple type or null type_str...
# Simple types type_string = dict(type="string") type_null = dict(type="null") type_integer = dict(type="integer") type_number = dict(type="number") type_object = dict(type="object") type_list = dict(type="list") type_boolean = dict(type="boolean") # Simple type or null type_string_or_null = dict(oneOf=[type_string, ...
mit
Python
a22e652210852b3234af056e7dbc688a5f263f88
Fix bug with insertOrganism() function call
PDX-Flamingo/codonpdx-python,PDX-Flamingo/codonpdx-python
codonpdx/insert.py
codonpdx/insert.py
#!/usr/bin/env python import json from db import dbManager # insert an organism into a database table def insert(args): if hasattr(args, 'json'): data = json.loads(args.json) else: data = json.load(args.infile) with dbManager('config/db.cfg') as db: for org in data: db...
#!/usr/bin/env python import json from db import dbManager # insert an organism into a database table def insert(args): if hasattr(args, 'json'): data = json.loads(args.json) else: data = json.load(args.infile) with dbManager('config/db.cfg') as db: for org in data: db...
apache-2.0
Python
f3cc2de83c88f01f7ec554ae6223132c284b4ad4
Fix import for Kotti > 0.8x.
Kotti/kotti_site_gallery,Kotti/kotti_site_gallery
kotti_site_gallery/__init__.py
kotti_site_gallery/__init__.py
from __future__ import absolute_import from fanstatic import Library from fanstatic import Resource from kotti.resources import Image from kotti.fanstatic import view_css from kotti.fanstatic import view_needed lib_kotti_site_gallery = Library('kotti_site_gallery', 'static') ksg_view_css = Resource(lib_kotti_site_ga...
from fanstatic import Library from fanstatic import Resource from kotti.resources import Image import kotti.static as ks lib_kotti_site_gallery = Library('kotti_site_gallery', 'static') view_css = Resource(lib_kotti_site_gallery, "kotti_site_gallery.css", minified="kotti_site_g...
bsd-2-clause
Python
421c1802dd74d8c731caedaaacce1865c4aa4254
remove reference to old getBucketSizes function.
rfdickerson/CS241,rfdickerson/cs241-data-structures,rfdickerson/CS241,rfdickerson/cs241-data-structures,rfdickerson/CS241,rfdickerson/cs241-data-structures
A4/hashtabletemplate.py
A4/hashtabletemplate.py
from collections import Hashable class Node (object): def __init__(self, key, value): self.key = key self.value = value self.nextNode = None class LinkedList (object): # insert your assignment 2 here class Hashtable (object): def __init__(self, hashFunction, size=500): ...
from collections import Hashable class Node (object): def __init__(self, key, value): self.key = key self.value = value self.nextNode = None class LinkedList (object): # insert your assignment 2 here class Hashtable (object): def __init__(self, hashFunction, size=500): ...
mit
Python
a4c5782158e7d3fa696fc4532836355457f48cc0
Add note about BibleGateway layout
Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot
versebot/webparser.py
versebot/webparser.py
""" VerseBot for reddit By Matthieu Grieger webparser.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ from bs4 import BeautifulSoup from urllib.request import urlopen class Parser: """ Parser class for BibleGateway parsing methods. """ def __init__(self): """ Initializes translations att...
""" VerseBot for reddit By Matthieu Grieger parser.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ from bs4 import BeautifulSoup from urllib.request import urlopen class Parser: """ Parser class for BibleGateway parsing methods. """ def __init__(self): """ Initializes translations attrib...
mit
Python
37b12b0ebbd838f38128c3c627148d351219f465
check right when accessing /kit and /stats
StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite
labonneboite/web/root/views.py
labonneboite/web/root/views.py
# coding: utf8 from flask import Blueprint, current_app from flask import abort, send_from_directory, redirect, render_template, request from labonneboite.common import util from labonneboite.conf import settings from labonneboite.web.search.forms import CompanySearchForm rootBlueprint = Blueprint('root', __name__)...
# coding: utf8 from flask import Blueprint, current_app from flask import send_from_directory, redirect, render_template, request from labonneboite.common import util from labonneboite.conf import settings from labonneboite.web.search.forms import CompanySearchForm rootBlueprint = Blueprint('root', __name__) @roo...
agpl-3.0
Python
079f0a4500023ae9e2a760be8dc5291b8f8cc51d
Fix fahrenheit temperatures
kiwiheretic/logos-v2,kiwiheretic/logos-v2,kiwiheretic/logos-v2,kiwiheretic/logos-v2
weather/bot_plugin.py
weather/bot_plugin.py
# test plugin from bot.pluginDespatch import Plugin import re import datetime import logging import pyowm from logos.roomlib import get_global_option from django.conf import settings logger = logging.getLogger(__name__) logging.config.dictConfig(settings.LOGGING) class WeatherPlugin(Plugin): plugin = ("weather", ...
# test plugin from bot.pluginDespatch import Plugin import re import datetime import logging import pyowm from logos.roomlib import get_global_option from django.conf import settings logger = logging.getLogger(__name__) logging.config.dictConfig(settings.LOGGING) class WeatherPlugin(Plugin): plugin = ("w", "Weath...
apache-2.0
Python
0c1517a0e9ada833011ad435a9799ada0bbb7c89
Use the Github API to compute changed files for PRs. (#8476)
tswast/google-cloud-python,tswast/google-cloud-python,GoogleCloudPlatform/gcloud-python,googleapis/google-cloud-python,tswast/google-cloud-python,tseaver/google-cloud-python,googleapis/google-cloud-python,GoogleCloudPlatform/gcloud-python,tseaver/google-cloud-python,tseaver/google-cloud-python
test_utils/scripts/get_target_packages_kokoro.py
test_utils/scripts/get_target_packages_kokoro.py
# Copyright 2017 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2017 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
41b5a95a5c396c131d1426dd926e0a1a4beccc86
Call method changed on v14
OCA/manufacture,OCA/manufacture
mrp_workorder_sequence/models/mrp_production.py
mrp_workorder_sequence/models/mrp_production.py
# Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import models class MrpProduction(models.Model): _inherit = "mrp.production" def _reset_work_order_sequence(self): for rec in self: current_seque...
# Copyright 2019-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import models class MrpProduction(models.Model): _inherit = "mrp.production" def _reset_work_order_sequence(self): for rec in self: current_seque...
agpl-3.0
Python
7b615eda1f37235fb7a727858a87cfec94563e6c
Migrate a test
jandecaluwe/myhdl,jck/myhdl,josyb/myhdl,myhdl/myhdl,jandecaluwe/myhdl,juhasch/myhdl,hgomersall/myhdl,cfelton/myhdl,jandecaluwe/myhdl,josyb/myhdl,jck/myhdl,juhasch/myhdl,myhdl/myhdl,cfelton/myhdl,jck/myhdl,hgomersall/myhdl,cfelton/myhdl,josyb/myhdl,myhdl/myhdl,juhasch/myhdl,hgomersall/myhdl
myhdl/test/conversion/general/test_constants.py
myhdl/test/conversion/general/test_constants.py
from __future__ import absolute_import from myhdl import * @module def constants(v, u, x, y, z, a): b = Signal(bool(0)) c = Signal(bool(1)) d = Signal(intbv(5)[8:]) e = Signal(intbv(4, min=-3, max=9)) @always_comb def logic(): u.next = d v.next = e x.next = b y...
from __future__ import absolute_import from myhdl import * def constants(v, u, x, y, z, a): b = Signal(bool(0)) c = Signal(bool(1)) d = Signal(intbv(5)[8:]) e = Signal(intbv(4, min=-3, max=9)) @always_comb def logic(): u.next = d v.next = e x.next = b y.next = ...
lgpl-2.1
Python
24301f1670e8879c2e72f78f9288a7f8b8f32179
Add relation to mongodb, store stuff that is posted.
0ortmann/wg-tools,0ortmann/wg-tools,0ortmann/wg-tools,0ortmann/wg-tools
py-backend/server.py
py-backend/server.py
#!/usr/bin/python from flask import Flask, request, json, make_response import deptCalculator from mongoengine import * import datetime from bson import json_util ''' Define some mongo stuff, very rudimentary storing of posted data. ''' connect('localhost:27017') class Post(Document): date_modified = DateTimeFi...
#!/usr/bin/python from flask import Flask, request, json, render_template import deptCalculator app = Flask(__name__) @app.route('/calcDepts', methods=['POST']) def depts(): if request.method == 'POST' and request.headers['Content-Type'] == ('application/json; charset=UTF-8'): postedJson = json.dumps(req...
mit
Python
54b147e59d1dfd4b65643a3f8a56098eb5a99451
Add more default args so tests pass in py3+
Yelp/kafka-utils,Yelp/kafka-utils
tests/kafka_cluster_manager/decommission_test.py
tests/kafka_cluster_manager/decommission_test.py
from __future__ import unicode_literals from argparse import Namespace import mock import pytest from kafka_utils.kafka_cluster_manager.cluster_info \ .partition_count_balancer import PartitionCountBalancer from kafka_utils.kafka_cluster_manager.cmds import decommission from tests.kafka_cluster_manager.helper im...
from __future__ import unicode_literals from argparse import Namespace import mock import pytest from kafka_utils.kafka_cluster_manager.cluster_info \ .partition_count_balancer import PartitionCountBalancer from kafka_utils.kafka_cluster_manager.cmds import decommission from tests.kafka_cluster_manager.helper im...
apache-2.0
Python
401c4c414eaaa80e9ed22b210f0b98e71ccfc970
Fix mixed indentation in commented python test
emilybache/DiamondKata,emilybache/DiamondKata
python/test_diamond_incremental.py
python/test_diamond_incremental.py
""" These test cases can be used to test-drive a solution to the diamond kata, in an incremental manner. to run the tests, use 'py.test' - see http://pytest.org Instructions: 1. Make the first test case for Diamond A pass 2. change the 'ignore_' to 'test_' for the next test case. Make it pass. 3. Uncomment the next l...
""" These test cases can be used to test-drive a solution to the diamond kata, in an incremental manner. to run the tests, use 'py.test' - see http://pytest.org Instructions: 1. Make the first test case for Diamond A pass 2. change the 'ignore_' to 'test_' for the next test case. Make it pass. 3. Uncomment the next l...
mit
Python
f13d9ec4f953dc93a9add14cb36b4a2ae0891835
remove unused action
dstufft/jutils
crate_project/apps/packages/admin.py
crate_project/apps/packages/admin.py
from django.contrib import admin from packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI from packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog class PackageURIAdmin(admin.TabularInline): model = PackageURI extra = 0 class PackageAd...
from django.contrib import admin from packages.models import Package, Release, ReleaseFile, TroveClassifier, PackageURI from packages.models import ReleaseRequire, ReleaseProvide, ReleaseObsolete, ReleaseURI, ChangeLog from packages.tasks import save_releases def releases_save(modeladmin, request, queryset): sav...
bsd-2-clause
Python
6a04607082a386b41e3fb0c53bb7be7a2ba5c4b6
simplify hammer-stroud for cube a bit
nschloe/quadpy
quadpy/hexahedron/hammer_stroud.py
quadpy/hexahedron/hammer_stroud.py
# -*- coding: utf-8 -*- # import numpy from ..helpers import untangle, fsd, pm, z class HammerStroud(object): ''' Preston C. Hammer and Arthur H. Stroud, Numerical Evaluation of Multiple Integrals II, Math. Comp. 12 (1958), 272-280, <https://doi.org/10.1090/S0025-5718-1958-0102176-6>. ''' ...
# -*- coding: utf-8 -*- # import numpy from .helpers import fs_r00, pm_rrr, fs_rr0, z from ..helpers import untangle class HammerStroud(object): ''' Preston C. Hammer and Arthur H. Stroud, Numerical Evaluation of Multiple Integrals II, Math. Comp. 12 (1958), 272-280, <https://doi.org/10.1090/S00...
mit
Python
9cb8a22673d36ab8e5379065d2d71ea2805370c8
Fix day calculation on history limit
ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player
radio/templatetags/radio_extras.py
radio/templatetags/radio_extras.py
import random from django import template from django.conf import settings from django.contrib.auth.models import User from radio.models import Profile register = template.Library() # anonymous time seting @register.simple_tag() def settings_anonymous_time(): return getattr(settings, 'ANONYMOUS_TIME', 0) # Get...
import random from django import template from django.conf import settings from django.contrib.auth.models import User from radio.models import Profile register = template.Library() # anonymous time seting @register.simple_tag() def settings_anonymous_time(): return getattr(settings, 'ANONYMOUS_TIME', 0) # Get...
mit
Python
00454daf57f2d24ca6c8080b6c3bb57dfcf32be2
change the new parser tests
tjwei/jedi,WoLpH/jedi,flurischt/jedi,flurischt/jedi,WoLpH/jedi,mfussenegger/jedi,jonashaag/jedi,tjwei/jedi,mfussenegger/jedi,dwillmer/jedi,jonashaag/jedi,dwillmer/jedi
test/test_new_parser.py
test/test_new_parser.py
from jedi.parser import Parser def test_basic_parsing(): def compare(string): """Generates the AST object and then regenerates the code.""" assert Parser(string).module.get_code() == string compare('\na #pass\n') compare('wblabla* 1\t\n') compare('def x(a, b:3): pass\n') compare('...
import logging from jedi.parser import pytree from jedi.parser.pgen2 import Driver def test_basic_parsing(): def compare(string): """Generates the AST object and then regenerates the code.""" assert d.parse_string(string).get_code() == string #if self.options["print_function"]: # pyth...
mit
Python
dcc3c857345ea1db3a264f7695591ef166c58719
Update __init__.py
jameslyons/pycipher
pycipher/__init__.py
pycipher/__init__.py
from adfgx import ADFGX from adfgvx import ADFGVX from simplesubstitution import SimpleSubstitution from caesar import Caesar from affine import Affine from enigma import Enigma from autokey import Autokey from beaufort import Beaufort from bifid import Bifid as Bifid from columnartransposition import ColTrans f...
from adfgx import ADFGX from adfgvx import ADFGVX from simplesubstitution import SimpleSubstitution from caesar import Caesar from affine import Affine from enigma import Enigma from autokey import Autokey from beaufort import Beaufort from bifid import Bifid as Bifid from columnartransposition import ColTrans f...
mit
Python
7f0d09a5d8c391dc6b28e6461939796fffc20825
Update to version v0.3.1
remiomosowon/pyeasyga,remiomosowon/pyeasyga
pyeasyga/__init__.py
pyeasyga/__init__.py
# -*- coding: utf-8 -*- """pyeasyga A simple and easy-to-use genetic algorithm implementation library in Python. For a bit array solution representation, simply instantiate the GeneticAlgorithm class with input data, define and supply a fitness function, run the Genetic Algorithm, and retrieve the solution! Other so...
# -*- coding: utf-8 -*- """pyeasyga A simple and easy-to-use genetic algorithm implementation library in Python. For a bit array solution representation, simply instantiate the GeneticAlgorithm class with input data, define and supply a fitness function, run the Genetic Algorithm, and retrieve the solution! Other so...
bsd-3-clause
Python
263230a4381ab2c13c40a083839aa4bc7a5e88c3
Fix hard coded filename path
naiquevin/lookupy
pyharbor/pyharbor.py
pyharbor/pyharbor.py
import json class Har(object): def __init__(self, filename): self.filaname = filename self.har = read_har(filename) def entries(self, include=None, exclude=None, **kwargs): entries = filter_entries(self.har, **kwargs) if include is not None: return include_keys(en...
import json filename = '/home/vineet/Dropbox/kodecrm.com404.har' class Har(object): def __init__(self, filename): self.filaname = filename self.har = read_har(filename) def entries(self, include=None, exclude=None, **kwargs): entries = filter_entries(self.har, **kwargs) if ...
mit
Python
d1d9371a728a5d5f5617568b23b072b89295bb61
Fix typo in Atlys HDMI2USB target.
mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware
targets/atlys/hdmi2usb.py
targets/atlys/hdmi2usb.py
from litex.gen.fhdl.decorators import ClockDomainsRenamer from litex.soc.integration.soc_core import mem_decoder from litex.soc.interconnect import stream from gateware.encoder import EncoderDMAReader, EncoderBuffer, Encoder from gateware.streamer import USBStreamer from targets.utils import csr_map_update from targe...
from litex.gen.fhdl.decorators import ClockDomainsRenamer from litex.soc.integration.soc_core import mem_decoder from litex.soc.interconnect import stream from gateware.encoder import EncoderDMAReader, EncoderBuffer, Encoder from gateware.streamer import USBStreamer from targets.utils import csr_map_update from targe...
bsd-2-clause
Python
6a9af602428542157e4a8b42bac8b04803ecd2eb
Create directory inside test
rlee287/pyautoupdate,rlee287/pyautoupdate
testing/test_rm_dirs.py
testing/test_rm_dirs.py
from __future__ import absolute_import, print_function import pytest import os from ..launcher import Launcher class TestRunProgram: @pytest.fixture(scope='class') def create_update_dir(self, request): os.mkdir('downloads') files=['tesfeo','fjfesf','fihghg'] filedir=[os.path.join(...
from __future__ import absolute_import, print_function import pytest import os from ..launcher import Launcher class TestRunProgram: @pytest.fixture(scope='class') def create_update_dir(self, request): files=['tesfeo','fjfesf','fihghg'] filedir=[os.path.join('downloads',fi) for fi in file...
lgpl-2.1
Python
dcde1a0c2b676d0ac11856d2797f3402f5ba038e
Remove unused import
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
wafer/users/models.py
wafer/users/models.py
from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save from django.utils.encoding import python_2_unicode_compatible from libravatar import libravatar_url try: from urllib2 import urlparse except ImportError: from urllib import parse as urlparse ...
from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save from django.utils.encoding import python_2_unicode_compatible from libravatar import libravatar_url try: from urllib2 import urlparse except ImportError: from urllib import parse as urlparse ...
isc
Python
19278f5599b68d87976796c3cf4884493c6f3473
Add module description.
andela-akiura/bucketlist
config/__init__.py
config/__init__.py
"""This package stores the config variables of the app."""
mit
Python
c97b760c9ca3213eded060e422ebe65b75f0dd84
fix big with hide=null
navotsil/Open-Knesset,ofri/Open-Knesset,navotsil/Open-Knesset,otadmor/Open-Knesset,DanaOshri/Open-Knesset,alonisser/Open-Knesset,DanaOshri/Open-Knesset,DanaOshri/Open-Knesset,otadmor/Open-Knesset,daonb/Open-Knesset,MeirKriheli/Open-Knesset,jspan/Open-Knesset,jspan/Open-Knesset,ofri/Open-Knesset,Shrulik/Open-Knesset,ota...
src/knesset/mks/admin.py
src/knesset/mks/admin.py
from django import forms from django.contrib import admin from django.forms.models import modelformset_factory from django.forms.models import inlineformset_factory from django.contrib.contenttypes import generic from django.db.models import Q from knesset.mks.models import * from knesset.links.models import Link from...
from django import forms from django.contrib import admin from django.forms.models import modelformset_factory from django.forms.models import inlineformset_factory from django.contrib.contenttypes import generic from knesset.mks.models import * from knesset.links.models import Link from knesset.video.models import Vi...
bsd-3-clause
Python
b6b15ce13e3633d24e00028d12081a58c6391d05
Update muLAn version
muLAn-project/muLAn,muLAn-project/muLAn
muLAn/_version.py
muLAn/_version.py
version_info = (0, 8, 14) __version__ = '.'.join(map(str, version_info))
version_info = (0, 8, 6) __version__ = '.'.join(map(str, version_info))
mit
Python
54cdc132bd4eae881b233ce8b94a0e532bf30883
add comments.
PyLadiesSeoul/LampGenie
1_get_Url.py
1_get_Url.py
# -*- coding:utf-8 -*- # import란? import requests import BeautifulSoup # string을 저장. mobile_site_url = "http://www.aladin.co.kr/m/off/gate.aspx?" # requests 모듈 사용하기. response = requests.get(mobile_site_url) content = response.content # BeautifulSoup 사용하기. shop_list = BeautifulSoup.BeautifulSoup(content).findAll('td'...
import requests import BeautifulSoup mobile_site_url = "http://www.aladin.co.kr/m/off/gate.aspx?" response = requests.get(mobile_site_url) content = response.content shop_list = BeautifulSoup.BeautifulSoup(content).findAll('td') for x in shop_list: print "=" * 50 print x.text
mit
Python
8901aecc35f939a2b3a62665afff1d50bdab5867
Bump version number
nabla-c0d3/nassl,nabla-c0d3/nassl,nabla-c0d3/nassl
nassl/__init__.py
nassl/__init__.py
__author__ = "Alban Diquet" __version__ = "4.0.0"
__author__ = "Alban Diquet" __version__ = "3.1.0"
agpl-3.0
Python
a805d414557a14a8588b6e34a9fbb93cc87651df
Change ttl_skew to 50%, to allow a task to run twice before riemann notices that it never checked in.
crashlytics/riemann-sumd
lib/scheduler.py
lib/scheduler.py
import time import logging log = logging.getLogger(__name__) class TaskSchedule(): def __init__(self): self.tasks = [] log.debug("TaskSchedule created") def add(self, task, ttl_skew=0.5): offset = ((ttl_skew * task.ttl) - task.skew()) log.info("Scheduling '%s' for %ss from now" % (task.name, offset)) i...
import time import logging log = logging.getLogger(__name__) class TaskSchedule(): def __init__(self): self.tasks = [] log.debug("TaskSchedule created") def add(self, task, ttl_skew=0.8): offset = ((ttl_skew * task.ttl) - task.skew()) log.info("Scheduling '%s' for %ss from now" % (task.name, offset)) i...
mit
Python
c108deb403d49eb2b8fddcc49b2ba585c676e730
Move spec matching logic to base layer
johnsca/layer-apache-hadoop-datanode,juju-solutions/layer-apache-hadoop-datanode
reactive/datanode.py
reactive/datanode.py
from charms.reactive import when, when_not, set_state, remove_state from charms.hadoop import get_hadoop_base from jujubigdata.handlers import HDFS from jujubigdata import utils from charmhelpers.core import hookenv @when('hadoop.installed') @when_not('namenode.related') def blocked(): hookenv.status_set('blocked...
from charms.reactive import when, when_not, set_state, remove_state from charms.hadoop import get_hadoop_base from jujubigdata.handlers import HDFS from jujubigdata import utils from charmhelpers.core import hookenv @when('hadoop.installed') @when_not('namenode.related') def blocked(): hookenv.status_set('blocked...
apache-2.0
Python
01a2c81d1abe82b758631c141823536f9da67b01
make bigger section for data models
mylokin/redisext,mylokin/redisext
redisext/__init__.py
redisext/__init__.py
''' Introduction ------------ Redisext is a tool for data modeling. Its primary goal is to provide light interface to well-known data models based on Redis such as queues, hashmaps, counters, pools and stacks. Redisext could be treated as a ORM for Redis. Tutorial -------- Counter Model allows you to build counters ...
''' Introduction ------------ Redisext is a tool for data modeling. Its primary goal is to provide light interface to well-known data models based on Redis such as queues, hashmaps, counters, pools and stacks. Redisext could be treated as a ORM for Redis. Tutorial -------- Counter Model allows you to build counters ...
mit
Python
73f8a1e2e0006c2a37ae6264afe70a8207ffbb54
Bump version.
gzzhanghao/mitmproxy,fimad/mitmproxy,gzzhanghao/mitmproxy,ddworken/mitmproxy,cortesi/mitmproxy,xaxa89/mitmproxy,dufferzafar/mitmproxy,zlorb/mitmproxy,Kriechi/mitmproxy,laurmurclar/mitmproxy,ParthGanatra/mitmproxy,dufferzafar/mitmproxy,tdickers/mitmproxy,MatthewShao/mitmproxy,vhaupert/mitmproxy,Kriechi/mitmproxy,mosajja...
netlib/version.py
netlib/version.py
IVERSION = (0, 9, 1) VERSION = ".".join(str(i) for i in IVERSION) NAME = "netlib" NAMEVERSION = NAME + " " + VERSION
IVERSION = (0, 9) VERSION = ".".join(str(i) for i in IVERSION) NAME = "netlib" NAMEVERSION = NAME + " " + VERSION
mit
Python
150c79b70f8ec0992083ef8d2499623f94765097
Add context to render_basic.
FlipperPA/wagtail-components
restructured_text/restructured_text.py
restructured_text/restructured_text.py
from django.utils.safestring import mark_safe from docutils.core import publish_parts from wagtail.wagtailcore import blocks class RSTBlock(blocks.TextBlock): """ A ReSTructured text block for Wagtail streamfields. """ class Meta: icon = 'code' def render_basic(self, value, context=None)...
from django.utils.safestring import mark_safe from docutils.core import publish_parts from wagtail.wagtailcore import blocks class RSTBlock(blocks.TextBlock): """ A ReSTructured text block for Wagtail streamfields. """ class Meta: icon = 'code' def render_basic(self, value): retu...
bsd-3-clause
Python
d1b78294bde544d2db1c44a96e0986be4419e68d
Add docstring to utils.is_json_string_list
matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo
web/utils/__init__.py
web/utils/__init__.py
import json from django.core.exceptions import ValidationError def is_json_string_list(s): ''' Checks if the string s represents a list of strings in JSON. The function does nothing if s represents a valid list of strings, or raises a suitable ValidationError if not. ''' try: val = js...
import json from django.core.exceptions import ValidationError def is_json_string_list(s): try: val = json.loads(s) except: raise ValidationError('Not a JSON value.') if type(val) is not list: raise ValidationError('Not a JSON list.') for x in val: if type(x) is not uni...
agpl-3.0
Python
9ca1d1f1ddf2684a99d3730b59b2389e0e3f09cf
Update writeInputs.py
radical-cybertools/radical.repex
repex/writeInputs.py
repex/writeInputs.py
import os import sys import fileinput import shutil def writeInputs(max_temp, min_temp, replicas, timesteps, basename): max_temp = max_temp min_temp = min_temp replicas = replicas timesteps = timesteps #for i in range(replicas): #shutil.copy2('mdin', 'mdin_{0}'.format(i)) Temps_List = [...
import os import sys import fileinput import shutil def writeInputs(max_temp, min_temp, replicas, timesteps, basename): max_temp = max_temp min_temp = min_temp replicas = replicas timesteps = timesteps #for i in range(replicas): #shutil.copy2('mdin', 'mdin_{0}'.format(i)) Temps_List = [...
mit
Python
5950625aa536e6a0e4d2ca89393c323df29e0d3d
Fix build against django 4.0 Django 4.0 dropped `django.conf.urls.url()` for `django.urls.re_path()`
maciej-gol/tenant-schemas-celery,maciej-gol/tenant-schemas-celery
test_app/test_app/urls.py
test_app/test_app/urls.py
"""test_app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
"""test_app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
mit
Python
548e6736c41ca11a2c07f2ce6104ab3eff7f3517
Update CLAW package with version 1.2.1 (#10528)
LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/claw/package.py
var/spack/repos/builtin/packages/claw/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Claw(CMakePackage): """CLAW Compiler targets performance portability problem in climate an...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Claw(CMakePackage): """CLAW Compiler targets performance portability problem in climate an...
lgpl-2.1
Python
22f0e0200e560dc3fbbc3c9911ba32bb52c298df
Add a warning when OCIO is set to invalid path, and fallback to the blender config path.
prman-pixar/RenderManForBlender,prman-pixar/RenderManForBlender
rfb_utils/color_manager_blender.py
rfb_utils/color_manager_blender.py
import os import bpy import sys from ..rfb_utils.envconfig_utils import envconfig try: from rman_utils.color_manager import ColorManager except: ColorManager = None __clrmgr__ = None __has_warned__ = False class ColorManagerBlender(ColorManager): def __init__(self, config_path, **kwargs): super(Co...
import os import bpy import sys from ..rfb_utils.envconfig_utils import envconfig try: from rman_utils.color_manager import ColorManager except: ColorManager = None __clrmgr__ = None class ColorManagerBlender(ColorManager): def __init__(self, config_path, **kwargs): super(ColorManagerBlender, self...
mit
Python
a06e23dcd2956fb5b9f6dff48714ff9c9b4bd5b7
Update flows.py
illotum/sdn-fabric,illotum/sdn-fabric
fabric/flows.py
fabric/flows.py
""" This module containes pure functions to help with creating flow table entries. """ from ryu.ofproto import ofproto_v1_3 as ofp from ryu.ofproto import ofproto_v1_3_parser as parser def compose(actions=[], to_table=0): """ Compose instructions set from given entries :param actions: actions to perform ...
""" This module containes pure functions to help with creating flow table entries. """ from ryu.ofproto import ofproto_v1_3 as ofp from ryu.ofproto import ofproto_v1_3_parser as parser def compose(actions=[], to_table=0): """ Compose instructions set from given entries :param actions: actions to perform ...
apache-2.0
Python
6af1ff0a3dd89a06a1fd4b6ee4428405f365da17
Bump the version string to v0.12.0 (#764)
tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io
tensorflow_io/core/python/ops/version_ops.py
tensorflow_io/core/python/ops/version_ops.py
# Copyright 2019 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 required by applica...
# Copyright 2019 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 required by applica...
apache-2.0
Python
7ba52a548693603c73366375408413ead578e671
add test for console output error
titusz/onixcheck
tests/test_onixcheck.py
tests/test_onixcheck.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from onixcheck.__main__ import main from onixcheck import data def test_main_o3_ref_valid(capsys): argv = [data.VALID_ONIX2_REF] exit_code = main(argv) out, err = capsys.readouterr() assert 'VALID' in out assert 'INVALID' not in err ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from onixcheck.__main__ import main from onixcheck import data def test_main_o3_ref_valid(capsys): argv = [data.VALID_ONIX2_REF] exit_code = main(argv) out, err = capsys.readouterr() assert 'VALID' in out assert 'INVALID' not in err ...
bsd-2-clause
Python
7fcd1690bd61ee9781ec1f2adeed19731afa883c
simplify example
doubleO8/versionone-sdk-spoon,aarcro/VersionOne.SDK.Python,coddingtonbear/VersionOne.SDK.Python,versionone/VersionOne.SDK.Python
examples/meta_example.py
examples/meta_example.py
from v1pysdk import V1Meta v1 = V1Meta() my_story = v1.Story.find_by_id('1005') print s.Name # 'New Story 2' s.Owners # [<v1pysdk.v1meta.Member object at 0x02AD9710>] s.Scope # <v1pysdk.v1meta.Scope object at 0x02AB2550> for my_story in v1.Story,query("Name='New Story 2'"): print my_story.Name
from v1pysdk.v1meta import * meta = V1Meta() Story = meta.asset_class('Story') s = Story('1005') print s.Name # 'New Story 2' s.Owners # [<v1pysdk.v1meta.Member object at 0x02AD9710>] s.Scope # <v1pysdk.v1meta.Scope object at 0x02AB2550>
bsd-3-clause
Python
e25e26f2cb628b025330a70ef2e2d0b888259d08
Stop app only if it started
pygeek/flower,Lingling7/flower,ucb-bar/bar-crawl-web,barseghyanartur/flower,allengaller/flower,lucius-feng/flower,pj/flower,lucius-feng/flower,ChinaQuants/flower,tellapart/flower,asmodehn/flower,tellapart/flower,Lingling7/flower,jzhou77/flower,barseghyanartur/flower,lucius-feng/flower,ChinaQuants/flower,marrybird/flowe...
flower/app.py
flower/app.py
from __future__ import absolute_import import logging from functools import partial from concurrent.futures import ThreadPoolExecutor import celery import tornado.web from tornado import ioloop from .api import control from .urls import handlers from .events import Events from .options import default_options log...
from __future__ import absolute_import import logging from functools import partial from concurrent.futures import ThreadPoolExecutor import celery import tornado.web from tornado import ioloop from .api import control from .urls import handlers from .events import Events from .options import default_options log...
bsd-3-clause
Python
159aea1c97b8e8de45802cace031e7206c3c8fec
Add a __str__ for Tile.
chipx86/the-cure
thecure/sprites/tile.py
thecure/sprites/tile.py
from thecure.resources import load_spritesheet_frame from thecure.sprites import Sprite class Tile(Sprite): NAME = 'tile' WIDTH = 64 HEIGHT = 64 NEED_TICKS = False def __init__(self, filename, tile_offset): super(Tile, self).__init__() self.filename = filename self.tile_...
from thecure.resources import load_spritesheet_frame from thecure.sprites import Sprite class Tile(Sprite): NAME = 'tile' WIDTH = 64 HEIGHT = 64 NEED_TICKS = False def __init__(self, filename, tile_offset): super(Tile, self).__init__() self.filename = filename self.tile_...
mit
Python
aa20215e00aaa872d391fc774f4696c913274eca
add payment_term field in invoices from sale order
Gebesa-Dev/Addons-gebesa
sales_channel/models/sale_order.py
sales_channel/models/sale_order.py
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models class SaleOrder(models.Model): _inherit = "sale.order" @api.multi def action_invoice_create(self, grouped=False, final=False): res = sup...
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models class SaleOrder(models.Model): _inherit = "sale.order" @api.multi def action_invoice_create(self, grouped=False, final=False): res = sup...
agpl-3.0
Python
def66bc381f03970640a61d64b49ad5de9ef3879
Remove OCAMLLIB from build environment
0install/0install,afb/0install,afb/0install,afb/0install,gasche/0install,bastianeicher/0install,bhilton/0install,fdopen/0install,gasche/0install,0install/0install,jaychoo/0install,dbenamy/0install,gfxmonk/0install,jaychoo/0install,dbenamy/0install,DarkGreising/0install,bastianeicher/0install,fdopen/0install,bhilton/0in...
ocaml/build-in.py
ocaml/build-in.py
# Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does) import sys import os from os.path import relpath ocaml_build_dir = relpath(sys.argv[1], '.') # Hack: when we can depend on a full OCaml feed with the build tools, we can remove this. # Until then, we need to avoid trying to compile aga...
# Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does) import sys import os from os.path import relpath ocaml_build_dir = relpath(sys.argv[1], '.') os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
lgpl-2.1
Python
2476fef95f006b5d85fd655c970ba35b04ed999a
add method imports to __ini__.py
cstrelioff/resumepy,cstrelioff/resumepy
resumepy/__init__.py
resumepy/__init__.py
from .process import create_parser from .process import process_html from .process import process_pdf from .process import process_text from .utils import check_dir from .utils import copy_file from .utils import mkdirs from .utils import make_temp_directory
mit
Python
d666b96ed7bc3339e162f53accee141fa2f42a16
Update model.py
meng-sun/hil,kylehogan/hil,kylehogan/hil,henn/hil,henn/hil,CCI-MOC/haas,henn/hil_sahil,apoorvemohan/haas,apoorvemohan/haas,henn/hil_sahil,henn/haas,SahilTikale/haas,lokI8/haas,SahilTikale/switchHaaS,meng-sun/hil,kylehogan/haas
haas/model.py
haas/model.py
from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy import * from passlib.hash import sha512_crypt from haas.config import cfg Base = declarative_base() Session = sessionmaker() def init_db(create=False): uri = cfg.get('data...
from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy import * from passlib.hash import sha512_crypt from haas.config import cfg Base = declarative_base() Session = sessionmaker() def init_db(create=False): uri = cfg.get('data...
apache-2.0
Python
7ba828bd266dabf0a44a47c6428a4a4db003ea16
disable csrf protection at testing env.
soasme/rio,soasme/rio,soasme/rio
rio/settings/test.py
rio/settings/test.py
# -*- coding: utf-8 -*- DEBUG = True TESTING = True SECRET_KEY = 'no-secret' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/rio-test.db' CELERY_BROKER_URL = 'sqla+' + SQLALCHEMY_DATABASE_URI CELERY_RESULT_BACKEND = 'db+' + SQLALCHEMY_DATABASE_URI REDIS_DEFAULT_CLUSTERS = { 0: ...
# -*- coding: utf-8 -*- DEBUG = True TESTING = True SECRET_KEY = 'no-secret' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/rio-test.db' CELERY_BROKER_URL = 'sqla+' + SQLALCHEMY_DATABASE_URI CELERY_RESULT_BACKEND = 'db+' + SQLALCHEMY_DATABASE_URI REDIS_DEFAULT_CLUSTERS = { 0: ...
mit
Python
ffbcadf66ba6379e4f98ec070c0e4203e12e1236
add phenotype group
Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout
scout/blueprints/core/constants.py
scout/blueprints/core/constants.py
# -*- coding: utf-8 -*- """Constants.""" PHENOTYPE_GROUPS = { 'HP:0001298': { 'name': 'Encephalopathy', 'abbr': 'ENC' }, 'HP:0012759': { 'name': 'Neurodevelopmental abnormality', 'abbr': 'NDEV' }, 'HP:0001250': { 'name': 'Seizures', 'abbr': 'EP' }...
# -*- coding: utf-8 -*- """Constants.""" PHENOTYPE_GROUPS = { 'HP:0001298':{ 'name': 'Encephalopathy', 'abbr': 'ENC' }, 'HP:0012759':{ 'name': 'Neurodevelopmental abnormality', 'abbr': 'NDEV' }, 'HP:0001250':{ 'name': 'Seizures', 'abbr': 'EP' }, ...
bsd-3-clause
Python
405bccd60660397da0be2c6607017bd8a287a077
use locker
jpn--/pines,jpn--/pines
pines/tar.py
pines/tar.py
import os, io, tarfile, hashlib, json from .busy_dir import locker def _sha512_checksum(s): sha512 = hashlib.sha512() sha512.update(s) return sha512.hexdigest() def _save_hashes(hashes, path="."): """ Save configuration to a JSON file. If filename is not an absolute path, it will be prefixed with ~/.pines/ ""...
import os, io, tarfile, hashlib, json from .busy_dir import locked_directory def _sha512_checksum(s): sha512 = hashlib.sha512() sha512.update(s) return sha512.hexdigest() def _save_hashes(hashes, path="."): """ Save configuration to a JSON file. If filename is not an absolute path, it will be prefixed with ~/....
mit
Python
0a8209725e1efbc819f21652cc0413625f998059
Update KC CTS
KhronosGroup/Vulkan-CTS,googlestadia/VK-GL-CTS,KhronosGroup/Vulkan-CTS,googlestadia/VK-GL-CTS,KhronosGroup/VK-GL-CTS,KhronosGroup/Vulkan-CTS,googlestadia/VK-GL-CTS,KhronosGroup/VK-GL-CTS,KhronosGroup/Vulkan-CTS,KhronosGroup/VK-GL-CTS,KhronosGroup/VK-GL-CTS,googlestadia/VK-GL-CTS,KhronosGroup/VK-GL-CTS,KhronosGroup/Vulk...
external/fetch_kc_cts.py
external/fetch_kc_cts.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # Khronos OpenGL CTS # ------------------ # # Copyright (c) 2016 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # Khronos OpenGL CTS # ------------------ # # Copyright (c) 2016 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
apache-2.0
Python
beabd44cc187cd986c05eb1ac5289866081ebd22
Update mockito-core to 2.24.5
GerritCodeReview/plugins_webhooks
external_plugin_deps.bzl
external_plugin_deps.bzl
load("//tools/bzl:maven_jar.bzl", "maven_jar") def external_plugin_deps(): maven_jar( name = "mockito", artifact = "org.mockito:mockito-core:2.24.5", sha1 = "599509fe319bd9e39559b8f987bee5d4b77167e4", deps = [ "@byte-buddy//jar", "@byte-buddy-agent//jar", ...
load("//tools/bzl:maven_jar.bzl", "maven_jar") def external_plugin_deps(): maven_jar( name = "mockito", artifact = "org.mockito:mockito-core:2.24.0", sha1 = "969a7bcb6f16e076904336ebc7ca171d412cc1f9", deps = [ "@byte-buddy//jar", "@byte-buddy-agent//jar", ...
apache-2.0
Python
6c8fc2db5943a5e6c6c8d56a5561003cb60d23e4
fix so admin and debug toolbar isn't closed
Pr0jectX/challenge
core/middleware.py
core/middleware.py
from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ from django.conf import settings from core.models import Config from levels.models import Level import re class ClosedMiddleware(object): def process_request(self, request): if hasattr(request, 'user') and reques...
from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ from core.models import Config from levels.models import Level class ClosedMiddleware(object): def process_request(self, request): if hasattr(request, 'user') and request.user.is_staff: return None ...
agpl-3.0
Python
676562966cc8d9f6731b1cbac3c8a3827c7d62c4
Bump version to 0.1.53
botify-labs/python-simple-workflow,botify-labs/python-simple-workflow
swf/__init__.py
swf/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- version = (0, 1, 53) __title__ = "python-simple-workflow" __author__ = "Oleiade" __license__ = "MIT" __version__ = '.'.join(map(str, version))
#!/usr/bin/env python # -*- coding: utf-8 -*- version = (0, 1, 52) __title__ = "python-simple-workflow" __author__ = "Oleiade" __license__ = "MIT" __version__ = '.'.join(map(str, version))
mit
Python
4da61308f727dc42f0b0030aa54eeff2205c1fee
Change case
yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti
core/web/webapp.py
core/web/webapp.py
from __future__ import unicode_literals import os from importlib import import_module from bson.json_util import dumps from flask import Flask, url_for, request from flask_login import LoginManager, current_user from core.user import User from core.web.json import JSONDecoder from core.web.api import api from core.w...
from __future__ import unicode_literals import os from importlib import import_module from bson.json_util import dumps from flask import Flask, url_for, request from flask_login import LoginManager, current_user from core.user import User from core.web.json import JSONDecoder from core.web.api import api from core.w...
apache-2.0
Python
6ab4e871c07d123a9b5ab2ee9ca1f01d41aeed94
Fix bug in incar attribute gettingg.
PytLab/VASPy,PytLab/VASPy
scripts/change_incar_parameters.py
scripts/change_incar_parameters.py
''' Modify recursively parameters in all INCAR file. ''' import argparse import commands import logging from vaspy import PY2 from vaspy.incar import InCar SHELL_COMMAND = "find ./ -name 'INCAR'" _logger = logging.getLogger("vaspy.script") if "__main__" == __name__: # Check command validity. status, outp...
#!/usr/bin/env python ''' Modify recursively parameters in all INCAR file. ''' import argparse import commands import logging from vaspy.incar import InCar SHELL_COMMAND = "find ./ -name 'INCAR'" _logger = logging.getLogger("vaspy.script") if "__main__" == __name__: # Check command validity. status, outp...
mit
Python
469388b1e22496740c264ba4bb37305708ea543e
handle scores < -1 and > 1
lrvick/synt
synt/guesser.py
synt/guesser.py
# -*- coding: utf-8 -*- from synt.utils.redis_manager import RedisManager from synt.utils.extractors import best_word_feats from synt.utils.text import sanitize_text MANAGER = RedisManager() DEFAULT_CLASSIFIER = MANAGER.load_classifier() def guess(text, classifier=DEFAULT_CLASSIFIER): """Takes a blob of text and ...
from synt.utils.redis_manager import RedisManager from synt.utils.extractors import best_word_feats from synt.utils.text import sanitize_text MANAGER = RedisManager() DEFAULT_CLASSIFIER = MANAGER.load_classifier() def guess(text, classifier=DEFAULT_CLASSIFIER): """Takes a blob of text and returns the sentiment an...
agpl-3.0
Python
9b8bedc00be962284abb0420537d32e2ed7f4947
Tag new release: 3.1.15
Floobits/floobits-sublime,Floobits/floobits-sublime
floo/version.py
floo/version.py
PLUGIN_VERSION = '3.1.15' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
PLUGIN_VERSION = '3.1.14' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
apache-2.0
Python
554942c6ae8dfb71d1a2af895b60cd6b4923cc28
Tag new release: 3.1.9
Floobits/floobits-sublime,Floobits/floobits-sublime
floo/version.py
floo/version.py
PLUGIN_VERSION = '3.1.9' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
PLUGIN_VERSION = '3.1.8' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
apache-2.0
Python
cc0f463f49ba551a5381948d8ea89cd82ba9b52e
Fix #765.
HIPERFIT/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,diku-dk/futhark
rts/python/memory.py
rts/python/memory.py
# Start of memory.py. import ctypes as ct def addressOffset(x, offset, bt): return ct.cast(ct.addressof(x.contents)+int(offset), ct.POINTER(bt)) def allocateMem(size): return ct.cast((ct.c_byte * max(0,size))(), ct.POINTER(ct.c_byte)) # Copy an array if its is not-None. This is important for treating # Numpy a...
# Start of memory.py. import ctypes as ct def addressOffset(x, offset, bt): return ct.cast(ct.addressof(x.contents)+int(offset), ct.POINTER(bt)) def allocateMem(size): return ct.cast((ct.c_byte * max(0,size))(), ct.POINTER(ct.c_byte)) # Copy an array if its is not-None. This is important for treating # Numpy a...
isc
Python
1c695763ce3edc982e939fee0e0c5ab2da10d575
Sort those lists..
CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend
scripts/import_staff_identities.py
scripts/import_staff_identities.py
#!/usr/bin/env python import time import requests from threepio import logger from service.accounts.eucalyptus import AccountDriver as EucaAccountDriver from service.accounts.openstack import AccountDriver as OSAccountDriver from core.models import AtmosphereUser as User from core.models import Provider, Quota, Allo...
#!/usr/bin/env python import time import requests from threepio import logger from service.accounts.eucalyptus import AccountDriver as EucaAccountDriver from service.accounts.openstack import AccountDriver as OSAccountDriver from core.models import AtmosphereUser as User from core.models import Provider, Quota, Allo...
apache-2.0
Python
c40f7b216d1ebe14332acd2f4aa8df819053258a
Create serializers.py
divyamodi128/django_comments,divyamodi128/django_comments,divyamodi128/django_comments
src/posts/serializers.py
src/posts/serializers.py
from rest_framework import serializers from .models import Post class PostSerializers(serializers.HyperlinkedModelSerializer): class Meta: model = Post fields = ('url', 'title', 'content', 'timestamp', 'updated', 'media_url')
from rest_framework import serializers from .models import Post class PostSerializers(serializers.HyperlinkedModelSerializer): class Meta: model = Post fields = ('url', 'title', 'content', 'timestamp', 'updated', 'media_url') '''4703635512 ygnesha ranga 510 771 9301 '''
mit
Python
17933131c3f78a41a4aa803959e31e200cecd97e
add missing label declarator to all fields in forms
byteweaver/django-forums,ckcnik/django-forums,byteweaver/django-forums,ckcnik/django-forums
forums/forms.py
forums/forms.py
from django import forms class TopicCreateForm(forms.Form): topic = forms.CharField(label="Topic", min_length=3) message = forms.CharField(label="Message", min_length=3, widget=forms.Textarea()) class PostCreateForm(forms.Form): message = forms.CharField(label="Message", min_length=3, widget=forms.Texta...
from django import forms class TopicCreateForm(forms.Form): topic = forms.CharField("Topic", min_length=3) message = forms.CharField("Message", min_length=3, widget=forms.Textarea()) class PostCreateForm(forms.Form): message = forms.CharField("Message", min_length=3, widget=forms.Textarea())
bsd-3-clause
Python
8fa358b0ab8b2892ca062ceec399d58e4b077e46
update config path
voidabhi/cricinfo,voidabhi/cricinfo
cricinfo/my_bot.py
cricinfo/my_bot.py
#!/usr/bin/python import requests from bs4 import BeautifulSoup import xmltodict import click from ConfigParser import SafeConfigParser def get_config(key): """ Fetch config from config file """ parser = SafeConfigParser() parser.read('../.config') return parser.get(key) class Match(object): """ Represen...
#!/usr/bin/python import requests from bs4 import BeautifulSoup import xmltodict import click from ConfigParser import SafeConfigParser def get_config(key): """ Fetch config from config file """ parser = SafeConfigParser() parser.read('.config') return parser.get(key) class Match(object): """ Represents ...
mit
Python
c0815fb71a97a6dd0ddce99755012738a137e6cc
remove access token
stopthatcow/zazu,stopthatcow/zazu
zazu/github_helper.py
zazu/github_helper.py
# -*- coding: utf-8 -*- """github functions for zazu""" import zazu.util zazu.util.lazy_import(locals(), [ 'click', 'getpass', 'github', 'keyring', 're', 'requests', 'socket' ]) __author__ = "Nicholas Wiles" __copyright__ = "Copyright 2016" def get_gh_token(): """Make new GitHub token...
# -*- coding: utf-8 -*- """github functions for zazu""" import zazu.util zazu.util.lazy_import(locals(), [ 'click', 'getpass', 'github', 'keyring', 're', 'requests', 'socket' ]) __author__ = "Nicholas Wiles" __copyright__ = "Copyright 2016" def get_gh_token(): """Make new GitHub token...
mit
Python
1a357cdcb6b204bb7df147461b16d1cc15b05143
add filter capability
clofresh/proboscis
proboscis.py
proboscis.py
import sys import time from datetime import datetime import pymongo db = pymongo.Connection().mongolog time_key = 'created' message_key = 'msg' if len(sys.argv) > 1: filter_query = eval(sys.argv[1]) else: filter_query = {} last_time = list(db.log.find(filter_query, [time_key]).sort(time_key, pymongo.DESCEN...
import time from datetime import datetime import pymongo db = pymongo.Connection().mongolog time_key = 'created' message_key = 'msg' last_time = list(db.log.find({}, [time_key]).sort(time_key, pymongo.DESCENDING).limit(1))[0][time_key] while True: for row in db.log.find({time_key: {'$gt': last_time}}).sort(tim...
bsd-3-clause
Python
d5dc16ce9f7f6373ebef6563ba25e14133d51cf7
Fix test/helpers.py linter warnings.
duckinator/boreutils,duckinator/boreutils
test/helpers.py
test/helpers.py
""" Helper functions for the Boreutils test suite. """ from contextlib import contextmanager from pathlib import Path import os import subprocess @contextmanager def _modified_path(): current_dir = Path(__file__).resolve().parent bin_dir = (current_dir / '..' / 'bin').resolve() original_path = os.environ...
from contextlib import contextmanager from pathlib import Path import os import subprocess @contextmanager def _modified_path(): current_dir = Path(__file__).resolve().parent bin_dir = (current_dir / '..' / 'bin').resolve() original_path = os.environ['PATH'] try: os.environ['PATH'] = f'{bin_di...
isc
Python
5c17662e3acac6f4daab116cde23a4cca71c3372
Initialize threadpool as late as possible to let the process fork before spawning threads.
martijnvermaat/rpclib,martijnvermaat/rpclib,arskom/spyne,martijnvermaat/rpclib,arskom/spyne,arskom/spyne
src/rpclib/aux/thread.py
src/rpclib/aux/thread.py
# # rpclib - Copyright (C) Rpclib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This lib...
# # rpclib - Copyright (C) Rpclib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This lib...
lgpl-2.1
Python
b297ad6b4d52b688a1c50ffc2a5574d8061c5ce0
Check for errors parsing the CSV as we go.
larsyencken/csvdiff
csvdiff/records.py
csvdiff/records.py
# -*- coding: utf-8 -*- # # records.py # csvdiff # import csv from . import error class InvalidKeyError(Exception): pass def load(file_or_stream): istream = (open(file_or_stream) if not hasattr(file_or_stream, 'read') else file_or_stream) return _safe_iterator(csv.Dict...
# -*- coding: utf-8 -*- # # records.py # csvdiff # import csv class InvalidKeyError(Exception): pass def load(file_or_stream): istream = (open(file_or_stream) if not hasattr(file_or_stream, 'read') else file_or_stream) return csv.DictReader(istream) def index(record_s...
bsd-3-clause
Python
408f470085e481a687ddea012920feca26f4d2fe
set fixedWidth to func_list_widget
IfengAutomation/uitester,IfengAutomation/uitester
uitester/ui/case_manager/completer_widget.py
uitester/ui/case_manager/completer_widget.py
# -*- encoding: UTF-8 -*- import os from PyQt5 import uic from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtWidgets import QWidget, QListWidget, QTextBrowser class CompleterWidget(QWidget): select_signal = pyqtSignal(str, name="select_signal") selected_func_name_signal = pyqtSignal(str, str, name="selecte...
# -*- encoding: UTF-8 -*- import os from PyQt5 import uic from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtWidgets import QWidget, QListWidget, QTextBrowser class CompleterWidget(QWidget): select_signal = pyqtSignal(str, name="select_signal") selected_func_name_signal = pyqtSignal(str, str, name="selecte...
apache-2.0
Python
204f7e2b544eb1767e50bbee0171d631914298a8
Make test runnable.
markvdw/opt_tools
testing/test_stopwatch.py
testing/test_stopwatch.py
import sys import time import unittest sys.path.append('..') from opt_tools.helpers import Stopwatch class TestStopwatch(unittest.TestCase): def test_basic(self): s = Stopwatch() s2 = Stopwatch() s3 = Stopwatch(elapsed_time=13.0) s2.start() s3.start() time.sleep(0....
import time import unittest from helpers import Stopwatch class TestStopwatch(unittest.TestCase): def test_basic(self): s = Stopwatch() s2 = Stopwatch() s3 = Stopwatch(elapsed_time=13.0) s2.start() s3.start() time.sleep(0.1) self.assertTrue(s.elapsed_time ...
apache-2.0
Python
e1eb3c608f975c6672a47d3e4bcb7c29e8a7b965
update version
gbrammer/grizli
grizli/version.py
grizli/version.py
# git describe --tags __version__ = "0.6.0-79-g3c65f39"
# git describe --tags __version__ = "0.6.0-67-g098087f"
mit
Python
fab0b57e0c28336ed1ae771e5b3c94a95dd8b093
Use only deterministic names in da.wrap
jakirkham/dask,ssanderson/dask,PhE/dask,mrocklin/dask,mraspaud/dask,mraspaud/dask,pombredanne/dask,vikhyat/dask,vikhyat/dask,blaze/dask,wiso/dask,gameduell/dask,jcrist/dask,dask/dask,ssanderson/dask,mrocklin/dask,dask/dask,cowlicks/dask,mikegraham/dask,PhE/dask,chrisbarber/dask,clarkfitzg/dask,wiso/dask,clarkfitzg/dask...
dask/array/wrap.py
dask/array/wrap.py
from __future__ import absolute_import, division, print_function from itertools import product from functools import partial from toolz import curry import numpy as np from ..base import tokenize from .core import Array, normalize_chunks from .numpy_compat import full def dims_from_size(size, blocksize): """ ...
from __future__ import absolute_import, division, print_function from itertools import count, product from functools import partial from toolz import curry import numpy as np from .core import Array, normalize_chunks from .numpy_compat import full names = ('wrapped_%d' % i for i in count(1)) def dims_from_size(si...
bsd-3-clause
Python
c70b02cbe7b57548dec9efd6da2d511470bb0ecc
Update tests
mirnylab/cooler
tests/cli/test_coarsen.py
tests/cli/test_coarsen.py
# -*- coding: utf-8 -*- from functools import partial import os.path as op import subprocess import tempfile import filecmp import sys import os import cooler import logging import numpy as np import h5py import nose from nose.tools import with_setup, set_trace from click.testing import CliRunner from cooler.cli.clo...
# -*- coding: utf-8 -*- from functools import partial import os.path as op import subprocess import tempfile import filecmp import sys import os import cooler import logging import numpy as np import h5py import nose from nose.tools import with_setup, set_trace from click.testing import CliRunner from cooler.cli.clo...
bsd-3-clause
Python
c94177f671ee06d4922f323090fa6653c6b97b3f
fix issue
pyprism/Hiren-Git-Commit-Reminder,pyprism/Hiren-Git-Commit-Reminder
github/tests.py
github/tests.py
from django.core.urlresolvers import resolve from django.test import TestCase from django.http import HttpRequest from django.test import LiveServerTestCase from django.contrib.auth.models import User from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from sele...
from django.core.urlresolvers import resolve from django.test import TestCase from django.http import HttpRequest from django.test import LiveServerTestCase from django.contrib.auth.models import User from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from sele...
mit
Python
d472beade2135cf98f04c81914ac91f9896a9f2e
Update het.py
mspopgen/Evolib,mspopgen/Evolib,padraicc/Evolib
bin/het.py
bin/het.py
import sys from evolib.NGSFormats import VariantCallFormat vcf = VariantCallFormat(sys.stdin) args = sys.argv[1:] names = args[0].split(",") for row in vcf: chrom, pos = row['CHROM'], row['POS'] GTs = list((smp['GT'] for smp in row.iter_samples() if smp.name in names and smp['GT'] is not None and smp['GT'] ...
import sys from evolib.NGSFormats import VariantCallFormat vcf = VariantCallFormat(sys.stdin) args = sys.argv[1:] names = args[0].split(",") for row in vcf: chrom, pos = row['CHROM'], row['POS'] try: GTs = list((smp['GT'] for smp in row.iter_samples() if smp.name in names and smp['GT'] != "./." and ...
mit
Python
1de64fe5e7153c68a427805b24f08e8347492ff4
remove unused import
ngouzy/smartchangelog,ngouzy/commitmsg
test/support.py
test/support.py
import inspect import subprocess import sys import os from contextlib import contextmanager from typing import List, Iterator, TextIO, cast from io import StringIO import commitmsg """Path of the file containing commitmsg module""" commitmsg_script_path = inspect.getfile(commitmsg) def git_command(*git_args: str) -...
import inspect import subprocess import sys import os from contextlib import contextmanager from typing import List, Tuple, Iterator, TextIO, cast from io import StringIO import commitmsg """Path of the file containing commitmsg module""" commitmsg_script_path = inspect.getfile(commitmsg) def git_command(*git_args:...
mit
Python
aa603a96d0b7260ec5b687e1d75404512156de10
add missing param to test
oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk
test/test_db.py
test/test_db.py
""" shrunk - Rutgers University URL Shortener Unit tests for the database. """ from shrunk import ShrunkClient def get_shrunk_connection(): return ShrunkClient("db") def setup(): pass def teardown(): """Cleans up the database after testing.""" shrunk = get_shrunk_connection() shrunk.delete_u...
""" shrunk - Rutgers University URL Shortener Unit tests for the database. """ from shrunk import ShrunkClient def get_shrunk_connection(): return ShrunkClient("localhost") def setup(): pass def teardown(): """Cleans up the database after testing.""" shrunk = get_shrunk_connection() shrunk.d...
mit
Python
3b6aeac94c08a8d961d10bd9d0bf2fbca1e5ea35
Add CJSON test suite to the test_io.py file
Schamnad/cclib,berquist/cclib,langner/cclib,langner/cclib,gaursagar/cclib,Schamnad/cclib,cclib/cclib,cclib/cclib,cclib/cclib,ATenderholt/cclib,berquist/cclib,berquist/cclib,langner/cclib,gaursagar/cclib,ATenderholt/cclib
test/test_io.py
test/test_io.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Run writer unit tests for cclib.""" import sys import unittest sys.path.append('io') from testccio import * from test...
# -*- coding: utf-8 -*- # # Copyright (c) 2016, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Run writer unit tests for cclib.""" import sys import unittest sys.path.append('io') from testccio import * from test...
bsd-3-clause
Python
e914d33fa17f475142c2e8b267f2e096944150a3
add roles from keycloak to user profile
bcgov/gwells,bcgov/gwells,bcgov/gwells,bcgov/gwells
gwells/authentication.py
gwells/authentication.py
""" 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, software distri...
""" 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, software distri...
apache-2.0
Python
5117f2a5a5676144c46f374138a406cf499c03cf
Bump version 2.1.2
arteria/django-hijack-admin,arteria/django-hijack-admin,arteria/django-hijack-admin
hijack_admin/__init__.py
hijack_admin/__init__.py
# -*- coding: utf-8 -*- __version__ = '2.1.2' # pragma: no cover default_app_config = 'hijack_admin.apps.HijackAdminConfig'
# -*- coding: utf-8 -*- __version__ = '2.1.1' # pragma: no cover default_app_config = 'hijack_admin.apps.HijackAdminConfig'
mit
Python
e3680dfd76c8471e63fd2bd71d8d0754bec75036
Remove dead code
hydroshare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare
hs_communities/models.py
hs_communities/models.py
from django.db import models class Topic(models.Model): name = models.CharField(editable=True, null=False, max_length=255) def __str__(self): return "{}".format(self.name) class TopicEntry(models.Model): topic = models.ForeignKey(Topic, null=False, ...
from django.db import models class Topic(models.Model): name = models.CharField(editable=True, null=False, max_length=255) def __str__(self): return "{}".format(self.name) class TopicEntry(models.Model): topic = models.ForeignKey(Topic, null=False, ...
bsd-3-clause
Python
adf8562b78496454f822a9cf33f161445a995a2a
move author and version info to __init__
asrozar/perception
perceptiond.py
perceptiond.py
#!/usr/bin/env python from app import db_session # Perception # # Copyright (C) 2017 Avery Rozar # # This program is free software; you can redistribute it and/or modify it under the terms of the The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ...
#!/usr/bin/env python from app import db_session # Perception # # Copyright (C) 2017 Avery Rozar # # This program is free software; you can redistribute it and/or modify it under the terms of the The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ...
mit
Python
7a6a6446c56d9bb119bf2e534bc90549c93c3a80
put showLabel function into displayWindow class as a method
lucaskotw/paperpass
guipaperpass.py
guipaperpass.py
from Tkinter import Label class displaywWindow: " This class display the window of paperpass " def showLabel(): widget = Label(None, text='Hello!') widget.pack()
from Tkinter import Label def showLabel(): widget = Label(None, text='Hello!') widget.pack()
mit
Python
195a74fffebff179ca8a52d685a37bdad34cd8ad
Fix bug where text box get and clear don't work
lawsie/guizero,lawsie/guizero,lawsie/guizero
guizero/Text.py
guizero/Text.py
from tkinter import Label, StringVar from . import utilities as utils class Text(Label): def __init__(self, master, text="", size=12, color="black", font="Helvetica", grid=None, align=None): # Description of this object (for friendly error messages) self.description = "[Text] object with tex...
from tkinter import Label, StringVar from . import utilities as utils class Text(Label): def __init__(self, master, text="", size=12, color="black", font="Helvetica", grid=None, align=None): # Description of this object (for friendly error messages) self.description = "[Text] object with tex...
bsd-3-clause
Python
abc43a49323f5b925de9bf506fc9a766721e369f
Add authenticated decorator for profile page
kkstu/DNStack,kkstu/DNStack,kkstu/DNStack
handler/user.py
handler/user.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio from BaseHandler import BaseHandler from tornado.web import authenticated as Auth class LoginHandler(BaseHandler): def get(self): if not self.session.isGuest: return self.redirect('/') # 已登录则跳转到首页 next = self.get_argument...
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio from BaseHandler import BaseHandler class LoginHandler(BaseHandler): def get(self): if not self.session.isGuest: return self.redirect('/') # 已登录则跳转到首页 next = self.get_argument("next", "/") self.render('user/login....
mit
Python