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 |
|---|---|---|---|---|---|---|---|---|
7c120c02097bfaa1f494627ac93d6cddf5fb9049 | FIX adding newline for chunks | ecarreras/cutools | cutools/diff/__init__.py | cutools/diff/__init__.py | from hashlib import md5
from clint.textui import puts, colored
def clean_diff(diff):
"""Removes diff header from a diff.
"""
res = []
skip = True
for line in diff.split('\n'):
if line.startswith('diff --git'):
skip = True
if line.startswith('@@ '):
skip = Fa... | from hashlib import md5
from clint.textui import puts, colored
def clean_diff(diff):
"""Removes diff header from a diff.
"""
res = []
skip = True
for line in diff.split('\n'):
if line.startswith('diff --git'):
skip = True
if line.startswith('@@ '):
skip = Fa... | isc | Python |
c8fa72a130d84d921b23f5973dafb8fa91367381 | Make ip_type a RadioSelect in the PTR form | drkitty/cyder,murrown/cyder,zeeman/cyder,murrown/cyder,OSU-Net/cyder,murrown/cyder,OSU-Net/cyder,akeym/cyder,akeym/cyder,zeeman/cyder,akeym/cyder,murrown/cyder,akeym/cyder,drkitty/cyder,zeeman/cyder,OSU-Net/cyder,zeeman/cyder,drkitty/cyder,OSU-Net/cyder,drkitty/cyder | cyder/cydns/ptr/forms.py | cyder/cydns/ptr/forms.py | from django import forms
from cyder.cydns.forms import DNSForm
from cyder.cydns.ptr.models import PTR
class PTRForm(DNSForm):
def delete_instance(self, instance):
instance.delete()
class Meta:
model = PTR
exclude = ('ip', 'reverse_domain', 'ip_upper',
'ip_lower')
... | from django import forms
from cyder.cydns.forms import DNSForm
from cyder.cydns.ptr.models import PTR
class PTRForm(DNSForm):
def delete_instance(self, instance):
instance.delete()
class Meta:
model = PTR
exclude = ('ip', 'reverse_domain', 'ip_upper',
'ip_lower')
... | bsd-3-clause | Python |
e68c85ae4526557efd0d3c1bd45857583d542659 | handle errors in better bibtex | rafaqz/citation.vim | python/citation_vim/zotero/betterbibtex.py | python/citation_vim/zotero/betterbibtex.py | # -*- coding: utf-8 -*-
import os
import shutil
import json
import sqlite3
class betterBibtex(object):
def __init__(self, zotero_path, cache_path):
self.bb_file = os.path.join(zotero_path, 'better-bibtex/db.json')
self.bb_database = os.path.join(zotero_path, 'betterbibtex-lokijs.sqlite')
... | # -*- coding: utf-8 -*-
import os
import shutil
import json
import sqlite3
class betterBibtex(object):
def __init__(self, zotero_path, cache_path):
self.bb_file = os.path.join(zotero_path, 'better-bibtex/db.json')
self.bb_database = os.path.join(zotero_path, 'betterbibtex-lokijs.sqlite')
... | mit | Python |
cbdbe14365d5caad28fe77d9c2ca1c66cbf783bd | test travis turning off db switch | sdss/marvin,bretthandrews/marvin,albireox/marvin,bretthandrews/marvin,sdss/marvin,bretthandrews/marvin,albireox/marvin,albireox/marvin,sdss/marvin,bretthandrews/marvin,albireox/marvin,sdss/marvin | python/marvin/tests/misc/test_db_switch.py | python/marvin/tests/misc/test_db_switch.py | #!/usr/bin/env python2
# encoding: utf-8
#
# test_db_switch.py
#
# Created by José Sánchez-Gallego on Sep 7, 2016.
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
def create_connection(db_name):
"""Creates the connection and import the model classes."... | #!/usr/bin/env python2
# encoding: utf-8
#
# test_db_switch.py
#
# Created by José Sánchez-Gallego on Sep 7, 2016.
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
def create_connection(db_name):
"""Creates the connection and import the model classes."... | bsd-3-clause | Python |
c8df75a2112cd8e6a4f929ceac21714b716e46ce | Use the IRC nickname for !twitter if one is not provided. | DASPRiD/DASBiT | dasbit/plugin/twitter.py | dasbit/plugin/twitter.py | from twisted.web.client import getPage
from urllib import urlencode
import json
class Twitter:
def __init__(self, manager):
self.client = manager.client
manager.registerCommand('twitter', 'lookup', 'twitter', '(?P<query>.*?)', self.lookup)
def lookup(self, source, query):
if query.isd... | from twisted.web.client import getPage
from urllib import urlencode
import json
class Twitter:
def __init__(self, manager):
self.client = manager.client
manager.registerCommand('twitter', 'lookup', 'twitter', '(?P<query>.*?)', self.lookup)
def lookup(self, source, query):
if query.isd... | bsd-3-clause | Python |
774da53edef30cb2f3c45cc47c63d46f142a4e07 | Use four space indentation, repo_path to arguments | RepoReapers/reaper,RepoReapers/reaper,RepoReapers/reaper,RepoReapers/reaper | score_repo.py | score_repo.py | #!/usr/bin/env python3
import argparse
import importlib
import json
import os
import sys
def load_attribute_plugins(attributes):
for attribute in attributes:
if attribute['enabled']:
try:
attribute['implementation'] = importlib.import_module("attributes.{0}.main".format(attribu... | #!/usr/bin/env python3
import argparse
import importlib
import json
import sys
def loadAttributePlugins(attributes):
for attribute in attributes:
if attribute['enabled']:
try:
attribute['implementation'] = importlib.import_module("attributes.{0}.main".format(attribute['name']))
except Import... | apache-2.0 | Python |
40bbb06c222d6be1f59d32204a7636eaf023e5d4 | reduce minimal read count per segment to 200 | medvir/SmaltAlign,medvir/SmaltAlign,medvir/SmaltAlign | select_ref.py | select_ref.py | #!/opt/miniconda/bin/python3
import sys
import subprocess
from textwrap import fill
import pandas as pd
from Bio import SeqIO
readfile = sys.argv[1]
allrefs = dict([(s.id.split('_')[0], str(s.seq))
for s in SeqIO.parse('/rv_home/stschmu/Repositories/SmaltAlign/References/flugenomes.fasta', 'fasta')])... | #!/opt/miniconda/bin/python3
import sys
import subprocess
from textwrap import fill
import pandas as pd
from Bio import SeqIO
readfile = sys.argv[1]
allrefs = dict([(s.id.split('_')[0], str(s.seq))
for s in SeqIO.parse('/rv_home/stschmu/Repositories/SmaltAlign/References/flugenomes.fasta', 'fasta')])... | mit | Python |
47c7cccc674beee06c2d4d6f6f197cb860d33354 | Update bno055.py | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | home/Calamity/bno055.py | home/Calamity/bno055.py | arduino = Runtime.createAndStart("arduino","Arduino")
arduino.connect("COM11")
bno = Runtime.createAndStart("bno","Bno055")
bno.setController(arduino)
if bno.begin():
while (True):
event = bno.getEvent()
print event.orientation.x
print event.orientation.y
print event.orientation.z
sleep(1)
| arduino = Runtime.createAndStart("arduino","Arduino")
arduino.connect("COM11")
bno = Runtime.createAndStart("bno","Bno055")
bno.setController(arduino)
if bno.begin():
event = bno.getEvent()
print event.orientation.x
print event.orientation.y
print event.orientation.z
| apache-2.0 | Python |
59f96d2ca0f3752052d870ef9c7bc5bc21f21e40 | add header | SiLab-Bonn/basil,SiLab-Bonn/basil,MarcoVogt/basil | host/pydaq/HL/tdc_s3.py | host/pydaq/HL/tdc_s3.py | #
# ------------------------------------------------------------
# Copyright (c) SILAB , Physics Institute of Bonn University
# ------------------------------------------------------------
#
# SVN revision information:
# $Rev:: $:
# $Author:: $:
# $Date:: ... | #
# ------------------------------------------------------------
# Copyright (c) SILAB , Physics Institute of Bonn University
# ------------------------------------------------------------
#
# SVN revision information:
# $Rev:: 1 $:
# $Author:: TheresaObermann $:
# $Date:: 2013-10-09 10... | bsd-3-clause | Python |
f52921e78cc6a8af38df50f0b0ba4d04b15fd768 | fix the import error in db.py | giphub/gip,giphub/gip,giphub/gip | service/db.py | service/db.py | #coding=utf-8
import torndb
import datetime
from constants.errorcode import Errorcode
from util.gip_exception import GipException
class DB(object):
def __init__(self, application):
self.mysql_read = application.mysql_conn_read
self.mysql_write = application.mysql_conn_write
#self.mong... | #coding=utf-8
import torndb
import datetime
from constants.errorcode import Errorcode
from util.lt_exception import LTException
class DB(object):
def __init__(self, application):
self.mysql_read = application.mysql_conn_read
self.mysql_write = application.mysql_conn_write
... | mit | Python |
0b4b57f90ee3d0fe0af3ba9921adccda784d6301 | Allow to order payment profile by name, type and status. | opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind | src/waldur_mastermind/invoices/filters.py | src/waldur_mastermind/invoices/filters.py | import django_filters
from rest_framework import filters
from waldur_core.core import filters as core_filters
from . import models
class InvoiceFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(
view_name='customer-detail', field_name='customer__uuid'
)
customer_uuid = django_f... | import django_filters
from rest_framework import filters
from waldur_core.core import filters as core_filters
from . import models
class InvoiceFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(
view_name='customer-detail', field_name='customer__uuid'
)
customer_uuid = django_f... | mit | Python |
af0fbfe74ecaac67fb37f03e01a9aefcd06ce83f | Change default scriptPubKey in coinbase | bitcoinxt/bitcoinxt,dagurval/bitcoinxt,dagurval/bitcoinxt,bitcoinxt/bitcoinxt,bitcoinxt/bitcoinxt,dagurval/bitcoinxt,bitcoinxt/bitcoinxt,dagurval/bitcoinxt,bitcoinxt/bitcoinxt,bitcoinxt/bitcoinxt,dagurval/bitcoinxt,dagurval/bitcoinxt | qa/rpc-tests/test_framework/blocktools.py | qa/rpc-tests/test_framework/blocktools.py | # blocktools.py - utilities for manipulating blocks and transactions
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from script import CScript, CScriptOp, OP_TRUE, OP_CHECKSIG
# Create a block (wit... | # blocktools.py - utilities for manipulating blocks and transactions
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from script import CScript, CScriptOp
# Create a block (with regtest difficulty)
... | mit | Python |
4d413d45def838d730806097484d7ccf9d49744f | Fix to test code | zenotech/MyCluster,zenotech/MyCluster | mycluster/test.py | mycluster/test.py |
import mycluster
mycluster.init()
mycluster.create_submit('hybrid:hybrid.q',script_name='test.job',num_tasks=2,
tasks_per_node=2,
my_script='test.bsh',
... |
import mycluster
mycluster.create_submit('hybrid:hybrid.q',script_name='test.job',num_tasks=2,
tasks_per_node=2,
my_script='test.bsh',
... | bsd-3-clause | Python |
4c29471af61989e852a813999cf37aa9a8acf76d | test anon to /users endpoint | awemulya/fieldsight-kobocat,mainakibui/kobocat,piqoni/onadata,spatialdev/onadata,GeoODK/onadata,smn/onadata,qlands/onadata,jomolinare/kobocat,GeoODK/onadata,spatialdev/onadata,mainakibui/kobocat,mainakibui/kobocat,mainakibui/kobocat,kobotoolbox/kobocat,spatialdev/onadata,hnjamba/onaclone,sounay/flaminggo-test,kobotoolb... | onadata/apps/api/tests/viewsets/test_user_viewset.py | onadata/apps/api/tests/viewsets/test_user_viewset.py | import json
from onadata.apps.api.tests.viewsets.test_abstract_viewset import\
TestAbstractViewSet
from onadata.apps.api.viewsets.user_viewset import UserViewSet
class TestUserViewSet(TestAbstractViewSet):
def setUp(self):
super(self.__class__, self).setUp()
def test_user_list(self):
vie... | import json
from onadata.apps.api.tests.viewsets.test_abstract_viewset import\
TestAbstractViewSet
from onadata.apps.api.viewsets.user_viewset import UserViewSet
class TestUserViewSet(TestAbstractViewSet):
def setUp(self):
super(self.__class__, self).setUp()
def test_user_list(self):
vie... | bsd-2-clause | Python |
9e30bc38cfa3cb000ab2d84730552d50ea604ac1 | configure wsgi file to use whitenoise | arnaudlimbourg/heroku-libsass-python,arnaudlimbourg/heroku-libsass-python,arnaudlimbourg/heroku-libsass-python | heroku-libsass-python/wsgi.py | heroku-libsass-python/wsgi.py | """
WSGI config for project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting... | """
WSGI config for project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting... | bsd-3-clause | Python |
d6371341c13ffe623755cf89ff03733c111bb994 | change to rga2 | NSLS-II-XPD/ipython_ophyd,NSLS-II-XPD/ipython_ophyd | profile_collection/startup/12-rga.py | profile_collection/startup/12-rga.py | ### This is RGA:2 configured for ExQ new RGA connected at 10.28.2.142 #####
from ophyd import Device, Component as Cpt
class RGA(Device):
startRGA = Cpt(EpicsSignal, 'Cmd:MID_Start-Cmd')
stopRGA = Cpt(EpicsSignal, 'Cmd:ScanAbort-Cmd')
mass1 = Cpt(EpicsSignalRO, 'P:MID1-I')
mass2 = Cpt(EpicsSignalRO, '... | from ophyd import Device, Component as Cpt
class RGA(Device):
startRGA = Cpt(EpicsSignal, 'Cmd:MID_Start-Cmd')
stopRGA = Cpt(EpicsSignal, 'Cmd:ScanAbort-Cmd')
mass1 = Cpt(EpicsSignalRO, 'P:MID1-I')
mass2 = Cpt(EpicsSignalRO, 'P:MID2-I')
mass3 = Cpt(EpicsSignalRO, 'P:MID3-I')
mass4 = Cpt(EpicsS... | bsd-2-clause | Python |
ec46226b0ae5e9d2c29aa07f2ec6749f96a36804 | add str isValidPalindrome | Daetalus/Algorithms | str/string_function.py | str/string_function.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
def reverseStr(input_str, begin, end):
# Pythonic way should be input_str[::-1]
str_list = list(input_str)
while begin < end:
str_list[begin], ... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
def reverseStr(input_str, begin, end):
# Pythonic way should be input_str[::-1]
str_list = list(input_str)
while begin < end:
str_list[begin], ... | unlicense | Python |
39bf1b019897b71a3269e46816f11eefa32de507 | Fix argument order | NoRedInk/elm-ops-tooling,NoRedInk/elm-ops-tooling | elm_package.py | elm_package.py | #! /usr/bin/env python
"""
Load and save elm-package.json safely.
"""
# from typing import Dict, Tuple, IO
import copy
from collections import OrderedDict
import json
def load(fileobj):
# type: (IO[str]) -> Dict
return json.load(fileobj, object_pairs_hook=OrderedDict)
def dump(package, fileobj):
# type... | #! /usr/bin/env python
"""
Load and save elm-package.json safely.
"""
# from typing import Dict, Tuple, IO
import copy
from collections import OrderedDict
import json
def load(fileobj):
# type: (IO[str]) -> Dict
return json.load(fileobj, object_pairs_hook=OrderedDict)
def dump(package, fileobj):
# type... | bsd-3-clause | Python |
552a9e958443ffdff4b28e6e432c09e7d011df6a | Update tesselate_shapes_frame docstring | wheeler-microfluidics/svg_model | svg_model/tesselate.py | svg_model/tesselate.py | # coding: utf-8
import types
import pandas as pd
from .seidel import Triangulator
def tesselate_shapes_frame(df_shapes, shape_i_columns):
'''
Tesselate each shape path into one or more triangles.
Parameters
----------
df_shapes : pandas.DataFrame
Table containing vertices of shapes, one ... | # coding: utf-8
import types
import pandas as pd
from .seidel import Triangulator
def tesselate_shapes_frame(df_shapes, shape_i_columns):
'''
Tesselate each shape path into one or more triangles.
Return `pandas.DataFrame` with columns storing the following fields
for each row (where each row corresp... | lgpl-2.1 | Python |
dfee7e1c89df879f187921752485153fd6214445 | Fix typo | ipython/ipython,ipython/ipython | IPython/extensions/cythonmagic.py | IPython/extensions/cythonmagic.py | # -*- coding: utf-8 -*-
"""
The cython magic has been integrated into Cython itself,
which is now released in version 0.21.
cf github `Cython` organisation, `Cython` repo, under the
file `Cython/Build/IpythonMagic.py`
"""
#-----------------------------------------------------------------------------
# Copyright (C) ... | # -*- coding: utf-8 -*-
"""
The cython magic has been integrated into Cython itself,
which is now released in version 0.21.
cf github `Cython` organisation, `Cython` repo, under the
file `Cython/Build/IpythonMagic.py`
"""
#-----------------------------------------------------------------------------
# Copyright (C) ... | bsd-3-clause | Python |
9f56f877705bdc0171c3afddadc6d58fb867cefc | Fix PEP 8 issue. | thaim/ansible,thaim/ansible | test/units/modules/system/test_systemd.py | test/units/modules/system/test_systemd.py | import os
import tempfile
from ansible.compat.tests import unittest
from ansible.modules.system.systemd import parse_systemctl_show
class ParseSystemctlShowTestCase(unittest.TestCase):
def test_simple(self):
lines = [
'Type=simple',
'Restart=no',
'Requires=system.slic... | import os
import tempfile
from ansible.compat.tests import unittest
from ansible.modules.system.systemd import parse_systemctl_show
class ParseSystemctlShowTestCase(unittest.TestCase):
def test_simple(self):
lines = [
'Type=simple',
'Restart=no',
'Requires=system.slic... | mit | Python |
52c6efa0a84334522cdd76e1e85ffe6bf601ea02 | Annotate commands/export_single_user.py. | dhcrzf/zulip,eeshangarg/zulip,jphilipsen05/zulip,Galexrt/zulip,tommyip/zulip,calvinleenyc/zulip,jainayush975/zulip,synicalsyntax/zulip,amanharitsh123/zulip,kou/zulip,SmartPeople/zulip,susansls/zulip,AZtheAsian/zulip,jackrzhang/zulip,samatdav/zulip,ahmadassaf/zulip,TigorC/zulip,grave-w-grave/zulip,Jianchun1/zulip,niftyn... | zerver/management/commands/export_single_user.py | zerver/management/commands/export_single_user.py | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
import os
import shutil
import subprocess
import tempfile
import... | from __future__ import absolute_import
from __future__ import print_function
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
import os
import shutil
import subprocess
import tempfile
import ujson
from zerver.lib.export import do_export_user
from ze... | apache-2.0 | Python |
2a2309bb4f3a8ae231106123855959d44a0e7551 | Fix linter | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/viz/helpers/size_continuous_layer.py | cartoframes/viz/helpers/size_continuous_layer.py | from __future__ import absolute_import
from ..layer import Layer
def size_continuous_layer(source, value, title='', size=None, color=None):
return Layer(
source,
style={
'point': {
'width': 'ramp(linear(sqrt(${0}), sqrt(globalMin(${0})), sqrt(globalMax(${0}))), {1})'.f... | from __future__ import absolute_import
from ..layer import Layer
def size_continuous_layer(source, value, title='', size=None, color=None):
return Layer(
source,
style={
'point': {
'width': 'ramp(linear(sqrt(${0}), sqrt(globalMin(${0})), sqrt(globalMax(${0}))), {1})'.f... | bsd-3-clause | Python |
c426ae514227adaf9dd86f6ada6ce05bc76298c2 | Make portal_config fetch config from a URL | EndPointCorp/appctl,EndPointCorp/appctl | catkin/src/portal_config/scripts/serve_config.py | catkin/src/portal_config/scripts/serve_config.py | #!/usr/bin/env python
import rospy
import urllib2
from portal_config.srv import *
# XXX TODO: return an error if the config file isn't valid JSON
class ConfigRequestHandler():
def __init__(self, url):
self.url = url
def get_config(self):
response = urllib2.urlopen(self.url)
return re... | #!/usr/bin/env python
import rospy
from portal_config.srv import *
class ConfigRequestHandler():
def __init__(self, url):
self.url = url
def get_config(self):
return '{"foo": "bar"}'
def handle_request(self, request):
config = self.get_config()
return PortalConfigRespons... | apache-2.0 | Python |
cb96065fcf1f31dfbecfbb064c9414ffbc69217f | Remove all relative imports. We have always been at war with relative imports. | brad/django-localflavor-gb | forms.py | forms.py | """
GB-specific Form helpers
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.gb.gb_regions import GB_NATIONS_CHOICES, GB_REGION_CHOICES
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as... | """
GB-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class GBPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... | bsd-3-clause | Python |
c78c6f7e9cc305b96eb35a5a0c8f7353db5a3ed2 | Update _share.py | tago-io/tago-python | tago/account/_share.py | tago/account/_share.py | import requests # Used to make HTTP requests
import os
import json
API_TAGO = os.environ.get('TAGO_SERVER') or 'https://api.tago.io'
def invite(type, ref_id, data, default_options):
data = data if data else {}
if ref_id is None or ref_id == '':
raise ValueError('ref_id must be set')
elif data['ema... | import requests # Used to make HTTP requests
import os
import json
API_TAGO = os.environ.get('TAGO_SERVER') or 'https://api.tago.io'
def invite(type, ref_id, data, default_options):
data = data if data else {}
if ref_id is None or ref_id == '':
raise ValueError('ref_id must be set')
elif data['ema... | mit | Python |
e0bebba359bca6498c212e1c1fae3d95d2a046b4 | Fix python scripts src/chrome_frame/tools/test/page_cycler/cf_cycler.py | adobe/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,gavinp/chr... | chrome_frame/tools/test/page_cycler/cf_cycler.py | chrome_frame/tools/test/page_cycler/cf_cycler.py | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Automates IE to visit a list of web sites while running CF in full tab mode.
The page cycler automates IE and navigates it to a... | # Copyright (c) 2009 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.
"""Automates IE to visit a list of web sites while running CF in full tab mode.
The page cycler automates IE and navigates it to a series of URLs.... | bsd-3-clause | Python |
3575415592fbd215de02e139d95ad5780bccadd2 | Add greeting method that returns given parameter | ttn6ew/cs3240-labdemo | hello.py | hello.py |
def greeting(msg):
print(msg)
if __name__ == "__main__":
greeting('hello')
| print("Hello")
| mit | Python |
f2e8f2ef957a6053345f72889c1048a871988bc0 | Add octario library path to the plugin helper | redhat-openstack/octario,redhat-openstack/octario | ir-plugin/osp_version_name.py | ir-plugin/osp_version_name.py | #!/usr/bin/env python
# Copyright 2017 Red Hat, Inc.
# 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
#
... | #!/usr/bin/env python
# Copyright 2017 Red Hat, Inc.
# 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
#
... | apache-2.0 | Python |
5a5418a9e5f817c3c3f426f57aeefe800c45cc96 | Implement tuples. | iksteen/jaspyx,ztane/jaspyx | jaspyx/visitor/types.py | jaspyx/visitor/types.py | import json
from jaspyx.visitor import BaseVisitor
class Types(BaseVisitor):
def visit_Num(self, node):
self.output(json.dumps(node.n))
def visit_Str(self, node):
self.output(json.dumps(node.s))
def visit_List(self, node):
self.group(node.elts, prefix='[', infix=', ', suffix=']')... | import json
from jaspyx.visitor import BaseVisitor
class Types(BaseVisitor):
def visit_Num(self, node):
self.output(json.dumps(node.n))
def visit_Str(self, node):
self.output(json.dumps(node.s))
def visit_List(self, node):
self.group(node.elts, prefix='[', infix=', ', suffix=']')... | mit | Python |
5cda63163acec59a43c3975f1320b7268dcf337b | Add parameter for log level | opesci/devito,opesci/devito | devito/parameters.py | devito/parameters.py | """The parameters dictionary contains global parameter settings."""
__all__ = ['Parameters', 'parameters']
# Be EXTREMELY careful when writing to a Parameters dictionary
# Read here for reference: http://wiki.c2.com/?GlobalVariablesAreBad
# https://softwareengineering.stackexchange.com/questions/148108/why-is-global-... | """The parameters dictionary contains global parameter settings."""
__all__ = ['Parameters', 'parameters']
# Be EXTREMELY careful when writing to a Parameters dictionary
# Read here for reference: http://wiki.c2.com/?GlobalVariablesAreBad
# If any issues related to global state arise, the following class should
# be ... | mit | Python |
8555fc56b72dc86f266055da4b903cda7986654b | Update utils.py to prevent downcasting | zafarali/emdp | emdp/utils.py | emdp/utils.py | import numpy as np
# 1D utilities.
def convert_int_rep_to_onehot(state, vector_size):
s = np.zeros(vector_size)
s[state] = 1
return s
def convert_onehot_to_int(state):
if type(state) is not np.ndarray:
state = np.array(state)
return state.argmax().item()
#
# def xy_to_flatten_state(state, ... | import numpy as np
# 1D utilities.
def convert_int_rep_to_onehot(state, vector_size):
s = np.zeros(vector_size)
s[state] = 1
return s
def convert_onehot_to_int(state):
if type(state) is not np.ndarray:
state = np.array(state)
return state.argmax().astype(np.int8)
#
# def xy_to_flatten_stat... | mit | Python |
76aa0d680f85298ca66de7bbcd0dbdc2342c9955 | Update Vikidia versions | happy5214/pywikibot-core,Darkdadaah/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,hasteur/g13bot_tools_new,happy5214/pywikibot-core,Darkdadaah/pywikibot-core,wikimedia/pywikibot-core,wikimedia/pywikibot-core,npdoty/pywikibot,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,magul/pywikibot-core,magul/pywik... | pywikibot/families/vikidia_family.py | pywikibot/families/vikidia_family.py | # -*- coding: utf-8 -*-
"""Family module for Vikidia."""
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot import family
class Family(family.SubdomainFamily):
"""Family class for Vikidia."""
name = 'vikidia'
domain = 'vikidia.org'
codes = ['ca', 'de', '... | # -*- coding: utf-8 -*-
"""Family module for Vikidia."""
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot import family
class Family(family.SubdomainFamily):
"""Family class for Vikidia."""
name = 'vikidia'
domain = 'vikidia.org'
codes = ['ca', 'en', '... | mit | Python |
5138db4353edf7414c79ca8e1e42c73b35313b15 | Remove various now unused interfaces. | faassen/morepath,morepath/morepath,taschini/morepath | morepath/interfaces.py | morepath/interfaces.py | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
class Interface(object):
__meta__ = ABCMeta
# class IConsumer(Interface):
# """A consumer consumes steps in a stack to find an object.
# """
# @abstractmethod
# def __call__(self, obj, stack, lookup):
# """Returns a boolean ... | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
class Interface(object):
__meta__ = ABCMeta
class IConsumer(Interface):
"""A consumer consumes steps in a stack to find an object.
"""
@abstractmethod
def __call__(self, obj, stack, lookup):
"""Returns a boolean meaning that... | bsd-3-clause | Python |
a0791372d7943a785ae55ed31044d0316b53a2ac | Patch release | sbaechler/feincms-elephantblog,matthiask/feincms-elephantblog,michaelkuty/feincms-elephantblog,matthiask/feincms-elephantblog,matthiask/feincms-elephantblog,michaelkuty/feincms-elephantblog,sbaechler/feincms-elephantblog,feincms/feincms-elephantblog,michaelkuty/feincms-elephantblog,sbaechler/feincms-elephantblog,feincm... | elephantblog/__init__.py | elephantblog/__init__.py | from __future__ import absolute_import, unicode_literals
VERSION = (1, 0, 1)
__version__ = '.'.join(map(str, VERSION))
| from __future__ import absolute_import, unicode_literals
VERSION = (1, 0, 0)
__version__ = '.'.join(map(str, VERSION))
| bsd-3-clause | Python |
34a6ccce1d93843d53efb5985ff5bbb7ea063e31 | add force_text a la Django | mitsuhiko/babel,python-babel/babel,mitsuhiko/babel,python-babel/babel,mitsuhiko/babel | babel/_compat.py | babel/_compat.py | import sys
import array
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if not PY2:
text_type = str
binary_type = bytes
string_types = (str,)
integer_types = (int, )
text_to_native = lambda s, enc: s
unichr = chr
iterkeys = lambda d: iter(d.keys())
itervalues = lambda d: ite... | import sys
import array
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if not PY2:
text_type = str
string_types = (str,)
integer_types = (int, )
unichr = chr
text_to_native = lambda s, enc: s
iterkeys = lambda d: iter(d.keys())
itervalues = lambda d: iter(d.values())
iterit... | bsd-3-clause | Python |
b65b359402b2f38dad043b1b6d1840f0ef6d8e72 | Fix constants | prozorro-sale/openprocurement.auctions.dgf | openprocurement/auctions/dgf/constants.py | openprocurement/auctions/dgf/constants.py | from datetime import datetime, timedelta
from openprocurement.api.models import TZ, ORA_CODES
def read_json(name):
import os.path
from json import loads
curr_dir = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(curr_dir, name)
with open(file_path) as lang_file:
data =... | from datetime import datetime, timedelta
from openprocurement.api.models import TZ, ORA_CODES
def read_json(name):
import os.path
from json import loads
curr_dir = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(curr_dir, name)
with open(file_path) as lang_file:
data =... | apache-2.0 | Python |
2fb1c14f9ad0b72f1f059d7e5e233b8001c2b60b | Update auth tests | MichaelCurrin/twitterverse,MichaelCurrin/twitterverse | app/tests/integration/test_twitter_api.py | app/tests/integration/test_twitter_api.py | # -*- coding: utf-8 -*-
"""
Twitter API test module.
Do requests to the Twitter API using configured credentials. NB. These require
valid tokens for a Twitter dev account, plus a network connection.
"""
from unittest import TestCase
from lib.config import AppConf
from lib.twitter_api import authentication
conf = App... | # -*- coding: utf-8 -*-
"""
Twitter API test module.
"""
from unittest import TestCase
from lib.twitter_api import authentication
class TestAuth(TestCase):
def test_generateAppToken(self):
auth = authentication._generateAppAccessToken()
def test_getTweepyConnection(self):
auth = authenticat... | mit | Python |
f91fc2a8858c243b62d1a9a369d45216fb15f443 | Change auth selenium test to use wait_element_become_present | jucacrispim/toxicbuild,jucacrispim/toxicbuild,jucacrispim/toxicbuild,jucacrispim/toxicbuild | tests/webui/steps/authentication_steps.py | tests/webui/steps/authentication_steps.py | # -*- coding: utf-8 -*-
import time
from behave import when, then, given
from toxicbuild.ui import settings
from tests.webui.steps.base_steps import ( # noqa f811
given_logged_in_webui, user_sees_main_main_page_login)
# Scenario: Someone try to access a page without being logged.
@when('someone tries to access... | # -*- coding: utf-8 -*-
import time
from behave import when, then, given
from toxicbuild.ui import settings
from tests.webui.steps.base_steps import ( # noqa f811
given_logged_in_webui, user_sees_main_main_page_login)
# Scenario: Someone try to access a page without being logged.
@when('someone tries to access... | agpl-3.0 | Python |
1ab8224372a5f839c8f0f74f3cafe7926905a7ec | Update __init__.py | breznak/nupic,breznak/nupic,breznak/nupic | nupic/__init__.py | nupic/__init__.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 | Python |
39986540e1ad1c4712405e46b988459f2abbf6e9 | Update for new python | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Communication/testUDP.py | Communication/testUDP.py | # -------------------------------------------------------
import socket, traceback
import time
host = ''
#host = '192.168.201.251'
port = 1234
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind((ho... | # -------------------------------------------------------
import socket, traceback
import time
host = ''
port = 12345
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind((host, port))
filein = open... | mit | Python |
862c42a8abf0836604f56a9008018f34c405ca13 | update version number | F5Networks/f5-common-python,F5Networks/f5-common-python,wojtek0806/f5-common-python | f5/__init__.py | f5/__init__.py | # Copyright 2016 F5 Networks 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 agreed to in writi... | # Copyright 2016 F5 Networks 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 agreed to in writi... | apache-2.0 | Python |
db36e08a81d16463d8c76b896593aaeb91c057a0 | Refactor into get_check_digit_from_checkable_int method | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/luhn.py | falcom/luhn.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
def get_check_digit_from_checkable_int (number):
return (9 * ((number // 10) + rotate_digit(number % 10))) % 10
def rotate_digit (digit)... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
def convert_into_luhn_checkable_int (number):
if number:
return int(number)
else:
return None
def rotate_digit (dig... | bsd-3-clause | Python |
29be4cad4ab90fe5d1fc087f0de2e8a575ced40b | Bump version | walkr/nanoservice | nanoservice/version.py | nanoservice/version.py | VERSION = '0.3.1'
| VERSION = '0.3.0'
| mit | Python |
f66e3e965c00c455608dba994575098e1cd246ae | Update request_tracking_codes.py | osantana/correios,olist/correios,solidarium/correios | samples/request_tracking_codes.py | samples/request_tracking_codes.py | # Copyright 2017 Adler Medrado
#
# 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... | from ..correios.client import Correios
from ..correios.models.user import User, Service
def get_tracking_codes(service, quantity):
olist_user = User('Your Company\'s Name', 'Your Company\'s CNPJ')
client = Correios('Your Correio\'s username', 'Your correio\'s password')
tracking_codes = client.request_tra... | apache-2.0 | Python |
f3791ea0ed11d46edf9998b80fd1ddd54d7e9b20 | Bump to pre-release version 1.0.rc2. | appfolio/farcy,appfolio/farcy,appfolio/farcy | farcy/const.py | farcy/const.py | """Constants used throughout Farcy."""
import os
import re
__version__ = '1.0.rc2'
VERSION_STR = 'farcy v{0}'.format(__version__)
CONFIG_DIR = os.path.expanduser('~/.config/farcy')
MD_VERSION_STR = ('[{0}](https://github.com/appfolio/farcy)'
.format(VERSION_STR))
FARCY_COMMENT_START = '_{0}_'.for... | """Constants used throughout Farcy."""
import os
import re
__version__ = '1.0.rc1'
VERSION_STR = 'farcy v{0}'.format(__version__)
CONFIG_DIR = os.path.expanduser('~/.config/farcy')
MD_VERSION_STR = ('[{0}](https://github.com/appfolio/farcy)'
.format(VERSION_STR))
FARCY_COMMENT_START = '_{0}_'.for... | bsd-2-clause | Python |
035d5feee8ea0691e5777a7b96c362877bcf01ca | Add logging | ThibF/G-youmus,ThibF/G-youmus | consumerSQS/consumer.py | consumerSQS/consumer.py | import boto3
import logging
from config import config
import answer
import json
import time
import librarian
def work(message):
message = json.loads(message)
print(type(message))
print(message)
return sendToManager(message)
def sendToManager(message):
if("entry" in message):
um = librarian... | import boto3
import logging
from config import config
import answer
import json
import time
import librarian
def work(message):
message = json.loads(message)
print(type(message))
print(message)
return sendToManager(message)
def sendToManager(message):
if("entry" in message):
um = librarian... | mit | Python |
e14b8c6b06c75414f42f730e4c1e1a9208e335b0 | correct shebang | ypnos/sonne,ypnos/sonne,ypnos/sonne | fetch/fetch.py | fetch/fetch.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Greedy climate data fetch
"""
filename = 'wwis.json'
indexurl = 'http://worldweather.wmo.int/en/json/full_city_list.txt'
baseurl = 'http://worldweather.wmo.int/en/json/{0}_en.xml'
guideurl = 'http://worldweather.wmo.int/en/dataguide.html'
notice = 'Please note the gui... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Greedy climate data fetch
"""
filename = 'wwis.json'
indexurl = 'http://worldweather.wmo.int/en/json/full_city_list.txt'
baseurl = 'http://worldweather.wmo.int/en/json/{0}_en.xml'
guideurl = 'http://worldweather.wmo.int/en/dataguide.html'
notice = 'Please note the guidelin... | agpl-3.0 | Python |
aeca55a5ca5a8b15314cc7bd31a3c89361436318 | Add return type check test | rwhitt2049/trouve,rwhitt2049/nimble | tests/test_pandas_integration.py | tests/test_pandas_integration.py | from unittest import TestCase, main
import numpy as np
import pandas as pd
import numpy.testing as npt
from nimble import Events
class TestAsPandasCondition(TestCase):
def setUp(self):
conditional_series = pd.Series([0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1])
condition = (conditional_series > 0)
... | from unittest import TestCase, main
import numpy as np
import pandas as pd
import numpy.testing as npt
from nimble import Events
class TestAsPandasCondition(TestCase):
def setUp(self):
conditional_series = pd.Series([0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1])
condition = (conditional_series > 0)
... | mit | Python |
7e13edfea2ee0c055f890fba08fa645141cd2f7d | add colourbar | ChristosT/colour-surfaces | helix.py | helix.py | # Create the data.
from numpy import pi, sin, cos, mgrid
[u,v] = mgrid[-5:5:0.01,0:2*pi+0.1:0.1]
a=2
x = u*cos(v)
y = u*sin(v)
z = a*v
K=-a**2/(u**2 +a**2)**2
from mayavi import mlab
s = mlab.mesh(x, y, z,scalars=K)
mlab.colorbar(orientation='horizontal',title='Gaussian Curvature')
mlab.show()
| # Create the data.
from numpy import pi, sin, cos, mgrid
[u,v] = mgrid[-5:5:0.01,0:2*pi+0.1:0.1]
a=2
x = u*cos(v)
y = u*sin(v)
z = a*v
K=-a**2/(u**2 +a**2)**2
from mayavi import mlab
s = mlab.mesh(x, y, z,scalars=K)
mlab.show()
| mit | Python |
b5146035b7f4ae641a53bb956e9afee62c50c347 | Change cache directory for vendor LST | daq-tools/kotori,daq-tools/kotori,daq-tools/kotori,daq-tools/kotori,daq-tools/kotori,zerotired/kotori,zerotired/kotori,daq-tools/kotori,zerotired/kotori,zerotired/kotori,daq-tools/kotori,zerotired/kotori,zerotired/kotori | kotori/vendor/lst/h2m/util.py | kotori/vendor/lst/h2m/util.py | # -*- coding: utf-8 -*-
# (c) 2015 Andreas Motl, Elmyra UG <andreas.motl@elmyra.de>
import os
from appdirs import user_cache_dir
from kotori.daq.intercom.c import LibraryAdapter, StructRegistryByID
#from kotori.daq.intercom.cffi_adapter import LibraryAdapterCFFI
def setup_h2m_structs_pyclibrary():
cache_dir = os.p... | # -*- coding: utf-8 -*-
# (c) 2015 Andreas Motl, Elmyra UG <andreas.motl@elmyra.de>
import os
from appdirs import user_cache_dir
from kotori.daq.intercom.c import LibraryAdapter, StructRegistryByID
#from kotori.daq.intercom.cffi_adapter import LibraryAdapterCFFI
def setup_h2m_structs_pyclibrary():
cache_dir = user... | agpl-3.0 | Python |
e6b11c0c110d0457cc31d7d798a2b35e19a0f56e | fix wrong parser | bcicen/slackn,bcicen/slack-notify | slackn/cli.py | slackn/cli.py | import sys
import logging
from argparse import ArgumentParser
from slackn.core import Queue, Notifier
from slackn.version import version
log = logging.getLogger('slackn')
def get_queue(s):
if ':' in s:
host,port = s.split(':')
else:
host,port = (s, 6379)
return Queue(host,port)
def proce... | import sys
import logging
from argparse import ArgumentParser
from slackn.core import Queue, Notifier
from slackn.version import version
log = logging.getLogger('slackn')
def get_queue(s):
if ':' in s:
host,port = s.split(':')
else:
host,port = (s, 6379)
return Queue(host,port)
def proce... | mit | Python |
463d044cfa70de6bde04c380c459274acb71a1b6 | add database | zjuguxi/flask_study,zjuguxi/flask_study,zjuguxi/flask_study | hello.py | hello.py | from flask import Flask, render_template, session, redirect, url_for, flash
from flask.ext.script import Manager
from flask.ext.bootstrap import Bootstrap
from flask.ext.moment import Moment
from flask.ext.wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
from flask.ex... | from flask import Flask, render_template, session, redirect, url_for, flash
from flask.ext.script import Manager
from flask.ext.bootstrap import Bootstrap
from flask.ext.moment import Moment
from flask.ext.wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
app = Flask(... | mit | Python |
9de3dacc7c687bc5e4d11a5a334f5ef5cc4d2f37 | Fix call to genome mapping code | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | rnacentral_pipeline/cli/genome_mapping.py | rnacentral_pipeline/cli/genome_mapping.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | apache-2.0 | Python |
6424edf4186236443ba4ec5a1b2ffcc26de7c695 | add classifications | jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot | fl/__init__.py | fl/__init__.py | # encoding=utf-8
from pupa.scrape import Jurisdiction, Organization
from .votes import FlVoteScraper
from .bills import FlBillScraper
from .people import FlPersonScraper
class Florida(Jurisdiction):
division_id = "ocd-division/country:us/state:fl"
classification = "government"
name = "Florida"
url = "... | # encoding=utf-8
from pupa.scrape import Jurisdiction, Organization
from .votes import FlVoteScraper
from .bills import FlBillScraper
from .people import FlPersonScraper
class Florida(Jurisdiction):
division_id = "ocd-division/country:us/state:fl"
classification = "government"
name = "Florida"
url = "... | mit | Python |
40d9ceb14c57c109e8f6371b1a4c677fa33e1669 | Bump base package requirements (#10078) | DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core | snmp/setup.py | snmp/setup.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... | bsd-3-clause | Python |
0a0ebb7dd3267d727e6af598f6d964cd4d73fd69 | Add TODO for multiple e-mail verification clicks. | SUNET/eduid-signup,SUNET/eduid-signup,SUNET/eduid-signup | eduid_signup/utils.py | eduid_signup/utils.py | from uuid import uuid4
from hashlib import sha256
import datetime
from pyramid.httpexceptions import HTTPInternalServerError
from eduid_signup.i18n import TranslationString as _
from eduid_signup.compat import text_type
def generate_verification_link(request):
code = text_type(uuid4())
link = request.route... | from uuid import uuid4
from hashlib import sha256
import datetime
from pyramid.httpexceptions import HTTPInternalServerError
from eduid_signup.i18n import TranslationString as _
from eduid_signup.compat import text_type
def generate_verification_link(request):
code = text_type(uuid4())
link = request.route... | bsd-3-clause | Python |
f9141964ffa4ed36420b8ba564407c2ca661ac46 | edit on glitter | CptShock/AuroraModules | glitter.py | glitter.py | from willie.module import commands
import random
@commands('glitter')
def ans(bot, trigger):
bot.say("*'-.*\(^O^)/*.-'*") | from willie.module import commands
import random
@commands('glitter')
def ans(bot, trigger):
bot.reply("*'-.*\(^O^)/*.-'*") | mit | Python |
3a83ff315db6f34fb8e656309580060cf708b8a1 | Refactor request body | LWprogramming/Hack-Brown2017 | request.py | request.py | '''
Code adapted from https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics.V2.0/operations/56f30ceeeda5650db055a3c9
'''
import http.client, urllib.request, urllib.parse, urllib.error
import script
import numpy as np
def main():
'''
Sends a single POST request with a test bit of text.
'''
... | '''
Code adapted from https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics.V2.0/operations/56f30ceeeda5650db055a3c9
'''
import http.client, urllib.request, urllib.parse, urllib.error
import script
def main():
'''
Sends a single POST request with a test bit of text.
'''
headers = heade... | mit | Python |
c5d68743bf6392ae5e4c6bd80ed6727bfebf77fd | Solve basic/string2.py Please enter the commit message for your changes. Lines starting | DevilFruit99/GooglePythonClass,DevilFruit99/GooglePythonClass | basic/string2.py | basic/string2.py | #!/usr/bin/python2.4 -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic string exercises
# D. verbing
# Given a string, if its length is a... | #!/usr/bin/python2.4 -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic string exercises
# D. verbing
# Given a string, if its length is a... | apache-2.0 | Python |
634aa9818875c15c3db0ac0763fc15889936b79e | Add a structure test macro to make test writing easier. | GoogleContainerTools/container-structure-test,GoogleContainerTools/container-structure-test | tests.bzl | tests.bzl | # Copyright 2017 Google Inc. 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 agre... | # Copyright 2017 Google Inc. 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 agre... | apache-2.0 | Python |
f5df42e6049b31b1c147da7160e0595e595c6dbc | Add logging to grade | edx/ease,edx/ease | grade.py | grade.py | #Grader called by pyxserver_wsgi.py
#Loads a grader file, which is a dict containing the prompt of the question,
#a feature extractor object, and a trained model.
#Extracts features and runs trained model on the submission to produce a final score.
#Correctness determined by ratio of score to max possible score.
#Requi... | #Grader called by pyxserver_wsgi.py
#Loads a grader file, which is a dict containing the prompt of the question,
#a feature extractor object, and a trained model.
#Extracts features and runs trained model on the submission to produce a final score.
#Correctness determined by ratio of score to max possible score.
#Requi... | agpl-3.0 | Python |
f96989d067f6fd073d04f96bdf2ae314c9b02d49 | Use request helper function in LayersScraper | kshvmdn/uoft-scrapers,cobalt-uoft/uoft-scrapers,arkon/uoft-scrapers,g3wanghc/uoft-scrapers | uoftscrapers/scrapers/utils/layers.py | uoftscrapers/scrapers/utils/layers.py | import requests
import json
from . import Scraper
class LayersScraper:
"""A superclass for scraping Layers of the UofT Map.
Map is located at http://map.utoronto.ca
"""
host = 'http://map.utoronto.ca/'
@staticmethod
def get_layers_json(campus):
"""Retrieve the JSON structure from ho... | import requests
import json
from . import Scraper
class LayersScraper:
"""A superclass for scraping Layers of the UofT Map.
Map is located at http://map.utoronto.ca
"""
host = 'http://map.utoronto.ca/'
s = requests.Session()
@staticmethod
def get_layers_json(campus):
"""Retrieve... | mit | Python |
b747da4fe99372e53850a964f450c7b00a4d81c9 | Add node add/delete, edge del | jwarren116/data-structures | graph.py | graph.py |
class SimpleGraph(object):
"""This is a simple graph program that will allow us
to impliment a graph data structure"""
def __init__(self, dict_graph={}):
self.dict_graph = dict_graph
def node(self):
'''return a list of all nodes in the graph'''
return list(__dict_graph.keys())
... |
class SimpleGraph(object):
"""This is a simple graph program that will allow us
to impliment a graph data structure"""
def __init__(self, dict_graph={}):
self.dict_graph = dict_graph
def node(self):
'''return a list of all nodes in the graph'''
return list(__dict_graph.keys())
... | mit | Python |
4dbde6b8c33a85508ae9c375fef4d4caabfb4d15 | add function build_valid_filename | encorehu/nlp | nlp/extractors/base.py | nlp/extractors/base.py | import re
class BaseExtractor(object):
def build_valid_filename(self, text):
dst=text
for x in '\t\n\':;",.[](){}~!@#$%^&*_+-=/<>?':
dst=dst.replace(x,' ')
dst=dst.replace(' ','-').replace('--','-').replace('--','-')
dst=dst.strip('-')
return dst
... | import re
class BaseExtractor(object):
def _extract(self, html):
result =[]
return result
def find_between(self, text, s1, s2=None):
if not s1:
raise Exception('s1 is None!')
pos1 = text.find(s1)
if s2 and pos1 != -1:
pos2 = text.... | mit | Python |
a2837ab778d39e66c6178dae34a3bebdc638061f | fix test | The-Compiler/pytest,nicoddemus/repo-test,ericdill/pytest,jaraco/pytest,etataurov/pytest,Haibo-Wang-ORG/pytest,vodik/pytest,lukas-bednar/pytest,doordash/pytest,chillbear/pytest,JonathonSonesen/pytest,pelme/pytest,bukzor/pytest,omarkohl/pytest,mbirtwell/pytest,inirudebwoy/pytest,vodik/pytest,vmalloc/dessert,untitaker/pyt... | py/test/testing/test_outcome.py | py/test/testing/test_outcome.py |
import py
import marshal
class TestRaises:
def test_raises(self):
py.test.raises(ValueError, "int('qwe')")
def test_raises_exec(self):
py.test.raises(ValueError, "a,x = []")
def test_raises_syntax_error(self):
py.test.raises(SyntaxError, "qwe qwe qwe")
def test_raises_funct... |
import py
import marshal
class TestRaises:
def test_raises(self):
py.test.raises(ValueError, "int('qwe')")
def test_raises_exec(self):
py.test.raises(ValueError, "a,x = []")
def test_raises_syntax_error(self):
py.test.raises(SyntaxError, "qwe qwe qwe")
def test_raises_funct... | mit | Python |
38dc94240fdecaa0676921d32f749ca31da94c49 | Add unit tests for similarity graph and density estimation utilities. | CoAxLab/DeBaCl | debacl/test/test_utils.py | debacl/test/test_utils.py | #####################################
## Brian P. Kent
## test_utils.py
## created: 20140529
## updated: 20140712
## Test the DeBaCl utility functions.
#####################################
import unittest
import numpy as np
import scipy.special as spspec
import sys
from debacl import utils as utl
class TestDensit... | #####################################
## Brian P. Kent
## test_utils.py
## created: 20140529
## updated: 20140529
## Test the DeBaCl utility functions.
#####################################
import unittest
import numpy as np
import scipy.special as spspec
import sys
sys.path.insert(0, '/home/brian/Projects/debacl/DeB... | bsd-3-clause | Python |
f0f1fb06896294f2657083aa7a077d852ea8bb4b | add sort order | dictoss/active-task-summary,dictoss/active-task-summary,dictoss/active-task-summary,dictoss/active-task-summary | ats/admin.py | ats/admin.py | from django.contrib import admin
from .models import ProjectWorker
class ProjectWorkerAdmin(admin.ModelAdmin):
list_filter = ['user', 'project', 'job']
ordering = ['user', 'project', 'job']
admin.site.register(ProjectWorker, ProjectWorkerAdmin)
| from django.contrib import admin
from .models import ProjectWorker
class ProjectWorkerAdmin(admin.ModelAdmin):
list_filter = ['user', 'project', 'job']
admin.site.register(ProjectWorker, ProjectWorkerAdmin)
| bsd-2-clause | Python |
6447899ec344d14fbb78b9a2bbbe8b75451f10f2 | Set isolation level to reapeatable read | d120/pyophase,d120/pyophase,d120/pyophase,d120/pyophase | pyophase/settings_production.py | pyophase/settings_production.py | """
This is the settings file used in production.
First, it imports all default settings, then overrides respective ones.
Secrets are stored in and imported from an additional file, not set under version control.
"""
from pyophase import settings_secrets as secrets
from .settings import *
SECRET_KEY = secrets.SECRE... | """
This is the settings file used in production.
First, it imports all default settings, then overrides respective ones.
Secrets are stored in and imported from an additional file, not set under version control.
"""
from pyophase import settings_secrets as secrets
from .settings import *
SECRET_KEY = secrets.SECRE... | agpl-3.0 | Python |
4839121f90934f7e52e51c05d052d27124680be7 | Remove confusing and useless "\n" | pyQode/pyqode.python,pyQode/pyqode.python,mmolero/pyqode.python,zwadar/pyqode.python | pyqode/python/backend/server.py | pyqode/python/backend/server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Main server script for a pyqode.python backend. You can directly use this
script in your application if it fits your needs or use it as a starting point
for writing your own server.
::
usage: server.py [-h] [-s [SYSPATH [SYSPATH ...]]] port
positional argumen... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Main server script for a pyqode.python backend. You can directly use this
script in your application if it fits your needs or use it as a starting point
for writing your own server.
::
usage: server.py [-h] [-s [SYSPATH [SYSPATH ...]]] port
positional argumen... | mit | Python |
31852bbf09e4f416f93c7720ecd9eca8cfe32d38 | Update version | MoiTux/pyramid-request-log | pyramid_request_log/__init__.py | pyramid_request_log/__init__.py | from __future__ import absolute_import
from .config import includeme
__version__ = '0.7'
| from __future__ import absolute_import
from .config import includeme
__version__ = '0.6'
| mit | Python |
791b6720e489353bb5a2b35906dd88f558f26c33 | Handle NotImplementedError | Meisterschueler/ogn-python,glidernet/ogn-python,Meisterschueler/ogn-python,glidernet/ogn-python,Meisterschueler/ogn-python,glidernet/ogn-python,glidernet/ogn-python,Meisterschueler/ogn-python | ogn/gateway/process.py | ogn/gateway/process.py | import logging
from ogn.commands.dbutils import session
from ogn.model import AircraftBeacon, ReceiverBeacon, Location
from ogn.parser import parse, ParseError
logger = logging.getLogger(__name__)
def replace_lonlat_with_wkt(message):
location = Location(message['longitude'], message['latitude'])
message['... | import logging
from ogn.commands.dbutils import session
from ogn.model import AircraftBeacon, ReceiverBeacon, Location
from ogn.parser import parse, ParseError
logger = logging.getLogger(__name__)
def replace_lonlat_with_wkt(message):
location = Location(message['longitude'], message['latitude'])
message['... | agpl-3.0 | Python |
5c5f7981905c757cd5a750c2b2d09ea6bc6f1f28 | Add BoolTypeFactory class | thombashi/DataProperty | dataproperty/_factory.py | dataproperty/_factory.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import six
from .converter import NopConverterCreator
from .converter import IntegerConverterCreator
from .converter import FloatConverterCreator
from .converter import BoolConverterCr... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import six
from .converter import NopConverterCreator
from .converter import IntegerConverterCreator
from .converter import FloatConverterCreator
from .converter import DateTimeConvert... | mit | Python |
27df09cd98d9128d89d9d9d26ee0e89223fbd990 | document idlerpg's external dependencies | zordsdavini/qtile,zordsdavini/qtile | libqtile/widget/idlerpg.py | libqtile/widget/idlerpg.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Tycho Andersen
#
# 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, modi... | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Tycho Andersen
#
# 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, modi... | mit | Python |
f9f3ca75e8151b1467fddffe390aee6a8fe00259 | Change configuration for wsgi settings | Dev-Cloud-Platform/Dev-Cloud,Dev-Cloud-Platform/Dev-Cloud,Dev-Cloud-Platform/Dev-Cloud,Dev-Cloud-Platform/Dev-Cloud,Dev-Cloud-Platform/Dev-Cloud | dev_cloud/web_service/wsgi.py | dev_cloud/web_service/wsgi.py | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2015] Michał Szczygieł, M4GiK Software
#
# 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... | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2015] Michał Szczygieł, M4GiK Software
#
# 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... | apache-2.0 | Python |
f3724421fa859a5970e66353b6a311aa14b866ec | Add additional spacing to improve readability | boundary/tsi-lab,jdgwartney/tsi-lab,jdgwartney/tsi-lab,jdgwartney/tsi-lab,jdgwartney/tsi-lab,boundary/tsi-lab,boundary/tsi-lab,boundary/tsi-lab | labs/lab-5/ex5-1.log.py | labs/lab-5/ex5-1.log.py | #!/usr/bin/python
#
# Copyright 2016 BMC Software, 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 la... | #!/usr/bin/python
#
# Copyright 2016 BMC Software, 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 la... | apache-2.0 | Python |
d40f1fe493ec2c71d84ac84f5dc989c68de321ca | add version option | pinkavaj/batch_isp | batch_isp.py | batch_isp.py | import argparse
from parts import Parts
from pgm_error import PgmError
from operations import Operations
from serial_io import SerialIO
class BatchISP:
def __init__(self):
parser = argparse.ArgumentParser(
description='Linux remake of Atmel\'s BatchISP utility.')
parser.add_argumen... | import argparse
from parts import Parts
from pgm_error import PgmError
from operations import Operations
from serial_io import SerialIO
class BatchISP:
def __init__(self):
parser = argparse.ArgumentParser(
description='Linux remake of Atmel\'s BatchISP utility.')
parser.add_argumen... | apache-2.0 | Python |
dbf3af1de0bbbda178e5bbd1ca0473a83d8cb9b3 | test triggering travis | Lenijas/test-travisci,Lenijas/test-travisci,Lenijas/test-travisci | fabre_test.py | fabre_test.py | #!/usr/bin/env python
# coding=UTF-8
import sys
import pytest
sys.exit(0)
| #!/usr/bin/env python
# coding=UTF-8
import sys
sys.exit(0)
| bsd-3-clause | Python |
4cff5b7a14dfda786fef4a869e72095b7d9d83e4 | correct relative import, d'oh | SLACKHA/pyJac,kyleniemeyer/pyJac,SLACKHA/pyJac,kyleniemeyer/pyJac | pyjac/performance_tester/__main__.py | pyjac/performance_tester/__main__.py | import sys
import os
from . import performance_tester as pt
from argparse import ArgumentParser
def main(args=None):
if args is None:
# command line arguments
parser = ArgumentParser(description='performance_tester.py: '
'tests pyJac performance'
... | import sys
import os
import .performance_tester as pt
from argparse import ArgumentParser
def main(args=None):
if args is None:
# command line arguments
parser = ArgumentParser(description='performance_tester.py: '
'tests pyJac performance'
... | mit | Python |
7596de67f67f5bdc9350067a896dcd4b7b4c7650 | Stop requiring the path of the users file; only require the name. | hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook | gobbldygook.py | gobbldygook.py | #!/usr/bin/env python3
import argparse, csv, os
from course import Course, all_courses, all_labs, getCourse
from student import Student
def argument_parse():
parser = argparse.ArgumentParser(description="This program works best if you give it some data. However, we have some example stuff to show you anyway.)")
pa... | #!/usr/bin/env python3
import argparse, csv, os
from course import Course, all_courses, all_labs, getCourse
from student import Student
def argument_parse():
parser = argparse.ArgumentParser(description="This program works best if you give it some data. However, we have some example stuff to show you anyway.)")
pa... | agpl-3.0 | Python |
d73c6addf064ba7b78c4874a6affc6bac6dfee1f | Add image feature detection | grenmester/hunt-master,grenmester/hunt-master,grenmester/hunt-master,grenmester/hunt-master,grenmester/hunt-master | image.py | image.py | from __future__ import division
import numpy as np
import cv2
import time, io
from matplotlib import pyplot as plt
from google.cloud import vision
MIN_MATCH_COUNT = 200
# only using match count right now
MIN_MATCH_RATIO = .2
def compare(img1_name, img2_name):
"""
Return whether img1 and img2 differ signfician... | from __future__ import division
import numpy as np
import cv2
import time
from matplotlib import pyplot as plt
MIN_MATCH_COUNT = 200
# only using match count right now
MIN_MATCH_RATIO = .2
def compare(img1_name, img2_name):
"""
Return whether img1 and img2 differ signficiantly
Determined through feature ... | mit | Python |
377aef17394b2dabd6db7439d3cfcd4e0d54a3c2 | Allow codata tests to be run as script. | jasonmccampbell/scipy-refactor,scipy/scipy-svn,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,scipy/scipy-svn,scipy/scipy-svn,scipy/scipy-svn | scipy/constants/tests/test_codata.py | scipy/constants/tests/test_codata.py |
import warnings
from scipy.constants import find
from numpy.testing import assert_equal, run_module_suite
def test_find():
warnings.simplefilter('ignore', DeprecationWarning)
keys = find('weak mixing', disp=False)
assert_equal(keys, ['weak mixing angle'])
keys = find('qwertyuiop', disp=False)
... |
import warnings
from scipy.constants import find
from numpy.testing import assert_equal
def test_find():
warnings.simplefilter('ignore', DeprecationWarning)
keys = find('weak mixing', disp=False)
assert_equal(keys, ['weak mixing angle'])
keys = find('qwertyuiop', disp=False)
assert_equal(keys,... | bsd-3-clause | Python |
e4fbd6f8e13861053a4a29c776ae24b934639fa5 | fix ports on yaml script | DaMSL/K3,DaMSL/K3,yliu120/K3 | tools/scripts/mosaic/gen_yaml.py | tools/scripts/mosaic/gen_yaml.py | #!/usr/bin/env python3
#
# Create a yaml file for running a mosaic file
# Note: *requires pyyaml*
import argparse
import yaml
def address(port):
return ['127.0.0.1', port]
def create_peers(peers):
res = []
for p in peers:
res += [{'addr':address(p[1])}]
return res
def entity(role, port, peers... | #!/usr/bin/env python3
#
# Create a yaml file for running a mosaic file
# Note: *requires pyyaml*
import argparse
import yaml
def address(port):
return ['127.0.0.1', port]
def create_peers(peers):
res = []
for p in peers:
res += [{'addr':address(p[1])}]
return res
def entity(role, port, peers... | apache-2.0 | Python |
8e664b417d978d040d780dc252418fce087c47f4 | Fix version option | ARMmbed/greentea | src/htrun/htrun.py | src/htrun/htrun.py | #
# Copyright (c) 2021-2022 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Greentea Host Tests Runner."""
from multiprocessing import freeze_support
from htrun import init_host_test_cli_params
from htrun.host_tests_runner.host_test_default import DefaultTestSelector
from ... | #
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Greentea Host Tests Runner."""
from multiprocessing import freeze_support
from htrun import init_host_test_cli_params
from htrun.host_tests_runner.host_test_default import DefaultTestSelector
from htrun... | apache-2.0 | Python |
625c70580770b5bb00a64d15e14d15c623db21ee | Update urls.py | bdang2012/taiga-back-casting,Tigerwhit4/taiga-back,xdevelsistemas/taiga-back-community,gam-phon/taiga-back,19kestier/taiga-back,crr0004/taiga-back,taigaio/taiga-back,coopsource/taiga-back,gam-phon/taiga-back,rajiteh/taiga-back,Rademade/taiga-back,astagi/taiga-back,coopsource/taiga-back,EvgeneOskin/taiga-back,coopsource... | taiga/base/utils/urls.py | taiga/base/utils/urls.py | import django_sites as sites
URL_TEMPLATE = "{scheme}://{domain}/{path}"
def build_url(path, scheme="http", domain="localhost"):
return URL_TEMPLATE.format(scheme=scheme, domain=domain, path=path.lstrip("/"))
def is_absolute_url(path):
"""Test wether or not `path` is absolute url."""
return path.starts... | import django_sites as sites
URL_TEMPLATE = "{scheme}://{domain}/{path}"
def build_url(path, scheme="http", domain="localhost"):
return URL_TEMPLATE.format(scheme=scheme, domain=domain, path=path.lstrip("/"))
def is_absolute_url(path):
"""Test wether or not `path` is absolute url."""
return path.starts... | agpl-3.0 | Python |
1656cbd6b62690017af810e795b8a23b3907a1fa | bump 1.0.2 | meng89/epubuilder,meng89/epubuilder,meng89/epubuilder | epubuilder/version.py | epubuilder/version.py | # coding=utf-8
__version__ = '1.0.2'
| # coding=utf-8
__version__ = '1.0.1'
| mit | Python |
c8fdcf888f6c34e8396f11b3e7ab3088af59abb6 | Add tests for slice intersection and sanitization. | RaoUmer/distarray,enthought/distarray,enthought/distarray,RaoUmer/distarray | distarray/tests/test_utils.py | distarray/tests/test_utils.py | import unittest
from distarray import utils
from numpy import arange
from numpy.testing import assert_array_equal
class TestMultPartitions(unittest.TestCase):
"""
Test the multiplicative parition code.
"""
def test_both_methods(self):
"""
Do the two methods of computing the multiplic... | import unittest
from distarray import utils
class TestMultPartitions(unittest.TestCase):
"""
Test the multiplicative parition code.
"""
def test_both_methods(self):
"""
Do the two methods of computing the multiplicative partitions agree?
"""
for s in [2, 3]:
... | bsd-3-clause | Python |
673b123b147b99f49357b02c227b1d34ae653485 | Set up some realistic defaults. | chrisnorman7/pyrts,chrisnorman7/pyrts,chrisnorman7/pyrts | bootstrap.py | bootstrap.py | """This script will bootstrap the database to a minimal level for usage.
You will be left with the following buildings:
* Town Hall (homely).
* Farm (requires Town Hall).
* Stable (requires Farm)
You will be left with the following land features:
* Mine (provides gold)
* Quarry (provides stone)
* Lake (provides water... | """This script will bootstrap the database to a minimal level for usage.
You will be left with the following buildings:
* Town Hall (homely).
* Farm (requires Town Hall).
* Stable (requires Farm)
You will be left with the following land features:
* Mine (provides gold)
* Quarry (provides stone)
* Lake (provides water... | mpl-2.0 | Python |
208b6cf99d90494df9a0f6d66a0ea3669ff5fe66 | remove get, add ls and rm | sliceofcode/dogbot,slice/dogbot,slice/dogbot,slice/dogbot,sliceofcode/dogbot | dog/ext/config.py | dog/ext/config.py | import logging
from discord.ext import commands
from dog import Cog
log = logging.getLogger(__name__)
class Config(Cog):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.permitted_keys = [
'woof_response'
]
@commands.group()
@commands.guild_... | import logging
from discord.ext import commands
from dog import Cog
log = logging.getLogger(__name__)
class Config(Cog):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.permitted_keys = [
'woof_response'
]
@commands.group()
@commands.guild_... | mit | Python |
546f1188444365a365dc1dd7a81c2ffc974cf8b2 | change of documentation in the param vector class | LeonAgmonNacht/Genetic-Algorithm-Firewall-TAU | ParamVector.py | ParamVector.py | class ParamVector(object):
"""
This class represents the vectors that defines a firewall
a ParamVector is a class that represents a vector that defines a firewall.
we have our indicator functions that should get parameters, lets call these functions g1...gn
for each gi we can say that there is a vec... | class ParamVector(object):
"""
This class represents the vectors that defines a firewall
a ParamVector is a class that represents a vector that defines a firewall.
we have our indicator functions that should get parameters, lets call these functions g1...gn
for each gi we can say that there is a vec... | mit | Python |
1c7317ea85206541c8d518a3fc6cb338ad6873d3 | Fix requires_auth decorator | norbert/fickle | fickle/api.py | fickle/api.py | import os
from functools import wraps
import flask
from flask import request, json
USERNAME = 'fickle'
def Response(data, status = 200):
body = json.dumps(data)
return flask.Response(body, status = status, mimetype = 'application/json')
def SuccessResponse(dataset_id = None):
return Response({ 'success'... | import os
from functools import wraps
import flask
from flask import request, json
USERNAME = 'fickle'
def Response(data, status = 200):
body = json.dumps(data)
return flask.Response(body, status = status, mimetype = 'application/json')
def SuccessResponse(dataset_id = None):
return Response({ 'success'... | mit | Python |
9437e024b1e1630e06d1b05972eb9049af442be0 | fix bad copy/paste | rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs | build_all.py | build_all.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
# list of projects
progs = [
{'path': 'apps/EHD', 'travis': True},
{'path': 'apps/fractal/cpp', 'travis': False},
{'path': 'apps/GenMAI', 'travis': True},
{'path': 'apps/md5', 'travis': True},
{'path': 'apps/minibarreTE', '... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess
# list of projects
progs = [
{'path': 'apps/EHD', 'travis': True},
{'path': 'apps/fractal/cpp', 'travis': False},
{'path': 'apps/GenMAI', 'travis': True},
{'path': 'apps/md5', 'travis': True},
{'path': 'apps/minibarreTE', '... | apache-2.0 | Python |
a8cb15b1983c48547edfeb53bfb63245f7e7c892 | Revert "log integrations with zabbix through pyzabbix" | globocom/dbaas-zabbix,globocom/dbaas-zabbix | dbaas_zabbix/__init__.py | dbaas_zabbix/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
def factory_for(**kwargs):
databaseinfra = kwargs['databaseinfra']
credentials = kwargs['credentials']
del kwargs[... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
from dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi
from dbaas_zabbix.provider_factory import ProviderFactory
from pyzabbix import ZabbixAPI
stream = logging.StreamHandler(sys.stdout)
stream.setLevel(logging.DEBUG)
log = logging.getLogger('p... | bsd-3-clause | Python |
b3c1b3b66d1c720172e731d1bfc44cfb44c992a3 | Revert of [Android] Re-enable content_browsertests on main waterfall. (https://codereview.chromium.org/132403005/) | dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,anirudhSK/chromium,krieger-od/nwjs... | build/android/pylib/gtest/gtest_config.py | build/android/pylib/gtest/gtest_config.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.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
... | # 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.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
... | bsd-3-clause | Python |
3812403655153e86a8b0e1ac68c9b15e69d6a4e3 | Update BUILD_OSS to 4770. | fcitx/mozc,fcitx/mozc,google/mozc,fcitx/mozc,google/mozc,fcitx/mozc,google/mozc,fcitx/mozc,google/mozc,google/mozc | src/data/version/mozc_version_template.bzl | src/data/version/mozc_version_template.bzl | # Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | # Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | bsd-3-clause | Python |
b6d747599661f3ce19b4d2f6ea9f80ec9839a2d8 | Update couchm.reactor.py | Anton04/MQTT-Stage,Anton04/MQTT-Stage | resources/reactors/couchm.reactor.py | resources/reactors/couchm.reactor.py | #!/usr/bin/python
import argparse
import mosquitto
#from pushover import PushoverClient
import os, sys
import urllib2
import json, base64
import ConfigParser
#Posting data to couchDB
def post(doc):
global config
url = 'http://%(server)s/%(database)s/_design/energy_data/_update/measurement' % config
# print url... | #!/usr/bin/python
import argparse
import mosquitto
#from pushover import PushoverClient
import os, sys
import urllib2
import json, base64
#Posting data to couchDB
def post(doc):
global config
url = 'http://%(server)s/%(database)s/_design/energy_data/_update/measurement' % config
# print url
request = urllib2.... | mit | Python |
7a2fd7bbdaed3ffda3cb8740d38e5f3e88dd8ce8 | add name for the thread | Impactstory/oadoi,Impactstory/oadoi,Impactstory/sherlockoa,Impactstory/oadoi,Impactstory/sherlockoa | update.py | update.py | from time import time
from app import db
import argparse
from jobs import update_registry
from util import elapsed
# needs to be imported so the definitions get loaded into the registry
import jobs_defs
"""
examples of calling this:
# update everything
python update.py Person.refresh --limit 10 --chunk 5 --rq
# up... | from time import time
from app import db
import argparse
from jobs import update_registry
from util import elapsed
# needs to be imported so the definitions get loaded into the registry
import jobs_defs
"""
examples of calling this:
# update everything
python update.py Person.refresh --limit 10 --chunk 5 --rq
# up... | mit | Python |
0b54c244e6e4b745a678fe69fc1be7c16850203d | Fix a mistake. | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/distutils/example_without_dependency/setup.py | python/distutils/example_without_dependency/setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyNurseryRhymesDemo
# The MIT License
#
# Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org)
#
# 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 ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyNurseryRhymesDemo
# The MIT License
#
# Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org)
#
# 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 ... | mit | Python |
6c11b9cc9b213928e32d883d4f557f7421da6802 | Add kamerstukken to dossier API | openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer | document/api.py | document/api.py | from rest_framework import serializers, viewsets
from document.models import Document, Kamerstuk, Dossier
class DossierSerializer(serializers.HyperlinkedModelSerializer):
documents = serializers.HyperlinkedRelatedField(read_only=True,
view_name='document-detail... | from rest_framework import serializers, viewsets
from document.models import Document, Kamerstuk, Dossier
class DossierSerializer(serializers.HyperlinkedModelSerializer):
documents = serializers.HyperlinkedRelatedField(read_only=True,
view_name='document-detail... | mit | Python |
51e35e88597d2c34905222cd04a46a2a840c0d92 | Refactor Poly ABC | oneklc/dimod,oneklc/dimod | dimod/core/polysampler.py | dimod/core/polysampler.py | # Copyright 2019 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 2019 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.