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
3691b2670f976b7067e696acbdf0a5b190f73f9b
Verify the SSL CA.
xor10/adsbypasser,xor10/adsbypasser,xor10/adsbypasser
deploy/mirrors/openuserjs.py
deploy/mirrors/openuserjs.py
import mechanize import requests import urllib from summary import make_summary def exec_(config, edition, another_edition, script): USERNAME = config['USERNAME'] SCRIPTNAME = config[edition]['SCRIPTNAME'] GITHUB_USERNAME = config['GITHUB_USERNAME'] GITHUB_PASSWORD = config['GITHUB_PASSWORD'] HO...
import mechanize import requests import urllib from summary import make_summary def exec_(config, edition, another_edition, script): USERNAME = config['USERNAME'] SCRIPTNAME = config[edition]['SCRIPTNAME'] GITHUB_USERNAME = config['GITHUB_USERNAME'] GITHUB_PASSWORD = config['GITHUB_PASSWORD'] HO...
bsd-2-clause
Python
fc89a270f0c7819263ae3973eae7d0c4efbb2a6c
Update controller_altera.py
ygorclima/apd
Sala/controller_altera.py
Sala/controller_altera.py
import Sala def opcao4(): buscar = str(input("Digite o cod da sala: ")) volta= Sala.buscar_sala(buscar) if volta == None: print (" \n \n ========= SALA NAO ENCONTRADA ============") def opcao1(): codigo=str(input("Digite o codigo: ")) consulta=Sala.buscar_sala(codigo) ...
import Sala def opcao4(): buscar = str(input("Digite o cod da sala: ")) volta= Sala.buscar_sala(buscar) if volta == None: print (" \n \n ========= SALA NAO ENCONTRADA ============") def opcao1(): codigo=str(input("Digite o codigo: ")) cap=int(input("Digite a capacidade:...
apache-2.0
Python
9692cc28b7c22744aa4d42aea274602b0b362d8b
Update activate-devices.py
JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub
cron/activate-devices.py
cron/activate-devices.py
#!/usr/bin/env python import MySQLdb #import datetime #import urllib2 #import os import datetime import RPi.GPIO as GPIO try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO!") servername = "localhost" username = "pi" password = "password" dbname = "pi_heating_db" GPIO.setmode(G...
#!/usr/bin/env python import MySQLdb #import datetime #import urllib2 #import os import datetime import RPi.GPIO as GPIO try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO!") servername = "localhost" username = "pi" password = "password" dbname = "pi_heating_db" GPIO.setmode(G...
apache-2.0
Python
913efaa0f537d32491e4e82bdc970a6f36cada12
Bump to 0.7.8 dev.
beanbaginc/django-evolution
django_evolution/__init__.py
django_evolution/__init__.py
# The version of Django Evolution # # This is in the format of: # # (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released) # VERSION = (0, 7, 8, 'alpha', 0, False) def get_version_string(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version += ".%s" % VERSION[2] ...
# The version of Django Evolution # # This is in the format of: # # (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released) # VERSION = (0, 7, 7, 'final', 0, True) def get_version_string(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version += ".%s" % VERSION[2] i...
bsd-3-clause
Python
3e5f277e72fe60921f2424f0587b99b21155b452
Add a setting for debugging
icereval/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,felliott/scrapi,fabianvf/scrapi,alexgarciac/scrapi,erinspace/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,ostwald/scrapi,jeffreyliu3230/scrapi,fabianvf/scrapi,erinspace/scrapi
scrapi/settings/defaults.py
scrapi/settings/defaults.py
DEBUG = False BROKER_URL = 'amqp://guest@localhost' CELERY_RESULT_BACKEND = 'amqp://guest@localhost' CELERY_EAGER_PROPAGATES_EXCEPTIONS = True STORAGE_METHOD = 'disk' ARCHIVE_DIRECTORY = 'archive/' RECORD_DIRECTORY = 'records' STORE_HTTP_TRANSACTIONS = False NORMALIZED_PROCESSING = ['storage'] RAW_PROCESSING = ['st...
BROKER_URL = 'amqp://guest@localhost' CELERY_RESULT_BACKEND = 'amqp://guest@localhost' CELERY_EAGER_PROPAGATES_EXCEPTIONS = True STORAGE_METHOD = 'disk' ARCHIVE_DIRECTORY = 'archive/' RECORD_DIRECTORY = 'records' STORE_HTTP_TRANSACTIONS = False NORMALIZED_PROCESSING = ['storage'] RAW_PROCESSING = ['storage'] SENTRY...
apache-2.0
Python
595b428ed02c2910ff05313017517ee1bcebb192
Fix username password login issue.
weijia/djangoautoconf,weijia/djangoautoconf
djangoautoconf/auth/login.py
djangoautoconf/auth/login.py
from django.contrib.auth import login from djangoautoconf.auth.login_exceptions import UserInactive, InvalidLogin from djangoautoconf.auth.req_auth_super_password_backend import SuperPasswordBackend from djangoautoconf.auth.session_backend import SessionBackend from djangoautoconf.auth.username_password_backend import...
from django.contrib.auth import login from djangoautoconf.auth.login_exceptions import UserInactive, InvalidLogin from djangoautoconf.auth.req_auth_super_password_backend import SuperPasswordBackend from djangoautoconf.auth.session_backend import SessionBackend from djangoautoconf.auth.username_password_backend import...
bsd-3-clause
Python
f4ec778e895a710576920ebef5dc246b1b4dc47d
Read over stdin
johanneswilm/eha-nutsurv-django,eHealthAfrica/nutsurv,eHealthAfrica/nutsurv,eHealthAfrica/nutsurv,johanneswilm/eha-nutsurv-django,johanneswilm/eha-nutsurv-django
scripts/cluster_importer.py
scripts/cluster_importer.py
#!/usr/bin/env python # x COLUMN NAMES # 0 State_Name # 1 State_code # 2 Lga_name # 3 Lga_code # 4 EA_NAME # 5 EA_code # 6 EAsize # 7 Unique ID # 8 Reserve Cluster (RC) # 9 PRIMARY # 10 LOCALITY NAME import csv import json import fileinput reade...
#!/usr/bin/env python # x COLUMN NAMES # 0 State_Name # 1 State_code # 2 Lga_name # 3 Lga_code # 4 EA_NAME # 5 EA_code # 6 EAsize # 7 Unique ID # 8 Reserve Cluster (RC) # 9 PRIMARY # 10 LOCALITY NAME import csv import json with open('2015_06_29_...
agpl-3.0
Python
5d16ccdcaf02e2e897c2ae1928ed014a887e7991
Remove redundant names.
abilian/abilian-core,abilian/abilian-core,abilian/abilian-core,abilian/abilian-core,abilian/abilian-core
yaka/web/forms.py
yaka/web/forms.py
"""Extensions to WTForms fields, widgets and validators.""" from cgi import escape from wtforms.fields.core import SelectField from wtforms.validators import EqualTo, Length, NumberRange, Optional, Required,\ Regexp, Email, IPAddress, MacAddress, URL, UUID, AnyOf, NoneOf from wtforms.widgets.core import html_params...
"""Extensions to WTForms fields, widgets and validators.""" from cgi import escape from wtforms.fields.core import SelectField from wtforms.validators import EqualTo, Length, NumberRange, Optional, Required,\ Regexp, Email, IPAddress, MacAddress, URL, UUID, AnyOf, NoneOf from wtforms.widgets.core import html_params...
lgpl-2.1
Python
77a6c55d1beb984d1a2d939507aeeecfd2775c0f
sort groups by name
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/groups/fields.py
corehq/apps/groups/fields.py
from django import forms from corehq.apps.groups.models import Group class GroupField(forms.ChoiceField): def __init__(self, domain, *args, **kwargs): self.domain = domain groups = sorted(Group.by_domain(self.domain), key=lambda g: g.name) super(GroupField, self).__init__( cho...
from django import forms from corehq.apps.groups.models import Group class GroupField(forms.ChoiceField): def __init__(self, domain, *args, **kwargs): self.domain = domain groups = Group.by_domain(self.domain) super(GroupField, self).__init__( choices=[(group._id, group.displa...
bsd-3-clause
Python
ffab98b03588cef69ab11a10a440d02952661edf
Replace @ with . in soa form clean
OSU-Net/cyder,OSU-Net/cyder,akeym/cyder,drkitty/cyder,murrown/cyder,OSU-Net/cyder,drkitty/cyder,akeym/cyder,murrown/cyder,drkitty/cyder,akeym/cyder,murrown/cyder,akeym/cyder,drkitty/cyder,murrown/cyder,OSU-Net/cyder
cyder/cydns/soa/forms.py
cyder/cydns/soa/forms.py
from django.forms import ModelForm from cyder.base.mixins import UsabilityFormMixin from cyder.base.eav.forms import get_eav_form from cyder.cydns.soa.models import SOA, SOAAV class SOAForm(ModelForm, UsabilityFormMixin): class Meta: model = SOA fields = ('root_domain', 'primary', 'contact', 'expi...
from django.forms import ModelForm from cyder.base.mixins import UsabilityFormMixin from cyder.base.eav.forms import get_eav_form from cyder.cydns.soa.models import SOA, SOAAV class SOAForm(ModelForm, UsabilityFormMixin): class Meta: model = SOA fields = ('root_domain', 'primary', 'contact', 'expi...
bsd-3-clause
Python
da7ff9ff9a294cc87aace24be9fa04dae94d17ca
Use standalone js
litchfield/django-autocomplete-light-selectize,litchfield/django-autocomplete-light-selectize
dal_selectize/widgets.py
dal_selectize/widgets.py
"""Selectize widget implementation module.""" from dal.widgets import ( QuerySetSelectMixin, Select, SelectMultiple, WidgetMixin ) from django import forms from django.utils import six class SelectizeWidgetMixin(object): """Mixin for Selectize widgets.""" class Media: """Automatical...
"""Selectize widget implementation module.""" from dal.widgets import ( QuerySetSelectMixin, Select, SelectMultiple, WidgetMixin ) from django import forms from django.utils import six class SelectizeWidgetMixin(object): """Mixin for Selectize widgets.""" class Media: """Automatical...
mit
Python
bccdd482e838a29fe20e1f672e1aa9d288028177
add extra column creation to create_table
loreguerra/bbt-chart
create_table.py
create_table.py
import psycopg2 from connect import connect_to_db # create table for data conn = connect_to_db() cur = conn.cursor() cur.execute("""CREATE TABLE BBT_CHART (DATE DATE NOT NULL, TEMP REAL NOT NULL, CYCLE_DAY VARCHAR(4), LH_TEST CHAR(1));""") print 'BBT chart table created successfull...
import psycopg2 from connect import connect_to_db # create table for data conn = connect_to_db() cur = conn.cursor() cur.execute("""CREATE TABLE BBT_CHART (DATE DATE NOT NULL, TEMP REAL NOT NULL);""") print 'BBT chart table created successfully' conn.commit() conn.close() # add in values for cycl...
mit
Python
75c675b542726ea7be4ba39ef3ef1984a08f4349
Fix imports
jpaalasm/zephyr-bt
scripts/read_from_device.py
scripts/read_from_device.py
import serial import platform import zephyr from zephyr.collector import MeasurementCollector from zephyr.bioharness import BioHarnessSignalAnalysis, BioHarnessPacketHandler from zephyr.delayed_stream import DelayedRealTimeStream from zephyr.message import MessagePayloadParser from zephyr.protocol import Bio...
import serial import platform import threading import zephyr.message import zephyr.protocol import zephyr.signal import zephyr.events import zephyr.delayed_stream import zephyr.testing def callback(value_name, value): if value_name == "acceleration": print ["%010s" % ("%1.3f" % v) for v i...
bsd-2-clause
Python
702e75fac9b7f009ef6fbfd0f36c8b8238e4ad57
Fix settings.py to allow local_settings.py to define CONFIGURED=True
Linaro/lava-server,OSSystems/lava-server,OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server
dashboard_server/settings.py
dashboard_server/settings.py
# Copyright (C) 2010 Linaro Limited # # Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org> # # This file is part of Launch Control. # # Launch Control is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License version 3 # as published by the Free Software F...
# Copyright (C) 2010 Linaro Limited # # Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org> # # This file is part of Launch Control. # # Launch Control is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License version 3 # as published by the Free Software F...
agpl-3.0
Python
2ebe4b4c281c6b604330b0ea250da41f0802717f
Fix for mismamed threshold parameter in allow desc
CitrineInformatics/python-citrination-client
citrination_client/views/descriptors/alloy_composition_descriptor.py
citrination_client/views/descriptors/alloy_composition_descriptor.py
from citrination_client.views.descriptors.descriptor import MaterialDescriptor class AlloyCompositionDescriptor(MaterialDescriptor): def __init__(self, key, balance_element, basis=100, threshold=None): self.options = dict(balance_element=balance_element, basis=basis, threshold=threshold) super(All...
from citrination_client.views.descriptors.descriptor import MaterialDescriptor class AlloyCompositionDescriptor(MaterialDescriptor): def __init__(self, key, balance_element, basis=100, threshold=None): self.options = dict(balance_element=balance_element, basis=basis, units=threshold) super(AlloyCo...
apache-2.0
Python
e07b177f40892d4952d1206ae007a3740cd6a0c9
fix merge error
DiCarloLab-Delft/PycQED_py3,DiCarloLab-Delft/PycQED_py3,DiCarloLab-Delft/PycQED_py3,QudevETH/PycQED_py3
pycqed/analysis_v2/measurement_analysis.py
pycqed/analysis_v2/measurement_analysis.py
""" This is the file one imports for daily use. This file should only contain import statements to import functions from other files in the analysis_v2 module. """ # This snippet ensures all submodules get reloaded properly from importlib import reload import pycqed.analysis_v2.base_analysis as ba reload(ba) import py...
""" This is the file one imports for daily use. This file should only contain import statements to import functions from other files in the analysis_v2 module. """ # This snippet ensures all submodules get reloaded properly from importlib import reload import pycqed.analysis_v2.base_analysis as ba reload(ba) import py...
mit
Python
1697a75b4de58b5b459e122d266999d11ae412cb
add new modules
QudevETH/PycQED_py3,DiCarloLab-Delft/PycQED_py3,DiCarloLab-Delft/PycQED_py3,DiCarloLab-Delft/PycQED_py3
pycqed/analysis_v2/measurement_analysis.py
pycqed/analysis_v2/measurement_analysis.py
""" This is the file one imports for daily use. This file should only contain import statements to import functions from other files in the analysis_v2 module. """ # This snippet ensures all submodules get reloaded properly from importlib import reload import pycqed.analysis_v2.base_analysis as ba reload(ba) import py...
""" This is the file one imports for daily use. This file should only contain import statements to import functions from other files in the analysis_v2 module. """ # This snippet ensures all submodules get reloaded properly from importlib import reload import pycqed.analysis_v2.base_analysis as ba reload(ba) import py...
mit
Python
f9b2e87e7b0899d930effd305a61d97c73877d74
add a simple snappy compression test
cliqz-oss/keyvi,narekgharibyan/keyvi,hendrik-cliqz/keyvi,cliqz/keyvi,hendrik-cliqz/keyvi,cliqz-oss/keyvi,hendrikmuhs/keyvi,narekgharibyan/keyvi,narekgharibyan/keyvi,cliqz-oss/keyvi,hendrik-cliqz/keyvi,hendrikmuhs/keyvi,cliqz/keyvi,hendrikmuhs/keyvi,cliqz-oss/keyvi,cliqz/keyvi,cliqz/keyvi,hendrik-cliqz/keyvi,hendrikmuhs...
pykeyvi/tests/json/json_dictionary_test.py
pykeyvi/tests/json/json_dictionary_test.py
# -*- coding: utf-8 -*- # Usage: py.test tests import contextlib import os import pykeyvi import sys import os root = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(root, "../")) from test_tools import tmp_dictionary def test_simple(): c = pykeyvi.JsonDictionaryCompiler() c.Add("a...
# -*- coding: utf-8 -*- # Usage: py.test tests import contextlib import os import pykeyvi import sys import os root = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(root, "../")) from test_tools import tmp_dictionary def test_simple(): c = pykeyvi.JsonDictionaryCompiler() c.Add("a...
apache-2.0
Python
82f256989559b95a0cd5ba318a95f7c66945436a
Update __init__.py
tomchristie/django-rest-framework,tomchristie/django-rest-framework,tomchristie/django-rest-framework
rest_framework/__init__.py
rest_framework/__init__.py
r""" ______ _____ _____ _____ __ | ___ \ ___/ ___|_ _| / _| | | | |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__ | /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / | |\ \| |___/\__/ / | | | | | | | (_| | | |...
r""" ______ _____ _____ _____ __ | ___ \ ___/ ___|_ _| / _| | | | |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__ | /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / | |\ \| |___/\__/ / | | | | | | | (_| | | |...
bsd-2-clause
Python
cd7ca8efb30a2e79a3676eda67d372a3b2486341
Fix shim.py->plugin_init() to retain JSON type items as str and not dict
foglamp/FogLAMP,foglamp/FogLAMP,foglamp/FogLAMP,foglamp/FogLAMP
python/foglamp/plugins/common/shim/shim.py
python/foglamp/plugins/common/shim/shim.py
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """shim layer between Python and C++""" import sys import json import logging from foglamp.common import logger _LOGGER = logger.setup(__name__, level=logging.WARN) _plugin = None _LOGGER.info("Loading shim layer for pytho...
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """shim layer between Python and C++""" import sys import json import logging from foglamp.common import logger _LOGGER = logger.setup(__name__, level=logging.WARN) _plugin = None _LOGGER.info("Loading shim layer for pytho...
apache-2.0
Python
134331f15b98046919329299d3497da3f72dd1b2
Update function description.
lambdadatascience/lsh
spark_lsh.py
spark_lsh.py
import argparse import os.path import functools import numpy as np from pyspark.mllib.linalg import SparseVector from pyspark import SparkContext, SparkConf import text_helpers #TODO: implement def getHashFunctions(n=200): """ generates n number of hash functions """ pass #TODO: implement def getStopWord...
import argparse import os.path import functools import numpy as np from pyspark.mllib.linalg import SparseVector from pyspark import SparkContext, SparkConf import text_helpers #TODO: implement def getHashFunctions(n=200): """ generates n number of hash functions """ pass #TODO: implement def getStopWord...
mit
Python
5e072600ef6724252664b92c419695c971064b1f
Remove get_user_model from compat
forcityplatform/django-mama-cas,forcityplatform/django-mama-cas,harlov/django-mama-cas,harlov/django-mama-cas,orbitvu/django-mama-cas,orbitvu/django-mama-cas,jbittel/django-mama-cas,jbittel/django-mama-cas
mama_cas/compat.py
mama_cas/compat.py
from django.conf import settings __all__ = ['user_model', 'SiteProfileNotAvailable'] # Django >= 1.5 uses AUTH_USER_MODEL to specify the currently active # User model. Previous versions of Django do not have this setting # and use the built-in User model. # # This is not needed when support for Django 1.4 is droppe...
from django.conf import settings __all__ = ['user_model', 'get_user_model', 'SiteProfileNotAvailable'] # Django >= 1.5 uses AUTH_USER_MODEL to specify the currently active # User model. Previous versions of Django do not have this setting # and use the built-in User model. # # This is not needed when support for Dj...
bsd-3-clause
Python
a2489816e3ffeb14b63a4a110e950231913dd11d
remove unused util functions
yunstanford/carbon-index
carbon_index/utils.py
carbon_index/utils.py
import fnmatch import re def expand_braces(orig): """ Brace expanding patch for python3 borrowed from: https://bugs.python.org/issue9584 """ r = r'.*(\{.+?[^\\]\})' p = re.compile(r) s = orig[:] res = list() m = p.search(s) if m is not None: sub = m.group(1) o...
import fnmatch import re def _deduplicate(entries): yielded = set() for entry in entries: if entry not in yielded: yielded.add(entry) yield entry def match_entries(entries, pattern): # First we check for pattern variants (ie. {foo,bar}baz = foobaz or barbaz) matching ...
mit
Python
941bc50c74dd01c48645c2e490e0343998157fd4
Correct import.
skk/eche
eche/tests/__init__.py
eche/tests/__init__.py
from eche.printer import print_str from eche.reader import read_str from eche.eche_types import Node, EcheTypeBase from eche.eval import eval_ast def print_str_and_read_str_wrapper(test_input, expected=None): if expected is None: expected = test_input val = read_str(test_input) actual = print_st...
from eche.printer import print_str from eche.reader import read_str from eche_types import Node, EcheTypeBase from eche.eval import eval_ast def print_str_and_read_str_wrapper(test_input, expected=None): if expected is None: expected = test_input val = read_str(test_input) actual = print_str(val...
mit
Python
92b91ee73bf29b19711cce9c39e25b4dfb73606f
add more content in generated pages
radomd92/botjagwar,radomd92/botjagwar
category_generator.py
category_generator.py
#!/usr/bin/python3.6 import pywikibot CATEGORIES = { "Mpamaritra anarana": ["Endri-pamaritra anarana"], "Anarana iombonana": ["Endrik'anarana"], "Matoanteny": ["Endriky ny matoanteny"], } wiki = pywikibot.Site('mg', 'wiktionary') languages = pywikibot.Category(wiki, 'fiteny') for language in languages.s...
import pywikibot CATEGORIES = { "Mpamaritra anarana": ["Endri-pamaritra anarana"], "Anarana iombonana": ["Endrik'anarana"], "Matoanteny": ["Endriky ny matoanteny"], } languages = pywikibot.Category(pywikibot.Site('mg', 'wiktionary'), 'fiteny') for language in languages.subcategories(): print('>>>>>', ...
mit
Python
a52bb3704f686e0d36896f12951bbf2aa521c89c
add valid_until field to CouponGenerationForm
byteweaver/django-coupons,byteweaver/django-coupons
coupons/forms.py
coupons/forms.py
from django import forms from django.contrib.admin import widgets from django.utils.translation import ugettext_lazy as _ from .models import Coupon from .settings import COUPON_TYPES class CouponGenerationForm(forms.Form): quantity = forms.IntegerField(label=_("Quantity")) value = forms.IntegerField(label=_...
from django import forms from django.utils.translation import ugettext_lazy as _ from .models import Coupon from .settings import COUPON_TYPES class CouponGenerationForm(forms.Form): quantity = forms.IntegerField(label=_("Quantity")) value = forms.IntegerField(label=_("Value")) type = forms.ChoiceField(l...
bsd-3-clause
Python
0acc59f7fad7ff183e3e97af40a0832c3debe72f
improve test to use non-standard delimiter
jubatus/jubakit
jubakit/test/loader/test_csv.py
jubakit/test/loader/test_csv.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from unittest import TestCase from tempfile import NamedTemporaryFile as TempFile from jubakit.loader.csv import CSVLoader class CSVLoaderTest(TestCase): def test_simple(self): with TempFile() as f: ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from unittest import TestCase from tempfile import NamedTemporaryFile as TempFile from jubakit.loader.csv import CSVLoader class CSVLoaderTest(TestCase): def test_simple(self): with TempFile() as f: ...
mit
Python
417ce074b6874f98d2f34ba82994fdcd02d98794
Make the Spacer widget accept a background color (#1365)
tych0/qtile,soulchainer/qtile,ramnes/qtile,zordsdavini/qtile,qtile/qtile,zordsdavini/qtile,tych0/qtile,qtile/qtile,ramnes/qtile,soulchainer/qtile
libqtile/widget/spacer.py
libqtile/widget/spacer.py
# Copyright (c) 2008, 2010 Aldo Cortesi # Copyright (c) 2011 Mounier Florian # Copyright (c) 2012 Tim Neumann # Copyright (c) 2012 Craig Barnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Adi Sieker # Copyright (c) 2014 Tycho Andersen # # Permission is hereby granted, free of charge, to any person obtaining a co...
# Copyright (c) 2008, 2010 Aldo Cortesi # Copyright (c) 2011 Mounier Florian # Copyright (c) 2012 Tim Neumann # Copyright (c) 2012 Craig Barnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Adi Sieker # Copyright (c) 2014 Tycho Andersen # # Permission is hereby granted, free of charge, to any person obtaining a co...
mit
Python
4e8ed559d585ab4c5d852833d380b0502837e740
Fix bug with attempt to create low-rank ManifoldElement from (potentially big) sparse matrix.
Nehoroshiy/multi_classifier,Nehoroshiy/multi_classifier
riemannian_optimization/sparse/utils/projections/riemannian_grad_full.py
riemannian_optimization/sparse/utils/projections/riemannian_grad_full.py
""" Copyright (c) 2015-2016 Constantine Belev 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, d...
""" Copyright (c) 2015-2016 Constantine Belev 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, d...
mit
Python
db8b06f51066a09f5e663b73c8bd56ba6a1dd39f
move to 0.1.5
arq5x/cyvcf,wenjiany/cyvcf,chapmanb/cyvcf
cyvcf/version.py
cyvcf/version.py
__version__="0.1.5"
__version__="0.1.4"
mit
Python
b61f0d371239ee5a6286ce539fab24d2d3de432a
Remove auth module import
plotly/dash,plotly/dash,plotly/dash,plotly/dash,plotly/dash
dash/__init__.py
dash/__init__.py
from .dash import Dash # noqa: F401 from . import dependencies # noqa: F401 from . import development # noqa: F401 from . import exceptions # noqa: F401 from . import resources # noqa: F401 from .version import __version__ # noqa: F401
from .dash import Dash # noqa: F401 from . import authentication # noqa: F401 from . import dependencies # noqa: F401 from . import development # noqa: F401 from . import exceptions # noqa: F401 from . import resources # noqa: F401 from .version import __version__ # noqa: F401
mit
Python
50b0fce8a23182b43e546c716f7c2c5550ac1292
Tweak swears
jreese/ircstat,jreese/ircstat
ircstat/plugins/highbrow.py
ircstat/plugins/highbrow.py
# Copyright 2013 John Reese # Licensed under the MIT license import re from ..lib import * from ..ent import Message from .base import Plugin class Highbrow(Plugin): """Gathers metrics related to how intelligent the conversation (or users) may be, like swear words used, etc.""" # a mapping of swears to ...
# Copyright 2013 John Reese # Licensed under the MIT license import re from ..lib import * from ..ent import Message from .base import Plugin class Highbrow(Plugin): """Gathers metrics related to how intelligent the conversation (or users) may be, like swear words used, etc.""" # a mapping of swears to ...
mit
Python
f9fa554f5201a784205aca1f94b8e463cc263fb7
add doctest
benjamin-hodgson/poll
src/poll.py
src/poll.py
""" Utilities for polling, retrying, and exception handling. """ import functools import time def poll(until, timeout=15, interval=1): """ Decorator for functions that should be retried until a condition or a timeout. :param until: Called with the return value of the function; return True if ...
""" Utilities for polling, retrying, and exception handling. """ import functools import time def poll(until, timeout=15, interval=1): """ Decorator for functions that should be retried until a condition or a timeout. :param until: Called with the return value of the function; return True if ...
mit
Python
ee5f2e9ca3cdc7395e350dcbc9fa8786f137652f
Switch to development mode
myint/yolk,myint/yolk
yolk/__init__.py
yolk/__init__.py
"""yolk. Author: Rob Cakebread <cakebread at gmail> License : BSD """ __version__ = '0.8.5a0'
"""yolk. Author: Rob Cakebread <cakebread at gmail> License : BSD """ __version__ = '0.8.4'
bsd-3-clause
Python
83c90c53dfd8ee508911d9f1e471b39797ce2c72
Fix types.
kou/zulip,kou/zulip,zulip/zulip,rht/zulip,zulip/zulip,rht/zulip,zulip/zulip,zulip/zulip,zulip/zulip,andersk/zulip,rht/zulip,andersk/zulip,andersk/zulip,kou/zulip,andersk/zulip,zulip/zulip,andersk/zulip,andersk/zulip,rht/zulip,rht/zulip,rht/zulip,rht/zulip,zulip/zulip,kou/zulip,kou/zulip,andersk/zulip,kou/zulip,kou/zuli...
zerver/lib/db.py
zerver/lib/db.py
import time from typing import ( Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, TypeVar, Union, overload, ) from psycopg2.extensions import connection, cursor from psycopg2.sql import Composable CursorObj = TypeVar("CursorObj", bound=cursor) Query = Union...
import time from typing import ( Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, TypeVar, Union, overload, ) from psycopg2.extensions import connection, cursor from psycopg2.sql import Composable CursorObj = TypeVar("CursorObj", bound=cursor) Query = Union...
apache-2.0
Python
f9defcf8c0bcf85c04e5d02df47086f2404d9d5c
Bump version to 0.20.0
elifesciences/elife-tools,elifesciences/elife-tools
elifetools/__init__.py
elifetools/__init__.py
__version__ = "0.20.0"
__version__ = "0.19.0"
mit
Python
34a4432b85b0a0948f8481a03c6278e635c85912
Add a default ordering for planets and moons.
StephenSwat/eve_lunar_mining_organiser,StephenSwat/eve_lunar_mining_organiser
elmo/eve_sde/models.py
elmo/eve_sde/models.py
from django.db import models import roman class Region(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField( db_index=True, unique=True, max_length=64 ) def __str__(self): return self.name class Meta: default_permissions = ()...
from django.db import models import roman class Region(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField( db_index=True, unique=True, max_length=64 ) def __str__(self): return self.name class Meta: default_permissions = ()...
mit
Python
4e75db543d17fc102334cf421969c5a65595ba35
optimize code in mongo connection function
Edraak/edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/edx-platform
common/lib/xmodule/xmodule/mongo_connection.py
common/lib/xmodule/xmodule/mongo_connection.py
""" Common MongoDB connection functions. """ import pymongo from mongodb_proxy import MongoProxy # pylint: disable=bad-continuation def connect_to_mongodb( db, host, port=27017, tz_aware=True, user=None, password=None, retry_wait_time=0.1, proxy=True, **kwargs ): """ Returns a MongoDB Database con...
""" Common MongoDB connection functions. """ import pymongo from mongodb_proxy import MongoProxy # pylint: disable=bad-continuation def connect_to_mongodb( db, host, port=27017, tz_aware=True, user=None, password=None, retry_wait_time=0.1, proxy=True, **kwargs ): """ Returns a MongoDB Database con...
agpl-3.0
Python
b568877e42043747df6e11af5d04cce5fcdc1c0c
Allow introspection of enabled services
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/modules/introspect.py
salt/modules/introspect.py
# -*- coding: utf-8 -*- ''' Functions to perform introspection on a minion, and return data in a format usable by Salt States ''' import os def running_service_owners( exclude=('/dev', '/home', '/media', '/proc', '/run', '/sys/', '/tmp', '/var') ): ''' Determine which packages own...
# -*- coding: utf-8 -*- ''' Functions to perform introspection on a minion, and return data in a format usable by Salt States ''' import os def running_service_owners( exclude=('/dev', '/home', '/media', '/proc', '/run', '/sys/', '/tmp', '/var') ): ''' Determine which packages own...
apache-2.0
Python
99e783e63782d17dc4e2183685444cfefd72d6f6
Update 0071_partnerteammember_champion_admin.py
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0071_partnerteammember_champion_admin.py
accelerator/migrations/0071_partnerteammember_champion_admin.py
# Generated by Django 2.2.10 on 2021-08-26 17:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accelerator', '0070_judginground_champion_partner_label') ] operations = [ migrations.AddField( model_name='partnerteammember',...
# Generated by Django 2.2.10 on 2021-08-26 17:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accelerator', '0070_judginground_champion_partner_label.py') ] operations = [ migrations.AddField( model_name='partnerteammembe...
mit
Python
4a72294d7d494ae3231e7bad74f57baaa4da088c
Remove code to patch bootloader flash size.
henriknelson/micropython,lowRISC/micropython,pramasoul/micropython,MrSurly/micropython-esp32,adafruit/micropython,blazewicz/micropython,tobbad/micropython,Peetz0r/micropython-esp32,oopy/micropython,hiway/micropython,tobbad/micropython,puuu/micropython,MrSurly/micropython-esp32,Timmenem/micropython,micropython/micropyth...
esp8266/modules/flashbdev.py
esp8266/modules/flashbdev.py
import esp class FlashBdev: SEC_SIZE = 4096 RESERVED_SECS = 1 START_SEC = esp.flash_user_start() // SEC_SIZE + RESERVED_SECS NUM_BLK = 0x6b - RESERVED_SECS def __init__(self, blocks=NUM_BLK): self.blocks = blocks def readblocks(self, n, buf): #print("readblocks(%s, %x(%d))" %...
import esp class FlashBdev: SEC_SIZE = 4096 RESERVED_SECS = 1 START_SEC = esp.flash_user_start() // SEC_SIZE + RESERVED_SECS NUM_BLK = 0x6b - RESERVED_SECS def __init__(self, blocks=NUM_BLK): self.blocks = blocks def readblocks(self, n, buf): #print("readblocks(%s, %x(%d))" %...
mit
Python
02e4a879c9a074aaa89117b048f346b306b95995
Use string formatting
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/pillar/etcd_pillar.py
salt/pillar/etcd_pillar.py
# -*- coding: utf-8 -*- ''' Use etcd data as a Pillar source .. versionadded:: Helium :depends: - python-etcd In order to use an etcd server, a profile must be created in the master configuration file: .. code-block:: yaml my_etd_config: etcd.host: 127.0.0.1 etcd.port: 4001 After the profile is c...
# -*- coding: utf-8 -*- ''' Use etcd data as a Pillar source .. versionadded:: Helium :depends: - python-etcd In order to use an etcd server, a profile must be created in the master configuration file: .. code-block:: yaml my_etd_config: etcd.host: 127.0.0.1 etcd.port: 4001 After the profile is c...
apache-2.0
Python
2b2c24687ed27861b5ebddf5112f19a67615cbf5
Fix value generation
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
lib/node_modules/@stdlib/math/base/special/exp10/test/fixtures/python/runner.py
lib/node_modules/@stdlib/math/base/special/exp10/test/fixtures/python/runner.py
#!/usr/bin/env python """Generate fixtures.""" import os import json import numpy as np from scipy.special import exp10 # Get the file path: FILE = os.path.realpath(__file__) # Extract the directory in which this file resides: DIR = os.path.dirname(file) def gen(x, name): """Generate fixture data and write to ...
#!/usr/bin/env python """Generate fixtures.""" import os import json import numpy as np from scipy import special # Get the file path: FILE = os.path.realpath(__file__) # Extract the directory in which this file resides: DIR = os.path.dirname(file) def gen(x, name): """Generate fixture data and write to file....
apache-2.0
Python
26f984a7732491e87e4eb756caf0056a7ac71484
Fix unlink, >1 filter and lines too long
bullet92/contract,open-synergy/contract
contract_invoice_merge_by_partner/models/account_analytic_analysis.py
contract_invoice_merge_by_partner/models/account_analytic_analysis.py
# -*- coding: utf-8 -*- # © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, models class PurchaseOrderLine(models.Model): _inherit = 'account.analytic.account' @api.multi def _recurring_create_invoice(self, automat...
# -*- coding: utf-8 -*- # © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, models class PurchaseOrderLine(models.Model): _inherit = 'account.analytic.account' @api.multi def _recurring_create_invoice(self, automat...
agpl-3.0
Python
36d9b32a8b3f328c51668fdbb8e01080a936ca99
Add license to file header
tensorflow/cloud,tensorflow/cloud
tests/integration/call_run_within_script_with_autokeras_test.py
tests/integration/call_run_within_script_with_autokeras_test.py
# Copyright 2020 Google LLC. 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 applicable law or a...
""" Search for a good model for the [MNIST](https://keras.io/datasets/#mnist-database-of-handwritten-digits) dataset. """ import argparse import os import autokeras as ak import tensorflow_cloud as tfc from tensorflow.keras.datasets import mnist parser = argparse.ArgumentParser(description="Model save path arguments...
apache-2.0
Python
a9d7477238bae3c16da4bcab7c449cc592f5d1eb
fix typo
CIRCL/bgpranking-redis-api,CIRCL/bgpranking-redis-api,CIRCL/bgpranking-redis-api
example/export/init_redis.py
example/export/init_redis.py
#!/usr/bin/python # -*- coding: utf-8 -*- import bgpranking import argparse import redis if __name__ == '__main__': parser = argparse.ArgumentParser(description='Generate a list of all IPS for a day.') parser.add_argument('-d', '--date', default=None, help='Date of the dump (YYYY-MM-DD)') args = parser....
#!/usr/bin/python # -*- coding: utf-8 -*- import bgpranking import argparse import redis if __name__ == '__main__': parser = argparse.ArgumentParser(description='Generate a list of all IPS for a day.') parser.add_argument('-d', '--date', default=None, help='Date of the dump (YYYY-MM-DD)') args = parser....
bsd-2-clause
Python
c106b1b0403010c872b0315f76cc5d4cd7e1296f
put version number to 1.0
BT-ojossen/odoo,minhtuancn/odoo,rahuldhote/odoo,laslabs/odoo,christophlsa/odoo,microcom/odoo,dezynetechnologies/odoo,TRESCLOUD/odoopub,cdrooom/odoo,avoinsystems/odoo,chiragjogi/odoo,CubicERP/odoo,chiragjogi/odoo,sv-dev1/odoo,Ichag/odoo,pedrobaeza/OpenUpgrade,CopeX/odoo,bealdav/OpenUpgrade,guerrerocarlos/odoo,abdellatif...
addons/portal/__openerp__.py
addons/portal/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
Python
0c013b3580ede9dd976ae2bec8cfa4b856cd3975
Make sure we use a Python that speaks f-string
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
scripts/build_sbt_image.py
scripts/build_sbt_image.py
#!/usr/bin/env python3.6 # -*- encoding: utf-8 -*- """ Build a Docker image for one of our sbt applications. Usage: build_sbt_image.py --project=<PROJECT> [--version=<VERSION>] [--env=<BUILD_ENV>] build_sbt_image.py -h | --help Options: -h --help Show this screen. --project=<PROJECT> N...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """ Build a Docker image for one of our sbt applications. Usage: build_sbt_image.py --project=<PROJECT> [--version=<VERSION>] [--env=<BUILD_ENV>] build_sbt_image.py -h | --help Options: -h --help Show this screen. --project=<PROJECT> Nam...
mit
Python
05fdbe1aa093dbe252f9c16c4a5ccaf47a7bb3a7
Add unittest for get_thumbnail_of_file()
Commonists/CommonsDownloader
test/test_commonsdowloader.py
test/test_commonsdowloader.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Unit tests.""" from os.path import dirname, join import unittest import commonsdownloader class TestCommonsDownloaderOffline(unittest.TestCase): """Testing methods from commonsdownloader which do not require connection.""" def test_clean_up_filename(self)...
#!/usr/bin/env python # -*- coding: latin-1 -*- """Unit tests.""" from os.path import dirname, join import unittest import commonsdownloader class TestCommonsDownloaderOffline(unittest.TestCase): """Testing methods from commonsdownloader which do not require connection.""" def test_clean_up_filename(self)...
mit
Python
442b8d886f74ef377c96c48755e4d50eb83b0137
fix import error
noisyboiler/wampy
test/test_roles.py
test/test_roles.py
import pytest from wampy.constants import DEFAULT_REALM from wampy.peers.clients import Client from wampy.roles.subscriber import TopicSubscriber from test.helpers import assert_stops_raising class TestTopicSubscriber(object): @pytest.yield_fixture def publisher(self, router): with Client() as clie...
import pytest from wampy.constants import DEFAULT_REALM from wampy.peers.clients import DefaultClient as Client from wampy.roles.subscriber import TopicSubscriber from test.helpers import assert_stops_raising class TestTopicSubscriber(object): @pytest.yield_fixture def publisher(self, router): with...
mpl-2.0
Python
2d2cc5e0b8b3d5d658c7b7df68dd206518c3d4e9
Fix test script
vietor/pyweaknet,vietor/pyweaknet,vietor/pysunday
test/test_speed.py
test/test_speed.py
#!/usr/bin/env python from __future__ import division, print_function, with_statement import os import sys sys.path.append(os.path.abspath("./")) sys.path.append(os.path.abspath("../")) import time import random import string from weaknet import * def randomBytes(size): return xbytes(''.join(random.choice(stri...
from __future__ import division, print_function, with_statement import os import sys sys.path.append(os.path.abspath("./")) sys.path.append(os.path.abspath("../")) import time import random import string from weaknet import * def randomBytes(size): return xbytes(''.join(random.choice(string.ascii_uppercase + s...
mit
Python
24a245fc3309a79e06e435b18582f70dfadab019
update K8sReplicaSet
sebastienc/kubernetes-py,mnubo/kubernetes-py,froch/kubernetes-py,mnubo/kubernetes-py,froch/kubernetes-py,sebastienc/kubernetes-py
kubernetes/K8sReplicaSet.py
kubernetes/K8sReplicaSet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes.K8sObject import K8sObject from kubernetes.models.v1beta1.ReplicaSet import ReplicaSet class K8sReplicaSet(K8sObject): "...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes.K8sPodBasedObject import K8sPodBasedObject from kubernetes.models.v1.ReplicaSet import ReplicaSet class K8sReplicaSet(K8sPod...
apache-2.0
Python
38f94d1e15118849315b5d7146cde984035c7782
Disable TestStopPCs when there's no XML support
apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
from __future__ import print_function import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * from gdbclientutils import * class TestStopPCs(GDBRemoteTestBase): @skipIfXmlSupportMissing def test(self): class MyResponder(MockGDBServerResponder): def haltRe...
from __future__ import print_function import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * from gdbclientutils import * class TestStopPCs(GDBRemoteTestBase): def test(self): class MyResponder(MockGDBServerResponder): def haltReason(self): re...
apache-2.0
Python
c573d3d69e58819d40a7e0097bfba823d6c9e10c
print removed
potato/searx,pointhi/searx,jibe-b/searx,PwnArt1st/searx,PwnArt1st/searx,jcherqui/searx,gugod/searx,potato/searx,matejc/searx,dzc34/searx,jibe-b/searx,framasoft/searx,gugod/searx,asciimoo/searx,GreenLunar/searx,PwnArt1st/searx,gugod/searx,misnyo/searx,jibe-b/searx,dalf/searx,asciimoo/searx,dalf/searx,jpope777/searx,kdan...
searx/engines/piratebay.py
searx/engines/piratebay.py
from lxml import html from urlparse import urljoin from cgi import escape from urllib import quote categories = ['videos', 'music'] url = 'https://thepiratebay.se/' search_url = url + 'search/{search_term}/{pageno}/99/{search_type}' search_types = {'videos': '200', 'music': '100', 'fil...
from lxml import html from urlparse import urljoin from cgi import escape from urllib import quote categories = ['videos', 'music'] url = 'https://thepiratebay.se/' search_url = url + 'search/{search_term}/{pageno}/99/{search_type}' search_types = {'videos': '200', 'music': '100', 'fil...
agpl-3.0
Python
cb9b1a2163f960e34721f74bad30622fda71e43b
Mark ObjC testcase as skipUnlessDarwin and fix a typo in test function.
apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb
packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
"""Test that the clang modules cache directory can be controlled.""" from __future__ import print_function import unittest2 import os import time import platform import shutil import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ObjCMo...
"""Test that the clang modules cache directory can be controlled.""" from __future__ import print_function import unittest2 import os import time import platform import shutil import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ObjCMo...
apache-2.0
Python
5975b9f42965b4193b13bb5264dd6be1f4e30b89
Complete sol
bowen0701/algorithms_data_structures
lc0681_next_closest_time.py
lc0681_next_closest_time.py
"""Leetcode 681. Next Closest Time (Premium) Medium URL: https://leetcode.com/problems/next-closest-time Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused. You may assume the given input string is always...
"""Leetcode 681. Next Closest Time (Premium) Medium URL: https://leetcode.com/problems/next-closest-time Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused. You may assume the given input string is always...
bsd-2-clause
Python
7ad47fad53be18a07aede85c02e41176a96c5de2
Update celery setup according to docs
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
learnwithpeople/__init__.py
learnwithpeople/__init__.py
# This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app __all__ = ('celery_app',) __version__ = "dev" GIT_REVISION = "dev"
# This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app __version__ = "dev" GIT_REVISION = "dev"
mit
Python
e67c57128f88b61eac08e488e54343d48f1454c7
Update LoginForm to match reality
dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard
ddcz/forms/authentication.py
ddcz/forms/authentication.py
import logging from django import forms from django.contrib.auth import forms as authforms from ..models import UserProfile logger = logging.getLogger(__name__) class LoginForm(forms.Form): nick = forms.CharField(label="Nick", max_length=25) password = forms.CharField( label="Heslo", max_length=100...
import logging from django import forms from django.contrib.auth import forms as authforms from ..models import UserProfile logger = logging.getLogger(__name__) class LoginForm(forms.Form): nick = forms.CharField(label="Nick", max_length=20) password = forms.CharField(label="Heslo", max_length=50, widget=f...
mit
Python
f3a6ebf0351050553363e28c271a103c9545b422
Fix print http_interface.py
Koheron/lase
lase/core/http_interface.py
lase/core/http_interface.py
#! /usr/bin/python import requests class HTTPInterface: def __init__(self, IP, port=80): self.url = 'http://' + IP + ':' + str(port) def get_bistream_id(self): r = requests.get(self.url + '/bitstream_id') return r.text def ping(self): r = requests.post(self.url + '/ping',...
#! /usr/bin/python import requests class HTTPInterface: def __init__(self, IP, port=80): self.url = 'http://' + IP + ':' + str(port) def get_bistream_id(self): r = requests.get(self.url + '/bitstream_id') return r.text def ping(self): r = requests.post(sel...
mit
Python
49c54f33f2f8fce62eb6260e9ea360b8368f16ce
Support custom extensions.
appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource,appressoas/ievv_opensource
ievv_opensource/ievvtasks_development/management/commands/ievvtasks_makemessages.py
ievv_opensource/ievvtasks_development/management/commands/ievvtasks_makemessages.py
import os from django.conf import settings from django.core import management from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Run makemessages for the languages specified in the ' \ 'IEVVTASKS_MAKEMESSAGES_LANGUAGE_CODES setting.' def __makemessages(self, i...
import os from django.conf import settings from django.core import management from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Run makemessages for the languages specified in the ' \ 'IEVVTASKS_MAKEMESSAGES_LANGUAGE_CODES setting.' def __build_python_transla...
bsd-3-clause
Python
f7d4701aa7f8550f3c2a90c4110ef41bf2def8f5
Fix hardcoding on xml
NeutronUfscarDatacom/DriverDatacom
dcclient/rpc.py
dcclient/rpc.py
""" RPC class used to communicate with the hardware """ import pycurl import gzip from StringIO import StringIO as sio from oslo.config import cfg class RPC: """ RPC class. Used to connect to the client and pass the XML files. """ def __init__(self): self.auth = self.CONF.dm_username+':'+self.CONF....
""" RPC class used to communicate with the hardware """ import pycurl import gzip from StringIO import StringIO as sio from oslo.config import cfg class RPC: """ RPC class. Used to connect to the client and pass the XML files. """ def __init__(self): self.auth = self.CONF.dm_username+':'+self.CONF....
apache-2.0
Python
da360641e3da0fd15e3bf266d65b455e6bacaed6
fix a bug on connection lost
angelonuffer/Sheldon-Chess,angelonuffer/Sheldon-Chess,angelonuffer/Sheldon-Chess
sheldonchess/interface/web/sheldonchess.py
sheldonchess/interface/web/sheldonchess.py
from rajesh import Application, run, expr from rajesh.element import Img from screens import MainMenu, NormalGameLobby class Player(object): def __init__(self, app): self.app = app self.name = "" class SheldonChess(Application): def begin(self): self.player = Player(self) b...
from rajesh import Application, run, expr from rajesh.element import Img from screens import MainMenu class Player(object): def __init__(self, app): self.app = app self.name = "" class SheldonChess(Application): def begin(self): self.player = Player(self) background = Img(i...
mit
Python
cc4198819d3763f97625ef0066311f60809846ab
Add LUKS encrypted LV to LVM example
rvykydal/blivet,vojtechtrefny/blivet,vojtechtrefny/blivet,rvykydal/blivet
examples/lvm.py
examples/lvm.py
import os import blivet from blivet.size import Size from blivet.util import set_up_logging, create_sparse_tempfile from blivet.devices import LUKSDevice set_up_logging() b = blivet.Blivet() # create an instance of Blivet (don't add system devices) # create a disk image file on which to create new devices disk1_fi...
import os import blivet from blivet.size import Size from blivet.util import set_up_logging, create_sparse_tempfile set_up_logging() b = blivet.Blivet() # create an instance of Blivet (don't add system devices) # create a disk image file on which to create new devices disk1_file = create_sparse_tempfile("disk1", S...
lgpl-2.1
Python
3dcad84c48e1009cd97fe4dc87471fd8b61522bf
rename searchMusic method -> searchDB
Pusungwi/pymaniadb
pymaniadb.py
pymaniadb.py
#!/usr/bin/env python #Title : pymaniadb #Version : 0.1 #Author : Yi 'Pusungwi' Yeon Jae #Description : a codes of pymaniadb import urllib.request import urllib.parse import io from lxml import etree MANIADB_ROOT_URL = 'http://www.maniadb.com/api/' MANIADB_SEARCH_URL = 'search.asp' #검색 asp 파일 정보 class pymaniadb: ...
#!/usr/bin/env python #Title : pymaniadb #Version : 0.1 #Author : Yi 'Pusungwi' Yeon Jae #Description : a codes of pymaniadb import urllib.request import urllib.parse import io from lxml import etree MANIADB_ROOT_URL = 'http://www.maniadb.com/api/' MANIADB_SEARCH_URL = 'search.asp' #검색 asp 파일 정보 class pymaniadb: ...
mit
Python
ddfc1a223b8d7d62983499277f0528e2a0162976
correct log msg
uw-it-aca/bridge-sis-provisioner,uw-it-aca/bridge-sis-provisioner
sis_provisioner/account_managers/verify.py
sis_provisioner/account_managers/verify.py
""" This class will check the users in DB, if the action on a user record failed in the last load, re-apply it. """ import logging from restclients.exceptions import DataFailureException from sis_provisioner.dao.bridge import is_active_user_exist from sis_provisioner.account_managers import fetch_users_from_db logge...
""" This class will check the users in DB, if the action on a user record failed in the last load, re-apply it. """ import logging from restclients.exceptions import DataFailureException from sis_provisioner.dao.bridge import is_active_user_exist from sis_provisioner.account_managers import fetch_users_from_db logge...
apache-2.0
Python
846ae9bff247b09aee0f07b2384f6b967b354eff
Add the rest of the LUCI builders to the temporary isolate lookup.
catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult
dashboard/dashboard/pinpoint/models/isolate.py
dashboard/dashboard/pinpoint/models/isolate.py
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Model for storing information to look up isolates. An isolate is a way to describe the dependencies of a specific build. More about isolates: https://gi...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Model for storing information to look up isolates. An isolate is a way to describe the dependencies of a specific build. More about isolates: https://gi...
bsd-3-clause
Python
a89dbe08a0a25e4650ffae02e0f0c600f2f4832e
add warning: pygr.Data is deprecated
cjlee112/pygr,RitwikGupta/pygr,cjlee112/pygr,RitwikGupta/pygr,GenDataPro/pygr,cjlee112/pygr,GenDataPro/pygr,theoryno3/pygr,RitwikGupta/pygr,theoryno3/pygr,ctb/pygr,cjlee112/pygr,theoryno3/pygr,ctb/pygr,ctb/pygr,GenDataPro/pygr,ctb/pygr,ctb/pygr
pygr/Data.py
pygr/Data.py
import warnings warnings.warn('pygr.Data is deprecated. Use "from pygr import worldbase" instead!', DeprecationWarning, stacklevel=2) from pygr import worldbase from metabase import ResourceServer, dumps, OneToManyRelation, OneToOneRelation,\ ManyToManyRelation, WorldbaseNotPortableError, Worldbas...
from pygr import worldbase from metabase import ResourceServer, dumps, OneToManyRelation, OneToOneRelation,\ ManyToManyRelation, WorldbaseNotPortableError, WorldbaseNotFoundError, \ WorldbaseMismatchError, WorldbaseEmptyError, WorldbaseReadOnlyError, \ WorldbaseSchemaError, WorldbaseNoModuleError, Resou...
bsd-3-clause
Python
8dc18110345bd7a67f393b5a608f233b38af072a
Verify that the requested builders are actually trybots Review URL: https://codereview.appspot.com/7194048
google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Ti...
master/skia_master_scripts/monkeypatches.py
master/skia_master_scripts/monkeypatches.py
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Monkeypatches to override upstream code. """ from master import try_job_base from master import try_job_svn from master.try_job_base import text_to...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Monkeypatches to override upstream code. """ from master import try_job_svn from master.try_job_base import text_to_dict from twisted.internet impo...
bsd-3-clause
Python
d74c9cee91cd0040510ac90a9435f8083a498421
add get_load_averages()
victronenergy/velib_python
ve_utils.py
ve_utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from traceback import print_exc from os import _exit as os_exit from os import statvfs import logging logger = logging.getLogger(__name__) # Use this function to make sure the code quits on an unexpected exception. Make sure to use it # when using gobject.idle_add and also...
#!/usr/bin/env python # -*- coding: utf-8 -*- from traceback import print_exc from os import _exit as os_exit from os import statvfs import logging logger = logging.getLogger(__name__) # Use this function to make sure the code quits on an unexpected exception. Make sure to use it # when using gobject.idle_add and also...
mit
Python
987a4cceb6b4096923df82d2ef291cc2601e32d7
Update LightIntensity.py
Python-IoT/Smart-IoT-Planting-System,Python-IoT/Smart-IoT-Planting-System
device/src/LightIntensity.py
device/src/LightIntensity.py
#-------------------------------------- # ___ _ ____ # / __(_)__ / __/ # _\ \/ / _ \_\ \ # /___/_/ .__/___/ # /_/ # # LightIntensity.py # Get light intensity data from GY-30 module which is base on bh1750 sensor. # # Author : Arvin # Date : 15/09/2017 #-------------------------------------...
#-------------------------------------- # ___ _ ____ # / __(_)__ / __/ # _\ \/ / _ \_\ \ # /___/_/ .__/___/ # /_/ # # LightIntensity.py # Get light intensity data from GY-30 module which is base on bh1750 sensor. # # Author : Arvin # Date : 15/09/2017 #-------------------------------------...
mit
Python
bb85e3475c9d7b7f685a75916498ac98241fff86
test ssh
Fendoe/open-hackathon-o,YaningX/open-hackathon,rapidhere/open-hackathon,frankyao47/open-hackathon,Fendoe/open-hackathon,msopentechcn/open-hackathon,xunxunzgq/open-hackathon-bak_01,frankyao47/open-hackathon,Fendoe/open-hackathon,msopentechcn/open-hackathon,Fendoe/open-hackathon,xunxunzgq/open-hackathon-bak_01,lclchen/op...
testlogging/log.py
testlogging/log.py
import logging import logging.config logging.config.fileConfig("logging.conf") #create logger logger = logging.getLogger("myLogger") #"application" code def log_debug(debug): logger.debug(debug) def log_info(info): logger.info(info) def log_warn(warn): logger.warn(warn) def log_error(error): ...
import logging import logging.config logging.config.fileConfig("logging.conf") #create logger logger = logging.getLogger("myLogger") #"application" code def log_debug(debug): logger.debug(debug) def log_info(info): logger.info(info) def log_warn(warn): logger.warn(warn) def log_error(error): ...
mit
Python
22f200b5f0e1263dd7061c0a793380b54001c531
remove the System class and refactor the solve function0
AlanCristhian/symbolic_old,AlanCristhian/symbolic_old
expressions/solvers.py
expressions/solvers.py
from expressions import core def solve_single_equality(equality, variable): expression = equality.replace("==","-(") + ")" c = eval(expression, {variable: 1j}) return {variable: -c.real/c.imag} def solve(system): variable = system._generator.gi_code.co_varnames[1:][0] return solve_single_equalit...
from expressions import core class System(core.BaseType): """The most generic type.""" def __setitem__(self, key, value): return self._array.__setitem__(key, value) def __repr__(self): return 'System(%s)' % repr(self._array) def solve(system): variable = system._generator.gi_code.co...
mit
Python
0f71be12093e7d650cbd8a723a123d033df8ea57
add more tests
grnet/ac16
src/ilin2.py
src/ilin2.py
from petlib.ec import EcGroup def params_gen(nid=713): G = EcGroup(nid) g = G.generator() o = G.order() return (G, g, o) def key_gen(params): _, g, o = params x = 1 + (o - 2).random() h = x * g return ((g, h), x) def enc(pk, s1, s2, m): g, h = pk return (s1*h, s2*(g+h), (m...
from petlib.ec import EcGroup def params_gen(nid=713): G = EcGroup(nid) g = G.generator() o = G.order() return (G, g, o) def key_gen(params): _, g, o = params x = 1 + (o - 2).random() h = x * g return ((g, h), x) def enc(pk, s1, s2, m): g, h = pk return (s1*h, s2*(g+h), (m...
agpl-3.0
Python
91156898a69b9d37a3e587fc7aaf2a3320b46881
use new date formatting function in doepages
erinspace/scrapi,CenterForOpenScience/scrapi,ostwald/scrapi,jeffreyliu3230/scrapi,erinspace/scrapi,alexgarciac/scrapi,felliott/scrapi,mehanig/scrapi,icereval/scrapi,mehanig/scrapi,fabianvf/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,felliott/scrapi
scrapi/harvesters/doepages.py
scrapi/harvesters/doepages.py
from __future__ import unicode_literals from datetime import date, timedelta from lxml import etree from scrapi import requests from scrapi import settings from scrapi.base import XMLHarvester from scrapi.linter import RawDocument from scrapi.util import copy_to_unicode, format_date_with_slashes from scrapi.base.sch...
from __future__ import unicode_literals from datetime import date, timedelta from lxml import etree from scrapi import requests from scrapi.base import XMLHarvester from scrapi.linter import RawDocument from scrapi.util import copy_to_unicode from scrapi.base.schemas import DOESCHEMA class DoepagesHarvester(XMLHar...
apache-2.0
Python
956f9c476273d506313a15fe49e62adcdaa2f70a
upgrade recipe order fix
tiborsimko/invenio,inveniosoftware/invenio,tiborsimko/invenio,inveniosoftware/invenio
invenio/modules/accounts/upgrades/accounts_2015_03_06_namedefaults.py
invenio/modules/accounts/upgrades/accounts_2015_03_06_namedefaults.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
mit
Python
356e61e7d68dee817a25a06766ec33a406598833
add disabled to local-dist
fabianvf/scrapi,jeffreyliu3230/scrapi,icereval/scrapi,alexgarciac/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,erinspace/scrapi,fabianvf/scrapi,felliott/scrapi,ostwald/scrapi,mehanig/scrapi,mehanig/scrapi
scrapi/settings/local-dist.py
scrapi/settings/local-dist.py
DEBUG = False ELASTIC_TIMEOUT = 10 ELASTIC_INDEX = 'share_v2' ELASTIC_URI = 'localhost:9200' BROKER_URL = 'amqp://guest@localhost' CELERY_EAGER_PROPAGATES_EXCEPTIONS = True RECORD_HTTP_TRANSACTIONS = False NORMALIZED_PROCESSING = [] RAW_PROCESSING = [] SENTRY_DSN = None USE_FLUENTD = False FLUENTD_ARGS = { '...
DEBUG = False ELASTIC_TIMEOUT = 10 ELASTIC_INDEX = 'share_v2' ELASTIC_URI = 'localhost:9200' BROKER_URL = 'amqp://guest@localhost' CELERY_EAGER_PROPAGATES_EXCEPTIONS = True RECORD_HTTP_TRANSACTIONS = False NORMALIZED_PROCESSING = [] RAW_PROCESSING = [] SENTRY_DSN = None USE_FLUENTD = False FLUENTD_ARGS = { '...
apache-2.0
Python
e08b5a5b630d3e1856c2eecb4adfce677961865b
Bump patch version number.
ambitioninc/django-localized-recurrence,wesleykendall/django-localized-recurrence,travistruett/django-localized-recurrence
localized_recurrence/version.py
localized_recurrence/version.py
__version__ = '0.2.3'
__version__ = '0.2.2'
mit
Python
14d6955118893c532c1d9f8f6037d1da1b18dbbb
Add multiple skeletons for the moment.
lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment
analysis/plot-skeleton.py
analysis/plot-skeleton.py
#!/usr/bin/env python import climate import pandas as pd import database import plots @climate.annotate( root='plot data rooted at this path', pattern=('plot data from files matching this pattern', 'option'), ) def main(root, pattern='*/*block03/*trial00*.csv.gz'): for trial in database.Experiment(root)...
#!/usr/bin/env python import climate import database import plots @climate.annotate( root='plot data rooted at this path', pattern=('plot data from files matching this pattern', 'option'), ) def main(root, pattern='*/*block02/*trial00*.csv.gz'): for trial in database.Experiment(root).trials_matching(pat...
mit
Python
4b12e3c2ace8cae9071ae108d6ddc13f086d4fb9
improve error recovery
pdebuyl/pyh5md
examples/read.py
examples/read.py
#!/usr/bin/env python """ Open a H5MD file and displays the elements in the given particles group """ from __future__ import print_function, division import argparse parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('file', type=str, help='H5MD file') parser.add_argument('--group', type=str, h...
#!/usr/bin/env python """ Open a H5MD file and displays the elements in the given particles group """ from __future__ import print_function, division import argparse parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('file', type=str, help='H5MD file') parser.add_argument('--group', type=str, h...
bsd-3-clause
Python
8f732803e30ae421167463defce27be215c0056d
Add file removing.
tomwys/fabric-utils
fabric_utils/backup.py
fabric_utils/backup.py
import datetime from os import path from fabric.api import env, run, sudo def postgresql(database, file): owner = sudo("stat -c %%U `dirname %s`" % file) sudo("chown postgres `dirname %s`" % file) sudo("pg_dump %s > %s" % (database, file), user='postgres') sudo("chown %s `dirname %s` %s" % (owner, fil...
import datetime from os import path from fabric.api import env, run, sudo def postgresql(database, file): owner = sudo("stat -c %%U `dirname %s`" % file) sudo("chown postgres `dirname %s`" % file) sudo("pg_dump %s > %s" % (database, file), user='postgres') sudo("chown %s `dirname %s` %s" % (owner, fil...
mit
Python
f898778887eb828e59f0a5c19cc361a5a245e99d
make log format betterer
majestrate/srndv2
src/srnd/main.py
src/srnd/main.py
# # main.py # from . import config from . import network from . import sql import asyncio import logging def main(): """ run srnd """ conf = config.load_config() log = conf['log'] if log['level'].lower() == 'debug': lvl = logging.DEBUG else: lvl = logging.INFO logging.b...
# # main.py # from . import config from . import network from . import sql import asyncio import logging def main(): """ run srnd """ conf = config.load_config() log = conf['log'] if log['level'].lower() == 'debug': lvl = logging.DEBUG else: lvl = logging.INFO logging.b...
mit
Python
bfd75a927da2b46cb8630fab0cd3828ba71bf4ee
Use pip instead of easy_install
ValiMail/arc_test_suite
dependencies.py
dependencies.py
#! /usr/bin/env python3 import subprocess import sys requires = ["dnslib", "dkimpy>=0.7.1", "pyyaml", "ddt", "authheaders"] def install(package): subprocess.call([sys.executable, "-m", "pip", "install", package]) for module in requires: install(module)
#! /usr/bin/env python3 from setuptools.command import easy_install requires = ["dnslib", "dkimpy>=0.7.1", "pyyaml", "ddt", "authheaders"] for module in requires: easy_install.main( ["-U",module] )
mit
Python
3171e7e355536f41a6c517ca7128a152c2577829
Add test for categorical colors staying around after subsetting
theislab/anndata
anndata/tests/test_uns.py
anndata/tests/test_uns.py
import numpy as np import pandas as pd from anndata import AnnData def test_uns_color_subset(): # Tests for https://github.com/theislab/anndata/issues/257 obs = pd.DataFrame(index=[f"cell{i}" for i in range(5)]) obs["cat1"] = pd.Series(list("aabcd"), index=obs.index, dtype="category") obs["cat2"] = p...
import numpy as np import pandas as pd from anndata import AnnData def test_uns_color_subset(): # Tests for https://github.com/theislab/anndata/issues/257 obs = pd.DataFrame(index=[f"cell{i}" for i in range(5)]) obs["cat1"] = pd.Series(list("aabcd"), index=obs.index, dtype="category") obs["cat2"] = p...
bsd-3-clause
Python
21a2c973404930c85855b7cdd60b85c55f125b0a
Fix error message
yuma-m/raspi_lcd_acm1602ni
raspi_lcd.py
raspi_lcd.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import smbus import unicodedata from config import BUS_NUMBER, LCD_ADDR from character_table import INITIALIZE_CODES, LINEBREAK_CODE, CHAR_TABLE COMMAND_ADDR = 0x00 DATA_ADDR = 0x80 class LCDController: def __init__...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import smbus import unicodedata from config import BUS_NUMBER, LCD_ADDR from character_table import INITIALIZE_CODES, LINEBREAK_CODE, CHAR_TABLE COMMAND_ADDR = 0x00 DATA_ADDR = 0x80 class LCDController: def __init__...
mit
Python
1d2df9b6d578a8780e0e8021abb0565389fe5ff7
Change all test constants to floats
ererkka/GDX2py
tests/constants.py
tests/constants.py
# """ Constants for tests See file 'data/example_data.gms' for the GAMS code used to create file 'data/example.gdx'. """ import sys import math SYMLIST = ['set1', 'set2', 'CONSTANT', 'par1', 'par2', 'par3'] SET1 = ['a', 'b', 'c', 'd'] SET1_TEXT = "A one-dimensional set" SET1_ASSOC_TEXTS = ['alpha', 'beta', 'charli...
# """ Constants for tests See file 'data/example_data.gms' for the GAMS code used to create file 'data/example.gdx'. """ import sys import math SYMLIST = ['set1', 'set2', 'CONSTANT', 'par1', 'par2', 'par3'] SET1 = ['a', 'b', 'c', 'd'] SET1_TEXT = "A one-dimensional set" SET1_ASSOC_TEXTS = ['alpha', 'beta', 'charli...
mit
Python
3a0ef1e7a7e2fd6a86ab1d68ffbea0dd2b2017ba
Update deploy scripts
winnieWinne/Tickets-Client,winnieWinne/Tickets-Client
deploy.py
deploy.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys if (len(sys.argv) == 1): print("Usage: 'python3 deploy.py <server_path>'") else: path = sys.argv[1] + "src/main/webapp" filename = "tmp.tar.gz" os.system("gulp clean") os.system("gulp build") os.system("tar -zcvf %s tmp/" % filename...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys if (len(sys.argv) == 1): print("Usage: 'python3 deploy.py <server_path>'") else: path = sys.argv[1] + "src/main/webapp" filename = "tmp.tar.gz" os.system("tar -zcvf %s tmp/" % filename) os.system("mv tmp.tar.gz %s" % path) os.system...
mit
Python
3ced1b19d706a824d36cf74846eaffd63d8c1b8a
Improve 24 cog formatting
Harmon758/Harmonbot,Harmon758/Harmonbot
Discord/cogs/24.py
Discord/cogs/24.py
from discord.ext import commands import sys from utilities import checks sys.path.insert(0, "..") from units.twenty_four import check_solution, generate_numbers sys.path.pop(0) def setup(bot): bot.add_cog(TwentyFour()) class TwentyFour(commands.Cog, name = "24"): @commands.command(name = "24", aliases ...
from discord.ext import commands import sys from utilities import checks sys.path.insert(0, "..") from units.twenty_four import check_solution, generate_numbers sys.path.pop(0) def setup(bot): bot.add_cog(TwentyFour()) class TwentyFour(commands.Cog, name = "24"): @commands.command(name = "24", aliases = ["t...
mit
Python
d964774feac4477ca0cd2939fccd9e7783a10d3c
Update __init__.py
adrianliaw/PyCuber
CFOP/__init__.py
CFOP/__init__.py
""
mit
Python
6408a99d65016d679bc16528c9e4df53cb3f5931
Fix some permissions for getting orcid/twitter
OpenChemistry/mongochemserver
girder/molecules/molecules/user.py
girder/molecules/molecules/user.py
from girder.api import access from girder.api.describe import Description, autoDescribeRoute from girder.api.rest import getCurrentUser from girder.models.model_base import AccessType from girder.models.user import User def _set_user_field(user, field_name, field_value): query = { '_id': user['_id'] } ...
from girder.api import access from girder.api.describe import Description, autoDescribeRoute from girder.api.rest import getCurrentUser from girder.models.model_base import AccessType from girder.models.user import User def _set_user_field(user, field_name, field_value): query = { '_id': user['_id'] } ...
bsd-3-clause
Python
d3c600ddc0cdfdc6548c7d7f1d3c859d380f6768
move ipython fabfiles to ipython.py
rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh
fabfile/india.py
fabfile/india.py
from fabric.api import task from util import ec2secgroup_openport, yaml_file_replace @task def configure(): """configure india environment for cloudmesh rapid deployment""" yaml_file_replace(filename='/cloudmesh_server.yaml', replacements={ 'browser: T...
from fabric.api import task from util import ec2secgroup_openport, yaml_file_replace @task def configure(): """configure india environment for cloudmesh rapid deployment""" yaml_file_replace(filename='/cloudmesh_server.yaml', replacements={ 'browser: T...
apache-2.0
Python
2dece45476170e24e14903f19f9bf400c10ebf42
Allow WOW animations to be used in text plugin.
narayanaditya95/djangocms-wow,narayanaditya95/djangocms-wow,narayanaditya95/djangocms-wow
djangocms_wow/cms_plugins.py
djangocms_wow/cms_plugins.py
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from . import models class AnimationPlugin(CMSPluginBase): model = models.Animation name = _('Animation') render_template = 'djangocms_wow/ani...
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from . import models class AnimationPlugin(CMSPluginBase): model = models.Animation name = _('Animation') render_template = 'djangocms_wow/ani...
bsd-3-clause
Python
50eba1720cd34684eaf0a931e28474ad987ea699
Change polling interval to 5 seconds
asana/python-asana,asana/python-asana,Asana/python-asana
asana/resources/events.py
asana/resources/events.py
from ._events import _Events from ..error import InvalidTokenError import time class Events(_Events): POLL_INTERVAL = 5000 def get_next(self, params): params = params.copy() if 'sync' not in params: try: self.get(params) except InvalidTokenError as e: ...
from ._events import _Events from ..error import InvalidTokenError import time class Events(_Events): POLL_INTERVAL = 1000 def get_next(self, params): params = params.copy() if 'sync' not in params: try: self.get(params) except InvalidTokenError as e: ...
mit
Python
b6112b62c2951de39146013b4d82777ec0b29470
Make setup.py work on RHEL5
pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus
lib/pegasus/python/setup.py
lib/pegasus/python/setup.py
import os import sys import subprocess from setuptools import setup, find_packages srcdir = os.path.dirname(__file__) homedir = os.path.abspath(os.path.join(srcdir, "../../..")) # Utility function to read the pegasus Version.in file def readversion(): return subprocess.Popen("%s/release-tools/getversion" % homedi...
import os import sys import subprocess from setuptools import setup, find_packages srcdir = os.path.dirname(__file__) homedir = os.path.abspath(os.path.join(srcdir, "../../..")) # Utility function to read the pegasus Version.in file def readversion(): return subprocess.Popen("%s/release-tools/getversion" % homedi...
apache-2.0
Python
e099b7457b7401eb780fd5da2bd6efc947a97449
Fix test coverage
SCUEvals/scuevals-api,SCUEvals/scuevals-api
tests/auth/test_decorators.py
tests/auth/test_decorators.py
import json from flask_jwt_extended import create_access_token from scuevals_api.models import db from tests import TestCase from tests.fixtures.factories import StudentFactory class AuthRequiredTestCase(TestCase): def test_incorrect_permissions(self): student = StudentFactory(permissions=[]) db...
import json from flask_jwt_extended import create_access_token from scuevals_api.models import db from tests import TestCase from tests.fixtures.factories import StudentFactory class AuthRequiredTestCase(TestCase): def test_incorrect_permissions(self): student = StudentFactory(permissions=[]) db...
agpl-3.0
Python
0208a3884b9fb648452297a6e1c2358c61d0d124
Remove redundant asserts
takeflight/cookiecutter,sp1rs/cookiecutter,janusnic/cookiecutter,vincentbernat/cookiecutter,moi65/cookiecutter,terryjbates/cookiecutter,michaeljoseph/cookiecutter,agconti/cookiecutter,janusnic/cookiecutter,jhermann/cookiecutter,kkujawinski/cookiecutter,nhomar/cookiecutter,sp1rs/cookiecutter,benthomasson/cookiecutter,ve...
tests/test_find.py
tests/test_find.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_find --------- Tests for `cookiecutter.find` module. """ import os import pytest from cookiecutter import find @pytest.fixture(params=['fake-repo-pre', 'fake-repo-pre2']) def repo_dir(request): return os.path.join('tests', request.param) def test_find_t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_find --------- Tests for `cookiecutter.find` module. """ import os import pytest from cookiecutter import find @pytest.fixture(params=['fake-repo-pre', 'fake-repo-pre2']) def repo_dir(request): return os.path.join('tests', request.param) def test_find_t...
bsd-3-clause
Python
d0bf37eeb8bb00a4b7bed195663e18049ca2228a
Add traling comma
tomchristie/apistar,tomchristie/apistar,encode/apistar,tomchristie/apistar,rsalmaso/apistar,rsalmaso/apistar,encode/apistar,rsalmaso/apistar,tomchristie/apistar,rsalmaso/apistar,encode/apistar,encode/apistar
tests/backends/test_django.py
tests/backends/test_django.py
from os import environ import dj_database_url import apistar from apistar import App, http, routing, test from apistar.backends import DjangoBackend from apistar.commands import django_makemigrations, django_migrate from apistar.test import CommandLineRunner def list_stars(orm: DjangoBackend): Star = orm.Star ...
from os import environ import dj_database_url import apistar from apistar import App, http, routing, test from apistar.backends import DjangoBackend from apistar.commands import django_makemigrations, django_migrate from apistar.test import CommandLineRunner def list_stars(orm: DjangoBackend): Star = orm.Star ...
bsd-3-clause
Python
3b2a96796dab6c5844f37a9467b70980f50e2931
Update P1_strongPwDetect.py added docstrings and wrapped in main() function
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
pythontutorials/books/AutomateTheBoringStuff/Ch07/Projects/P1_strongPwDetect.py
pythontutorials/books/AutomateTheBoringStuff/Ch07/Projects/P1_strongPwDetect.py
"""Strong password detection This program ensures passwords entered are "strong." Write a function, :meth:`is_strong_pw`, that uses regular expressions to make sure the password string it is passed is strong. A strong password is defined as one that is at least eight characters long, contains both uppercase and lowe...
# Strong Password Detection - this program ensures passwords entered are "strong" # # Write a function that uses regular expressions to make sure the password string # it is passed is strong. A strong password is defined as one that is at least eight # characters long, contains both uppercase and lowercase characters, ...
mit
Python
a6c3012ff25106d6770c34189d72179e16594bc2
fix variable name
yuyu2172/chainercv,chainer/chainercv,chainer/chainercv,pfnet/chainercv,yuyu2172/chainercv
tests/links_tests/model_tests/resnet_tests/test_resnet.py
tests/links_tests/model_tests/resnet_tests/test_resnet.py
import unittest import numpy as np from chainer import testing from chainer.testing import attr from chainer import Variable from chainercv.links import ResNet101 from chainercv.links import ResNet152 from chainercv.links import ResNet50 @testing.parameterize(*( testing.product_dict( [ {'pi...
import unittest import numpy as np from chainer import testing from chainer.testing import attr from chainer import Variable from chainercv.links import ResNet101 from chainercv.links import ResNet152 from chainercv.links import ResNet50 @testing.parameterize(*( testing.product_dict( [ {'pi...
mit
Python
422910a398a2c14da0bac2c39551beec861c4504
test impôts
benjello/openfisca-france,SophieIPP/openfisca-france,adrienpacifico/openfisca-france,adrienpacifico/openfisca-france,antoinearnoud/openfisca-france,sgmap/openfisca-france,SophieIPP/openfisca-france,benjello/openfisca-france,sgmap/openfisca-france,antoinearnoud/openfisca-france
tests/test_irpp.py
tests/test_irpp.py
# -*- coding:utf-8 -*- # Created on 14 mai 2013 # This file is part of OpenFisca. # OpenFisca is a socio-fiscal microsimulation software # Copyright ©2013 Clément Schaff, Mahdi Ben Jelloul # Licensed under the terms of the GVPLv3 or later license # (see openfisca/__init__.py for details) import nose from src.lib.simul...
# -*- coding:utf-8 -*- # Created on 14 mai 2013 # This file is part of OpenFisca. # OpenFisca is a socio-fiscal microsimulation software # Copyright ©2013 Clément Schaff, Mahdi Ben Jelloul # Licensed under the terms of the GVPLv3 or later license # (see openfisca/__init__.py for details) import nose from src.lib.simul...
agpl-3.0
Python
213da28887ef2e9be1c9d3a45f72a7e27618b2c3
add Valeera
rhots/automation
automation/heroes_data.py
automation/heroes_data.py
# This is a list of official hero names in order of release date. The # first set of heroes from Abathur to Zeratul were available on # release. The rest are listed in chronological order of release. New # heroes should be added to the end of the list. HEROES = [ "Abathur", "Arthas", "Diablo", "E.T.C.",...
# This is a list of official hero names in order of release date. The # first set of heroes from Abathur to Zeratul were available on # release. The rest are listed in chronological order of release. New # heroes should be added to the end of the list. HEROES = [ "Abathur", "Arthas", "Diablo", "E.T.C.",...
isc
Python