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
04d00957ce0ef9a5a8c06d2514061a12925f7d2e
support auth0 RS256 jwts and jwks and multi-auth
swilcox/badash,swilcox/badash,swilcox/badash
badash-api/auth.py
badash-api/auth.py
"""auth.py for authentication related functions""" import hug from jose import jwt import requests from models import ApiKey from settings import settings def _get_rsa_key(kid): """get known good jwks""" # TODO: cache this!!! rsa_key = {} response = requests.get(settings.JWKS_URL) if response.stat...
"""auth.py for authentication related functions""" import hug import jwt from models import ApiKey from settings import settings def token_verify(token): """JWT token verification""" try: return jwt.decode(token, settings.JWT_SECRET, algorithm='HS256') except jwt.DecodeError: return False ...
mit
Python
04a807dd8ce625133a928b51296955383d2c6e49
Bump version to 0.3.4.1
davidmashburn/mtm_stats,davidmashburn/mtm_stats
mtm_stats/_version.py
mtm_stats/_version.py
__version_info__ = (0, 3, 4, 1) __version__ = '.'.join(map(str,__version_info__))
__version_info__ = (0, 3, 4, 0) __version__ = '.'.join(map(str,__version_info__))
apache-2.0
Python
798fa8bab4818949dbd2c927395970934cd7fe67
Remove extraneous debugging print statement
teury/django-multimedia,jbittel/django-multimedia
multimedia/signals.py
multimedia/signals.py
from filecmp import cmp import os from django.conf import settings def set_encode_profiles(sender, instance, **kwargs): """ Signal: pre_save Sender: Video, Audio Prior to saving, store the currently configured encoding profiles so we can later detect if the file needs to be encoded. If a new ...
from filecmp import cmp import os from django.conf import settings def set_encode_profiles(sender, instance, **kwargs): """ Signal: pre_save Sender: Video, Audio Prior to saving, store the currently configured encoding profiles so we can later detect if the file needs to be encoded. If a new ...
bsd-3-clause
Python
b5140af2a4b6e78cec29c3c08e957a18db6f3379
Remove set_trace() instruction.
0x1997/webassets,aconrad/webassets,wijerasa/webassets,heynemann/webassets,JDeuce/webassets,glorpen/webassets,wijerasa/webassets,scorphus/webassets,aconrad/webassets,john2x/webassets,0x1997/webassets,heynemann/webassets,florianjacob/webassets,aconrad/webassets,heynemann/webassets,JDeuce/webassets,scorphus/webassets,john...
tests/helpers.py
tests/helpers.py
from __future__ import with_statement import re from webassets.test import TempDirHelper, TempEnvironmentHelper __all__ = ('TempDirHelper', 'TempEnvironmentHelper', 'noop', 'assert_raises_regexp', 'check_warnings') # Define a noop filter; occasionally in tests we need to define # a filter to be able to ...
from __future__ import with_statement import re from webassets.test import TempDirHelper, TempEnvironmentHelper __all__ = ('TempDirHelper', 'TempEnvironmentHelper', 'noop', 'assert_raises_regexp', 'check_warnings') # Define a noop filter; occasionally in tests we need to define # a filter to be able to ...
bsd-2-clause
Python
3a809033788795c124f97bd68e1639e00b557105
use inlineCallbacks in tthrow
longaccess/longaccess-client,longaccess/longaccess-client,longaccess/longaccess-client
lacli/server/error.py
lacli/server/error.py
from lacli.exceptions import ApiAuthException from lacli.server.interface.ClientInterface.ttypes import InvalidOperation from lacli.server.interface.ClientInterface.ttypes import ErrorType from lacli.log import getLogger from twisted.python import log as twisted_log from twisted.python import failure from twisted.inter...
from lacli.exceptions import ApiAuthException from lacli.server.interface.ClientInterface.ttypes import InvalidOperation from lacli.server.interface.ClientInterface.ttypes import ErrorType from lacli.log import getLogger from twisted.python import log as twisted_log from twisted.python import failure from twisted.inter...
apache-2.0
Python
6b1034d6039948ab26f780918362e15548d4742b
fix bad domain key
laincloud/lain-sdk,laincloud/lain-sdk,laincloud/lain-sdk,supermeng/lain-sdk,supermeng/lain-sdk,supermeng/lain-sdk
lain_sdk/yaml/conf.py
lain_sdk/yaml/conf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import yaml from lain_sdk.yaml.lain_user_config import LainUserConfig DOCKER_APP_ROOT = '/lain/app' user_config = LainUserConfig.create() etc = user_config.get_config() PRIVATE_REGISTRY = None if etc is None else etc.get('private_docker_registry', None) DOMAI...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import yaml from lain_sdk.yaml.lain_user_config import LainUserConfig DOCKER_APP_ROOT = '/lain/app' user_config = LainUserConfig.create() etc = user_config.get_config() PRIVATE_REGISTRY = None if etc is None else etc.get('private_docker_registry', None) DOMAI...
mit
Python
66849a560c7677b8eab72cc459b429a125f414f2
test case fix
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
custom/icds_reports/tests/agg_tests/test_child_vaccines_agg.py
custom/icds_reports/tests/agg_tests/test_child_vaccines_agg.py
import datetime from datetime import date from custom.icds_reports.models.aggregate import ChildVaccines from django.test.testcases import TestCase from custom.icds_reports.tasks import update_child_vaccine_table class ChildVaccineAggregationTest(TestCase): always_include_columns = {'due_list_date_anc_1', 'due_...
from datetime import date from custom.icds_reports.models.aggregate import ChildVaccines from django.test.testcases import TestCase from custom.icds_reports.tasks import update_child_vaccine_table class ChildVaccineAggregationTest(TestCase): always_include_columns = {'due_list_date_anc_1', 'due_list_date_anc_2',...
bsd-3-clause
Python
fae5a45cc796c6105764bc480026ce9895e6a07c
Rename setup script for player data retrieval
leaffan/pynhldb
_setup_database.py
_setup_database.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions from setup.create_players import migrate_players from setup.create_player_data import create_player_seasons from setup.create_player_data import create_player_...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions from setup.create_players import migrate_players from setup.create_player_seasons import create_player_seasons from setup.create_player_seasons import create_p...
mit
Python
6bf0e7347e875fca8cc19c4c26e34bbb84765e20
Update database.py
Python-IoT/Smart-IoT-Planting-System,Python-IoT/Smart-IoT-Planting-System
cloud/database.py
cloud/database.py
#!/usr/bin/env python import pymysql #Python3 db = pymysql.connect("localhost","sips","root","zaijian" ) cursor = db.cursor() cursor.execute("SELECT VERSION()") data = cursor.fetchone() print ("Database version : %s " % data) db.close() def create_table(): db = pymysql.connect("localhost","sips","root","zaijian"...
#!/usr/bin/env python import pymysql #Python3 db = pymysql.connect("localhost","sips","root","zaijian" ) cursor = db.cursor() cursor.execute("SELECT VERSION()") data = cursor.fetchone() print ("Database version : %s " % data) db.close() def create_table(): db = pymysql.connect("localhost","sips","root","zaijian"...
mit
Python
2ca9391b872bc4c6fe65e7ae624b40652978543e
add headers to mocked api response
cloudruninc/cloudrun-python
cloudrun/tests.py
cloudrun/tests.py
import datetime import json import responses import uuid from .cloudrun import Cloudrun from .run import Run token = uuid.uuid4().hex id = uuid.uuid4().hex def test_cloudrun_init(): assert type(Cloudrun(token)) is Cloudrun assert Cloudrun(token).token == token @responses.activate def test_run_create(): ...
import datetime import json import responses import uuid from .cloudrun import Cloudrun from .run import Run token = uuid.uuid4().hex id = uuid.uuid4().hex def test_cloudrun_init(): assert type(Cloudrun(token)) is Cloudrun assert Cloudrun(token).token == token @responses.activate def test_run_create(): ...
mit
Python
01e05b1cff478be7f59ce0e88b4bef40faa5f2e3
Change version number to 1.2.1
isrusin/cbcalc,isrusin/cbcalc
cbclib/version.py
cbclib/version.py
"""a cbclib version storage module.""" version_tuple = (1, 2, 1) full_version = "%d.%d.%d" % version_tuple
"""a cbclib version storage module.""" version_tuple = (1, 2, 0) full_version = "%d.%d.%d" % version_tuple
mit
Python
1f0cdff8008b45ac2c3792bf45b3b286b69fb9b5
Update version 0.10.12 -> 0.10.13
dwavesystems/dimod,dwavesystems/dimod
dimod/__init__.py
dimod/__init__.py
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
Python
fbce104748d401c8be7e561b029caa6954255919
Make function class method
NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo
website/noveltorpedo/forms.py
website/noveltorpedo/forms.py
# Copyright 2017 Brook Boese, Finn Ellis, Jacob Martin, Matthew Popescu, Rubin Stricklin, and Sage Callon # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without ...
# Copyright 2017 Brook Boese, Finn Ellis, Jacob Martin, Matthew Popescu, Rubin Stricklin, and Sage Callon # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without ...
mit
Python
cf3d064da599c8cd4ec1d965cac1d96fdef06bf9
Use relative URL in django_middleware.py
GoogleCloudPlatform/datastore-ndb-python,GoogleCloudPlatform/datastore-ndb-python
ndb/django_middleware.py
ndb/django_middleware.py
#!/usr/bin/env python # # 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, softwar...
#!/usr/bin/env python # # 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, softwar...
apache-2.0
Python
22fa64a963dd74249e5869cd53567a71944605a6
Fix SgHMC's momentum generation
blackjax-devs/blackjax
blackjax/sgmcmc/sghmc.py
blackjax/sgmcmc/sghmc.py
# Copyright 2020- The Blackjax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
# Copyright 2020- The Blackjax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
Python
d0f37bfed41635d105071e31eff1b68975e792d9
fix MD validation logging
cathydeng/openelections-core,openelections/openelections-core,cathydeng/openelections-core,datamade/openelections-core,datamade/openelections-core,openelections/openelections-core
openelex/us/md/validate.py
openelex/us/md/validate.py
from openelex.models import Contest, Candidate, Result #TODO: Add generic test for unique candidacies per contest #TODO: Add Result validations def validate_unique_contests(): """Should have a unique set of contests for all elections""" # Get all election ids election_ids = list(Contest.objects.distinct('...
from openelex.models import Contest, Candidate, Result #TODO: Add generic test for unique candidacies per contest #TODO: Add Result validations def validate_unique_contests(): """Should have a unique set of contests for all elections""" # Get all election ids election_ids = list(Contest.objects.distinct('...
mit
Python
7a2ab078a33cfa66b9c5a59c1244c1fb313e2caa
fix create superuser, add arctic admin role signal to prevent execution when updating the user
sanoma/django-arctic,sanoma/django-arctic,sanoma/django-arctic
arctic/signals.py
arctic/signals.py
from django.contrib.auth import get_user_model from django.db.models.signals import post_save from arctic.loading import (get_role_model, get_user_role_model) from .mixins import RoleAuthentication User = get_user_model() Role = get_role_model() UserRole = get_user_role_model() def superuser_post_save(sender, inst...
from django.contrib.auth import get_user_model from django.db.models.signals import post_save from arctic.loading import (get_role_model, get_user_role_model) from .mixins import RoleAuthentication User = get_user_model() Role = get_role_model() UserRole = get_user_role_model() def superuser_post_save(sender, inst...
mit
Python
5f9d8b30313200d9baa55ea468ad5b94481ba871
Make repo serializable via as_dict
bumper-app/bumper-bianca,bumper-app/bumper-bianca
bianca/orm/repository.py
bianca/orm/repository.py
""" file: repository.py author: Ben Grawi <bjg1568@rit.edu> date: October 2013 description: Holds the repository abstraction class and ORM """ import uuid from db import * from datetime import datetime class Repository(Base): """ Commit(): description: The SQLAlchemy ORM for the repository table """ ...
""" file: repository.py author: Ben Grawi <bjg1568@rit.edu> date: October 2013 description: Holds the repository abstraction class and ORM """ import uuid from db import * from datetime import datetime class Repository(Base): """ Commit(): description: The SQLAlchemy ORM for the repository table """ ...
mit
Python
dae397430d894a72db5afe06ec243931a5bf925b
Raise exception when calling reforms without loading any
sgmap/openfisca-web-api,openfisca/openfisca-web-api,sgmap/openfisca-web-api,openfisca/openfisca-web-api
openfisca_web_api/model.py
openfisca_web_api/model.py
# -*- coding: utf-8 -*- import os from openfisca_core import decompositions, reforms # Declarations, initialized in environment module build_reform_function_by_key = None decomposition_json_by_file_path_cache = {} input_variables_and_parameters_by_column_name_cache = {} input_variables_extractor = None parameters...
# -*- coding: utf-8 -*- import os from openfisca_core import decompositions, reforms # Declarations, initialized in environment module build_reform_function_by_key = None decomposition_json_by_file_path_cache = {} input_variables_and_parameters_by_column_name_cache = {} input_variables_extractor = None parameters...
agpl-3.0
Python
341de8221204aa1c5e88917d3c816ff87fe87f87
update copyright date
julien6387/supvisors,julien6387/supvisors,julien6387/supvisors,julien6387/supervisors,julien6387/supvisors,julien6387/supervisors,julien6387/supervisors,julien6387/supervisors
supvisors/tests/test_infosource.py
supvisors/tests/test_infosource.py
#!/usr/bin/python #-*- coding: utf-8 -*- # ====================================================================== # Copyright 2017 Julien LE CLEACH # # 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 Lice...
#!/usr/bin/python #-*- coding: utf-8 -*- # ====================================================================== # Copyright 2016 Julien LE CLEACH # # 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 Lice...
apache-2.0
Python
24cdbd0ead02efe250129f5edebdecfe2c18e199
Apply suggestions from code review
openpathsampling/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,choderalab/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,dwhswenson/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openp...
openpathsampling/random.py
openpathsampling/random.py
from __future__ import absolute_import import numpy as np import random # Set one rng for all of OPS if np.version.version < '1.17': # Legacy support, remove when numpy 1.16 support is dropped (Py2) class RandomState(np.random.RandomState): def __init__(self, *args, **kwargs): super(Random...
from __future__ import absolute_import import numpy as np import random # Set one rng for all of OPS if np.version.version < '1.17': # Legacy support, remove when numpy 1.16 support is dropped class RandomState(np.random.RandomState): def __init__(self, *args, **kwargs): super(RandomState,...
mit
Python
5d4d3e44dad5671dabc0fbe793a2260362adb181
Bump version.
armet/python-armet
armet/_version.py
armet/_version.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 4, 25) __version__ = '.'.join(map(str, __version_info__))
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 4, 24) __version__ = '.'.join(map(str, __version_info__))
mit
Python
257256a0fe4791e57f835a9a3e446638192a684e
update settings module
apipanda/openssl,apipanda/openssl,apipanda/openssl,apipanda/openssl
openssl/settings/common.py
openssl/settings/common.py
""" Django settings for mapoint project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
""" Django settings for mapoint project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
mit
Python
32fa361488f58478bc36e7465a56cdcd10e9cc82
clean up comment
dustwormghost/pygoogledrive
driveapi/driveapi.py
driveapi/driveapi.py
''' Google Drive API ''' import utils from apiclient.http import MediaFileUpload, HttpRequest from apiclient import errors class DriveApi: def upload_file(self, service, file_name, mime_type, body): '''upload one file with type and description Args: service: Drive service instance ...
''' Google Drive API ''' import utils from apiclient.http import MediaFileUpload, HttpRequest from apiclient import errors class DriveApi: def upload_file(self, service, file_name, mime_type, body): '''upload one file with type and description Args: service: Drive service instance ...
mit
Python
9ec1dc80f112d0b6f89bac0f91e2fdf620d28e9c
Fix tests
EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes,EndPointCorp/lg_ros_nodes
lg_screenshot/src/lg_screenshot/web_screenshot.py
lg_screenshot/src/lg_screenshot/web_screenshot.py
#!/usr/bin/env python import rospy import lg_common from lg_common.msg import GetScreenshot from lg_common.msg import Screenshot DEFAULT_BINARY = 'phantomjs' DEFAULT_SCRIPT = 'screenshots.js' class WebScreenshot: def __init__ (self, publisher, binary=DEFAULT_BINARY, script=DEFAULT_SCRIPT, dela...
#!/usr/bin/env python import rospy import lg_common from lg_common.msg import GetScreenshot from lg_common.msg import Screenshot DEFAULT_BINARY = 'phantomjs' DEFAULT_SCRIPT = 'screenshots.js' class WebScreenshot: def __init__ (self, publisher, binary=DEFAULT_BINARY, script=DEFAULT_SCRIPT, dela...
apache-2.0
Python
df29f6fa5e9f8591e0ab0b300305d78d0d315135
Remove unused modules in mpathutil
chandrikas/sm,xapi-project/sm,xapi-project/sm,chandrikas/sm,chandrikas/sm,xapi-project/sm
drivers/mpathutil.py
drivers/mpathutil.py
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # This program 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; version 2.1 only. # # This program is distributed in the hope that it will be u...
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # This program 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; version 2.1 only. # # This program is distributed in the hope that it will be u...
lgpl-2.1
Python
32c7dd65f2c21041bf1aab360e9720aa86d44120
Bump version
machtfit/django-database-email-backend,machtfit/django-database-email-backend
database_email_backend/__init__.py
database_email_backend/__init__.py
#-*- coding: utf-8 -*- VERSION = (0, 2, 1, 'machtfit', 1) __version__ = "0.2.1-machtfit-1" __authors__ = ["Stefan Foulis <stefan.foulis@gmail.com>", ]
#-*- coding: utf-8 -*- VERSION = (0, 2, 1) __version__ = "0.2.1" __authors__ = ["Stefan Foulis <stefan.foulis@gmail.com>", ]
mit
Python
9b822dab3dd1648e709a4c6d0f11279c4fd96c03
Update and_gate.py
kgsn1763/deep-learning-from-scratch,oreilly-japan/deep-learning-from-scratch
ch02/and_gate.py
ch02/and_gate.py
# coding: utf-8 import numpy as np def AND(x1, x2): x = np.array([x1, x2]) w = np.array([0.5, 0.5]) b = -0.7 tmp = (w*x).sum() + b if tmp <= 0: return 0 else: return 1 if __name__ == '__main__': for xs in [(0, 0), (1, 0), (0, 1), (1, 1)]: y = AND(xs[0], xs[1]) ...
# coding: utf-8 import numpy as np def AND(x1, x2): x = np.array([x1, x2]) w = np.array([0.5, 0.5]) b = -0.7 tmp = (w*x).sum() + b if tmp <= 0: return 0 else: return 1 if __name__ == '__main__': for xs in [(0, 0), (1, 0), (0, 1), (1, 1)]: y = AND(xs[0], xs[1]) ...
mit
Python
97ea09d632c8a6014c20749d10f4f17e53d15122
Make test/Interactive/version.py independent of specific copyright years
andrewyoung1991/scons,timj/scons,timj/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,timj/scons,timj/scons,timj/scons,andrewyoung1991/scons,timj/scons
test/Interactive/version.py
test/Interactive/version.py
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mit
Python
465977c2228620877b196e46ca883c743aeed856
Use MockRedis instead of dict to mock redis in unit tests
ronert/cf-predict,ronert/cf-predict
cf_predict/test/conftest.py
cf_predict/test/conftest.py
"""Unit tests configuration file.""" import pickle import numpy as np import pytest from sklearn import linear_model, tree, svm from mockredis import MockRedis from cf_predict import create_app def pytest_configure(config): """Disable verbose output when running tests.""" terminal = config.pluginmanager.get...
"""Unit tests configuration file.""" import pickle import numpy as np import pytest from sklearn import linear_model, tree, svm from cf_predict import create_app def pytest_configure(config): """Disable verbose output when running tests.""" terminal = config.pluginmanager.getplugin('terminal') base = te...
mit
Python
5e782be99fbab045c0fbf1392cfb41ce53edd706
Update game_of_thrones.py
creativcoder/AlgorithmicProblems,creativcoder/AlgorithmicProblems,creativcoder/AlgorithmicProblems,creativcoder/AlgorithmicProblems
hackerrank/IEEEXtremePractice/game_of_thrones.py
hackerrank/IEEEXtremePractice/game_of_thrones.py
#str = 'cdcdcdcdeeeef' str = 'eee' #str = 'aabb' unique_set = [] single_letter = False def extract_unique(input): for i in input: if i not in unique_set: unique_set.append(i) extract_unique(str) print "Unique elements are", unique_set # Testcode def test_eval_odd_inputs(string): for i in unique_set: if ...
str = 'cdcdcdcdeeeef' unique_set = [] single_letter = False def extract_unique(input): for i in input: if i not in unique_set: unique_set.append(i) extract_unique(str) print "unique elements are", unique_set def check_palin(inp): if (len(inp)%2 == 0): for i in unique_set: if not (inp.count(i)%2 == 0):...
mit
Python
f1cf033dedce7b50894999cb4e0f1dd1c9e777ce
Bring my Github up to date, with latest CSP.
zayneanderson/aima-python,AmberJBlue/aima-python,willhess/aima-python,jottenlips/aima-python,JoeLaMartina/aima-python,phaller0513/aima-python,AWPorter/aima-python,chandlercr/aima-python,NolanBecker/aima-python,WhittKinley/aima-python,zayneanderson/aima-python,willhess/aima-python,AWPorter/aima-python,armadill-odyssey/a...
submissions/McLean/myLogic.py
submissions/McLean/myLogic.py
cats = { 'kb': ''' Name(Felis, Catus) Name2(Catus, Cat) Name(Felis, Chaus) Name2(Chaus, JungleCat) Name(Panthera, Tigris) Name2(Tigris, Tiger) Name(Panthera, Onca) Name2(Onca, Jaguar) Name(Panthera, Pardus) Name2(Pardus, Leopared) Name(Panthera, Leo) Name2(Leo, Lion) Name(Felinae, Lynx) Name2(Lynx, Lynx) Name(Ac...
cats = { 'kb': ''' Name(Felis, Catus) Name2(Catus, Cat) Name(Felis, Chaus) Name2(Chaus, JungleCat) Name(Panthera, Tigris) Name2(Tigris, Tiger) Name(Panthera, Onca) Name2(Onca, Jaguar) Name(Panthera, Pardus) Name2(Pardus, Leopared) Name(Panthera, Leo) Name2(Leo, Lion) Name(Felinae, Lynx) Name2(Lynx, Lynx) Name(Ac...
mit
Python
1c7af58f9fabb5edfc559660d742825d3fbdefb0
Add some defaults for form input
Obihoernchen/ChaosWG-Manager,Obihoernchen/ChaosWG-Manager,Obihoernchen/ChaosWG-Manager
chaoswg/forms.py
chaoswg/forms.py
from flask_wtf import FlaskForm from wtforms.fields import StringField, PasswordField, IntegerField, FloatField, SubmitField from wtforms.validators import InputRequired, NumberRange, Optional class LoginForm(FlaskForm): name = StringField(u'Username', validators=[InputRequired()]) password = PasswordField(u'...
from flask_wtf import FlaskForm from wtforms.fields import StringField, PasswordField, IntegerField, FloatField, SubmitField from wtforms.validators import InputRequired, NumberRange, Optional class LoginForm(FlaskForm): name = StringField(u'Username', validators=[InputRequired()]) password = PasswordField(u'...
agpl-3.0
Python
de936b38cc1da06fb010427b66a983ead7409faa
Add method for controlling lights
vortexntnu/rov-control,vortexntnu/rov-control,vortexntnu/rov-control
light/scripts/light_node.py
light/scripts/light_node.py
#!/usr/bin/env python import rospy import Adafruit_BBIO.GPIO as GPIO from vortex_msgs.msg import LightInput from vortex_msgs.msg import Pwm FULL_CYCLE = 4096 GPIO_PIN_MAP = rospy.get_param('/light/gpio_pins') PWM_PIN_MAP = rospy.get_param('/light/pwm_pins') class LightNode(object): def __init__(self): ros...
#!/usr/bin/env python import rospy import Adafruit_BBIO.GPIO as GPIO from vortex_msgs.msg import LightInput from vortex_msgs.msg import Pwm PWM_LIGHT_PIN = 9 # Placeholder FULL_CYCLE = 4096 BT_LIGHT_PIN = "P8_10" # Placeholder RAMAN_LIGHT_PIN = "P8_12" # Placeholder class LightNode(object): def __init__(self): ...
mit
Python
33e1e41e867e996baccddb9a892ec05bbd4f93f9
Fix vote view to work with sharded Choice
disqus/sharding-example,komuW/sharding-example,komuW/sharding-example
polls/views.py
polls/views.py
from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.template import RequestContext from polls.models import Choice, Poll def vote(request, poll_id): p = get_object_or_404(Poll, pk=pol...
from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.template import RequestContext from polls.models import Choice, Poll def vote(request, poll_id): p = get_object_or_404(Poll, pk=pol...
apache-2.0
Python
2b3df42f77c7277369631c1b31266a41526bf90c
Revert the superuser creation in a migration
gregoil/rotest
src/rotest/management/migrations/0002_auto_20150224_1427.py
src/rotest/management/migrations/0002_auto_20150224_1427.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import models as auth_models ADMIN_USERNAME = "rotest" ADMIN_PASSWORD = "rotest" def create_users(apps, schema_editor): qa_group, _ = auth_models.Group.objects.get_or_create(name="QA") l...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import models as auth_models def create_users(apps, schema_editor): qa_group, _ = auth_models.Group.objects.get_or_create(name="QA") localhost, _ = auth_models.User.objects.get_or_create(...
mit
Python
c7ec4e6be21718ed7b9b94aed2815150d8e4b95f
Revert ntob check to imperative style
cherrypy/cheroot
cheroot/test/test_compat.py
cheroot/test/test_compat.py
"""Test Python 2/3 compatibility module.""" from __future__ import unicode_literals import unittest import pytest import six from cheroot import _compat as compat class StringTester(unittest.TestCase): """Tests for string conversion.""" @pytest.mark.skipif(six.PY3, reason='Only useful on Python 2') de...
"""Test Python 2/3 compatibility module.""" from __future__ import unicode_literals import unittest import pytest import six from cheroot import _compat as compat class StringTester(unittest.TestCase): """Tests for string conversion.""" @pytest.mark.skipif(six.PY3, reason='Only useful on Python 2') de...
bsd-3-clause
Python
dedd9eb86b61d79a3ac3247faf22bcdb77224159
Remove username conflict from instructor receivers test.
edx-solutions/edx-platform,edx-solutions/edx-platform,edx-solutions/edx-platform,edx-solutions/edx-platform
lms/djangoapps/instructor/tests/test_receivers.py
lms/djangoapps/instructor/tests/test_receivers.py
# pylint: disable=E1101 """ Run these tests @ Devstack: paver test_system -s lms --test_id=lms/djangoapps/gradebook/tests.py """ from datetime import datetime import uuid from django.conf import settings from django.contrib.auth.models import User from django.test.utils import override_settings from xmodule.modul...
# pylint: disable=E1101 """ Run these tests @ Devstack: paver test_system -s lms --test_id=lms/djangoapps/gradebook/tests.py """ from datetime import datetime import uuid from django.conf import settings from django.contrib.auth.models import User from django.test.utils import override_settings from xmodule.modul...
agpl-3.0
Python
8aaa3cfde073dcbd7a02e650275d7bc98de87fe1
Update affected test.
emedvedev/st2,Plexxi/st2,StackStorm/st2,lakshmi-kannan/st2,nzlosh/st2,nzlosh/st2,tonybaloney/st2,Plexxi/st2,peak6/st2,punalpatel/st2,lakshmi-kannan/st2,pixelrebel/st2,StackStorm/st2,StackStorm/st2,StackStorm/st2,peak6/st2,pixelrebel/st2,lakshmi-kannan/st2,tonybaloney/st2,Plexxi/st2,punalpatel/st2,emedvedev/st2,nzlosh/s...
st2api/tests/unit/controllers/v1/test_pack_config_schema.py
st2api/tests/unit/controllers/v1/test_pack_config_schema.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
Python
3c6f27dfe1f7c51026e3208a63ba92c145909354
Implement memory-efficient rd2sent2doc module
raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten
nn/models/rd2sent2doc.py
nn/models/rd2sent2doc.py
import functools import tensorflow as tf from ..embedding import bidirectional_id_sequence_to_embedding, \ bidirectional_embeddings_to_embedding from ..util import static_shape, static_rank, funcname_scope from ..mlp import mlp from ..dynamic_length import id_tree_to_root_width, id_sequence_to_...
import functools import tensorflow as tf from ..embedding import bidirectional_id_sequence_to_embedding, \ bidirectional_embeddings_to_embedding from ..util import static_shape, static_rank, funcname_scope from ..mlp import mlp from ..dynamic_length import id_tree_to_root_width def rd2sent2d...
unlicense
Python
cce26dd587bc2865ae74a29ed2425829833255f8
Bump version to v0.10.0
OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata
augur/metadata.py
augur/metadata.py
__version__ = '0.10.0'
__version__ = '0.9.8'
mit
Python
a1f9c850aa373622721feca50f8c6e993427ba02
change debug code
AlvinJian/auto_background_changer,AlvinJian/auto_background_changer
autobgch/bgchd.py
autobgch/bgchd.py
#!/usr/bin/python3 import argparse import os import sys import time from autobgch.bgch_libs.daemon_util import * from autobgch.bgch_libs.misc_util import * from autobgch.bgch_libs.bgch_core import * DEBUG=False def run(): parser = argparse.ArgumentParser(description='random wallpaper changer daemon') parser....
#!/usr/bin/python3 import argparse import os import sys import time from autobgch.bgch_libs.daemon_util import * from autobgch.bgch_libs.misc_util import * from autobgch.bgch_libs.bgch_core import * def run(): parser = argparse.ArgumentParser(description='random wallpaper changer daemon') parser.add_argument(...
mit
Python
99da6f0f52b974073c0e220eddb207318d68d8c3
Correct error in autoc/__init__.py
ericfourrier/auto-clean
autoc/__init__.py
autoc/__init__.py
__all__ = ["explorer", "naimputer"] from .explorer import DataExploration from .naimputer import NaImputer from .utils.getdata import get_dataset from .preprocess import PreProcessor
__all__ = ["explorer","naimputer"] from autoc.explorer import DataExploration from autoc.naimputer import NaImputer, missing_map from autoc.utils.helpers import get_dataset
mit
Python
ebd3113a2e18eda31de794217509e37fb269ecd0
Update cnctwo.py
lyelindustries/IPM
basemod/cnctwo.py
basemod/cnctwo.py
from basemod import axis from imputil import point from basemod import laser class CNCXY(): def __init__(self): self.Name = "" self.AxisX = axis.LINAXIS() self.AxisY = axis.LINAXIS() self.Position = point.POINT(0,0,0) self.Limitposition = point.POINT(0,0,0) self.Po...
mit
Python
abc05c9fdfb5918a5220c83e10a3ae6148ae1073
fix dir bug
Gaojiaqi/spark-ec2,Gaojiaqi/spark-ec2,Gaojiaqi/spark-ec2
get_pcap.py
get_pcap.py
#! /usr/bin/env python27 import sys import os import time import subprocess def get_slaves(): slaves = subprocess.check_output(['cat', '/root/spark-ec2/slaves']) return slaves.strip().split('\n') def get_master(): master = subprocess.check_output(['cat', '/root/spark-ec2/masters']).strip() return mast...
#! /usr/bin/env python27 import sys import os import time import subprocess def get_slaves(): slaves = subprocess.check_output(['cat', '/root/spark-ec2/slaves']) return slaves.strip().split('\n') def get_master(): master = subprocess.check_output(['cat', '/root/spark-ec2/masters']).strip() return mast...
apache-2.0
Python
3217305b5bbdbc1c1db120b21d767220289cdb57
Fix Wiki.create_repo()
9h37/pompadour-wiki,9h37/pompadour-wiki,9h37/pompadour-wiki
pompadour_wiki/pompadour_wiki/apps/wiki/models.py
pompadour_wiki/pompadour_wiki/apps/wiki/models.py
# -*- coding: utf-8 -*- from django.core.files.base import ContentFile from django.db.models.signals import post_delete from django.db import models from django.utils.translation import ugettext from django.core.cache import cache from gitstorage.StorageBackend import GitStorage class Wiki(models.Model): name =...
# -*- coding: utf-8 -*- from django.db.models.signals import post_delete from django.db import models from django.utils.translation import ugettext from django.core.cache import cache from gitstorage.StorageBackend import GitStorage class Wiki(models.Model): name = models.CharField(max_length=50) slug = mod...
mit
Python
1ddf644470df00a6cfb92b7361525ceb08b19488
add method to uuid_utils for getting both uuid and proper casing of name
JunctionAt/JunctionWWW,JunctionAt/JunctionWWW,JunctionAt/JunctionWWW
blueprints/uuid_utils.py
blueprints/uuid_utils.py
# Shamelessly stolen from https://github.com/Thezomg/mcapi/ ## Based on Java from https://github.com/Mojang/AccountsClient/ import requests import json AGENT = "minecraft" PROFILE_URL = "https://api.mojang.com/profiles/page/{page}" UUID_PROFILE_URL = 'https://sessionserver.mojang.com/session/minecraft/profile/{uuid}...
# Shamelessly stolen from https://github.com/Thezomg/mcapi/ ## Based on Java from https://github.com/Mojang/AccountsClient/ import requests import json AGENT = "minecraft" PROFILE_URL = "https://api.mojang.com/profiles/page/{page}" UUID_PROFILE_URL = 'https://sessionserver.mojang.com/session/minecraft/profile/{uuid}...
agpl-3.0
Python
1a3342a273068dce01e5a30f14d9b4d392c6e3d8
Fix bug in insert.py print
aherlihy/Monary,aherlihy/Monary
timing/insert.py
timing/insert.py
# Monary - Copyright 2011-2014 David J. C. Beach # Please see the included LICENSE.TXT and NOTICE.TXT for licensing information. import random import pymongo from profile import profile def do_insert(): NUM_BATCHES = 4500 BATCH_SIZE = 1000 # 4500 batches * 1000 per batch = 4.5 million records c = p...
# Monary - Copyright 2011-2014 David J. C. Beach # Please see the included LICENSE.TXT and NOTICE.TXT for licensing information. import random import pymongo from profile import profile def do_insert(): NUM_BATCHES = 4500 BATCH_SIZE = 1000 # 4500 batches * 1000 per batch = 4.5 million records c = p...
apache-2.0
Python
4f706f221e9a764ad82d84ccb504c1c37071d91f
Fix imports
bsipocz/astropy,dhomeier/astropy,stargaser/astropy,StuartLittlefair/astropy,mhvk/astropy,saimn/astropy,mhvk/astropy,pllim/astropy,MSeifert04/astropy,larrybradley/astropy,MSeifert04/astropy,astropy/astropy,pllim/astropy,pllim/astropy,StuartLittlefair/astropy,mhvk/astropy,dhomeier/astropy,pllim/astropy,stargaser/astropy,...
astropy/timeseries/io/kepler.py
astropy/timeseries/io/kepler.py
from ...io import registry from ...table import Table from ...time import Time from ..sampled import SampledTimeSeries __all__ = ['kepler_fits_reader'] def kepler_fits_reader(filename): # Parse Kepler FITS file with regular FITS reader tab = Table.read(filename, format='fits') # Rename columns to lowe...
from ..io import registry from ..table import Table from ..time import Time from .sampled import SampledTimeSeries __all__ = ['kepler_fits_reader'] def kepler_fits_reader(filename): # Parse Kepler FITS file with regular FITS reader tab = Table.read(filename, format='fits') # Rename columns to lowercas...
bsd-3-clause
Python
8033f5b1b52c75b9e6ce8255f76c3828194c7362
Improve typing
AtteqCom/zsl_jwt
src/zsl_jwt/auth/controller.py
src/zsl_jwt/auth/controller.py
""" :mod:`zsl_jwt.controller` ------------------------- Contains the login function. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import http from builtins import * # NOQA from typing import Any # NOQA from ...
""" :mod:`zsl_jwt.controller` ------------------------- Contains the login function. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import http from builtins import * # NOQA from typing import Any # NOQA from...
bsd-2-clause
Python
8a447a6bb89c5a99502c0432345cf492cf0a5e16
Fix django merge conflicts
tkajtoch/python-social-auth,tkajtoch/python-social-auth,tkajtoch/python-social-auth
social/apps/django_app/urls.py
social/apps/django_app/urls.py
"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url from social.utils import setting_name from social.apps.django_app import views extra = getattr(settings, setting_name('TRAILING_SLASH'), Tr...
"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url <<<<<<< HEAD ======= >>>>>>> master from social.utils import setting_name from social.apps.django_app import views extra = getattr(setting...
bsd-3-clause
Python
c610d798ca8db997e3d573b104341b66a232f760
Remove the `request` in the stream python client dependency (#2754)
apache/bookkeeper,apache/bookkeeper,apache/bookkeeper,apache/bookkeeper,apache/bookkeeper,apache/bookkeeper
stream/clients/python/setup.py
stream/clients/python/setup.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 # distributed under th...
# 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 # distributed under th...
apache-2.0
Python
24fae75eb94d99ac9a59580c3d1b8006e22140eb
fix sph to cart
adrn/gary,adrn/gala,adrn/gary,adrn/gala,adrn/gala,adrn/gary
streamteam/coordinates/util.py
streamteam/coordinates/util.py
# coding: utf-8 """ General utilities. """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys # Third-party import numpy as np __all__ = ["cartesian_to_spherical", "spherical_to_cartesian"] def cartesian_to_spherical(x, v): """ ...
# coding: utf-8 """ General utilities. """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys # Third-party import numpy as np __all__ = ["cartesian_to_spherical", "spherical_to_cartesian"] def cartesian_to_spherical(x, v): """ ...
mit
Python
5559a5b6de25719688e829b4c5f77f3b1399b1be
add hack
guillermooo-forks/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle
sublime_plugin_lib/__init__.py
sublime_plugin_lib/__init__.py
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) import logging import os import sublime # If we don't do this, logging will fail sometimes. :-/ logging....
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) import logging import os import sublime class PluginLogger(object): """A logger intented to be used ...
bsd-3-clause
Python
51f6f360a10f167031e828fd095ad6d89910b72b
Add missing allowed hosts
SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui
swh/web/settings/production.py
swh/web/settings/production.py
# Copyright (C) 2017-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information """ Django production settings for swh-web. """ from .common import...
# Copyright (C) 2017-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information """ Django production settings for swh-web. """ from .common import...
agpl-3.0
Python
d35135a3f5bb38ac22e53aebc6d0a7916d8063e8
Fix problem with fetch urls from cairoSVG
taigaio/taiga-back,taigaio/taiga-back,taigaio/taiga-back
taiga/base/utils/thumbnails.py
taiga/base/utils/thumbnails.py
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
agpl-3.0
Python
5006ba126793ecd346476b6d4526732a9823b665
Migrate from list_route to action decorator
erikcw/tasty_rest_framework
tasty_rest_framework/mixins.py
tasty_rest_framework/mixins.py
from django.core.paginator import EmptyPage from django.http import Http404 from .pagination import TastyPagination from .renderers import TastyPieJSONRenderer from .exceptions import MixinException from .serializers import TastyPieHyperlinkedIdentityField, TastyPieHyperlinkedRelatedField from rest_framework.decorators...
from django.core.paginator import EmptyPage from django.http import Http404 from .pagination import TastyPagination from .renderers import TastyPieJSONRenderer from .exceptions import MixinException from .serializers import TastyPieHyperlinkedIdentityField, TastyPieHyperlinkedRelatedField from rest_framework.decorators...
mit
Python
c3b0f43a0dcf900755dc06d87ceb5a9f8699f0ed
fix typo in svelte
tensorflow/lucid,tensorflow/lucid,tensorflow/lucid,tensorflow/lucid
lucid/scratch/web/svelte.py
lucid/scratch/web/svelte.py
import random import json import tempfile import subprocess import os.path as osp from IPython.core.magic import register_cell_magic from lucid.misc.io.showing import _display_html from lucid.misc.io.reading import read _svelte_temp_dir = tempfile.mkdtemp(prefix="svelte_") _template = """ <div id='$id'></div> <...
import random import json import tempfile import subprocess import os.path as osp from IPython.core.magic import register_cell_magic from lucid.misc.io.showing import _display_html from lucid.misc.io.reading import read _svelte_temp_dir = tempfile.mkdtemp(prefix="svelte_") _template = """ <div id='$id'></div> <...
apache-2.0
Python
f7567479ac49f01a8e3c10b265ba064f6ec97fda
create game board for number guessing game
joeryan/interact-python
numbers/numgame-tk.py
numbers/numgame-tk.py
from Tkinter import Tk, Frame, BOTH import numgame class GameBoard(Frame): game = numgame.NumGame() def __init__(self, parent): Frame.__init__(self, parent, background='white') self.parent = parent self.initUI() def initUI(self): self.parent.title("Number Guessing Game") ...
import Tkinter as Tk import numgame game = numgame.NumGame() print game.target
mit
Python
da1d2043079299bde7ee5699e1c7130e7f2b82ef
bump version to 2.7dev
lilydjwg/nvchecker
nvchecker/__init__.py
nvchecker/__init__.py
# MIT licensed # Copyright (c) 2013-2022 lilydjwg <lilydjwg@gmail.com>, et al. __version__ = '2.7dev'
# MIT licensed # Copyright (c) 2013-2022 lilydjwg <lilydjwg@gmail.com>, et al. __version__ = '2.6.1'
mit
Python
bc89f20edbd549d4e166a1db35582047160a158f
Update doorbot-v1.py
RABCbot/DoorButler
Test/doorbot-v1.py
Test/doorbot-v1.py
import time import alsaaudio as aa import pymumble.pymumble_py3 as pymumble import audioop # constants MIC_CHANNELS = 1 # mono MIC_FORMAT = aa.PCM_FORMAT_S16_LE # 16 bits litle-endian MIC_DEPTH = 2 # two bytes per sample MIC_RATE = 8000 # Hz MIC_FRAMESIZE = 1600 # 20 ms MIC_DEVICE = 'plughw:1,0' MUMBL...
import time import alsaaudio as aa import pymumble.pymumble_py3 as pymumble import audioop # constants MIC_CHANNELS = 1 # mono MIC_FORMAT = aa.PCM_FORMAT_S16_LE # 16 bits litle-endian MIC_DEPTH = 2 # two bytes per sample MIC_RATE = 8000 # Hz MIC_FRAMESIZE = 1600 # 20 ms MIC_DEVICE = 'plughw:1,0' MUMBL...
mit
Python
6cea5fffb87bb8fa3f9499d6ba51b8e3c8950a8d
bump version
vmalloc/offlinetb,vmalloc/offlinetb,vmalloc/offlinetb
offlinetb/__version__.py
offlinetb/__version__.py
__version__ = "0.0.7"
__version__ = "0.0.6"
bsd-3-clause
Python
fab9c33ed2e4e8c7c43ecf548dbc49c7b8cfd752
Add parent directory in path by default
rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory
observatory/manage.py
observatory/manage.py
#!/usr/bin/env python import os import os.path import sys if __name__ == "__main__": #Include parent directory in the path by default path = os.path.abspath('../') if path not in sys.path: sys.path.append(path) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "observatory.settings") from...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
isc
Python
865f0c3aee6c7568578a0ce84f6a3732fcb797d1
add idc info adn hardware info
xluren/flask-restful-api
app/openapi/db_model/models.py
app/openapi/db_model/models.py
from app import db from passlib.apps import custom_app_context as password_context class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(32), index=True) password = db.Column(db.String(64)) def __init__(self, username, password): ...
from app import db from passlib.apps import custom_app_context as password_context class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(32), index=True) password = db.Column(db.String(64)) def __init__(self, username, password): ...
mit
Python
a118bbfa632a20062f0f21c4eb0d375709b30cb1
Fix getters on MOJO models (#1442)
h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water,h2oai/sparkling-water
py/ai/h2o/sparkling/ml/models/H2OMOJOModelBase.py
py/ai/h2o/sparkling/ml/models/H2OMOJOModelBase.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
Python
d962bfd70b9d7df3f21d797733e26175e22aa040
sort gene list
mdejongh/CompareGeneContent,mdejongh/CompareGeneContent,mdejongh/CompareGeneContent,mdejongh/CompareGeneContent,mdejongh/CompareGeneContent
lib/CompareGeneContent/CompareGeneContentImpl.py
lib/CompareGeneContent/CompareGeneContentImpl.py
#BEGIN_HEADER from biokbase.workspace.client import Workspace as workspaceService #END_HEADER class CompareGeneContent: ''' Module Name: CompareGeneContent Module Description: A KBase module: CompareGeneContent This sample module contains one small method - count_contigs. ''' ######## WA...
#BEGIN_HEADER from biokbase.workspace.client import Workspace as workspaceService #END_HEADER class CompareGeneContent: ''' Module Name: CompareGeneContent Module Description: A KBase module: CompareGeneContent This sample module contains one small method - count_contigs. ''' ######## WA...
mit
Python
b6d375ac6be7688c944098f07b2f8cab0cd97e29
Add test to exception case for itersubclasses
khchine5/opal,khchine5/opal,khchine5/opal
opal/tests/test_utils.py
opal/tests/test_utils.py
""" Unittests for opal.utils """ from django.test import TestCase from django.db.models import ForeignKey, CharField from opal import utils class StringportTestCase(TestCase): def test_import(self): import collections self.assertEqual(collections, utils.stringport('collections')) def test_im...
""" Unittests for opal.utils """ from django.test import TestCase from django.db.models import ForeignKey, CharField from opal import utils class StringportTestCase(TestCase): def test_import(self): import collections self.assertEqual(collections, utils.stringport('collections')) def test_im...
agpl-3.0
Python
e94b5a747c2e892579229b2bf886c3c02351f491
Fix migration 047 in the case that there aren't actually threads stored.
rmasters/inbox,closeio/nylas,nylas/sync-engine,EthanBlackburn/sync-engine,wakermahmud/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,jobscore/sync-engine,Eagles2F/sync-engine,gale320/sync-engine,Eagles2F/sync-engine,EthanBlackburn/sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,gale320/sync-engine,PriviPK/...
migrations/versions/047_store_more_on_threads.py
migrations/versions/047_store_more_on_threads.py
"""Store more on threads Revision ID: 161b88c17615 Revises: 38d78543f8be Create Date: 2014-06-27 01:46:28.773074 """ # revision identifiers, used by Alembic. revision = '161b88c17615' down_revision = '38d78543f8be' import itertools from alembic import op import sqlalchemy as sa def upgrade(): from inbox.sqlal...
"""Store more on threads Revision ID: 161b88c17615 Revises: 38d78543f8be Create Date: 2014-06-27 01:46:28.773074 """ # revision identifiers, used by Alembic. revision = '161b88c17615' down_revision = '38d78543f8be' import itertools from alembic import op import sqlalchemy as sa def upgrade(): from inbox.sqlal...
agpl-3.0
Python
31c3873f1429f3cd27d07c30da3d390cc92267c7
Update serial_co2_t110.py
jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi
apps/serial/serial_co2_t110.py
apps/serial/serial_co2_t110.py
## This serial code for T110, ELT CO2 sensor ## Please see details for the CO2 sensor data sheet : http://eltsensor.co.kr/2012/eng/pdf/T-110/DS_T-110-3V_ver1.210.pdf ## Author : jeonghoon.kang@gmail.com import serial,os,time import sys import fcntl, socket, struct DEBUG_PRINT = 1 SERIAL_READ_BYTE = 12 def getHwAddr(...
## This serial code for T110, ELT CO2 sensor ## Please see details for the CO2 sensor data sheet : http://eltsensor.co.kr/2012/eng/pdf/T-110/DS_T-110-3V_ver1.210.pdf ## Author : jeonghoon.kang@gmail.com import serial,os,time import sys import fcntl, socket, struct DEBUG_PRINT = 1 SERIAL_READ_BYTE = 12 def getHwAddr(...
bsd-2-clause
Python
d549018970080f6219d31ceb3b0b15f6722816af
Bump to dev version
andela-ooladayo/click,mitsuhiko/click,MakerDAO/click,Nudies/click,her0e1c1/click,ternus/click,cbandera/click,jvrsantacruz/click,glorizen/click,hackebrot/click,Akasurde/click,scalp42/click,lucius-feng/click,pallets/click,willingc/click,ma-ric/click,pgkelley4/click,naoyat/click,hellodk/click,khwilson/click
click/__init__.py
click/__init__.py
# -*- coding: utf-8 -*- """ click ~~~~~ Click is a simple Python module that wraps the stdlib's optparse to make writing command line scripts fun. Unlike other modules, it's based around a simple API that does not come with too much magic and is composable. In case optparse ever gets removed ...
# -*- coding: utf-8 -*- """ click ~~~~~ Click is a simple Python module that wraps the stdlib's optparse to make writing command line scripts fun. Unlike other modules, it's based around a simple API that does not come with too much magic and is composable. In case optparse ever gets removed ...
bsd-3-clause
Python
11b8798367eafafe73b5b29ce4ab5ee75882978f
Update __init__
genkosta/django-editor-ymaps,genkosta/django-editor-ymaps,genkosta/django-editor-ymaps
djeym/__init__.py
djeym/__init__.py
# coding: utf-8 """ $$$$$___$$$$$$__$$$$$__$$__$$__$$___$$ $$__$$______$$__$$______$$$$___$$$_$$$ $$__$$______$$__$$$$_____$$____$$_$_$$ $$__$$__$$__$$__$$_______$$____$$___$$ $$$$$____$$$$___$$$$$____$$____$$___$$ """ VERSION = (1, 2, 2) __title__ = 'DjEYM (django-editor-ymaps)' __version__ = '.'.join(map(str, VERSI...
# coding: utf-8 """ $$$$$___$$$$$$__$$$$$__$$__$$__$$___$$ $$__$$______$$__$$______$$$$___$$$_$$$ $$__$$______$$__$$$$_____$$____$$_$_$$ $$__$$__$$__$$__$$_______$$____$$___$$ $$$$$____$$$$___$$$$$____$$____$$___$$ """ VERSION = (1, 2, 1) __title__ = 'DjEYM (django-editor-ymaps)' __version__ = '.'.join(map(str, VERSI...
mit
Python
08de4a5af64aff1cde4e183cd6a681a33b003007
Make code PEP8 compliant
Necior/md2db
md2db.py
md2db.py
#!/usr/bin/env python import sqlite3 source = "mikro.md" md = open(source) result = [] date = "" content = u"" # extract date and content and remove redundand new lines etc. for line in md: if line[0:3] == "###": if date: date = date.strip() time_formatted = date[...
#!/usr/bin/env python import sqlite3 source = "mikro.md" md = open(source) result = [] date = "" content = u"" # extract date and content and remove redundand new lines etc. for line in md: if line[0:3] == "###": if date: date = date.strip() time_formatted = date[11:] day = ...
mit
Python
a720ce57de97f48f9177728c9c76dc94c43a7211
Update tensorflow.py
vadimkantorov/wigwam
wigs/tensorflow.py
wigs/tensorflow.py
class tensorflow(PipWig): git_uri = 'https://github.com/tensorflow/tensorflow' tarball_uri = 'https://github.com/tensorflow/tensorflow/archive/v{RELEASE_VERSION}.tar.gz' last_release_version = '1.0.1' dependencies = ['bazel', 'numpy'] config_access = ['PATH_TO_NVCC', 'PATH_TO_CUDNN_SO'] supported_features = ['cud...
class tensorflow(PipWig): git_uri = 'https://github.com/tensorflow/tensorflow' tarball_uri = 'https://github.com/tensorflow/tensorflow/archive/v{RELEASE_VERSION}.tar.gz' last_release_version = '1.0.1' dependencies = ['bazel', 'numpy'] config_access = ['PATH_TO_NVCC', 'PATH_TO_CUDNN_SO'] supported_features = ['cud...
mit
Python
3f099fcd78a19d5b785feb2269926d29e4bd1d77
Bump develop version [ci skip]
nephila/djangocms-page-sitemap
djangocms_page_sitemap/__init__.py
djangocms_page_sitemap/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals __version__ = '0.8.1dev1' # pragma: no cover __author__ = 'Iacopo Spalletti <i.spalletti@nephila.it>' # pragma: no cover
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals __version__ = '0.8.0' # pragma: no cover __author__ = 'Iacopo Spalletti <i.spalletti@nephila.it>' # pragma: no cover
bsd-3-clause
Python
eccdf9dd2b8741e1d2500ae7edb0cb7f5cd59da4
Add `__all__` to `__init__py2.py`.
tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets
tensorflow_datasets/__init__py2.py
tensorflow_datasets/__init__py2.py
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
Python
67fcadfa8fd3e6c4161ca4756cc65f0db1386c06
Add OS X GTK to Python path.
fossilet/dotfiles,fossilet/dotfiles,fossilet/dotfiles
usercustomize.py
usercustomize.py
""" Customize Python Interpreter. Link your user customizing file to this file. For more info see: https://docs.python.org/3/library/site.html "Default value is ~/.local/lib/pythonX.Y/site-packages for UNIX and non-framework Mac OS X builds, ~/Library/Python/X.Y/lib/python/site-packages for Mac framework builds, and...
""" Customize Python Interpreter. Link your user customizing file to this file. For more info see: https://docs.python.org/3/library/site.html "Default value is ~/.local/lib/pythonX.Y/site-packages for UNIX and non-framework Mac OS X builds, ~/Library/Python/X.Y/lib/python/site-packages for Mac framework builds, and...
mit
Python
6559d3002cad07f14f59c129e0e8b24724a3d043
Fix bug introduced by better error handling.
locationlabs/confab
confab/resolve.py
confab/resolve.py
""" Resolve environment, role, and host choices into actions. If a user specifies only an environment, confab should target all hosts and roles in that environment. If one or more roles -- or one or more hosts -- are specified explicilty, confab should target a subset. """ from confab.model import get_roles_for_host, ...
""" Resolve environment, role, and host choices into actions. If a user specifies only an environment, confab should target all hosts and roles in that environment. If one or more roles -- or one or more hosts -- are specified explicilty, confab should target a subset. """ from confab.model import get_roles_for_host, ...
apache-2.0
Python
0012b5546b0b5c447c0e074b2f4422d0cb2dfd38
Update JMESPath expression in test
boto/s3transfer
tests/integration/__init__.py
tests/integration/__init__.py
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the 'license' file accompa...
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the 'license' file accompa...
apache-2.0
Python
ad7b1048cc66435e8309b28daebba8f25fde715c
bump to v0.7.3
ValvePython/steam
steam/__init__.py
steam/__init__.py
__version__ = "0.7.3" __author__ = "Rossen Georgiev" version_info = (0, 7, 3) from steam.steamid import SteamID from steam.webapi import WebAPI # proxy object # avoids importing steam.enums.emsg unless it's needed class SteamClient(object): def __new__(cls, *args, **kwargs): from steam.client import Ste...
__version__ = "0.7.2" __author__ = "Rossen Georgiev" version_info = (0, 7, 2) from steam.steamid import SteamID from steam.webapi import WebAPI # proxy object # avoids importing steam.enums.emsg unless it's needed class SteamClient(object): def __new__(cls, *args, **kwargs): from steam.client import Ste...
mit
Python
9fb639fa10b7d1dd14b5cb3c00c17470c9366805
Update models.py
bukson/steampy
steampy/models.py
steampy/models.py
import enum from collections import namedtuple class GameOptions: PredefinedOptions = namedtuple('PredefinedOptions', ['app_id', 'context_id']) STEAM = PredefinedOptions('753', '6') DOTA2 = PredefinedOptions('570', '2') CS = PredefinedOptions('730', '2') TF2 = PredefinedOptions('440', '2') PU...
import enum from collections import namedtuple class GameOptions: PredefinedOptions = namedtuple('PredefinedOptions', ['app_id', 'context_id']) STEAM = PredefinedOptions('753', '6') DOTA2 = PredefinedOptions('570', '2') CS = PredefinedOptions('730', '2') TF2 = PredefinedOptions('440', '2') PU...
mit
Python
29c428ea3ec9c974876a579939d16f5a56569f99
change fdroid to f-droid in config.sample.py
pfalcon/fdroidserver,matlink/fdroidserver,pfalcon/fdroidserver,OneEducation/AppUniverse_Server,f-droid/fdroid-server,matlink/fdroidserver,f-droid/fdroidserver,fantastico/fdroidserver,f-droid/fdroid-server,f-droid/fdroid-server,fantastico/fdroidserver,OneEducation/AppUniverse_Server,f-droid/fdroid-server,fantastico/fdro...
config.sample.py
config.sample.py
#Copy this file to config.py, then amend the settings below according to #your system configuration. sdk_path = "/path/to/android-sdk-linux_86" ndk_path = "/path/to/android-ndk-r8e" #You probably don't need to change this... javacc_path = "/usr/share/java" #Command for running maven 3 (could be mvn, mvn3, or a full...
#Copy this file to config.py, then amend the settings below according to #your system configuration. sdk_path = "/path/to/android-sdk-linux_86" ndk_path = "/path/to/android-ndk-r5" #You probably don't need to change this... javacc_path = "/usr/share/java" #Command for running maven 3 (could be mvn, mvn3, or a full ...
agpl-3.0
Python
e2e6f2956e88f785d9b7681e0030c334868dd24d
Fix pycodestyle error.
mozilla/lumbergh,mozilla/lumbergh,mozilla/lumbergh,glogiotatidis/lumbergh,glogiotatidis/lumbergh,glogiotatidis/lumbergh,glogiotatidis/lumbergh,mozilla/lumbergh
careers/careers/forms.py
careers/careers/forms.py
from django import forms from careers.careers.models import Position class PositionFilterForm(forms.Form): team = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) position_type = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) location = forms.ChoiceField(widget...
from django import forms from careers.careers.models import Position class PositionFilterForm(forms.Form): team = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) position_type = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) location = forms.ChoiceField(widget...
mpl-2.0
Python
4219ebc9a1d3d20239f4e467a52e9382193b8b76
Bump version number to next dev
docker/docker-py,auready/docker-py,docker/docker-py,auready/docker-py,vdemeester/docker-py,vpetersson/docker-py,vpetersson/docker-py,youhong316/docker-py,kaiyou/docker-py,funkyfuture/docker-py,kaiyou/docker-py,dimaspivak/docker-py,vdemeester/docker-py,dimaspivak/docker-py,youhong316/docker-py,funkyfuture/docker-py
docker/version.py
docker/version.py
version = "2.1.0-dev" version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
version = "2.0.0" version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
apache-2.0
Python
65d83da70c7257e093692d25ea18c4c6bbd0109f
fix syntax error
DongjunLee/kino-bot
tests/slack_listenser_test.py
tests/slack_listenser_test.py
import json import unittest from kino.listener import MsgListener class MsgListenerTest(unittest.TestCase): test_presence_msg = { "type": "presence_change", "presence": "away" } def test_is_presence(self): self.assertEqual(MsgListener().is_presence(self.test_presence_msg), True...
import json import unittest from kino.listener import MsgListener class MsgListenerTest(unittest.TestCase): test_presence_msg = { "type": "presence_change", "presence": "away" } def test_is_presence(self): self.assertEqual(MsgListener().is_presence(self.test_presence_msg), True...
mit
Python
f1b3a3f78bebf8750ceac60b852cf031f7d78e36
Use recipes licenses.
ikonst/cerbero,AlertMe/cerbero,nirbheek/cerbero-old,superdump/cerbero,brion/cerbero,atsushieno/cerbero,jackjansen/cerbero-2013,freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,brion/cerbero,ylatuya/cerbero,centricular/cerbero,multipath-rtp/cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,nirbheek/cerber...
cerbero/commands/info.py
cerbero/commands/info.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
Python
49e8a81c78ed1b66d0b4dae0d186165f176bec1d
Add simulation plot tests for trial
kbsezginel/tee_mof,kbsezginel/tee_mof
tests/test_simulation_plot.py
tests/test_simulation_plot.py
""" Tests Simulation class read method """ import os import yaml import numpy as np from teemof import Simulation from teemof.parameters import k_parameters k_ref_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'thermal-conductivity.yaml') time_ref_file = os.path.join(os.path.abspath(os.path.dirname(_...
""" Tests Simulation class read method """ import os import yaml import numpy as np from teemof import Simulation from teemof.parameters import k_parameters k_ref_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'thermal-conductivity.yaml') time_ref_file = os.path.join(os.path.abspath(os.path.dirname(_...
mit
Python
062adc56202ecd9d0714d34baa303cd26bf510a4
Add some documentation
gdetrez/fscons-ticketshop,gdetrez/fscons-ticketshop,gdetrez/fscons-ticketshop
ticketshop/ticketapp/admin.py
ticketshop/ticketapp/admin.py
from django.contrib import admin from .models import TicketPurchase, Ticket, TicketType, Coupon # ~~~ Ticket purchase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class TicketInline(admin.TabularInline): """ This is used to displayed the purchased ticket inline in the page showing the details o...
from django.contrib import admin from .models import TicketPurchase, Ticket, TicketType, Coupon class TicketInline(admin.TabularInline): model = Ticket extra = 1 def mark_selected_paid(modeladmin, request, queryset): for purchase in queryset: purchase.mark_as_paid() mark_selected_paid.short_descri...
mit
Python
4567bf8044ece7b4ef5ccc9cf81a7dac7bcab017
Correct unicode for access tokens
takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web
takeyourmeds/groups/models.py
takeyourmeds/groups/models.py
import datetime import functools from django.db import models from django.utils.crypto import get_random_string from .managers import GroupManager class Group(models.Model): """ Instances must be created using ``Group.objects.create_group`` to ensure Stripe is configured correctly. """ name = mo...
import datetime import functools from django.db import models from django.utils.crypto import get_random_string from .managers import GroupManager class Group(models.Model): """ Instances must be created using ``Group.objects.create_group`` to ensure Stripe is configured correctly. """ name = mo...
mit
Python
f6118478b06ebdbcddf2c21664ebbf6c1f4d74e0
fix ci
googlefonts/gftools,googlefonts/gftools
bin/gftools-test-gf-coverage.py
bin/gftools-test-gf-coverage.py
#!/usr/bin/env python3 # Copyright 2016 The Fontbakery Authors # Copyright 2017 The Google Fonts Tools Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
#!/usr/bin/env python3 # Copyright 2016 The Fontbakery Authors # Copyright 2017 The Google Fonts Tools Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
apache-2.0
Python
8dfb26d5aa6ea15afb319c00d909ee7185ca703c
Update witnesslint tool-info.
dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,sosy-lab/benchexec,dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec
benchexec/tools/witnesslint.py
benchexec/tools/witnesslint.py
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.result as result import benchexec.tools.template class Tool(benchexec.t...
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.result as result import benchexec.tools.template class Tool(benchexec.t...
apache-2.0
Python
61ea8ac67279cb46800237546384cf2e85180d1b
Test order file with both dsym and dwarf combination.
apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb
test/order/TestOrderFile.py
test/order/TestOrderFile.py
""" Test that debug symbols have the correct order as specified by the order file. """ import os, time import re import unittest2 import lldb from lldbtest import * class OrderFileTestCase(TestBase): mydir = "order" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_wit...
""" Test that debug symbols have the correct order as specified by the order file. """ import os, time import re import unittest2 import lldb from lldbtest import * class OrderFileTestCase(TestBase): mydir = "order" def test_order_file(self): """Test debug symbols follow the correct order by the ord...
apache-2.0
Python
50b96f1021f9dce85dad1b9c3d4c45f25cb1076b
update mentor program office hour factory
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/tests/factories/mentor_program_office_hour_factory.py
accelerator/tests/factories/mentor_program_office_hour_factory.py
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals import swapper from datetime import ( date, datetime, time, timedelta, ) from factory import ( DjangoModelFactory, Sequence, SubFactory, ) from pytz import utc from accelerator.apps import Accel...
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals import swapper from datetime import ( date, datetime, time, timedelta, ) from factory import ( DjangoModelFactory, Sequence, SubFactory, ) from pytz import utc from accelerator.apps import Accel...
mit
Python
e22794f07c6d1027e16617ac6874289794080967
Replace partial domain by (1,'=',1)
sergio-incaser/bank-payment,sergio-incaser/bank-payment,sergiocorato/bank-payment,damdam-s/bank-payment,rlizana/bank-payment,CompassionCH/bank-payment,incaser/bank-payment,sergiocorato/bank-payment,Antiun/bank-payment,sergio-teruel/bank-payment,rlizana/bank-payment,ndtran/bank-payment,David-Amaro/bank-payment,sergio-te...
account_payment_include_draft_move/wizard/payment_order_create.py
account_payment_include_draft_move/wizard/payment_order_create.py
# -*- coding: utf-8 -*- # ############################################################################## # # Authors: Adrien Peiffer # Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
# -*- coding: utf-8 -*- # ############################################################################## # # Authors: Adrien Peiffer # Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
agpl-3.0
Python
c9ba962d37c6beaee2e58cac029e8a1201fd7937
Refactor Keyring
hamzasheikh/testbin
testbin/keyring/keyring_.py
testbin/keyring/keyring_.py
import os from os.path import basename import keyring import keyrings class EncryptedKeyring_(keyrings.alt.file.EncryptedKeyring): def _unlock(self): """ Unlock this keyring by getting the password for the keyring from an environment variable. Overriding function because original require...
import os from os.path import basename import keyring import keyrings service = "testbin" # Change this value based on your requirements class EncryptedKeyring_(keyrings.alt.file.EncryptedKeyring): def _unlock(self): """ Unlock this keyring by getting the password for the keyring from an enviro...
mit
Python
1fd2299b2a0c993bd463ab88c0a7544ade2c945b
Remove init mrthod from disk test
vrovachev/kaspersky-framework
test_kasp/disk/test_disk.py
test_kasp/disk/test_disk.py
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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 (c) 2013 Hewlett-Packard Development Company, L.P. # # 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
7580c63433f1b79a5146ff6e1d333a1c73900f55
add category for AS number
amuehlem/misp-modules,VirusTotal/misp-modules,MISP/misp-modules,amuehlem/misp-modules,VirusTotal/misp-modules,MISP/misp-modules,MISP/misp-modules,VirusTotal/misp-modules,amuehlem/misp-modules
misp_modules/modules/expansion/onyphe.py
misp_modules/modules/expansion/onyphe.py
import json # -*- coding: utf-8 -*- import json try: from onyphe import Onyphe except ImportError: print("pyonyphe module not installed.") misperrors = {'error': 'Error'} mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domains'], 'output': ['hostname', 'domain', 'ip-src', 'ip-dst','url']} # poss...
import json # -*- coding: utf-8 -*- import json try: from onyphe import Onyphe except ImportError: print("pyonyphe module not installed.") misperrors = {'error': 'Error'} mispattributes = {'input': ['ip-src', 'ip-dst', 'hostname', 'domains'], 'output': ['hostname', 'domain', 'ip-src', 'ip-dst','url']} # poss...
agpl-3.0
Python
ab4860b88013598b21ff8c5a99beb2fba614b0d3
Change capture usage.
LegionXI/pydarkstar,AdamGagorik/pydarkstar
pydarkstar/auction/cleaner.py
pydarkstar/auction/cleaner.py
""" .. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com> """ from pydarkstar.tables.auction_house import AuctionHouse import pydarkstar.auction.auctionbase import pydarkstar.database class Cleaner(pydarkstar.auction.auctionbase.AuctionBase): """ Auction House cleaner. :param db: database object """...
""" .. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com> """ from pydarkstar.tables.auction_house import AuctionHouse import pydarkstar.auction.auctionbase import pydarkstar.database class Cleaner(pydarkstar.auction.auctionbase.AuctionBase): """ Auction House cleaner. :param db: database object """...
mit
Python
a52559144fa242c4b45ddb7f76f4151dee79e42d
Fix for bytes magic
benesch/pip,techtonik/pip,atdaemon/pip,xavfernandez/pip,sbidoul/pip,zvezdan/pip,sbidoul/pip,rouge8/pip,fiber-space/pip,atdaemon/pip,fiber-space/pip,mindw/pip,sigmavirus24/pip,pradyunsg/pip,sigmavirus24/pip,dstufft/pip,xavfernandez/pip,dstufft/pip,zvezdan/pip,atdaemon/pip,rouge8/pip,pfmoore/pip,pfmoore/pip,benesch/pip,d...
pip/utils/encoding.py
pip/utils/encoding.py
import codecs import locale import re BOMS = [ (codecs.BOM_UTF8, 'utf8'), (codecs.BOM_UTF16, 'utf16'), (codecs.BOM_UTF16_BE, 'utf16-be'), (codecs.BOM_UTF16_LE, 'utf16-le'), (codecs.BOM_UTF32, 'utf32'), (codecs.BOM_UTF32_BE, 'utf32-be'), (codecs.BOM_UTF32_LE, 'utf32-le'), ] ENCODING_RE = r...
import codecs import locale import re BOMS = [ (codecs.BOM_UTF8, 'utf8'), (codecs.BOM_UTF16, 'utf16'), (codecs.BOM_UTF16_BE, 'utf16-be'), (codecs.BOM_UTF16_LE, 'utf16-le'), (codecs.BOM_UTF32, 'utf32'), (codecs.BOM_UTF32_BE, 'utf32-be'), (codecs.BOM_UTF32_LE, 'utf32-le'), ] ENCODING_RE = r...
mit
Python
27c4c336578743f86226fdc9269bbd3f59d64a6a
Update P02_parseHTML added select() method example
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter11/P02_parseHTML.py
books/AutomateTheBoringStuffWithPython/Chapter11/P02_parseHTML.py
# This program uses requests to fetch an HTML page and BeautifulSoup to parse it import requests, bs4 # Creating a BeautifulSoup Object from HTML res = requests.get("http://nostarch.com") res.raise_for_status() # Raise error if nothing fetched noStarchSoup = bs4.BeautifulSoup(res.text, "lxml") # Specify parser to a...
# This program uses requests to fetch an HTML page and BeautifulSoup to parse it import requests, bs4 # Creating a BeautifulSoup Object from HTML res = requests.get("http://nostarch.com") res.raise_for_status() # Raise error if nothing fetched noStarchSoup = bs4.BeautifulSoup(res.text, "lxml") # Specify parser to a...
mit
Python
f7b32ea450b2f1006f8b03dd6bbd85f7b4280ba0
Add customization options to twill generator
storborg/pyweaving
pyweaving/generators/twill.py
pyweaving/generators/twill.py
from .. import Draft, Thread def twill(size=2, warp_color=(0, 0, 100), weft_color=(255, 255, 255)): # float=2 --> 2/2 twill # float=3 --> 3/3 twill # float=4 --> 4/4 twill # etc # we'll need 2 shafts / treadles per float thread shafts = 2 * size draft = Draft(num_shafts=shafts, num_treadl...
from .. import Draft, Thread def twill(size=2): # float=2 --> 2/2 twill # float=3 --> 3/3 twill # float=4 --> 4/4 twill # etc # we'll need 2 shafts / treadles per float thread shafts = 2 * size draft = Draft(num_shafts=shafts, num_treadles=shafts) # do tie-up for ii in range(shaf...
mit
Python