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 |
|---|---|---|---|---|---|---|---|---|
3503ba8c2f918a3f15cf55f5f9396d36593f999e | update version to dev | keflavich/pyradex | pyradex/version.py | pyradex/version.py | __version__ = "0.4.1dev"
| __version__ = "0.4.0"
| bsd-3-clause | Python |
237e22317de92337a0f2dbf52cf6572958bfd7ef | Fix bad function call | Kitware/clique,Kitware/clique,XDATA-Year-3/clique,Kitware/clique,XDATA-Year-3/clique,XDATA-Year-3/clique | tangelo/mongo/web/findLinks.py | tangelo/mongo/web/findLinks.py | import bson.json_util
from bson.objectid import ObjectId
import json
from pymongo import MongoClient
def load_json(value, default):
return default if value is None else json.loads(value)
def run(host=None, db=None, coll=None, spec=None, source=None, target=None, directed=None):
# Connect to the mongo collec... | import bson.json_util
from bson.objectid import ObjectId
import json
from pymongo import MongoClient
def load_json(value, default):
return default if value is None else json.loads(value)
def run(host=None, db=None, coll=None, spec=None, source=None, target=None, directed=None):
# Connect to the mongo collec... | apache-2.0 | Python |
2ecb4bed2c16b0c38eb4b8eb7e7895945c759ca0 | fix a typo | ufjfeng/leetcode-jf-soln,ufjfeng/leetcode-jf-soln | python/015_3sum.py | python/015_3sum.py | """
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note: The solution set must not contain duplicate triplets.
For example, given array S = [-1, 0, 1, 2, -1, -4],
A solution set is:
[
[-1, 0, 1],
... | """
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note: The solution set must not contain duplicate triplets.
For example, given array S = [-1, 0, 1, 2, -1, -4],
A solution set is:
[
[-1, 0, 1],
... | mit | Python |
c46d7fc602e932a25dde53dbc37312926b79b03a | Use a different variable name for the routing key in the amqp_clock.py demo, so as not to be confused with an exchange type. | smurfix/aio-py-amqp,dallasmarlow/py-amqp,dallasmarlow/py-amqp,jonahbull/py-amqp,smurfix/aio-py-amqp,yetone/py-amqp,dims/py-amqp,yetone/py-amqp,dims/py-amqp,newvem/py-amqplib,jonahbull/py-amqp | demo/amqp_clock.py | demo/amqp_clock.py | #!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.minute',
for example: '2007.11.26.1.12.33', where the dow (day of week)
is 0 for Sunday, 1 for Monday, and so on (sim... | #!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.minute',
for example: '2007.11.26.1.12.33', where the dow (day of week)
is 0 for Sunday, 1 for Monday, and so on (sim... | lgpl-2.1 | Python |
bfed31ab984e429f4559ae646347232790305161 | Fix try_input | aforren1/toon | demos/try_input.py | demos/try_input.py | import os
from toon.input import MultiprocessInput as MpI
from toon.input.mouse import Mouse
from toon.input.keyboard import Keyboard
from toon.input.hand import Hand
from toon.input.fake import FakeInput
from toon.input.clock import mono_clock
import numpy as np
import ctypes
# import matplotlib.pyplot as plt
if os.n... | import os
from toon.input import MultiprocessInput as MpI
from toon.input.mouse import Mouse
from toon.input.keyboard import Keyboard
from toon.input.hand import Hand
from toon.input.fake import FakeInput
from toon.input.clock import mono_clock
import numpy as np
import ctypes
# import matplotlib.pyplot as plt
if os.n... | mit | Python |
f6edde8cd2aecbaf1165c80f8bfc33cdfcb2552f | Fix a previously missed relative import | aquavitae/mongokit-py3 | mongokit/__init__.py | mongokit/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... | bsd-3-clause | Python |
72e7622de119d4ab68fdda358e98c0447abd0a47 | Update modules_install.py | hshi/cmake_code_script | modules_install.py | modules_install.py | #!/usr/bin/python
import sys
import os
import subprocess
import glob
install_dirc_name = sys.argv[1]
print "\033[1m" "Download custom cmake modules, move to "+install_dirc_name+"/Modules." "\033[0m"
str = raw_input("To comfirm, input 'Y':")
if str=='Y':
subprocess.call('git clone https://github.com/hshi/Modules',... | #!/usr/bin/python
import sys
import subprocess
install_dirc_name = sys.argv[1]
print "\033[1m" "Download custom cmake modules, move to "+install_dirc_name+"/Modules" "\033[0m"
subprocess.call('git clone https://github.com/hshi/Modules', shell=True)
subprocess.call('rm -rf '+install_dirc_name+'/Modules', shell=True)
su... | mit | Python |
e93f8707474d4433ea7bd82e65176f20d5c7518d | add options for status and settings | jblance/mpp-solar | mppsolar/__init__.py | mppsolar/__init__.py | # -*- coding: utf-8 -*-
# !/usr/bin/python
import logging
from argparse import ArgumentParser
# import mppcommands
import mpputils
logger = logging.getLogger()
# if __name__ == '__main__':
def main():
parser = ArgumentParser(description='MPP Solar Command Utility')
parser.add_argument('-c', '--command', hel... | # -*- coding: utf-8 -*-
# !/usr/bin/python
import logging
from argparse import ArgumentParser
# import mppcommands
import mpputils
logger = logging.getLogger()
# if __name__ == '__main__':
def main():
parser = ArgumentParser(description='MPP Solar Command Utility')
parser.add_argument('command', help='Comma... | mit | Python |
42326a18132381f0488b587329fe6b9aaea47c87 | Add cache headers to self-repair page | Osmose/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy,mozilla/normandy | normandy/selfrepair/views.py | normandy/selfrepair/views.py | from django.conf import settings
from django.shortcuts import render
from django.views.decorators.cache import cache_control
from normandy.base.decorators import short_circuit_middlewares
@short_circuit_middlewares
@cache_control(public=True, max_age=settings.API_CACHE_TIME)
def repair(request, locale):
return r... | from django.shortcuts import render
from normandy.base.decorators import short_circuit_middlewares
@short_circuit_middlewares
def repair(request, locale):
return render(request, 'selfrepair/repair.html', {
'locale': locale,
})
| mpl-2.0 | Python |
bfa7c6d302e5959fbc163d64ee14996f8f824dad | add - test case class extending unittests's for context initialiation | rfaulkner/easyML,rfaulkner/easyML,rfaulkner/easyML,rfaulkner/easyML | test/test.py | test/test.py | # -*- coding: utf-8 -*-
"""
dynamic_learn.testsuite
~~~~~~~~~~~~~~~~~~~~~~~
:license: BSD, see LICENSE for more details.
"""
import unittest
import theano.tensor as T
import tempfile
from versus.src.logistic import LogisticRegression
from versus.tools.dataIO import DataIORedis, DataIOHDFS
BATCH_SIZE = 50
class L... | # -*- coding: utf-8 -*-
"""
dynamic_learn.testsuite
~~~~~~~~~~~~~~~~~~~~~~~
:license: BSD, see LICENSE for more details.
"""
import unittest
import theano.tensor as T
import tempfile
from versus.src.logistic import LogisticRegression
from versus.tools.dataIO import DataIORedis, DataIOHDFS
BATCH_SIZE = 50
class T... | bsd-3-clause | Python |
0fc08b14d8350759f6c498d7ab49b59b2604df67 | Add some tests. | kovacsv/DebugToFile,kovacsv/DebugToFile | test/test.py | test/test.py | import os
import subprocess
def WriteTitle (title):
print '--- ' + title + ' ---'
def GetFileLines (fileName):
file = open (resultFilePath)
lines = file.readlines ()
file.close ()
return lines
def GetCommandOutput (command):
process = subprocess.Popen (command, stdout = subprocess.PIPE, stderr = subprocess.PIP... | import os
def WriteTitle (title):
print '--- ' + title + ' ---'
def GetFileLines (fileName):
file = open (resultFilePath)
lines = file.readlines ()
file.close ()
return lines
currentPath = os.path.dirname (os.path.abspath (__file__))
os.chdir (currentPath)
debugToFilePath = os.path.join ('..', 'solution', 'x64... | mit | Python |
229f01ef55b79d03370fcf8d4b2c076313194308 | Fix compatibility with Django >= 1.10 | theatlantic/django-auth-ldap | test/urls.py | test/urls.py | try:
from django.conf.defaults import patterns
except ImportError:
patterns = list
urlpatterns = patterns('')
| from django.conf.defaults import patterns
urlpatterns = patterns('')
| bsd-2-clause | Python |
4b58546835df9b872f7bed69d3920c2e44acdd0a | add django 1.10 urlpatterns compat | saulshanabrook/django-dumper | test/urls.py | test/urls.py | import django
try:
from django.conf.urls import url
except ImportError:
from django.conf.urls.defaults import url
from . import views
urlpatterns = [
url(
r'^simple/(?P<slug>[-\w]+)/$',
views.simple_detail,
name='simple-detail'
),
url(
r'^related/(?P<slug>[-\w]+)/$... | try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url
from . import views
urlpatterns = patterns(
'',
url(
r'^simple/(?P<slug>[-\w]+)/$',
views.simple_detail,
name='simple-detail'
),
url(
r'^relat... | mit | Python |
6aa17cbbc78b24368d3c62e565d5069f2b3dfcd8 | Clean up demo | sbrauer/pytest_spec | test_demo.py | test_demo.py | from pytest_spec import it, describe, context
# Basic usage: a top-level test function.
@it('generates test name dynamically')
def spec():
assert True
# You can use `describe` to organize related tests.
with describe('Foo bar'):
@it('does this')
def spec():
assert True
@it('does that')
de... | from pytest_spec import it, describe, context
# Basic usage: a top-level test function.
@it('generates test name dynamically')
def spec():
assert True
# You can use `describe` to organize related tests.
with describe('Foo bar'):
@it('does this')
def spec():
assert True
# `context` is similar ... | mit | Python |
e9b89e842975e766cb13e282a9ea18d7719353ac | test now tests multiple field types | FriedrichK/django-excel-sync,FriedrichK/django-excel-sync | excel_sync/tests/db/models/integration.py | excel_sync/tests/db/models/integration.py | import os
from django.conf import settings
from django.test import TestCase
from django.core.management import call_command
from django.db.models import loading
loading.cache.loaded = False
from mockito import *
from excel_sync.contrib.spreadsheet.excel import ExcelSpreadsheetSource
from excel_sync.db.models.fields ... | import os
from django.conf import settings
from django.test import TestCase
from django.core.management import call_command
from django.db.models import loading
loading.cache.loaded = False
from mockito import *
from excel_sync.contrib.spreadsheet.excel import ExcelSpreadsheetSource
from excel_sync.db.models.fields ... | bsd-3-clause | Python |
ff7ad8c9f720563b2a468aaaf0d05a1db6a1369a | Fix argument syntax error | sait-berkeley-infosec/pynessus-api | nessusapi/session.py | nessusapi/session.py | # session.py
import random
import xmltodict
# try python 3 imports, fall back to python 2
try:
from urllib.parse import urlencode
from urllib.request import urlopen, Request
from urllib.error import URLError, HTTPError
except ImportError:
from urllib import urlencode
from urllib2 import urlopen, R... | # session.py
import random
import xmltodict
# try python 3 imports, fall back to python 2
try:
from urllib.parse import urlencode
from urllib.request import urlopen, Request
from urllib.error import URLError, HTTPError
except ImportError:
from urllib import urlencode
from urllib2 import urlopen, R... | mit | Python |
23a1945520b06a28d2ced5e2446f9ae1e184f17c | Add more structure to ANI file | SkyLined/headsup | decode/ANI.py | decode/ANI.py | # Copyright 2010 Google 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 ... | # Copyright 2010 Google 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 ... | apache-2.0 | Python |
79a6627f3599ea46707e52cf400877f8085d5a18 | remove deprecated checks | mdietrichc2c/vertical-ngo,jorsea/vertical-ngo,jorsea/vertical-ngo | logistic_consignee/tests/__init__.py | logistic_consignee/tests/__init__.py | # -*- coding: utf-8 -*-
#
#
# Author: Yannick Vaucher
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License,... | # -*- coding: utf-8 -*-
#
#
# Author: Yannick Vaucher
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License,... | agpl-3.0 | Python |
cd31f39296d807f181986dc1fc28e7b101c6a97f | test matlab file .m and scheme file .scm | x1ah/Daily_scripts,x1ah/Daily_scripts,x1ah/Daily_scripts,xiahei/Daily_scripts,xiahei/Daily_scripts,x1ah/Daily_scripts,xiahei/Daily_scripts,x1ah/Daily_scripts | Newtouch/atouch.py | Newtouch/atouch.py | #!/usr/bin/env python
# coding:utf-8
import os
import argparse
header_msg = {
'py': '#!/usr/bin/env python\n# coding:utf-8\n',
'c': '#include <stdio.h>\n',
'scm': ';;;\n',
'm': ''
}
def par():
parser = argparse.ArgumentParser(
description='A script for add script header message'
)
... | #!/usr/bin/env python
# coding:utf-8
import os
import argparse
header_msg = {
'py': '#!/usr/bin/env python\n# coding:utf-8\n',
'c': '#include <stdio.h>\n'
}
def par():
parser = argparse.ArgumentParser(
description='A script for add script header message'
)
parser.add_argument('newfile')
... | mit | Python |
829e10b883a59d0d4d2f9ba6bc602fca807c44f4 | Rollback to json format | samcheck/PyMedia,samcheck/PyMedia,samcheck/PyMedia | OMDB_api_scrape.py | OMDB_api_scrape.py | #!/usr/bin/python3
# OMDB_api_scrape.py - parses a movie and year from the command line, grabs the
# JSON and saves a copy for later
import json, requests, sys, os
URL_BASE = 'http://www.omdbapi.com/?'
if len(sys.argv) > 1:
# Get address from command line.
mTitle = '+'.join(sys.argv[1:-1])
... | #!/usr/bin/python3
# OMDB_api_scrape.py - parses a movie and year from the command line, grabs the
# xml and saves a copy for later
import pprint, requests, sys, os
import lxml.etree
from xml.dom.minidom import parseString
URL_BASE = 'http://www.omdbapi.com/?'
if len(sys.argv) > 1:
# Get addres... | mit | Python |
bf4b50a3f8b12ce3552d0ca084ee1a3445e89ac2 | Update views.py | totem/totem-demo | demo/views.py | demo/views.py | import flask
import sys
from flask import request
app = flask.Flask(__name__)
@app.route('/')
def hello_world():
return flask.jsonify({
'message': 'Hello Worlb!',
'python': sys.version,
'headers': str(request.headers)
})
| import flask
import sys
from flask import request
app = flask.Flask(__name__)
@app.route('/')
def hello_world():
return flask.jsonify({
'message': 'Hello Worlbd!',
'python': sys.version,
'headers': str(request.headers)
})
| mit | Python |
1c7f4351f4d4be0266796a1188f1d782f29e2228 | Update main.py | Python-IoT/Smart-IoT-Planting-System,Python-IoT/Smart-IoT-Planting-System | device/src/main.py | device/src/main.py | #This is the file executing while STM32 MCU bootup, and in this file,
#it will call other functions to fullfill the project.
#Communication module: LoRa.
#Communication method with gateway via LoRa.
#Uart port drive LoRa module.
#Parse JSON between device and gateway via LoRa channel.
#LoRa module: E32-TTL-100
#Pin s... | #This is the file executing while STM32 MCU bootup, and in this file,
#it will call other functions to fullfill the project.
#Communication module: LoRa.
#Communication method with gateway via LoRa.
#Uart port drive LoRa module.
#Parse JSON between device and gateway via LoRa channel.
#LoRa module: E32-TTL-100
#Pin s... | mit | Python |
e6534ab7f57715a5799c61c208e84fb8d02dbc1c | Update views.py | totem/totem-demo | demo/views.py | demo/views.py | import flask
import sys
from flask import request
app = flask.Flask(__name__)
@app.route('/')
def hello_world():
return flask.jsonify({
'message': 'Hello World!',
'python': sys.version,
'headers': str(request.headers)
})
| import flask
import sys
from flask import request
app = flask.Flask(__name__)
@app.route('/')
def hello_world():
return flask.jsonify({
'message': 'Hello Worlb!',
'python': sys.version,
'headers': str(request.headers)
})
| mit | Python |
57b5caf7f7ffe17723cd11899df933028197e1c9 | test in stochastic.py | fomy/sim,fomy/simd | stochastic.py | stochastic.py | from mpmath import *
import random
class Weibull:
def __init__(self, shape, scale, location=0):
self.shape = mpf(shape)
self.scale = mpf(scale)
self.location = mpf(location)
def draw(self):
v = random.weibullvariate(self.scale, self.shape)
if v < self.location:
... | from mpmath import *
import random
class Weibull:
def __init__(self, shape, scale, location=0):
self.shape = mpf(shape)
self.scale = mpf(scale)
self.location = mpf(location)
def draw(self):
v = random.weibullvariate(self.scale, self.shape)
if v < self.location:
... | apache-2.0 | Python |
30171c3410dd38ad2ebe4893a2bbe3e5ae15e149 | Update views.py | totem/totem-demo | demo/views.py | demo/views.py | import flask
import sys
from flask import request
app = flask.Flask(__name__)
@app.route('/')
def hello_world():
return flask.jsonify({
'message': 'Hello Worlbd!',
'python': sys.version,
'headers': str(request.headers)
})
| import flask
import sys
from flask import request
app = flask.Flask(__name__)
@app.route('/')
def hello_world():
return flask.jsonify({
'message': 'Hello Worlb!',
'python': sys.version,
'headers': str(request.headers)
})
| mit | Python |
9d541eeebe789d61d915dbbc7fd5792e244bd93f | Create script to save documentation to a file | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | apache-2.0 | Python |
f8bb39b247bcd4b2d46e0fb3ebdeede40c867548 | add simple test for methods starting with _ | smspillaz/pychecker,smspillaz/pychecker,smspillaz/pychecker | pychecker/pychecker2/tests/class.py | pychecker/pychecker2/tests/class.py | import compiler.ast
class B(compiler.ast.Const):
inherited2 = 1
def x(self):
self.inherited1 = 1
class A(B):
def __init__(self):
self.x = 1 # define x on A
self.w.q = 1
def f(s, self): # unusual self
print self
s.self = ... | import compiler.ast
class B(compiler.ast.Const):
inherited2 = 1
def x(self):
self.inherited1 = 1
class A(B):
def __init__(self):
self.x = 1 # define x on A
self.w.q = 1
def f(s, self): # unusual self
print self
s.self = ... | bsd-3-clause | Python |
2d7882872bb79b07a4c7d17f06878da6dabddbe9 | use celery 3.0 and compatible kombo | LibreTime/libretime,LibreTime/libretime,LibreTime/libretime,LibreTime/libretime,LibreTime/libretime,LibreTime/libretime | python_apps/airtime-celery/setup.py | python_apps/airtime-celery/setup.py | from setuptools import setup
from subprocess import call
import os
import sys
# Change directory since setuptools uses relative paths
script_path = os.path.dirname(os.path.realpath(__file__))
print script_path
os.chdir(script_path)
install_args = ['install', 'install_data', 'develop']
no_init = False
run_postinst = F... | from setuptools import setup
from subprocess import call
import os
import sys
# Change directory since setuptools uses relative paths
script_path = os.path.dirname(os.path.realpath(__file__))
print script_path
os.chdir(script_path)
install_args = ['install', 'install_data', 'develop']
no_init = False
run_postinst = F... | agpl-3.0 | Python |
537c6b2c195aab571c59f470872e4dabf05de5a8 | remove IRate/Tag from the mercator Element types, this is not needed | fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,xs2maverick/adhocracy3.mercat... | src/adhocracy_core/adhocracy_core/resources/mercator.py | src/adhocracy_core/adhocracy_core/resources/mercator.py | """Mercator proposal."""
from adhocracy_core.interfaces import IItemVersion
from adhocracy_core.interfaces import IItem
from adhocracy_core.resources import add_resource_type_to_registry
from adhocracy_core.resources.itemversion import itemversion_metadata
from adhocracy_core.resources.item import item_metadata
from ad... | """Mercator proposal."""
from adhocracy_core.interfaces import IItemVersion
from adhocracy_core.interfaces import IItem
from adhocracy_core.interfaces import ITag
from adhocracy_core.resources import add_resource_type_to_registry
from adhocracy_core.resources.itemversion import itemversion_metadata
from adhocracy_core.... | agpl-3.0 | Python |
7e044175d7e0c658cdc96ff8aac91a047510b824 | Raise the tolerance limit for windows | oyamad/QuantEcon.py,oyamad/QuantEcon.py,QuantEcon/QuantEcon.py,QuantEcon/QuantEcon.py | quantecon/util/tests/test_timing.py | quantecon/util/tests/test_timing.py | """
Tests for timing.py
"""
import time
from sys import platform
from numpy.testing import assert_allclose, assert_
from quantecon.util import tic, tac, toc, loop_timer
class TestTicTacToc:
def setup_method(self):
self.h = 0.1
self.digits = 10
def test_timer(self):
if platform == 'd... | """
Tests for timing.py
"""
import time
from sys import platform
from numpy.testing import assert_allclose, assert_
from quantecon.util import tic, tac, toc, loop_timer
class TestTicTacToc:
def setup_method(self):
self.h = 0.1
self.digits = 10
def test_timer(self):
if platform == 'd... | bsd-3-clause | Python |
b9cec3d57d940d32d25599c4181fd07505e42c38 | Remove pip upgrade flag from on_plugin_install.py | wheeler-microfluidics/dmf_control_board_plugin | on_plugin_install.py | on_plugin_install.py | from datetime import datetime
import logging
from path_helpers import path
from pip_helpers import install
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
logging.info(str(datetime.now()))
requirements = path(__file__).parent.joinpath('requirements.txt').abspath()
logging.info(inst... | from datetime import datetime
import logging
from path_helpers import path
from pip_helpers import install
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
logging.info(str(datetime.now()))
requirements = path(__file__).parent.joinpath('requirements.txt').abspath()
logging.info(inst... | bsd-3-clause | Python |
4f6de9720d7e7a8ea3d6cc3f3a3828fb51a86946 | bump version | ArabellaTech/ydcommon,ArabellaTech/ydcommon,ArabellaTech/ydcommon | ydcommon/__init__.py | ydcommon/__init__.py | """
YD Technology common libraries
"""
VERSION = (0, 1, 3)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns shorter version (digit parts only) as string.
"""
version = '.'.join((str(each) for each in VERSION[:3]))
if len(VERSION) > 3:
version += ... | """
YD Technology common libraries
"""
VERSION = (0, 1, 2)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns shorter version (digit parts only) as string.
"""
version = '.'.join((str(each) for each in VERSION[:3]))
if len(VERSION) > 3:
version += ... | mit | Python |
2f231b3b1f99e6f08ea8b23fb54e5602efd53ab8 | Fix incorrect behavior in argv.StoreInModule (#389) | jettisonjoe/openhtf,google/openhtf,jettisonjoe/openhtf,grybmadsci/openhtf,google/openhtf,google/openhtf,grybmadsci/openhtf,ShaperTools/openhtf,grybmadsci/openhtf,ShaperTools/openhtf,ShaperTools/openhtf,fahhem/openhtf,jettisonjoe/openhtf,fahhem/openhtf,google/openhtf,fahhem/openhtf,fahhem/openhtf,ShaperTools/openhtf,Sha... | openhtf/util/argv.py | openhtf/util/argv.py | """Utilities for handling command line arguments.
StoreInModule:
Enables emulating a gflags-esque API (flag affects global value), but one
doesn't necessarily need to use flags to set values.
Example usage:
DEFAULT_VALUE = 0
ARG_PARSER = argv.ModuleParser()
ARG_PARSER.add_argument(
'--over... | """Utilities for handling command line arguments."""
import argparse
def ModuleParser():
return argparse.ArgumentParser(add_help=False)
class StoreInModule(argparse.Action):
def __init__(self, *args, **kwargs):
self._tgt_mod, self._tgt_attr = kwargs.pop('target').rsplit('.', 1)
proxy_cls =... | apache-2.0 | Python |
9fa6ed8c5dfdb0063a1248d5752a835ec60eb0ae | add sale_line_analytic as dependency | rfhk/tks-custom,rfhk/tks-custom | sale_project_create/__manifest__.py | sale_project_create/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright 2017 Rooms For (Hong Kong) Limited T/A OSCG
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': "Create Project from Sales",
'version': "10.0.1.0.1",
'author': "Rooms For (Hong Kong) Limited T/A OSCG",
'website': "https://www.odoo-asia.com/",
... | # -*- coding: utf-8 -*-
# Copyright 2017 Rooms For (Hong Kong) Limited T/A OSCG
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': "Create Project from Sales",
'version': "10.0.1.0.1",
'author': "Rooms For (Hong Kong) Limited T/A OSCG",
'website': "https://www.odoo-asia.com/",
... | agpl-3.0 | Python |
8fa72cea635171e94f0fb5538bc82197c6890b36 | FIX problem after reorganizing test. | jenisys/behave,jenisys/behave | tests/issues/test_issue0619.py | tests/issues/test_issue0619.py | # -*- coding: UTF-8 -*-
"""
https://github.com/behave/behave/issues/619
When trying to do something like::
foo = getattr(context, '_foo', 'bar')
Behave fails with::
File "[...]/behave/runner.py", line 208, in __getattr__
return self.__dict__[attr]
KeyError: '_foo'
I think this is because the __ge... | # -*- coding: UTF-8 -*-
"""
https://github.com/behave/behave/issues/619
When trying to do something like::
foo = getattr(context, '_foo', 'bar')
Behave fails with::
File "[...]/behave/runner.py", line 208, in __getattr__
return self.__dict__[attr]
KeyError: '_foo'
I think this is because the __ge... | bsd-2-clause | Python |
4aba08a85698825cbc216ff991dc9b85eda4b210 | add test for saving and loading weights | BioroboticsLab/diktya | tests/layers/test_attention.py | tests/layers/test_attention.py | # Copyright 2015 Leon Sixt
#
# 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, sof... | # Copyright 2015 Leon Sixt
#
# 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, sof... | apache-2.0 | Python |
3781bd3aca1e82b0ccdb73b90ad8e1ae7ae023be | fix PY-14472 Matplotlib import has failed in Python Console (AttributeError: 'module' object has no attribute 'rcParams') | xfournet/intellij-community,ahb0327/intellij-community,caot/intellij-community,MER-GROUP/intellij-community,dslomov/intellij-community,youdonghai/intellij-community,supersven/intellij-community,michaelgallacher/intellij-community,fnouama/intellij-community,SerCeMan/intellij-community,kool79/intellij-community,supersven... | python/helpers/pydev/pydev_import_hook.py | python/helpers/pydev/pydev_import_hook.py |
import sys
from pydevd_constants import IS_PY24, IS_PY3K
from pydevd_constants import DictContains
from types import ModuleType
class ImportHookManager(ModuleType):
def __init__(self, name, system_import):
ModuleType.__init__(self, name)
self._system_import = system_import
self._modules_t... |
import sys
from pydevd_constants import IS_PY24, IS_PY3K
from pydevd_constants import DictContains
from types import ModuleType
class ImportHookManager(ModuleType):
def __init__(self, name, system_import):
ModuleType.__init__(self, name)
self._system_import = system_import
self._modules_t... | apache-2.0 | Python |
27fee83065a775690986ad5b9406839d30d8dba1 | Add docstrings | pypa/pip,xavfernandez/pip,pfmoore/pip,sbidoul/pip,xavfernandez/pip,pfmoore/pip,sbidoul/pip,pradyunsg/pip,xavfernandez/pip,pypa/pip,pradyunsg/pip | src/pip/_internal/operations/install/editable_legacy.py | src/pip/_internal/operations/install/editable_legacy.py | """Legacy installation process, i.e. `setup.py develop`.
"""
import logging
from pip._internal.utils.logging import indent_log
from pip._internal.utils.setuptools_build import make_setuptools_develop_args
from pip._internal.utils.subprocess import call_subprocess
from pip._internal.utils.typing import MYPY_CHECK_RUNNI... | import logging
from pip._internal.utils.logging import indent_log
from pip._internal.utils.setuptools_build import make_setuptools_develop_args
from pip._internal.utils.subprocess import call_subprocess
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List, Optio... | mit | Python |
4ef9dffbada111a6eb8e2359c105fe56cbb78bc8 | clone function return 1 | SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,lewisodriscoll/sasview | sansmodels/src/sans/models/NoStructure.py | sansmodels/src/sans/models/NoStructure.py | #!/usr/bin/env python
""" Provide sin(x) function as a BaseComponent model
"""
from sans.models.BaseComponent import BaseComponent
import math
class NoStructure(BaseComponent):
""" Class that evaluates a sin(x) model.
"""
def __init__(self):
""" Initialization """
... | #!/usr/bin/env python
""" Provide sin(x) function as a BaseComponent model
"""
from sans.models.BaseComponent import BaseComponent
import math
class NoStructure(BaseComponent):
""" Class that evaluates a sin(x) model.
"""
def __init__(self):
""" Initialization """
... | bsd-3-clause | Python |
083a1d9ef5d376ab20a8cc5e0aa58d5d6df0d3f1 | change file names to lower case | evandromr/python_scitools | addepiclc_lcmath.py | addepiclc_lcmath.py | #!/usr/env python
import glob
import subprocess
if __name__ == '__main__':
'''
Add lightcurves
MOS1 + MOS2 = MOSS
PN + MOSS = EPIC
'''
mos1files = glob.glob('mos1_lc_net*')
mos2files = glob.glob('mos2_lc_net*')
pnfiles = glob.glob('pn_lc_net*')
mos1files.sort()
mos2files.sort... | #!/usr/env python
import glob
import subprocess
if __name__ == '__main__':
'''
Add lightcurves
MOS1 + MOS2 = MOSS
PN + MOSS = EPIC
'''
mos1files = glob.glob('MOS1_lc_net*')
mos2files = glob.glob('MOS2_lc_net*')
pnfiles = glob.glob('PN_lc_net*')
mos1files.sort()
mos2files.sort... | mit | Python |
5885b527cb8b04bbd71047dd3ff7b775434b5022 | Add script desc | bowen0701/algorithms_data_structures | alg_find_peak_1D.py | alg_find_peak_1D.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Find a peak in 1D array."""
def find_peak_naive(arr):
"""Find peak by naive iteration.
Time complexity: O(n).
"""
for i in range(len(arr)):
if i == 0:
if arr[i] >= arr[i... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def find_peak_naive(arr):
"""Find peak by naive iteration.
Time complexity: O(n).
"""
for i in range(len(arr)):
if i == 0:
if arr[i] >= arr[i + 1]:
return a... | bsd-2-clause | Python |
f606cc1eb743999735cec2faf351d9e009d38c4e | add the check | influence-usa/pupa,rshorey/pupa,mileswwatkins/pupa,opencivicdata/pupa,datamade/pupa,rshorey/pupa,opencivicdata/pupa,mileswwatkins/pupa,datamade/pupa,influence-usa/pupa | tools/scruffy/checkers/events.py | tools/scruffy/checkers/events.py | from .. import Check
from .common import common_checks, resolve
def check(db):
for event in db.events.find():
for check in common_checks(event, 'event', 'events'):
yield check
for agenda in event['agenda']:
for entity in agenda['related_entities']:
if entit... | from .. import Check
from .common import common_checks, resolve
def check(db):
for event in db.events.find():
for check in common_checks(event, 'event', 'events'):
yield check
for agenda in event['agenda']:
for entity in agenda['related_entities']:
if entit... | bsd-3-clause | Python |
600dbae40b99ac158d7b87b75fa1cdba79762901 | Bump version to 0.1.1 | GripQA/commit-entropy | lib/commit_entropy/settings.py | lib/commit_entropy/settings.py | #!/usr/bin/env python
# encoding: utf-8
#------------------------------------------------------------------------------
# Application Name
#------------------------------------------------------------------------------
app_name = 'entropy'
#-----------------------------------------------------------------------------... | #!/usr/bin/env python
# encoding: utf-8
#------------------------------------------------------------------------------
# Application Name
#------------------------------------------------------------------------------
app_name = 'entropy'
#-----------------------------------------------------------------------------... | apache-2.0 | Python |
9f952a37b2c907e9dcbb20b5a753953df87704cc | update model references | recombinators/snapsat,recombinators/snapsat,recombinators/snapsat | app/app/__init__.py | app/app/__init__.py | import os
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from .models import Session, Base
def main(global_config, **settings):
"""
Configure and return a WSGI application.
"""
settings['sqlalchemy.url'] = os.environ.get('DATABASE_URL')
engine = engine_from_confi... | import os
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from .models import DBSession, Base
def main(global_config, **settings):
"""
Configure and return a WSGI application.
"""
settings['sqlalchemy.url'] = os.environ.get('DATABASE_URL')
engine = engine_from_con... | mit | Python |
f95d8969899dd124831e0916c48463b0a4086d8c | Manage connection pool | UCUBusProj/app-data-scraper | app_data-scraper.py | app_data-scraper.py | from apscheduler.schedulers.blocking import BlockingScheduler
import urllib.request
import time
import json
import sqlalchemy
from sqlalchemy import insert, MetaData, Table
from datetime import datetime, timezone
from os import environ
def connect():
url = environ.get('DATABASE_URL')
eng = sqlalchemy.create_en... | from apscheduler.schedulers.blocking import BlockingScheduler
import urllib.request
import time
import json
import sqlalchemy
from sqlalchemy import insert, MetaData, Table
from datetime import datetime, timezone
from os import environ
def connect():
url = environ.get('DATABASE_URL')
eng = sqlalchemy.create_en... | mit | Python |
df54d768798e29c63d6d12cbe8d0acbd643b42e4 | Manage connection pool | UCUBusProj/app-data-scraper | app_data-scraper.py | app_data-scraper.py | from apscheduler.schedulers.blocking import BlockingScheduler
import urllib.request
import time
import json
import sqlalchemy
from sqlalchemy import insert, MetaData, Table
from datetime import datetime, timezone
from os import environ
def connect():
url = environ.get('DATABASE_URL')
eng = sqlalchemy.create_en... | from apscheduler.schedulers.blocking import BlockingScheduler
import urllib.request
import time
import json
import sqlalchemy
from sqlalchemy import insert, MetaData, Table
from datetime import datetime, timezone
from os import environ
def connect():
url = environ.get('DATABASE_URL')
eng = sqlalchemy.create_en... | mit | Python |
31e7bedcdfdf6681da9134a1193a52beddfb014e | check replication for all instances | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/workflow/steps/mysql/region_migration/check_replication.py | dbaas/workflow/steps/mysql/region_migration/check_replication.py | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from workflow.exceptions.error_codes import DBAAS_0020
from workflow.steps.mysql.util import check_seconds_behind
LOG = logging.getLogger(__name__)
class CheckReplication(BaseStep):
def __unicode__(s... | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from workflow.exceptions.error_codes import DBAAS_0020
from workflow.steps.mysql.util import check_seconds_behind
LOG = logging.getLogger(__name__)
class CheckReplication(BaseStep):
def __unicode__(s... | bsd-3-clause | Python |
9146d576c93c3d8ac5c8d50041517e21fbfa1c51 | set version to 0.9.0-final in preparation for release | emory-libraries/readux,emory-libraries/readux,emory-libraries/readux | readux/__init__.py | readux/__init__.py | __version_info__ = (0, 9, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (0, 9, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | apache-2.0 | Python |
0a522863dce6e42bf66c66a56078c00901c64f52 | Use database number from redis url if available. | denisov-vlad/redash,EverlyWell/redash,44px/redash,rockwotj/redash,M32Media/redash,guaguadev/redash,stefanseifert/redash,hudl/redash,easytaxibr/redash,denisov-vlad/redash,ninneko/redash,jmvasquez/redashtest,crowdworks/redash,easytaxibr/redash,getredash/redash,pubnative/redash,rockwotj/redash,crowdworks/redash,stefanseif... | redash/__init__.py | redash/__init__.py | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | bsd-2-clause | Python |
86418b48ca9bef5d0cd7cbf8468abfad633b56ed | Add try/except in case select function fails | andrewlrogers/srvy | write_csv.py | write_csv.py | """Export all responses from yesterday and save them to a .csv file."""
import sqlite3
import csv
from datetime import datetime, timedelta
import os
today = str(datetime.now().strftime('%Y-%m-%d'))
yesterday = str((datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d'))
export_directory = 'export'
export_filename... | """Export all responses from yesterday and save them to a CSV file."""
import sqlite3
import csv
from datetime import datetime, timedelta
import os
today = str(datetime.now().strftime('%Y-%m-%d'))
yesterday = str((datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d'))
export_directory = 'export'
export_filename ... | mit | Python |
e0b1d9a36e3af1dd616fdf73bf07f94bc0349144 | support DEBUG_FMF define in sfepy/discrete/iga/extmods/setup.py | lokik/sfepy,lokik/sfepy,BubuLK/sfepy,vlukes/sfepy,sfepy/sfepy,rc/sfepy,lokik/sfepy,RexFuzzle/sfepy,sfepy/sfepy,RexFuzzle/sfepy,rc/sfepy,BubuLK/sfepy,rc/sfepy,RexFuzzle/sfepy,lokik/sfepy,RexFuzzle/sfepy,BubuLK/sfepy,sfepy/sfepy,vlukes/sfepy,vlukes/sfepy | sfepy/discrete/iga/extmods/setup.py | sfepy/discrete/iga/extmods/setup.py | #!/usr/bin/env python
def configuration(parent_package='', top_path=None):
import os.path as op
from numpy.distutils.misc_util import Configuration
from sfepy import Config
site_config = Config()
os_flag = {'posix' : 0, 'windows' : 1}
auto_dir = op.dirname(__file__)
auto_name = op.split(... | #!/usr/bin/env python
def configuration(parent_package='', top_path=None):
import os.path as op
from numpy.distutils.misc_util import Configuration
from sfepy import Config
site_config = Config()
os_flag = {'posix' : 0, 'windows' : 1}
auto_dir = op.dirname(__file__)
auto_name = op.split(... | bsd-3-clause | Python |
abd5a50e361d09f244cc376f2e09301e5adec369 | Fix test_runtests on Windows | stonebig/numba,jriehl/numba,stefanseefeld/numba,stefanseefeld/numba,stonebig/numba,stonebig/numba,stonebig/numba,stefanseefeld/numba,stefanseefeld/numba,sklam/numba,stuartarchibald/numba,jriehl/numba,jriehl/numba,numba/numba,cpcloud/numba,sklam/numba,IntelLabs/numba,cpcloud/numba,sklam/numba,stuartarchibald/numba,Intel... | numba/tests/test_runtests.py | numba/tests/test_runtests.py | #!/usr/bin/env python
import unittest
import subprocess
def check_output(*popenargs, **kwargs):
# Provide this for backward-compatibility until we drop Python 2.6 support.
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = proc... | #!/usr/bin/env python
import unittest
import subprocess
def check_output(*popenargs, **kwargs):
# Provide this for backward-compatibility until we drop Python 2.6 support.
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = proc... | bsd-2-clause | Python |
1c52c9382ca98a8ddc0c7727931801432a629723 | Make examples test regex handle number spans | scriptotek/mc2skos | tests/test_process_examples.py | tests/test_process_examples.py | # encoding=utf-8
import unittest
import pytest
import os
import re
from lxml import etree
from mc2skos.mc2skos import process_record
from rdflib.namespace import RDF, SKOS, Namespace
from rdflib import URIRef, Literal, Graph
def get_records(marcfile):
for _, record in etree.iterparse(marcfile, tag='{http://www.lo... | # encoding=utf-8
import unittest
import pytest
import os
import re
from lxml import etree
from mc2skos.mc2skos import process_record
from rdflib.namespace import RDF, SKOS, Namespace
from rdflib import URIRef, Literal, Graph
def get_records(marcfile):
for _, record in etree.iterparse(marcfile, tag='{http://www.lo... | unlicense | Python |
a744e5dc7f12ecb6d45ce3887ff4d1d41e6971be | Simplify some test logic | pimlie/django-countries,fladi/django-countries,rahimnathwani/django-countries,basichash/django-countries,SmileyChris/django-countries,velfimov/django-countries,jrfernandes/django-countries,schinckel/django-countries,maximzxc/django-countries | django_countries/tests/test_fields.py | django_countries/tests/test_fields.py | from __future__ import unicode_literals
from django.test import TestCase
from django_countries.tests.models import Person
from django.utils.encoding import force_text
class TestCountryField(TestCase):
def create_person(self, country='NZ'):
return Person.objects.create(name='Chris Beaven', country='NZ')
... | from __future__ import unicode_literals
from django.test import TestCase
from django_countries.tests.models import Person
from django.utils.encoding import force_text
class TestCountryField(TestCase):
def create_person(self, country='NZ'):
return Person.objects.create(name='Chris Beaven', country=country... | mit | Python |
35a046a61d0acc1d6b7a1c084077bdf9ed7ff720 | Remove testing of private methods (other than that they exist) | jdgillespie91/trackerSpend,jdgillespie91/trackerSpend | tests/utils/parse_worksheet.py | tests/utils/parse_worksheet.py | import unittest
from unittest.mock import patch
from utils import parse_worksheet
class TestParseWorksheet(unittest.TestCase):
def test_open_worksheet_function_is_defined(self):
if not hasattr(parse_worksheet, '__open_worksheet'):
self.fail('__open_worksheet should be defined.')
def test_g... | import unittest
from utils import parse_worksheet
class TestParseWorksheet(unittest.TestCase):
def test_open_worksheet_function_is_defined(self):
if not hasattr(parse_worksheet, '__open_worksheet'):
self.fail('__open_sheet should be defined.')
def test_get_data_function_is_defined(self):
... | mit | Python |
b8216f707893b7b37844af7e61c589ee1805b385 | Integrate LLVM at llvm/llvm-project@d38b9f1f31b1 | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,ga... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "d38b9f1f31b1fa8ee885cfcd4ee7bd69771088c8"
LLVM_SHA256 = "4dac2be3c82bedd137b60b77ffb36ac203c2a2209278d589db6326e6a8fee499"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8e22539067d9376c4f808b25f543feba728d40c9"
LLVM_SHA256 = "db0a7099e6e1eacbb51338f0b18c237be7354c25e8126c523390bef965a9b6f6"
tf_http_archive(
... | apache-2.0 | Python |
fa7da2acfe379a56c4a2c5a09dd6405023f66218 | Integrate LLVM at llvm/llvm-project@0277a24f4bba | gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,frreiss/tensorflow-fred,sarvex/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "0277a24f4bbac284ba7a2ace7eeefdf6305e7f69"
LLVM_SHA256 = "f14a9666c78a7829e06ad8d1b6dc86f1f4a9a092eb0b9708f14a5e9e8d4f566f"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "bfb9c749c02402ba082e81bfdadb15fb331c59ae"
LLVM_SHA256 = "ccf8590120b44d2a0d8fb960f4009935ab1cee72bb3c5d1314d75bfd03915f92"
tf_http_archive(
... | apache-2.0 | Python |
527789bef0f0f386fcdbd929d3e1e4244d4861ce | Integrate LLVM at llvm/llvm-project@aed179f5f557 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "aed179f5f557664d6deb26ef6fdc6aa944af41af"
LLVM_SHA256 = "41911605d3654841eaa3d8cd854a95b71c39e643ea362086837ad3681a71db05"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8b18572ea7ca7733d8140cb1947079b8704d37db"
LLVM_SHA256 = "09acf878e80c88c1942bd3eee89eb85c074e9f6f38a1b68c85ee113dd3d6c716"
tfrt_http_archive(
... | apache-2.0 | Python |
c5bf7644569732e58ec83154927ba98acf752ecd | Integrate LLVM at llvm/llvm-project@5a64bc207ee0 | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensor... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "5a64bc207ee07d939271ee8631bf28b01e431a46"
LLVM_SHA256 = "b9e5fb8451619e11357c1d46ed52ca08d1ca5427a9c9134512da6475b1b618d1"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f06abbb393800b0d466c88e283c06f75561c432c"
LLVM_SHA256 = "3c13ed5cd452c1f56fa203a96b6e3a8c81787a1adc95b9c37c5c53cb21b7749c"
tf_http_archive(
... | apache-2.0 | Python |
d4bb7b6ffd9aecff2220e53f07b11fb173183f04 | Integrate LLVM at llvm/llvm-project@7128bb61fb59 | yongtang/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/te... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7128bb61fb59bd1d170865b5a5f0fe8fe0c00491"
LLVM_SHA256 = "067381e9c6276cd24c6384a8cb0b0b5ecfa95952a8a7a95f61b54f1e0ef0503a"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "128c6ed73b8f906a13ae908008c6f415415964bb"
LLVM_SHA256 = "1708ed634016e3bce06acaac481aeaa6c5d0fcaa8bfa7819dfaf8b77bdf18ae2"
tf_http_archive(
... | apache-2.0 | Python |
102f5befef27a33dec2cab2600f9b2b4bf3e5036 | Integrate LLVM at llvm/llvm-project@e6564f39c787 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "e6564f39c787d6aa06ad5573e55db3439ed3a263"
LLVM_SHA256 = "d26ec5fc319726a768673f43c369588d01cdf16820912ac804ee828222ba9181"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "b797d5e6b21b3af3d581642c9a535327aa0764a7"
LLVM_SHA256 = "5c6b7377dc9eda56033c6347cdd7855acefbb5bd684a5188f4e7aef049e7eed8"
tfrt_http_archive(
... | apache-2.0 | Python |
2b87fb80d99b44af134384d1ea99f6166daf0a3d | Add a separate launch for blink. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/gatekeeper_launch.py | scripts/slave/gatekeeper_launch.py | #!/usr/bin/env python
# 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.
"""Annotated script to launch the gatekeeper script."""
import os
import sys
SLAVE_DIR = os.path.dirname(os.path.abspath(__file__... | #!/usr/bin/env python
# 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.
"""Annotated script to launch the gatekeeper script."""
import os
import sys
SLAVE_DIR = os.path.dirname(os.path.abspath(__file__... | bsd-3-clause | Python |
b05f4c968c7a934295000efd3bb22e93cb3c327a | Convert Answer objects to string first (iters over Answer.rrset via __getitem__) | cetanu/sender_policy_flattener | sender_policy_flattener/crawler.py | sender_policy_flattener/crawler.py | # coding=utf-8
from dns import resolver # dnspython/3
from sender_policy_flattener.formatting import wrap_in_spf_tokens, ips_to_spf_strings, fit_bytes
from sender_policy_flattener.mechanisms import tokenize
from sender_policy_flattener.handlers import *
handle_tokens = {
'ip': handle_ip,
'mx': handle_mx,
... | # coding=utf-8
from dns import resolver # dnspython/3
from sender_policy_flattener.formatting import wrap_in_spf_tokens, ips_to_spf_strings, fit_bytes
from sender_policy_flattener.mechanisms import tokenize
from sender_policy_flattener.handlers import *
handle_tokens = {
'ip': handle_ip,
'mx': handle_mx,
... | mit | Python |
cc39c2849bbe6b5b88a6a34f613d3b6dfa445eab | Debug asynchronous image acquisition (via callback). | microy/VisionToolkit,microy/PyStereoVisionToolkit,microy/StereoVision,microy/VisionToolkit,microy/PyStereoVisionToolkit,microy/StereoVision | test-async.py | test-async.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images asynchronously
# from two AVT Manta cameras with the Vimba SDK
#
#
# External dependencies
#
import cv2
import ctypes as ct
import numpy as np
import Vimba
import Viewer
# Default image parameters from our cameras (AVT Manta G504B)
w... | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Application to capture images asynchronously
# from two AVT Manta cameras with the Vimba SDK
#
#
# External dependencies
#
import Vimba
import collections, cv2, time
import ctypes as ct
import numpy as np
#
# Frame callback function
#
def FrameCallback( pCamer... | mit | Python |
7baefcb3730d5925747ffb7a7473cfccb7e81188 | Revert to old ordering of shop app in INSTALLED_APPS. | Parisson/cartridge,viaregio/cartridge,wbtuomela/cartridge,jaywink/cartridge-reservable,traxxas/cartridge,syaiful6/cartridge,stephenmcd/cartridge,wyzex/cartridge,Kniyl/cartridge,jaywink/cartridge-reservable,wbtuomela/cartridge,ryneeverett/cartridge,wyzex/cartridge,Kniyl/cartridge,dsanders11/cartridge,ryneeverett/cartrid... | cartridge/project_template/settings.py | cartridge/project_template/settings.py |
import sys; sys.path.insert(0, "../../../mezzanine/")
from mezzanine.project_template.settings import *
# Main Django settings.
DEBUG = False
DEV_SERVER = False
MANAGERS = ADMINS = ()
TIME_ZONE = ""
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
LANGUAGE_CODE = "en"
SITE_ID = 1
USE_I18N = False
SECRET_KEY = "%(SECRET_KEY)s"
... |
import sys; sys.path.insert(0, "../../../mezzanine/")
from mezzanine.project_template.settings import *
# Main Django settings.
DEBUG = False
DEV_SERVER = False
MANAGERS = ADMINS = ()
TIME_ZONE = ""
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
LANGUAGE_CODE = "en"
SITE_ID = 1
USE_I18N = False
SECRET_KEY = "%(SECRET_KEY)s"
... | bsd-2-clause | Python |
a4e5153560922784afa1f7e2ac24336127909629 | Fix boolean logic | wied03/centos-package-cron,wied03/centos-package-cron,wied03/centos-package-cron | centos_package_cron/package_checker.py | centos_package_cron/package_checker.py | class PackageChecker:
def __init__(self, errata_fetcher, package_fetcher, os_fetcher):
self.errata_fetcher = errata_fetcher
self.package_fetcher = package_fetcher
self.os_fetcher = os_fetcher
def match_advisory_against_installed(self,advisory_package,current_installed):
return any(advisory_package['name'] =... | class PackageChecker:
def __init__(self, errata_fetcher, package_fetcher, os_fetcher):
self.errata_fetcher = errata_fetcher
self.package_fetcher = package_fetcher
self.os_fetcher = os_fetcher
def match_advisory_against_installed(self,advisory_package,current_installed):
return any(advisory_package['name'] =... | bsd-2-clause | Python |
1e771d07b2aa2a771bffea8126be8c5cac08a416 | allow usage of local WELT2000 file | RBE-Avionik/skylines,shadowoneau/skylines,Turbo87/skylines,shadowoneau/skylines,dkm/skylines,Harry-R/skylines,kerel-fs/skylines,shadowoneau/skylines,skylines-project/skylines,Harry-R/skylines,RBE-Avionik/skylines,dkm/skylines,RBE-Avionik/skylines,skylines-project/skylines,skylines-project/skylines,dkm/skylines,Turbo87/... | skylines/lib/waypoints/welt2000.py | skylines/lib/waypoints/welt2000.py | import os
import subprocess
from tg import config
from skylines.lib.waypoints.welt2000_reader import parse_welt2000_waypoints
def __get_database_file(dir_data):
path = os.path.join(dir_data, 'WELT2000.TXT')
# Create Welt2000 data folder if necessary
if not os.path.exists(os.path.dirname(path)):
... | import os
import subprocess
from tg import config
from skylines.lib.waypoints.welt2000_reader import parse_welt2000_waypoints
def __get_database_file(dir_data):
path = os.path.join(dir_data, 'WELT2000.TXT')
# Create Welt2000 data folder if necessary
if not os.path.exists(os.path.dirname(path)):
... | agpl-3.0 | Python |
fa7228e26791987e43fdcb216f98658b45a8b220 | Fix buildbot flag to GM | google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Ti... | slave/skia_slave_scripts/run_gm.py | slave/skia_slave_scripts/run_gm.py | #!/usr/bin/env python
# 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.
""" Run the Skia GM executable. """
from build_step import BuildStep
import os
import sys
JSON_SUMMARY_FILENAME = 'actual-result... | #!/usr/bin/env python
# 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.
""" Run the Skia GM executable. """
from build_step import BuildStep
import os
import sys
JSON_SUMMARY_FILENAME = 'actual-result... | bsd-3-clause | Python |
cf25d8bee88720d0cdda3a4d41649846bbc29666 | Add import in init | GEM-benchmark/NL-Augmenter | transformations/english_inflectional_variation/__init__.py | transformations/english_inflectional_variation/__init__.py | from .transformation import * | mit | Python | |
4eb368feea4f7d3a34aa4d0fdca0ef3d45262739 | modify prime_number_test.py file to return list only | Flevian/andelabootcamp16,Flevian/andelabootcamp16,Flevian/andelabootcamp16 | self_learning_clinic/prime_number_test.py | self_learning_clinic/prime_number_test.py | import unittest
from prime_numbers import primenumbers
class Test_prime_numbers(unittest.Testcase):
def test_returns_correct_primes(self):
self.assertTrue(primenumbers(20), [1,3,5,7,11,13,17,19])
def test_assert_input_is_not_string(self):
self.assertRaises(TypeError, primenumbers('a_string'))
def test_asserts... | import unittest
from prime_numbers import primenumbers
class Test_prime_numbers(unittest.Testcase):
def test_returns_correct_primes(self):
self.assertTrue(primenumbers(20), [1,3,5,7,11,13,17,19])
def test_assert_input_is_not_string(self):
self.assertRaises(TypeError, primenumbers('a_string'))
def test_asserts... | mit | Python |
5d243cb6de0f02e176f4091e3a34b3a23d824242 | allow all tests to be run by testing __init__.py | rc500/ardrone_archive_aarons_laptop,rc500/ardrone_archive_aarons_laptop,rc500/ardrone_archive_aarons_laptop,rc500/ardrone_archive_aarons_laptop,rc500/ardrone_archive_aarons_laptop | ardrone/__init__.py | ardrone/__init__.py | if __name__ == '__main__':
import doctest
import atcommands
import config
import dummy
doctest.testmod(atcommands)
doctest.testmod(config)
doctest.testmod(dummy)
| apache-2.0 | Python | |
0409bf6d6a198748e295dbcae3c6bbe8dce434bf | add models fot the event app | oscarmcm/invite-me,oscarmcm/invite-me,oscarmcm/invite-me,oscarmcm/invite-me | invite-me/event/models.py | invite-me/event/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext as _
class Event(models.Model):
"""
Stores a single event
"""
title = models.CharField(_('Title'), max_length=120)
language = models.CharField(
_('Language')... | bsd-3-clause | Python | |
6de35ac3b09a8c46305dc648968e6ab34e6ab835 | Make the default CELERY_RESULT_BACKEND explicit instead of using the driver default. Closes #125. | supriyantomaftuh/notifico,notifico/notifico,Dav1dde/notifico,Dav1dde/notifico,supriyantomaftuh/notifico,Dav1dde/notifico,notifico/notifico,supriyantomaftuh/notifico,notifico/notifico | notifico/config.py | notifico/config.py | # ---
# Default Notifico Configuration
# ---
import os
# ---
# Flask Misc.
# ---
# This key MUST be changed before you make a site public, as it is used
# to sign the secure cookies used for sessions.
SECRET_KEY = 'YouReallyShouldChangeThisYouKnow'
# ---
# Flask-SQLAlchemy
# ---
db_path = os.path.abspath(os.path.join... | # ---
# Default Notifico Configuration
# ---
import os
# ---
# Flask Misc.
# ---
# This key MUST be changed before you make a site public, as it is used
# to sign the secure cookies used for sessions.
SECRET_KEY = 'YouReallyShouldChangeThisYouKnow'
# ---
# Flask-SQLAlchemy
# ---
db_path = os.path.abspath(os.path.join... | mit | Python |
2d484a4d1c6e50292f5503ac9922c20d5533c9cb | add method for percentage_completed for ToDoList class | davidnjakai/bc-8-todo-console-application | todo_list.py | todo_list.py | import todo_item
class ToDoList(object):
def __init__(self, name, description, todo_items):
self.name = name
self.description = description
self.todo_items = todo_items
def add_todo(self, content, complete = False, *args):
todo_item = todo_item(content, complete, *args)
self.todo_items.append(todo_item)
... | import todo_item
class ToDoList(object):
def __init__(self, name, description, todo_items):
self.name = name
self.description = description
self.todo_items = todo_items
def add_todo(self, content, complete = False, *args):
todo_item = todo_item(content, complete, *args)
self.todo_items.append(todo_item)
... | mit | Python |
3ca8d371112680ee82255a12a4cab6584b10e285 | remove sphinx warnings | robertodr/autocmake,scisoft/autocmake,robertodr/autocmake,scisoft/autocmake,miroi/autocmake,coderefinery/autocmake,miroi/autocmake,coderefinery/autocmake | doc/extract_rst.py | doc/extract_rst.py | import glob
import os
import ntpath
#-------------------------------------------------------------------------------
def extract_rst_blobs(s_in):
s_out = []
is_rst_line = False
for line in s_in.split('\n'):
if is_rst_line:
if len(line) > 0:
if line[0] != '#':
... | import glob
import os
import ntpath
#-------------------------------------------------------------------------------
def extract_rst_blobs(s_in):
s_out = []
is_rst_line = False
for line in s_in.split('\n'):
if is_rst_line:
if len(line) > 0:
if line[0] != '#':
... | bsd-3-clause | Python |
bb6befdfbbced476923d14465418de3dc1bfe107 | fix ToDoList __init__() method to pass none_string_name test | davidnjakai/bc-8-todo-console-application | todo_list.py | todo_list.py | import todo_item
class ToDoList(object):
def __init__(self, name, description, todo_items):
if type(name) != type(''):
self.name = 'Enter valid name'
else:
self.name = name
if type(description) != type(''):
self.description = 'Enter valid description'
else:
self.description = description
self.tod... | import todo_item
class ToDoList(object):
def __init__(self, name, description, todo_items):
self.name = name
if type(description) != type(''):
self.description = 'Enter valid description'
else:
self.description = description
self.todo_items = todo_items
def add_todo(self, content, complete = False, *ar... | mit | Python |
bb033db459bca9c371782ce3fe0a4d572b3b9f9b | Add factories for Module and ModuleType | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | stagecraft/apps/dashboards/tests/factories/factories.py | stagecraft/apps/dashboards/tests/factories/factories.py | import factory
from ...models import Dashboard, Link, ModuleType, Module
from ....organisation.models import Node, NodeType
class DashboardFactory(factory.DjangoModelFactory):
class Meta:
model = Dashboard
published = True
title = "title"
slug = factory.Sequence(lambda n: 'slug%s' % n)
clas... | import factory
from ...models import Dashboard, Link
from ....organisation.models import Node, NodeType
class DashboardFactory(factory.DjangoModelFactory):
class Meta:
model = Dashboard
published = True
title = "title"
slug = factory.Sequence(lambda n: 'slug%s' % n)
class LinkFactory(factor... | mit | Python |
59a517926ed84fc2d3e05f41d47ec66ec3a9a57c | Stop importing PystacheAdapter automatically | livio/DocDown-Python,livio/DocDown-Python,livio/DocDown-Python,livio/DocDown-Python,livio/DocDown-Python,livio/DocDown-Python | docdown/template_adapters/__init__.py | docdown/template_adapters/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from .string_format import StringFormatAdapter
from .template_string import TemplateStringAdapter
| # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from .pystache import PystacheAdapter
from .string_format import StringFormatAdapter
from .template_string import TemplateStringAdapter
| bsd-3-clause | Python |
5fde251c4d9dd9c1c1c143e159f8b03e7d846b2d | Add OCA as author of OCA addons | factorlibre/l10n-spain,Domatix/l10n-spain,factorlibre/l10n-spain,factorlibre/l10n-spain | l10n_es_account_invoice_sequence/__openerp__.py | l10n_es_account_invoice_sequence/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 NaN Projectes de Programari Lliure, S.L.
# http://www.NaN-tic.com
# Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 NaN Projectes de Programari Lliure, S.L.
# http://www.NaN-tic.com
# Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro... | agpl-3.0 | Python |
df4047f084342a6ef433b394145c75352f58a03b | Update mathfunctions.py | kaitheslayer/developingprojects | Python/Math/mathfunctions.py | Python/Math/mathfunctions.py | # File with the functions which will be used in math script
# Number to the power of
def po (number, pof):
b = number
for _ in range(pof - 1):
b = int(b) * int(number)
return b
# Factors of a number
def factors (number):
current, ao, nums = 0, 0, []
while current < number:
ao = ao... | # File with the functions which will be used in math script
def po (number, pof):
b = number
for _ in range(pof - 1):
b = int(b) * int(number)
return b
def factors (number):
current, ao, nums = 0, 0, []
while current < number:
ao = ao + 1
current = number % ao
if ... | mit | Python |
e5940200612b293b1cecff4c6a683ecefa684345 | Add formatting to directory monitor. | jskora/scratch-nifi,jskora/scratch-nifi,jskora/scratch-nifi | dirMonitor.py | dirMonitor.py | #!/usr/bin/env python
import os, sys, time
folders = sys.argv[1:]
nameWidth = max([len(f) for f in folders])
currSize = dict((x, 0) for x in folders)
totalSize = dict((x, 0) for x in folders)
maxSize = dict((x, 0) for x in folders)
fmts = "%*s %13s%s %13s%s %13s%s"
n = 0
while True:
print fmts % (nameWidth,... | #!/usr/bin/env python
import os, sys, time
folders = sys.argv[1:]
currSize = dict((x, 0) for x in folders)
totalSize = dict((x, 0) for x in folders)
maxSize = dict((x, 0) for x in folders)
fmts = "%*s %13s %13s %13s"
fmtd = "%*s %13d %13d %13d"
n = 0
while True:
print fmts % (15, "dir", "size", "avg", "m... | apache-2.0 | Python |
3b5d04fd04df1397ffa0567f445d3270eb7d461f | Update Ax.py | CERN/TIGRE,CERN/TIGRE,CERN/TIGRE,CERN/TIGRE | Python/tigre/utilities/Ax.py | Python/tigre/utilities/Ax.py | from _Ax import _Ax_ext
import numpy as np
import copy
def Ax(img, geo, angles, projection_type="Siddon"):
if img.dtype != np.float32:
raise TypeError("Input data should be float32, not "+ str(img.dtype))
if not np.isreal(img).all():
raise ValueError("Complex types not compatible for ... | from _Ax import _Ax_ext
import numpy as np
import copy
def Ax(img, geo, angles, projection_type="Siddon"):
if img.dtype != np.float32:
raise TypeError("Input data should be float32, not "+ str(img.dtype))
if not np.isreal(img).all():
raise ValueError("Complex types not compatible for ... | bsd-3-clause | Python |
58f3c6668a20241a62d65618a3a454a44eeeccfc | Fix python 3 issue with `b` prefix strings | tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io | tensorflow_io/hadoop/python/kernel_tests/hadoop_test.py | tensorflow_io/hadoop/python/kernel_tests/hadoop_test.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 | Python |
5bdcf37a343b57d84e0cd9dd12fd2985c33d9c35 | bump to v1.5.0 | littlezz/island-backup,littlezz/island-backup,littlezz/island-backup | island_backup/_version.py | island_backup/_version.py | version = '1.5.0' | version = '1.4.7' | mit | Python |
999f01115ae7e2061ec5c2459e3e80c3c5d028f5 | Add the exceptions module to the 'never' list -- it is built in. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Tools/freeze/makeconfig.py | Tools/freeze/makeconfig.py | import regex
# Write the config.c file
never = ['marshal', '__main__', '__builtin__', 'sys', 'exceptions']
def makeconfig(infp, outfp, modules, with_ifdef=0):
m1 = regex.compile('-- ADDMODULE MARKER 1 --')
m2 = regex.compile('-- ADDMODULE MARKER 2 --')
while 1:
line = infp.readline()
if not line: break
out... | import regex
# Write the config.c file
never = ['marshal', '__main__', '__builtin__', 'sys']
def makeconfig(infp, outfp, modules, with_ifdef=0):
m1 = regex.compile('-- ADDMODULE MARKER 1 --')
m2 = regex.compile('-- ADDMODULE MARKER 2 --')
while 1:
line = infp.readline()
if not line: break
outfp.write(line)... | mit | Python |
5f8ec33a406e4fac3d161fb55f82c0a9f663a79d | Fix Latex author. | circuitar/Nanoshield_LoadCell,circuitar/Nanoshield_LoadCell | docs/conf.py | docs/conf.py | import sys
import os
import shlex
import subprocess
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
if read_the_docs_build:
subprocess.call('doxygen', shell=True)
extensions = ['breathe']
breathe_projects = { 'Nanoshield_LoadCell': 'xml' }
breathe_default_project = "Nanoshield_LoadCell"
templ... | import sys
import os
import shlex
import subprocess
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
if read_the_docs_build:
subprocess.call('doxygen', shell=True)
extensions = ['breathe']
breathe_projects = { 'Nanoshield_LoadCell': 'xml' }
breathe_default_project = "Nanoshield_LoadCell"
templ... | mit | Python |
11e9240f90c2de0a3b58a8b4a57016b5478b4bf8 | update to latest pandas and output .eps | brentp/cruzdb,brentp/cruzdb | paper/plot-timing.py | paper/plot-timing.py | import pandas as pa
import sys
from matplotlib import pyplot as plt
import numpy as np
plt.close()
f, ax = plt.subplots(1, figsize=(5,3))
df = pa.read_table(sys.argv[1])
pf = df.ix[~df.parallel]
pt = df.ix[df.parallel]
ax.set_ylabel('Intervals / Second')
x = 0.1 + np.arange(3)
width = 0.35
rects0 = ax.bar(x, 332... | import pandas as pa
import sys
from matplotlib import pyplot as plt
import numpy as np
plt.close()
f, ax = plt.subplots(1, figsize=(5,3))
df = pa.read_table(sys.argv[1])
pf = df.ix[~df.parallel]
pt = df.ix[df.parallel]
ax.set_ylabel('Intervals / Second')
x = 0.1 + np.arange(3)
width = 0.35
rects0 = ax.bar(x, 332... | mit | Python |
d89e5a4ff49b1345255435a8a945e43934064b83 | Add config for master doc for sphinx RTD build | epantry/django-sql-explorer,groveco/django-sql-explorer,groveco/django-sql-explorer,epantry/django-sql-explorer,epantry/django-sql-explorer,groveco/django-sql-explorer,groveco/django-sql-explorer | docs/conf.py | docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | mit | Python |
e188e324f1c7b8afab3b65b9e7337a0b1c3981f0 | Correct inter sphinx path to Tornado docs. | sprockets/sprockets.mixins.cors | docs/conf.py | docs/conf.py | #!/usr/bin/env python
import alabaster
from sprockets.mixins import cors
project = 'sprockets.mixins.cors'
copyright = '2015, AWeber Communication, Inc.'
version = cors.__version__
release = '.'.join(str(v) for v in cors.version_info[0:2])
needs_sphinx = '1.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext... | #!/usr/bin/env python
import alabaster
from sprockets.mixins import cors
project = 'sprockets.mixins.cors'
copyright = '2015, AWeber Communication, Inc.'
version = cors.__version__
release = '.'.join(str(v) for v in cors.version_info[0:2])
needs_sphinx = '1.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext... | bsd-3-clause | Python |
e40acd335b8ea7e45806df7f8dc44588862afda0 | Fix some commands not being triggered | osuripple/pep.py,osuripple/pep.py | objects/fokabot.py | objects/fokabot.py | """FokaBot related functions"""
import re
from common import generalUtils
from common.constants import actions
from common.ripple import userUtils
from constants import fokabotCommands
from constants import serverPackets
from objects import glob
# Tillerino np regex, compiled only once to increase performance
npRegex... | """FokaBot related functions"""
import re
from common import generalUtils
from common.constants import actions
from common.ripple import userUtils
from constants import fokabotCommands
from constants import serverPackets
from objects import glob
# Tillerino np regex, compiled only once to increase performance
npRegex... | agpl-3.0 | Python |
0a4a54aaa052acd24a0095fcd0d7b9f97a8daffc | Fix spelling of healthcheck | dgnorth/drift,dgnorth/drift,dgnorth/drift | drift/core/apps/healthcheck.py | drift/core/apps/healthcheck.py | # -*- coding: utf-8 -*-
"""
Schames listing APIs
"""
import importlib
import logging
import marshmallow as ma
from flask import current_app, g
from flask.views import MethodView
from flask_smorest import Blueprint, abort
from six.moves import http_client
log = logging.getLogger(__name__)
bp = Blueprint('healthcheck',... | # -*- coding: utf-8 -*-
"""
Schames listing APIs
"""
import importlib
import logging
import marshmallow as ma
from flask import current_app, g
from flask.views import MethodView
from flask_smorest import Blueprint, abort
from six.moves import http_client
log = logging.getLogger(__name__)
bp = Blueprint('healtchcheck'... | mit | Python |
52767e14f9906f8ca1d7c531e3d93672ae940716 | replace `strip()` | MIT-LCP/mimic-code,MIT-LCP/mimic-code,MIT-LCP/mimic-code | mimic-iv/buildmimic/sqlite/import.py | mimic-iv/buildmimic/sqlite/import.py | import os
import sys
from glob import glob
import pandas as pd
DATABASE_NAME = "mimic4.db"
THRESHOLD_SIZE = 5 * 10**7
CHUNKSIZE = 10**6
CONNECTION_STRING = "sqlite:///{}".format(DATABASE_NAME)
if os.path.exists(DATABASE_NAME):
msg = "File {} already exists.".format(DATABASE_NAME)
print(msg)
sys.exit()
f... | import os
import sys
from glob import glob
import pandas as pd
DATABASE_NAME = "mimic4.db"
THRESHOLD_SIZE = 5 * 10**7
CHUNKSIZE = 10**6
CONNECTION_STRING = "sqlite:///{}".format(DATABASE_NAME)
if os.path.exists(DATABASE_NAME):
msg = "File {} already exists.".format(DATABASE_NAME)
print(msg)
sys.exit()
f... | mit | Python |
2a6f52ac3b83b4e5adbb38622778c56f4503550f | Trim empty lines | F-Secure/mittn,mittn/mittn,mathias-nyman/mittn,F-Secure/mittn | mittn/headlessscanner/proxy_comms.py | mittn/headlessscanner/proxy_comms.py | """Helper functions to communicate with Burp Suite extension"""
"""
Copyright (c) 2013-2014 F-Secure
See LICENSE for details
Burp and Burp Suite are trademarks of Portswigger, Ltd.
"""
import select
import json
import shlex
import subprocess
import time
def read_next_json(process):
"""Return the next JSON form... | """Helper functions to communicate with Burp Suite extension"""
"""
Copyright (c) 2013-2014 F-Secure
See LICENSE for details
Burp and Burp Suite are trademarks of Portswigger, Ltd.
"""
import select
import json
import shlex
import subprocess
import time
def read_next_json(process):
"""Return the next JSON form... | apache-2.0 | Python |
b13baaa37133b7d4fe46682dbce7ed94d46ecaf4 | Add viewcode to sphinx docs | rosswhitfield/javelin | docs/conf.py | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode'
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2017, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
exclude... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx'
]
source_suffix = '.rst'
master_doc = 'index'
project = 'Javelin'
copyright = '2017, Ross Whitfield'
author = 'Ross Whitfield'
version = '0.1.0'
release = '0.1.0'
exclude_patt... | mit | Python |
cedab4c487db788ead5da788a9785ea38ca2e7fc | add more test | lybicat/lybica-runner,lybicat/lybica-runner | tst/test_lybica/actions/user_script.py | tst/test_lybica/actions/user_script.py | from unittest import TestCase
from lybica.actions.user_script import _UserScriptAction
from lybica.__main__ import Context
import os
import shutil
class TestUserScriptAction(TestCase):
def setUp(self):
super(TestUserScriptAction, self).setUp()
self.context = Context()
os.environ['WORKSPACE... | from unittest import TestCase
from lybica.actions.user_script import _UserScriptAction
from lybica.__main__ import Context
import os
import shutil
class TestUserScriptAction(TestCase):
def setUp(self):
super(TestUserScriptAction, self).setUp()
self.context = Context()
os.environ['WORKSPACE... | mit | Python |
96775296220703ac5f0ab8df04a103df1acac8da | Fix CI script | tableau/TabPy,tableau/TabPy,tableau/TabPy | CI/inc_ver.py | CI/inc_ver.py | '''
Update version (VERSION file in the repository root)
with commit number:
major.minor.commit
The script is only to be used in Travis CI,
see .travis.yml for more details.
The script uses Travis enviroment variables, see
https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
... | '''
Update version (VERSION file in the repository root)
with commit number:
major.minor.commit
The script is only to be used in Travis CI,
see .travis.yml for more details.
The script uses Travis enviroment variables, see
https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
... | mit | Python |
f7d1666e9c1b77f75b5749f03f86cd2c7d7e5e80 | change serie to 8.0 | MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server | openerp/release.py | openerp/release.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 | Python |
2e49ee5ae6f16c788e72b1bf7223bb109b565a73 | Fix constructor. | elielsardanons/dstar_sniffer,elielsardanons/dstar_sniffer | dstar_sniffer/aprs_lib/aprsis.py | dstar_sniffer/aprs_lib/aprsis.py | import aprslib
import logging
import nmea
from passcode import passcode_generator
from ..util_lib import config
def to_aprs_callsign(dstar_callsign):
module = dstar_callsign[-1:]
return dstar_callsign[:-1].strip() + "-" + module
def aprsis_dstar_callback(dstar_stream):
# only send beacon from Kenwood D74
if 'D74... | import aprslib
import logging
import nmea
from passcode import passcode_generator
from ..util_lib import config
def to_aprs_callsign(dstar_callsign):
module = dstar_callsign[-1:]
return dstar_callsign[:-1].strip() + "-" + module
def aprsis_dstar_callback(dstar_stream):
# only send beacon from Kenwood D74
if 'D74... | mit | Python |
3f30a92af2b80f26f023aa11d90af34dd327deee | fix screenshot function | WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder,WebArchivCZ/Seeder | Seeder/source/screenshots.py | Seeder/source/screenshots.py | import os
import requests
from logging import getLogger
from datetime import datetime
from django.db.models import Q
from django.conf import settings
from source import constants
from source.models import Source
logger = getLogger('screenshots.generator')
def take_screenshots():
"""
Downloads all the scr... | import os
import requests
from datetime import datetime
from django.db.models import Q
from django.conf import settings
from source import constants
from source.models import Source
def take_screenshots():
"""
Downloads all the screenshots
"""
now = datetime.now()
sources = Source.objects.filt... | mit | Python |
9edb3513c9152b1f0d6480ad901850812cb45626 | fix coverage | Brickstertwo/git-commands | bin/commands/upstream.py | bin/commands/upstream.py | """Get the current upstream branch."""
import os
import subprocess
from subprocess import PIPE
from enum import Enum
from utils import directories, git, messages
_MERGE_CONFIG = 'git config --local branch.{}.merge'
_REMOTE_CONFIG = 'git config --local branch.{}.remote'
_LOCAL_REMOTE = '.'
class IncludeRemote(Enum... | """Get the current upstream branch."""
import os
import subprocess
from subprocess import PIPE
from enum import Enum
from utils import directories, git, messages
_MERGE_CONFIG = 'git config --local branch.{}.merge'
_REMOTE_CONFIG = 'git config --local branch.{}.remote'
_LOCAL_REMOTE = '.'
class IncludeRemote(Enum... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.