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 |
|---|---|---|---|---|---|---|---|---|
927776d61abe9aae55689ffd7bb6ea12114b31fd | add main package file | thomashuang/angel,whiteclover/angel | angel/__init__.py | angel/__init__.py | from angel.html import HTML
from angel.css import CSS
from angel.dom import DOM
__version__ = '0.1.0'
VERSION = tuple(map(int, __version__.split('.')))
__all__ = ['HTML', 'CSS', 'DOM']
| mit | Python | |
f9cc8e04255d07c82d1a96682eebf044a6cdb977 | Fix conflicting migrations (#101) | UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator | projects/migrations/0003_auto_20160928_2137.py | projects/migrations/0003_auto_20160928_2137.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0002_auto_20151208_1553'),
]
operations = [
migrations.AlterField(
model_name='project',
... | agpl-3.0 | Python | |
37704a2e905342bf867225fb5a8a3fec0c55a9fd | Add strDiff problem and tests. Minor tweak to setup.py | HKuz/Test_Code | Problems/stringDiff.py | Problems/stringDiff.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['abdbacade', 'aaabbcdd', 'e']
]
for item in tests:
try:
temp_result ... | mit | Python | |
dd751e5477629adddedcba2734c33c9839506257 | Create mailer file | KpaBap/streetview_datechange_emailer | street_view_mailer.py | street_view_mailer.py | try:
from selenium import webdriver
except:
raise RuntimeError("Install Selenium for Python 3.x please")
import re
import smtplib
import mimetypes
from email.mime.multipart import MIMEMultipart
from email import encoders
from email.mime.image import MIMEImage
from email.mime.base import MIMEBase
"""
Author: I... | mpl-2.0 | Python | |
ecd834d482ef001989d4ce60042e4d018a5ac569 | Add two test cases to exercise many expression commands: o test_many_expr_commands() o test_expr_commands_can_handle_quotes() | llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb | test/expression_command/test/TestExprs.py | test/expression_command/test/TestExprs.py | """
Test many basic expression commands.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class BasicExprCommandsTestCase(TestBase):
mydir = os.path.join("expression_command", "test")
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line... | apache-2.0 | Python | |
856a47b3b570da26a5cdf02b0e3dc0c2b1980307 | Add PLL routing fuzzer | gatecat/prjoxide,gatecat/prjoxide,gatecat/prjoxide | fuzzers/LIFCL/120-pll-routing/fuzzer.py | fuzzers/LIFCL/120-pll-routing/fuzzer.py | from fuzzconfig import FuzzConfig
from interconnect import fuzz_interconnect
import re
configs = [
{
"cfg": FuzzConfig(job="PLLULC", device="LIFCL-40", sv="../shared/route_40.v", tiles=["CIB_R0C1:GPLL_ULC"]),
"rc": (1, 1),
},
{
"cfg": FuzzConfig(job="PLLLLC", device="LIFCL-40", sv="... | isc | Python | |
e120f5fac68e2daf7cdf6e9d7b17b1f63a330595 | Fix ExpressionNode names that changed in django 1.5 | django-nonrel/djangoappengine,Implisit/djangoappengine,dwdraju/djangoappengine | djangoappengine/db/expressions.py | djangoappengine/db/expressions.py | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | bsd-3-clause | Python |
69f7bbc9cd0715d0076a78f7cc4f8c044ba7199b | add examples directory and idaho image viewer example | michaelconnor00/gbdxtools,michaelconnor00/gbdxtools | examples/view_idaho_image.py | examples/view_idaho_image.py | from gbdxtools import Interface
import json
gi = Interface()
#catid = '101001000DB2FB00'
#catid = '1020010013C4CF00'
catid = '10400100120FEA00'
idaho_images = gi.get_idaho_images_by_catid(catid)
description = gi.describe_idaho_images(idaho_images)
print json.dumps(description, indent=4, sort_keys=True)
gi.create_ida... | mit | Python | |
03971196d5399851b17ff05b7ad03f438797f973 | Fix regen of EventInterfaces.in by depending on list | Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,Bysmyyr/blink-crosswalk,jtg-gg/blink,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,nwjs/blink,jtg-gg/blink,hgl888/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,jtg-gg/blink,smishenk/blink-crosswalk,Pluto-tv/blink-crosswalk,Pluto-tv/blink-crosswalk,kur... | Source/bindings/core_bindings_generated.gyp | Source/bindings/core_bindings_generated.gyp | # Copyright 2014 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.
# Generate EventInterfaces.in, used by core/ but depends on modules/,
# hence placed in bindings/ to avoid direct core/ -> modules/ dependency.
{
'include... | # Copyright 2014 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.
# Generate EventInterfaces.in, used by core/ but depends on modules/,
# hence placed in bindings/ to avoid direct core/ -> modules/ dependency.
{
'include... | bsd-3-clause | Python |
de350de6093600cf891385fafd875485051219c3 | Add core urls to project urls | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | apps/core/urls.py | apps/core/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.HomeView.as_view(), name='home'),
]
| bsd-3-clause | Python | |
31f16844dd98516b1f57e3913d0fdba3e5715aa8 | Delete method now softdeletep's all FK related objects | pinax/pinax-models,angvp/django-logical-delete,Ubiwhere/pinax-models,angvp/django-logical-delete,naringas/pinax-models | logicaldelete/models.py | logicaldelete/models.py | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.now)
... | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.... | mit | Python |
3dfc4bfbb71d1e97a6b8213f338df487fbae5fcc | Add auto migration for minor model changes | andychase/codebook,andychase/codebook | topics/migrations/0016_auto_20151221_0923.py | topics/migrations/0016_auto_20151221_0923.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('topics', '0015_auto_20151218_1823'),
]
operations = [
migrations.AlterField(
model_... | mit | Python | |
9ce0f7d3dad6b588f5e494edf68070e6c80c3339 | Add conversion to SAT | jaanos/LVR-2016,jaanos/LVR-2016 | tutorials/2017/thursday/graphColouring.py | tutorials/2017/thursday/graphColouring.py | from boolean import *
def graphColouring2SAT(G, k):
conj = []
for i in range(len(G)):
conj.append(Or(*((i, j) for j in range(k))))
for j in range(k):
for jj in range(j+1, k):
conj.append(Or(Not((i, j)), Not((i, jj))))
for ii in G[i]:
for j in rang... | mit | Python | |
48a0fe0a4f841fb58783e2c021d29bd8f2b657ab | Create Settings.py | maximx1/PyPlatformerEngine | pyplatformerengine/utilities/Settings.py | pyplatformerengine/utilities/Settings.py | import pygame
"""
Settings manager
"""
class Settings:
"""
Initializes the object
"""
def __init__(self,path):
self.settings = {}
settingsFile = open(path, "r")
for line in settingsFile:
settingName,settingValue = line.split("=")
self.sett... | mit | Python | |
2207351e805f11c39f843ca0e0eff261a7a5bde8 | Add half-naive solution to problem 10 | gidj/euler,gidj/euler | python/010_summation_of_primes/primes.py | python/010_summation_of_primes/primes.py | from math import sqrt
from typing import Generator
def prime_generator(limit: int) -> Generator[int, None, int]:
if limit < 2:
return
else:
yield 2
primes = [2]
for x in range(3, limit + 1, 2):
if any(map(lambda divisor: x % divisor == 0, primes[: int(sqrt(x))])):
c... | bsd-3-clause | Python | |
5980018bdf6989f1d86e9eabb24bf55b26df5115 | add forms.py for the group router | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/routers/group/forms.py | go/routers/group/forms.py | from django import forms
class GroupEditForm(forms.Form):
groups = forms.MultipleChoiceField(
label="Select Groups",
choices=[]
)
def __init__(self, *args, **kwargs):
groups = kwargs.pop('groups', [])
super(GroupEditForm, self).__init__(*args, **kwargs)
self.field... | bsd-3-clause | Python | |
94c8be385a08df24269008f7e7a1f4548387f763 | Create generate_struct.py | vnpy/vnpy,bigdig/vnpy,bigdig/vnpy,bigdig/vnpy,vnpy/vnpy,bigdig/vnpy | vnpy/api/tap/generator/generate_struct.py | vnpy/api/tap/generator/generate_struct.py | """"""
import importlib
class StructGenerator:
"""Struct生成器"""
def __init__(self, filename: str, prefix: str):
"""Constructor"""
self.filename = filename
self.prefix = prefix
self.typedefs = {}
self.load_constant()
def load_constant(self):
""""""
... | mit | Python | |
747ff2fbaf9e6216ba932f446418819723611174 | Add solution for problem 12 | rlucioni/project-euler | euler/solutions/solution_12.py | euler/solutions/solution_12.py | """Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers.
The 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of the first seven triangle numbers:
1:... | mit | Python | |
65aee742ea0e95b200152f8a90d9ad5ee86b2512 | Add a Locust load testing script | ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod | scripts/locustfile.py | scripts/locustfile.py | from locust import HttpLocust, TaskSet, task
import urllib
from faker import Faker
fake = Faker()
class SPARQLQueryTasks(TaskSet):
@task
def query_simple(self):
self.client.get("/sparql/?query=select+%2A+where+%7B+%3Fs+%3Fp+%3Fo+%7D+limit+0")
@task
def query_realistic(self):
self.clie... | apache-2.0 | Python | |
e84d811f13347da3625e3a30d200e836f6393e9d | Store OBO data into a suitable queryable format | jawrainey/healthchat,jawrainey/healthchat | scripts/obo_to_sql.py | scripts/obo_to_sql.py | # Note: based on - http://blog.adimian.com/2014/10/cte-and-closure-tables/
import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
def create_tables():
'''
Creates the two tables used to store the ontology concepts and terms.
- 'nodes' stores the .obo content.
- 'closure' stor... | mit | Python | |
5649a284826b4e85af29854f443a1fc421613932 | add solution for Binary Tree Right Side View | zhyu/leetcode,zhyu/leetcode | src/binaryTreeRightSideView.py | src/binaryTreeRightSideView.py | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a list of integers
def rightSideView(self, root):
res = []
def dfs(root, ... | mit | Python | |
fd0b8035035d23276496428747c35329741a49e1 | fix group invitation handler | manastech/de-bee,manastech/de-bee,manastech/de-bee,manastech/de-bee | groupInvitationHandler.py | groupInvitationHandler.py | import cgi
from google.appengine.ext import webapp
from model import *
from google.appengine.api import users
import registration as registration
import os
from google.appengine.ext.webapp import template
class GroupInvitationHandler(webapp.RequestHandler):
def get(self):
pass | mit | Python | |
7d3114e1cc934cc122de641f864690f81794d10b | add scripts folder to fill-app folder | sup/fill,sup/fill,sup/fill | fill-app/scripts/fetch_gae_sdk.py | fill-app/scripts/fetch_gae_sdk.py | #!/usr/bin/env python
# Copyright 2015 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 ... | mit | Python | |
9b48cb18980ae2e55ce02a84576f65f0bd8a27bb | Add wiki macro for the Like button. | thijstriemstra/trac-facebook-plugins | FacebookPlugins.py | FacebookPlugins.py | """
@note: enable X
"""
from trac.core import Component
from trac.wiki.macros import WikiMacroBase
class FacebookPlugins(Component):
"""
Support for Facebook plugins.
"""
revision = "$Rev$"
url = "$URL$"
class LikeButton(WikiMacroBase):
"""
The [http://developers.facebook.com/docs/... | mit | Python | |
fd032cf6b7b8793be5b6653c72286d5e5a458d25 | support for trigger Maker IFTTT | deisi/home-assistant,deisi/home-assistant,happyleavesaoc/home-assistant,morphis/home-assistant,luxus/home-assistant,ct-23/home-assistant,g12mcgov/home-assistant,sdague/home-assistant,balloob/home-assistant,justyns/home-assistant,tmm1/home-assistant,jamespcole/home-assistant,happyleavesaoc/home-assistant,molobrakos/home... | homeassistant/components/ifttt.py | homeassistant/components/ifttt.py | """
homeassistant.components.ifttt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This component enable you to trigger Maker IFTTT recipes.
Check https://ifttt.com/maker for details.
Configuration:
To use Maker IFTTT you will need to add something like the following to your
config/configuration.yaml.
ifttt:
key: xxxxx-x-xxxxxxxxxx... | apache-2.0 | Python | |
7cb546ba28a53b50969db384e79dc6bb394de4ad | use explicit relative import on djangoitem tests | hyrole/scrapy,Cnfc19932/scrapy,lacrazyboy/scrapy,wenyu1001/scrapy,gnemoug/scrapy,jorik041/scrapy,Digenis/scrapy,CodeJuan/scrapy,tagatac/scrapy,yidongliu/scrapy,dracony/scrapy,kmike/scrapy,kmike/scrapy,barraponto/scrapy,YeelerG/scrapy,hansenDise/scrapy,livepy/scrapy,beni55/scrapy,ramiro/scrapy,taito/scrapy,wujuguang/scr... | scrapy/tests/test_djangoitem/__init__.py | scrapy/tests/test_djangoitem/__init__.py | import os
from twisted.trial import unittest
from scrapy.contrib_exp.djangoitem import DjangoItem, Field
os.environ['DJANGO_SETTINGS_MODULE'] = 'scrapy.tests.test_djangoitem.settings'
try:
import django
except ImportError:
django = None
if django:
from .models import Person
else:
Person = None
cla... | import os
from twisted.trial import unittest
from scrapy.contrib_exp.djangoitem import DjangoItem, Field
os.environ['DJANGO_SETTINGS_MODULE'] = 'scrapy.tests.test_djangoitem.settings'
try:
import django
except ImportError:
django = None
if django:
from models import Person
else:
Person = None
clas... | bsd-3-clause | Python |
aa8f3d13f4718cbb0ce4a45b6e30bb1a676f7216 | Add migration | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/migrations/0039_auto_20160720_1002.py | fellowms/migrations/0039_auto_20160720_1002.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-20 10:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0038_auto_20160717_2144'),
]
operations = [
migrations.AlterFiel... | bsd-3-clause | Python | |
b3dc3a0e2125e44da7d5ca8d0caa2a6098891997 | Add objects/utils.py copied from Ironic | LaynePeng/magnum,sajuptpm/magnum,eshijia/magnum,paulczar/magnum,eshijia/SUR,mjbrewer/testindex,openstack/magnum,mjbrewer/testindex,eshijia/magnum,eshijia/SUR,mjbrewer/testindex,ddepaoli3/magnum,dimtruck/magnum,ramielrowe/magnum,ChengTiesheng/magnum,ffantast/magnum,ddepaoli3/magnum,sajuptpm/magnum,paulczar/magnum,LayneP... | magnum/objects/utils.py | magnum/objects/utils.py | # Copyright 2013 IBM Corp.
#
# 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 agree... | apache-2.0 | Python | |
4f2a481d0739b7eab5826a7198e768f364e97cdf | introduce configurable base type | openaps/openaps,openaps/openaps | openaps/configurable.py | openaps/configurable.py | import json
class Configurable (object):
name = None
required = [ ]
optional = [ ]
prefix = '{name:s}'
url_template = ""
def __init__ (self, name, **kwargs):
self.name = name
self.fields = kwargs
def section_name (self):
return '%s "%s"' % (self.prefix, self.name)
def add_option (self, k, v)... | mit | Python | |
fc72ca537e6eaf5f4bf04ed4511ec1acdd9eae11 | Add check script to test 'deprecated' decorator | aleju/imgaug,aleju/imgaug,aleju/ImageAugmenter | checks/check_deprecation_warning.py | checks/check_deprecation_warning.py | from __future__ import print_function, absolute_import, division
import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func="Foo")
def __init__(self):
pass
class Dummy2(object):
@ia.deprecated(alt_func="Foo", comment="Some example comment.")
def __init__(self):
pass
class D... | mit | Python | |
957d93639a4877258a55ec31c1817569da61c14f | Add scaletree script | kdmurray91/kwip-experiments,kdmurray91/kwip-experiments,kdmurray91/kwip-experiments | coalescent/scripts/scaletree.py | coalescent/scripts/scaletree.py | #!/usr/bin/env python3
from __future__ import division, print_function
from ete3 import Tree
import numpy as np
from numpy import median, mean
import itertools as itl
from math import ceil, log
from string import ascii_uppercase
METRICS = [
'mean',
'median',
'min',
'max',
]
def pwdist(tree):
'... | mit | Python | |
33a5f8394265770bcdcae152a7e9635572fe6e09 | Change the revision number for downloading chrome 29 from continuous archive. | PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,jaruba/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,M4... | chrome/test/chromedriver/archive.py | chrome/test/chromedriver/archive.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.
"""Downloads items from the Chromium continuous archive."""
import os
import platform
import urllib
import util
CHROME_27_REVISION = '190466'
CHROME_2... | # 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.
"""Downloads items from the Chromium continuous archive."""
import os
import platform
import urllib
import util
CHROME_27_REVISION = '190466'
CHROME_2... | bsd-3-clause | Python |
3026a02f1b8739eee42a53906db3169f8fc9653e | Add fibonacci-modified | vikasgorur/hackerrank,vikasgorur/hackerrank,vikasgorur/hackerrank | fibonacci-modified/solution.py | fibonacci-modified/solution.py | import sys
a, b, n = [int(x) for x in sys.stdin.readline().split()]
c = b*b + a
for i in range(3, n):
a, b, c = b, c, c*c+b
print(c) | mit | Python | |
594902c5f2dea525889e79bfabfb6e3f20abc4ab | Fix initial tuple for ignorable nexts in mezzanine.utils.login_redirect. | geodesign/mezzanine,stbarnabas/mezzanine,mush42/mezzanine,frankchin/mezzanine,orlenko/sfpirg,SoLoHiC/mezzanine,theclanks/mezzanine,dekomote/mezzanine-modeltranslation-backport,batpad/mezzanine,scarcry/snm-mezzanine,mush42/mezzanine,stephenmcd/mezzanine,Cajoline/mezzanine,ryneeverett/mezzanine,viaregio/mezzanine,damnfin... | mezzanine/utils/urls.py | mezzanine/utils/urls.py |
import re
import unicodedata
from django.core.urlresolvers import reverse, NoReverseMatch
from django.shortcuts import redirect
from django.utils.encoding import smart_unicode
from mezzanine.conf import settings
from mezzanine.utils.importing import import_dotted_path
def admin_url(model, url, object_id=None):
... |
import re
import unicodedata
from django.core.urlresolvers import reverse, NoReverseMatch
from django.shortcuts import redirect
from django.utils.encoding import smart_unicode
from mezzanine.conf import settings
from mezzanine.utils.importing import import_dotted_path
def admin_url(model, url, object_id=None):
... | bsd-2-clause | Python |
5e55978a81cc306ee92ba12e557a1652c7f80ad5 | Create dimension_reduction.py | gdarnell/arsvd | dimension_reduction.py | dimension_reduction.py | #!/usr/bin/python
import sys
import time
import numpy as np
from scipy import linalg, stats
def rsvd(X, dstar, power_iters=2):
""" Perform rsvd algorithm on input matrix.
Method must be supplied dstar.
Returns truncated svd (U,S,V).
Parameters
----------
X : int matrix
Matrix of n x m integers, where m <... | mit | Python | |
e58a84208a46cf749f92d8170ed81794ecfa3137 | Update downloadable clang to r347933 | davidzchen/tensorflow,karllessard/tensorflow,jbedorf/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,adit-chandra/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,theflofly/tensorflow,paolodedios/tensorflow,adit-chandra/tensorflow,aam-at/tensorflow,annare... | third_party/clang_toolchain/download_clang.bzl | third_party/clang_toolchain/download_clang.bzl | """ Helpers to download a recent clang release."""
def _get_platform_folder(os_name):
os_name = os_name.lower()
if os_name.startswith("windows"):
return "Win"
if os_name.startswith("mac os"):
return "Mac"
if not os_name.startswith("linux"):
fail("Unknown platform")
return "L... | """ Helpers to download a recent clang release."""
def _get_platform_folder(os_name):
os_name = os_name.lower()
if os_name.startswith("windows"):
return "Win"
if os_name.startswith("mac os"):
return "Mac"
if not os_name.startswith("linux"):
fail("Unknown platform")
return "L... | apache-2.0 | Python |
0bf2ed3b865180f3a46f3e34e3b90c9beccd720a | Create models.py | mcuringa/college-consultant,mcuringa/college-consultant | consultant/consultant/models.py | consultant/consultant/models.py | from django.db import models
from django import forms
from django.forms import ModelForm
class School(models.Model):
name = models.CharField(max_length=500)
four_year_college = models.Boolean(default=true)
is_public = models.Boolean(default=true)
population = models.IntergerField()
gender = models.CharField... | agpl-3.0 | Python | |
b57add183aa5fb4466583756cd0a3c22b5ae8f0b | add feature extractor abstract class | eEcoLiDAR/eEcoLiDAR | laserchicken/feature_extractor.py | laserchicken/feature_extractor.py | class FeatureExtractor(object):
def get_requirements(self):
"""
Get a list of names of the point attributes that are needed for this feature extraction. For simple features,
this could be just x, y, and z. Other features can build on again other features to have been computed first.
... | apache-2.0 | Python | |
c97ab456f22dca6a69e3775cc1353dbf3957389a | Add basic support for LimitlessLED | sfam/home-assistant,ErykB2000/home-assistant,open-homeautomation/home-assistant,Danielhiversen/home-assistant,toddeye/home-assistant,nugget/home-assistant,open-homeautomation/home-assistant,deisi/home-assistant,EricRho/home-assistant,tboyce021/home-assistant,theolind/home-assistant,mKeRix/home-assistant,Duoxilian/home-... | homeassistant/components/light/limitlessled.py | homeassistant/components/light/limitlessled.py | """
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
"""
import random
import logging
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import STATE_O... | apache-2.0 | Python | |
278a69902937812a87de0fe476787cc0f702231f | Create Triangle.py | SpAiNiOr/mystudy,SpAiNiOr/mystudy,SpAiNiOr/mystudy | learning/test/Triangle.py | learning/test/Triangle.py | class Triangle(object):
number_of_sides = 3
def __init__(self, angle1, angle2, angle3):
self.angle1 = angle1
self.angle2 = angle2
self.angle3 = angle3
def check_angles(self):
if (self.angle1+self.angle2+self.angle3) == 180:
return True
else:
... | apache-2.0 | Python | |
99c5cedcb910a8fe7919bb773f39da76da51332b | improve module description | charbeljc/account-financial-tools,diagramsoftware/account-financial-tools,factorlibre/account-financial-tools,andhit-r/account-financial-tools,andrius-preimantas/account-financial-tools,factorlibre/account-financial-tools,dvitme/account-financial-tools,luc-demeyer/account-financial-tools,damdam-s/account-financial-tool... | account_journal_period_close/__openerp__.py | account_journal_period_close/__openerp__.py | # -*- coding: utf-8 -*-
#
#
# Authors: Adrien Peiffer
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences result... | # -*- coding: utf-8 -*-
#
#
# Authors: Adrien Peiffer
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences result... | agpl-3.0 | Python |
94d342cc643b89f33e637e86e064cce747635696 | Update release version | BryceLohr/authentic,adieu/authentic2,BryceLohr/authentic,pu239ppy/authentic2,adieu/authentic2,adieu/authentic2,adieu/authentic2,pu239ppy/authentic2,BryceLohr/authentic,pu239ppy/authentic2,BryceLohr/authentic,pu239ppy/authentic2 | authentic2/__init__.py | authentic2/__init__.py | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'vendor'))
# The version of Authentic
VERSION = "2.0.2"
| import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'vendor'))
# The version of Authentic
VERSION = "2.0.1"
| agpl-3.0 | Python |
531ed8190dcc1c29c642867e9a916cf3aad89e5b | add module `models`, including 'ValidateModelMixin` | lookup/lu-dj-utils,lookup/lu-dj-utils | lu_dj_utils/models.py | lu_dj_utils/models.py | # coding: utf-8
"""Source: lookup_www.common.models (but just a subset)
"""
from __future__ import absolute_import, print_function, unicode_literals
###############################################################################
# MIXINS
###############################################################################... | bsd-3-clause | Python | |
d1e61c154d38eb63c03ad5f3111fd230f33b1204 | Add politifact plugin. | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | plumeria/plugins/politifact.py | plumeria/plugins/politifact.py | import re
import plumeria.util.http as http
from plumeria.command import commands, CommandError
from plumeria.command.parse import Text
from plumeria.message.mappings import build_mapping
from plumeria.util.collections import SafeStructure
from plumeria.util.ratelimit import rate_limit
@commands.register("politifact... | mit | Python | |
6c142b44775007937903409b61829eb8dd594f99 | add migrator for previous bugs | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/extras/daemon/migrator/migrate9to10.py | lbrynet/extras/daemon/migrator/migrate9to10.py | import sqlite3
import os
def do_migration(conf):
db_path = os.path.join(conf.data_dir, "lbrynet.sqlite")
connection = sqlite3.connect(db_path)
cursor = connection.cursor()
query = "select stream_hash, sd_hash from main.stream"
for stream_hash, sd_hash in cursor.execute(query):
head_blob_h... | mit | Python | |
c634f327d63a74f115408daaae40b8ffeff4a2e8 | add start of matchpixels | ajtag/ln2015 | utils/match_pixels.py | utils/match_pixels.py | __author__ = 'ajtag'
import csv
import xml.etree.ElementTree as ET
import os.path
import math
from collections import namedtuple
white = 255,255,255
Lamp = namedtuple("Lamp", ["x", "y", 'name', 'dmx', 'channel'])
def parse_imagemask_svg(x, y, scale, x_offset = 19, y_offset = 0):
tree = ET.parse('../Resourc... | mit | Python | |
6979f943c6320ba077eb0ff93159854e929cc11f | Bump version to 0.7.0 | thombashi/sqlitebiter,thombashi/sqlitebiter | sqlitebiter/_version.py | sqlitebiter/_version.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
VERSION = "0.7.0"
| # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
VERSION = "0.6.2"
| mit | Python |
d4a13cdea28d109cb2595fb6ab03c70b4c060483 | Remove unused import | vivek8943/tracker_project,vivek8943/tracker_project,abarto/tracker_project,abarto/tracker_project,abarto/tracker_project,vivek8943/tracker_project | tracker_project/tracker/sockets.py | tracker_project/tracker/sockets.py | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from kombu import BrokerConnection
from kombu.mixins import ConsumerMixin
from socketio.namespace import BaseNamespace
from socketio.sdjango import namespace
from .queues import notifications_queue
@namespace('/notifications')... | from __future__ import absolute_import, unicode_literals
import logging
from django.conf import settings
from kombu import BrokerConnection
from kombu.mixins import ConsumerMixin
from socketio.namespace import BaseNamespace
from socketio.sdjango import namespace
from .queues import notifications_queue
@namespace('... | mit | Python |
6a999c5a006f603c2218a4cfbc1d6ccb38178bb5 | Fix up utils and node | Storj/downstream-node,Storj/downstream-node | downstream_node/lib/utils.py | downstream_node/lib/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from heartbeat import Challenge
def query_to_list(query):
""" Takes a model query thing nad returns a list of dicts with the data
Example:
..:
result = utils.query_to_list(MyTable.query)
:param query: Query object
:return: List of dicts repr... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from heartbeat import Challenge
def model_to_json(model):
""" Returns a JSON representation of an SQLAlchemy-backed object.
From Zato: https://github.com/zatosource/zato
"""
_json = {}
_json['fields'] = {}
_json['pk'] = getattr(model, '... | mit | Python |
3b5dc1cbc520fe59886c1e37c74a7f3e11f7150d | Remove of debugging code | SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC | MS1/ddp-erlang-style/create_floats.py | MS1/ddp-erlang-style/create_floats.py | #!/usr/bin/python
__author__ = 'mcsquaredjr'
from dna_lib import *
from string import Template
import subprocess
CMD = "../create-floats INPUT $ITEMCOUNT $CHUNKCOUNT $CHUNKNO"
DEBUG = False
lines = my_lines()
myip = get_ip()
chunks = chunk_numbers()
for i, line in enumerate(lines):
port = int(MIN_PORT) + i + 1
... | #!/usr/bin/python
__author__ = 'mcsquaredjr'
from dna_lib import *
from string import Template
import subprocess
CMD = "../create-floats INPUT $ITEMCOUNT $CHUNKCOUNT $CHUNKNO"
DEBUG = False
lines = my_lines()
myip = get_ip()
chunks = chunk_numbers()
for i, line in enumerate(lines):
port = int(MIN_PORT) + i + 1
... | apache-2.0 | Python |
9f401479498b6694a6a6040a50de65518290a4cd | add wrap_nested for wrapping nested dicts | pankshok/xoinvader,pkulev/xoinvader | xoinvader/settings.py | xoinvader/settings.py | """
Module for handling settings.
"""
class Settings(dict):
"""Container for storing all game settings."""
def __init__(self, wrap_nested=False, *args, **kwargs):
super(Settings, self).__init__(*args, **kwargs)
if wrap_nested:
self._wrap_nested()
def _wrap_nested(self... | """
Module for handling settings.
"""
class Settings(dict):
"""Container for storing all game settings."""
def __init__(self, *args, **kwargs):
super(Settings, self).__init__(*args, **kwargs)
def __getattr__(self, name):
return self[name]
__setattr__ = dict.__setitem__
__delat... | mit | Python |
b5080ff954af99379b08cb7a6cec636f41073a34 | Allow piping from standard input | XueWei/gTTS,pndurette/gTTS,XueWei/gTTS | bin/gtts-cli.py | bin/gtts-cli.py | #! /usr/bin/python
from __future__ import print_function
from gtts import gTTS
from gtts import __version__
import sys
import argparse
import os
import codecs
def languages():
"""Sorted pretty printed string of supported languages"""
return ", ".join(sorted("{}: '{}'".format(gTTS.LANGUAGES[k], k) for k in gTT... | #! /usr/bin/python
from __future__ import print_function
from gtts import gTTS
from gtts import __version__
import sys
import argparse
import os
import codecs
def languages():
"""Sorted pretty printed string of supported languages"""
return ", ".join(sorted("{}: '{}'".format(gTTS.LANGUAGES[k], k) for k in gTT... | mit | Python |
3395e7f1954f939e6d7edfc9cf7886e4256ce6fc | Solve vehicle forces using a matrix. TODO: get results to match previous method of using the brute force equations. | kktse/uwfm | ymd/ymd_calculator.py | ymd/ymd_calculator.py | import numpy as np
import math
def tire_model(alpha):
""" returns tire force generated at a given slip angle
input - alpha (degree)
output - lateral tire force (N)
"""
# assume 600N/degree cornering stiffness
return 100*alpha
def main():
# define test conditions
#beta = math... | import numpy as np
def tire_model(alpha):
""" returns tire force generated at a given slip angle
input - alpha (degree)
output - lateral tire force (N)
"""
# assume 600N/degree cornering stiffness
return 100*alpha
def main():
# define test conditions
beta = 9 # degrees
... | apache-2.0 | Python |
ad2b8bce02c7b7b7ab477fc7fccc1b38fb60e63a | Allow for the case when a header isn't needed | Astroua/TurbuStat,e-koch/TurbuStat | turbustat/statistics/input_base.py | turbustat/statistics/input_base.py | # Licensed under an MIT open source license - see LICENSE
from astropy.io.fits import PrimaryHDU
from spectral_cube import SpectralCube
from spectral_cube.lower_dimensional_structures import LowerDimensionalObject
import numpy as np
def input_data(data, no_header=False):
'''
Accept a variety of input data fo... | # Licensed under an MIT open source license - see LICENSE
from astropy.io.fits import PrimaryHDU
from spectral_cube import SpectralCube
from spectral_cube.lower_dimensional_structures import LowerDimensionalObject
def input_data(data):
'''
Accept a variety of input data forms and return those expected by the... | mit | Python |
ccba0b9af690d98f12e5ee36b024c6e781709cba | handle exception from rmtree of a tmpdir | conda/kapsel,conda/kapsel | project/internal/test/tmpfile_utils.py | project/internal/test/tmpfile_utils.py | from __future__ import print_function, absolute_import
import tempfile
import shutil
import os
import sys
from project.internal.makedirs import makedirs_ok_if_exists
from project.local_state_file import LocalStateFile
local_tmp = os.path.abspath("./build/tmp")
makedirs_ok_if_exists(local_tmp)
class TmpDir(object):... | import tempfile
import shutil
import os
from project.internal.makedirs import makedirs_ok_if_exists
from project.local_state_file import LocalStateFile
local_tmp = os.path.abspath("./build/tmp")
makedirs_ok_if_exists(local_tmp)
class TmpDir(object):
def __init__(self, prefix):
self._dir = tempfile.mkdte... | bsd-3-clause | Python |
fcdbb6f6a0dc102161f1f752202ae9b95a4afbc0 | simplify API | bluedynamics/bda.bfg.app,bluedynamics/bda.bfg.app | src/bda/bfg/app/browser/form.py | src/bda/bfg/app/browser/form.py | from yafowil.base import factory
from yafowil.controller import Controller
from paste.httpexceptions import HTTPFound
from bda.bfg.tile import Tile
from bda.bfg.app.browser.utils import make_url
class Form(Tile):
@property
def form(self):
"""Return yafowil compound.
Not implemente... | from yafowil.base import factory
from yafowil.controller import Controller
from paste.httpexceptions import HTTPFound
from bda.bfg.tile import Tile
from bda.bfg.app.browser.utils import make_url
class Form(Tile):
@property
def form(self):
"""Return yafowil compound.
Not implemente... | bsd-3-clause | Python |
21b6f0f94885493a74e5b28ac6861c3d80865a6e | Rename langlink to blango_lang, so it's passed to the template when calling locals(). | fiam/blangoblog,fiam/blangoblog,fiam/blangoblog | blango/views.py | blango/views.py | from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.db import connection
try:
from django import newforms as forms
except ImportError:
from django import forms
from datetime import date
from set... | from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.db import connection
try:
from django import newforms as forms
except ImportError:
from django import forms
from datetime import date
from set... | bsd-3-clause | Python |
47843e9effeb78b5facf259f732865970e886113 | Rename form sets | mbertheau/jquery.django-formset-example,mbertheau/jquery.django-formset-example | blocks/views.py | blocks/views.py | from .forms import BlockForm
from django.core.urlresolvers import reverse
from django.forms.models import inlineformset_factory
from django.views.generic import (
ListView,
CreateView,
UpdateView,
)
from nested_formset import nestedformset_factory
from blocks import models
class BlockView(object):
m... | from .forms import BlockForm
from django.core.urlresolvers import reverse
from django.forms.models import inlineformset_factory
from django.views.generic import (
ListView,
CreateView,
UpdateView,
)
from nested_formset import nestedformset_factory
from blocks import models
class BlockView(object):
m... | mit | Python |
d9d754270972cc6d66d32b68240934a988fc9d54 | Use a temporal media directory when running the selenium tests | rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud | src/catalogue/tests/selenium.py | src/catalogue/tests/selenium.py | # -*- coding: utf-8 -*-
import time
from shutil import rmtree
from tempfile import mkdtemp
from django.conf import settings
import catalogue.utils
from commons.test import WirecloudSeleniumTestCase
from commons.wgt import WgtDeployer
__test__ = False
class CatalogueSeleniumTests(WirecloudSeleniumTestCase):
... | # -*- coding: utf-8 -*-
import time
from commons.test import WirecloudSeleniumTestCase
__test__ = False
class CatalogueSeleniumTests(WirecloudSeleniumTestCase):
__test__ = True
def test_add_gadget_to_catalog_wgt(self):
driver = self.driver
self.login()
self.change_main_view("ma... | agpl-3.0 | Python |
2ef4362be90e2314b69a2ff17ccb5d25ef8905fd | Set default version for cloud databases. | rackerlabs/rackspace-sdk-plugin,briancurtin/rackspace-sdk-plugin | rackspace/database/database_service.py | rackspace/database/database_service.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | Python |
2639f65a01952d9c819276f2d2222707db53c13a | Add daughter and son | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/radar/models/family_histories.py | radar/radar/models/family_histories.py | from collections import OrderedDict
from sqlalchemy import Column, Integer, ForeignKey, Boolean, String, Index
from sqlalchemy.dialects import postgresql
from sqlalchemy import orm
from radar.database import db
from radar.models.common import MetaModelMixin, uuid_pk_column, patient_id_column, patient_relationship
fro... | from collections import OrderedDict
from sqlalchemy import Column, Integer, ForeignKey, Boolean, String, Index
from sqlalchemy.dialects import postgresql
from sqlalchemy import orm
from radar.database import db
from radar.models.common import MetaModelMixin, uuid_pk_column, patient_id_column, patient_relationship
fro... | agpl-3.0 | Python |
a307bddf490b6ad16739593d4ca51693b9a340fe | Fix custom template tag to work with django 1.8 | 18F/regulations-site,jeremiak/regulations-site,18F/regulations-site,18F/regulations-site,eregs/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,jeremiak/regulations-site,jeremiak/regulation... | regulations/templatetags/in_context.py | regulations/templatetags/in_context.py | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | cc0-1.0 | Python |
0ea4b24660ea77affe4264df3a09d93ad7f51420 | Set no_auth to get-bundle and signup config endpoint | SUNET/eduid-webapp,SUNET/eduid-webapp,SUNET/eduid-webapp | src/eduid_webapp/jsconfig/app.py | src/eduid_webapp/jsconfig/app.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause | Python |
803ee1755dca1d78d15c69e0f8254408b87bbf9b | Update to remove empty query code | candidate-selection-tutorial-sigir2017/candidate-selection-tutorial,candidate-selection-tutorial-sigir2017/candidate-selection-tutorial,candidate-selection-tutorial-sigir2017/candidate-selection-tutorial | assignments/assignment1/exercise/src/frontend/app.py | assignments/assignment1/exercise/src/frontend/app.py | import web
import pysolr
import json
from nltk.tokenize import word_tokenize
urls = (
'/', 'SimpleIndexSearchPage',
'/searchSimpleIndex', 'SearchSimpleIndex',
)
CATEGORY = {'b': 'Business', 'e': 'Entertainment', 't': 'Science and Technology', 'm': 'Health'}
render = web.template.render('templates/', base='lay... | import web
import pysolr
import json
from nltk.tokenize import word_tokenize
urls = (
'/', 'SimpleIndexSearchPage',
'/searchSimpleIndex', 'SearchSimpleIndex',
)
CATEGORY = {'b': 'Business', 'e': 'Entertainment', 't': 'Science and Technology', 'm': 'Health'}
render = web.template.render('templates/', base='lay... | apache-2.0 | Python |
6e6c7697c078fc0b2c121d191a54942256415015 | Bump to 0.0.13-dev | ocefpaf/pyaxiom,axiom-data-science/pyaxiom,axiom-data-science/pyaxiom,ocefpaf/pyaxiom | pyaxiom/__init__.py | pyaxiom/__init__.py | __version__ = "0.0.13-dev"
# Package level logger
import logging
try:
# Python >= 2.7
from logging import NullHandler
except ImportError:
# Python < 2.7
class NullHandler(logging.Handler):
def emit(self, record):
pass
logger = logging.getLogger("pyaxiom")
logger.addHandler(logging.N... | __version__ = "0.0.12"
# Package level logger
import logging
try:
# Python >= 2.7
from logging import NullHandler
except ImportError:
# Python < 2.7
class NullHandler(logging.Handler):
def emit(self, record):
pass
logger = logging.getLogger("pyaxiom")
logger.addHandler(logging.NullH... | mit | Python |
80a58961d0f77b4603cbc606fe96fdea603a7c19 | Add django Admin Models | UmSenhorQualquer/pyforms | pyforms/__init__.py | pyforms/__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from pyforms.utils.settings_manager import conf
conf += 'pyforms.settings'
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = '3.0.0'
__maintainer__ = ["Ricardo Ribeiro", "Carlos Mão de Ferro"]
__email__ = ["ricardojvr@... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from pyforms.utils.settings_manager import conf
conf += 'pyforms.settings'
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = '3.0.0'
__maintainer__ = ["Ricardo Ribeiro", "Carlos Mão de Ferro"]
__email__ = ["ricardojvr@... | mit | Python |
10f0b888762415a548f7b579aa766991061947ec | BUMP 0.10.2 support subclasses of dict in c encoder | develf/mongo-python-driver,jameslittle/mongo-python-driver,aherlihy/mongo-python-driver,mongodb/mongo-python-driver,marcosleonefilho/hoop-pymongo,WingGao/mongo-python-driver,inspectlabs/mongo-python-driver,rychipman/mongo-python-driver,ShaneHarvey/mongo-python-driver,jbenet/mongo-python-driver,ShaneHarvey/mongo-python-... | pymongo/__init__.py | pymongo/__init__.py | # Copyright 2009 10gen, 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 writing, soft... | # Copyright 2009 10gen, 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 writing, soft... | apache-2.0 | Python |
d107ad5c8a25cda1887609bdeb8e0e6da083253a | BUMP 0.9.7 --no_ext option, version number and a bug fix | rychipman/mongo-python-driver,mongodb/mongo-python-driver,bq-xiao/mongo-python-driver,inspectlabs/mongo-python-driver,ramnes/mongo-python-driver,mher/pymongo,ameily/mongo-python-driver,llvtt/mongo-python-driver,rychipman/mongo-python-driver,WingGao/mongo-python-driver,brianwrf/mongo-python-driver,develf/mongo-python-dr... | pymongo/__init__.py | pymongo/__init__.py | # Copyright 2009 10gen, 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 writing, soft... | # Copyright 2009 10gen, 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 writing, soft... | apache-2.0 | Python |
92e3e3d5e0a31bf5e7d210b98f1328105e4afa68 | Add a short explanation to clean-bot | HiccupinGminor/tidbits,HiccupinGminor/tidbits | python/clean-bot.py | python/clean-bot.py | #!/usr/bin/python
import math
# A naive solution to HackerRank's botclean challenge: https://www.hackerrank.com/challenges/botclean
def findAllDirt(row_position, col_position, board):
dirt_locations = {}
i = 0
for row in board:
j = 0
for col in row:
if col == "d":
... | #!/usr/bin/python
import math
def findAllDirt(row_position, col_position, board):
dirt_locations = {}
i = 0
for row in board:
j = 0
for col in row:
if col == "d":
#Calculate the dirt's "score"
score = abs(row_position - i) + abs(col_position ... | mit | Python |
b69c7ea7ee82d1d7ddec7ddafdb8f4cf62c5d738 | Bump Version: 0.20.1 → 0.20.2 | akaszynski/vtkInterface | pyvista/_version.py | pyvista/_version.py | """ version info for pyvista """
# major, minor, patch
version_info = 0, 20, 2
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| """ version info for pyvista """
# major, minor, patch
version_info = 0, 20, 1
# Nice string for the version
__version__ = '.'.join(map(str, version_info))
| mit | Python |
f03fc1ab982dff47c101a64b6acc47b8400620e1 | Change how URIs are built with regard to port | gmr/queries,gmr/queries | queries/__init__.py | queries/__init__.py | """
Queries: PostgreSQL database access simplified
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically register support for UUIDs,
Unicode and Unicode arrays.
"""
__version__ = '1... | """
Queries: PostgreSQL database access simplified
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically register support for UUIDs,
Unicode and Unicode arrays.
"""
__version__ = '1... | bsd-3-clause | Python |
7bb3ddd218478b77c4d02831e1a32511bdd414fc | add todo for troubling mark bug | RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software | rj_gameplay/rj_gameplay/role/marker.py | rj_gameplay/rj_gameplay/role/marker.py | import stp
from rj_msgs.msg import RobotIntent
# TODO: mark skill has not been updated, how is it working here (see basicDefense)?
from rj_gameplay.skill import mark
class MarkerRole(stp.role.Role):
"""Role to produce marking behavior"""
def __init__(self, robot: stp.rc.Robot, target_robot: stp.rc.Robot) ->... | import stp
from rj_gameplay.skill import mark
from rj_msgs.msg import RobotIntent
class MarkerRole(stp.role.Role):
"""Role to produce marking behavior"""
def __init__(self, robot: stp.rc.Robot, target_robot: stp.rc.Robot) -> None:
super().__init__(robot)
self.mark_skill = None
self.... | apache-2.0 | Python |
7117a0e177409a0a7ba0363770219c6f774eadbd | Address issue https://github.com/globaleaks/GlobaLeaks/issues/1059 | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks | backend/globaleaks/utils/structures.py | backend/globaleaks/utils/structures.py | # -*- coding: UTF-8
# structures
# **********
#
# This file contains the complex structures stored in Storm table
# in order to checks integrity between exclusive options, provide defaults,
# supports extensions (without changing DB format)
from globaleaks import LANGUAGES_SUPPORTED_CODES
from globaleaks.models im... | # -*- coding: UTF-8
# structures
# **********
#
# This file contains the complex structures stored in Storm table
# in order to checks integrity between exclusive options, provide defaults,
# supports extensions (without changing DB format)
from globaleaks import LANGUAGES_SUPPORTED_CODES
from globaleaks.models im... | agpl-3.0 | Python |
c3addf83867efcf2941d6c13aa042099cadbedaa | test email is sent | ava-project/ava-website,ava-project/ava-website,ava-project/ava-website | website/user/tests/registration.py | website/user/tests/registration.py | from django.core import mail
from django.test import TestCase, Client
from django.contrib.auth.models import User
from ..forms import RegisterForm
class RegisterTest(TestCase):
def setUp(self):
User.objects.create_user('username', 'email@email.fr', 'password')
self.client = Client()
def test... | from django.test import TestCase, Client
from django.contrib.auth.models import User
from ..forms import RegisterForm
class RegisterTest(TestCase):
def setUp(self):
User.objects.create_user('username', 'email@email.fr', 'password')
self.client = Client()
def test_correct_registration(self):
... | mit | Python |
4a6f76857a626dd756675a4fe1dd3660cf63d8b7 | Move module time to main() | bowen0701/algorithms_data_structures | alg_fibonacci.py | alg_fibonacci.py | """Fibonacci series:
0, 1, 1, 2, 3, 5, 8,...
- Fib(0) = 0
- Fib(1) = 1
- Fib(n) = Fib(n - 1) + Fib(n - 2)
"""
from __future__ import print_function
def fibonacci(n):
"""Get nth number of Fibonacci series by recursion."""
if n == 0:
return 0
elif n == 1 or n == 2:
return 1
else:
... | """Fibonacci series:
0, 1, 1, 2, 3, 5, 8,...
- Fib(0) = 0
- Fib(1) = 1
- Fib(n) = Fib(n - 1) + Fib(n - 2)
"""
from __future__ import print_function
import time
def fibonacci(n):
"""Get nth number of Fibonacci series by recursion."""
if n == 0:
return 0
elif n == 1 or n == 2:
return 1
... | bsd-2-clause | Python |
20043f0bbf06fabd4862744123650bad46ccf13d | fix priority reference. | alexsilva/django-xadmin,alexsilva/django-xadmin,alexsilva/django-xadmin,alexsilva/django-xadmin | xadmin/templatetags/xadmin_tags.py | xadmin/templatetags/xadmin_tags.py | import re
from django import template
from django.template import Library
from django.utils import six
from django.utils.html import escape
from django.utils.safestring import mark_safe
from xadmin.util import static, vendor as util_vendor
register = Library()
@register.simple_tag(takes_context=True)
def username_... | import re
from django import template
from django.template import Library
from django.utils import six
from django.utils.html import escape
from django.utils.safestring import mark_safe
from xadmin.util import static, vendor as util_vendor
register = Library()
@register.simple_tag(takes_context=True)
def username_... | bsd-3-clause | Python |
76a0bae50e51c39d5ccdaa63309cacabda219ddc | Add test for more special tabs | meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u... | chrome/test/functional/special_tabs.py | chrome/test/functional/special_tabs.py | #!/usr/bin/python
# Copyright (c) 2010 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.
import pyauto_functional # Must be imported before pyauto
import pyauto
class SpecialTabsTest(pyauto.PyUITest):
"""TestCase for Sp... | #!/usr/bin/python
# Copyright (c) 2010 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.
import pyauto_functional # Must be imported before pyauto
import pyauto
class SpecialTabsTest(pyauto.PyUITest):
"""TestCase for Sp... | bsd-3-clause | Python |
cbbe17c702238af8259cff9d52d7bb3e1d8e47b7 | Update _unittests/ut_hackathon/test_crypt.py | sdpython/ensae_projects,sdpython/ensae_projects,sdpython/ensae_projects | _unittests/ut_hackathon/test_crypt.py | _unittests/ut_hackathon/test_crypt.py | """
@brief test log(time=8s)
"""
import sys
import os
import warnings
import unittest
from pyquickhelper.pycode import skipif_travis
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
... | """
@brief test log(time=8s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
... | mit | Python |
595ae47653a747c304522beb76c045b14ba38e87 | Fix test_fields | khchine5/django-shop,jrief/django-shop,jrief/django-shop,awesto/django-shop,divio/django-shop,awesto/django-shop,nimbis/django-shop,nimbis/django-shop,nimbis/django-shop,khchine5/django-shop,jrief/django-shop,awesto/django-shop,divio/django-shop,jrief/django-shop,nimbis/django-shop,divio/django-shop,khchine5/django-sho... | example/tests/test_fields.py | example/tests/test_fields.py | # -*- coding: utf-8
from __future__ import unicode_literals
from django.db import models
from django.test import TestCase
from shop.models.defaults.cart_item import CartItem
from shop.models.fields import JSONField
class JsonModel(models.Model):
class Meta:
app_label = 'JsonModel'
json = JSONField... | # -*- coding: utf-8
from __future__ import unicode_literals
from django.test import TestCase
from shop.models.defaults.customer import Customer
class JSONFieldTest(TestCase):
"""JSONField Wrapper Tests"""
def test_json_field_create(self):
"""Test saving a JSON object in our JSONField"""
jso... | bsd-3-clause | Python |
843d8e8811ab197fdbb416a7cc7d045af6f1e4bf | Fix project list resources | cgwire/zou | zou/app/blueprints/crud/project.py | zou/app/blueprints/crud/project.py | from zou.app.models.project import Project
from zou.app.services import user_service, projects_service
from zou.app.utils import permissions
from .base import BaseModelResource, BaseModelsResource
class ProjectsResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, Project)
... | from zou.app.models.project import Project
from zou.app.services import user_service, projects_service
from .base import BaseModelResource, BaseModelsResource
class ProjectsResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, Project)
def add_project_permission_filter... | agpl-3.0 | Python |
3f7e9f1392b3cc2f915d332ee224578e71dcebc3 | Add __version__ | vahtras/amy,vahtras/amy,shapiromatron/amy,wking/swc-amy,wking/swc-amy,pbanaszkiewicz/amy,shapiromatron/amy,pbanaszkiewicz/amy,swcarpentry/amy,shapiromatron/amy,vahtras/amy,swcarpentry/amy,wking/swc-amy,wking/swc-amy,swcarpentry/amy,pbanaszkiewicz/amy | workshops/__init__.py | workshops/__init__.py | __version__ = '0.2.0'
| mit | Python | |
f7a1e75bd11388ee5053e0f4e66dd95a760adc3c | Update openFile.py | Armando115Tapia/proyecto-2do-Bimestre-BI | Procesamiento/ProcesarTweets/openFile.py | Procesamiento/ProcesarTweets/openFile.py |
#Código escrito en lenguaje python que permite leer el archivo .txt creado por printInFile
#con el objetivo de extraer el campo value que contiene el texto de cada tweet recolectado
import json
import sys
from pprint import pprint
import urllib2
# encoding:utf-8
valor = '"value":"'
#Ejemplo de directorio Proyecto ... | import json
import sys
from pprint import pprint
import urllib2
# encoding:utf-8
valor = '"value":"'
with open('/root/PycharmProjects/ImprimirTweets/tweetsUIO.txt') as f:
for line in f:
line.split(valor)
#print(line.split("value"))
#result = line.split('value:')[-1]
result = line.s... | mit | Python |
abd709f9defd7375abdc3300b2ad6cb5e5d2a30a | Fix a bug in readv(). Close #2447. (#2453) | angr/angr,angr/angr,angr/angr | angr/procedures/linux_kernel/iovec.py | angr/procedures/linux_kernel/iovec.py | import angr
from ..posix.read import read
from ..posix.write import write
from ...sim_type import register_types, parse_types
register_types(parse_types("""
struct iovec {
void *iov_base; /* Starting address */
size_t iov_len; /* Number of bytes to transfer */
};
"""))
class readv(angr.SimProcedure):
... | import angr
from ..posix.read import read
from ..posix.write import write
from ...sim_type import register_types, parse_types
register_types(parse_types("""
struct iovec {
void *iov_base; /* Starting address */
size_t iov_len; /* Number of bytes to transfer */
};
"""))
class readv(angr.SimProcedure):
... | bsd-2-clause | Python |
dc2254457602ca40f79d20d9eb97e64941ab7709 | use SI units in units example | mgk/urwid_timed_progress | examples/reasonable_units.py | examples/reasonable_units.py | #!/usr/bin/env python
from time import sleep
import urwid as uw
from urwid_timed_progress import TimedProgressBar
# Demo of bar adjusting to reasonable units
# The demo simulates progress at different rates to show
# the progress bar changing units as needed.
if __name__ == '__main__':
palette = [
('norm... | #!/usr/bin/env python
from time import sleep
import urwid as uw
from urwid_timed_progress import TimedProgressBar
# Demo of bar adjusting to reasonable units
# The demo simulates progress at different rates to show
# the progress bar changing units as needed.
if __name__ == '__main__':
palette = [
('norm... | mit | Python |
0ea72bc6c1470960294bbc92ee1e1e9b606699c9 | Update fb_login.py | umangahuja1/Python | Automation/fb_login.py | Automation/fb_login.py | from selenium import webdriver
from getpass import getpass
usr = input('Enter your username or email id: ')
pwd = getpass('Enter your password : ')
driver = webdriver.Chrome()
driver.get('https://www.facebook.com/')
username_box = driver.find_element_by_id('email')
username_box.send_keys(usr)
password_box = driver.... | '''
This script is created to perform facebook login from terminal
'''
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui... | apache-2.0 | Python |
169a14df3a5e145310f9d73b2531f62e4a02bd5a | Fix zip on clang-release-builder. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/android/archive_build.py | scripts/slave/android/archive_build.py | #!/usr/bin/env python
# Copyright 2014 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.
"""A tool to archive an Android build.
This script is used for Debug and Release builds.
When this is run, the current directory ... | #!/usr/bin/env python
# Copyright 2014 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.
"""A tool to archive an Android build.
This script is used for Debug and Release builds.
When this is run, the current directory ... | bsd-3-clause | Python |
782574b58e96eadcb3f07dbdf91fdf3ecc88b98e | Fix naming issue in host state | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/states/host.py | salt/states/host.py | '''
Manage the state of the hosts file
'''
def present(name, ip):
'''
Ensures that the named host is present with the given ip
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
if __salt__['hosts.has_pair'](ip, name):
ret['changes'] = '... | '''
Manage the state of the hosts file
'''
def present(name, ip):
'''
Ensures that the named host is present with the given ip
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
if __salt__['hosts.has_pair'](ip, name):
ret['changes'] = '... | apache-2.0 | Python |
c300192f08edfecf843e00a8076cff97010e5fd5 | Add some docstring. | fyabc/MiniGames | Shift_pygame/Shift_pygame/utils/basic.py | Shift_pygame/Shift_pygame/utils/basic.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
__author__ = 'fyabc'
def error(msg, *args, **kwargs):
print(msg, *args, **kwargs, file=sys.stderr)
def sign(x):
return 1 if x > 0 else (-1 if x < 0 else 1)
_comment_pattern = re.compile(r'#.*?\n')
def strip_line(line):
"""Remove comme... | #! /usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
__author__ = 'fyabc'
def error(msg, *args, **kwargs):
print(msg, *args, **kwargs, file=sys.stderr)
def sign(x):
return 1 if x > 0 else (-1 if x < 0 else 1)
_comment_pattern = re.compile(r'#.*?\n')
def strip_line(line):
return _comment... | mit | Python |
876cbb786929f3eb18500faa960a3970bc252e2b | allow authproxy requests with double slash in URL (/tiles//layername) | omniscale/gbi-server,omniscale/gbi-server,omniscale/gbi-server | app/gbi_server/authproxy/blueprint.py | app/gbi_server/authproxy/blueprint.py | # This file is part of the GBI project.
# Copyright (C) 2013 Omniscale GmbH & Co. KG <http://omniscale.com>
#
# 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/licens... | # This file is part of the GBI project.
# Copyright (C) 2013 Omniscale GmbH & Co. KG <http://omniscale.com>
#
# 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/licens... | apache-2.0 | Python |
df95f72566d0b01be27342f0da42980d3d8a1b60 | Remove unused DefaultRouter in retina_api.urls | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | app/grandchallenge/retina_api/urls.py | app/grandchallenge/retina_api/urls.py | from django.urls import path, include
from rest_framework.routers import DefaultRouter, SimpleRouter
from grandchallenge.retina_api import views
from django.views.decorators.cache import cache_page
from django.conf import settings
app_name = "retina_api"
annotation_router = SimpleRouter()
annotation_router.register(
... | from django.urls import path, include
from rest_framework.routers import DefaultRouter, SimpleRouter
from grandchallenge.retina_api import views
from django.views.decorators.cache import cache_page
from django.conf import settings
app_name = "retina_api"
router = DefaultRouter()
annotation_router = SimpleRouter()
an... | apache-2.0 | Python |
c1e7ff32956d003800c113907309f56096d0be41 | set interval int on scheduler minute | jgabriellima/mining,chrisdamba/mining,mining/mining,mlgruby/mining,AndrzejR/mining,seagoat/mining,mining/mining,avelino/mining,avelino/mining,mlgruby/mining,AndrzejR/mining,chrisdamba/mining,jgabriellima/mining,mlgruby/mining,seagoat/mining | bin/scheduler.py | bin/scheduler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import time
import schedule
from bottle.ext.mongo import MongoPlugin
from settings import ADMIN_BUCKET_NAME, MONGO_URI
from bin.mining import run
def job(slug):
run(slug)
def rules(cube):
scheduler_type = cube.get(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import time
import schedule
from bottle.ext.mongo import MongoPlugin
from settings import ADMIN_BUCKET_NAME, MONGO_URI
from bin.mining import run
def job(slug):
run(slug)
def rules(cube):
scheduler_type = cube.get(... | mit | Python |
ea5fd30a583016b4dc858848e28168ada74deca3 | Check in fix for py3k and urlparse. | scls19fr/blaze,markflorisson/blaze-core,ChinaQuants/blaze,jdmcbr/blaze,nkhuyu/blaze,cpcloud/blaze,LiaoPan/blaze,FrancescAlted/blaze,cowlicks/blaze,FrancescAlted/blaze,mwiebe/blaze,markflorisson/blaze-core,mwiebe/blaze,ContinuumIO/blaze,FrancescAlted/blaze,aterrel/blaze,AbhiAgarwal/blaze,jdmcbr/blaze,aterrel/blaze,China... | blaze/py3help.py | blaze/py3help.py | import sys
import itertools
PY3 = sys.version_info[:2] >= (3,0)
if PY3:
def dict_iteritems(d):
return d.items().__iter__()
xrange = range
_inttypes = (int,)
_strtypes = (str,)
unicode = str
imap = map
basestring = str
import urllib.parse as urlparse
else:
import __builtin__... | import sys
import itertools
PY3 = sys.version_info[:2] >= (3,0)
if PY3:
def dict_iteritems(d):
return d.items().__iter__()
xrange = range
_inttypes = (int,)
_strtypes = (str,)
unicode = str
imap = map
basestring = str
import urllib
urlparse = urllib.parse
else:
import _... | bsd-3-clause | Python |
5d40bdeb1b95c051d0655595846acd91cff6160f | Bump version | Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/b... | botan_version.py | botan_version.py |
release_major = 1
release_minor = 11
release_patch = 7
release_so_abi_rev = release_patch
# These are set by the distribution script
release_vc_rev = None
release_datestamp = 0
release_type = 'unreleased'
|
release_major = 1
release_minor = 11
release_patch = 6
release_so_abi_rev = release_patch
# These are set by the distribution script
release_vc_rev = None
release_datestamp = 0
release_type = 'unreleased'
| bsd-2-clause | Python |
7205fa3fca6b31467e35a4472aa900ec75db6caf | Solve No.158 by python | jonathanxqs/lintcode,jonathanxqs/lintcode | 158.py | 158.py | class Solution:
"""
@param s: The first string
@param b: The second string
@return true or false
"""
def anagram(self, s, t):
def hashLize(s):
dicts1= dict()
for j in s:
if j in dicts1.keys():
dicts1[j]+=1
else:... | mit | Python | |
239dba89e8cb933fe8950412eeaea3ca4caa92bd | remove all instances | FredrikAugust/Aether-Nodes,FredrikAugust/Aether-Nodes,FredrikAugust/Aether-Nodes | src/app.py | src/app.py | __author__ = 'Fredrik A. Madsen-Malmo'
from flask import Flask, flash, render_template, g
import models
import forms
import os
DEBUG = True
PORT = port = int(os.environ.get('PORT', 33507))
HOST = '0.0.0.0'
app = Flask(__name__)
app.secret_key = os.environ.get('secret_key', 'error')
# Before and after request
@ap... | __author__ = 'Fredrik A. Madsen-Malmo'
from flask import Flask, flash, render_template, g
import models
import forms
import os
DEBUG = True
PORT = port = int(os.environ.get('PORT', 33507))
HOST = '0.0.0.0'
app = Flask(__name__)
app.secret_key = os.environ.get('secret_key', 'error')
# Before and after request
@ap... | mit | Python |
7a0c87ae0cca03bb13f105ecbc385ab85ef80dd2 | Fix Alu again | bongtrop/SMC | alu.py | alu.py | import translator
#nand gate
def nand(a, b):
a = translator.com2s2bin(a)
b = translator.com2s2bin(b)
result = ""
for i in range(0,32):
if not (a[i]=='1' and b[i]=='1'):
result+='1'
else:
result+='0'
return translator.bin2com2s(result)
#adder
def add(a, b):
return a+b
#get zero bit... | import translator
#nand gate
def nand(a, b):
a = translator.com2s2bin(a)
b = translator.com2s2bin(b)
result = ""
for i in range(0,32):
if (not (a[i] and b[i])):
result+='1'
else:
result+='0'
return int(result, 2)
#adder
def add(a, b):
return a+b
#get zero bit
def equal(a, b):
re... | bsd-3-clause | Python |
6304dee5624c3bfb6b481a2d4e7b486c742d71bd | remove the useless code to reduce the complexity | Microsoft/multiverso,you-n-g/multiverso,zhengsx/multiverso,you-n-g/multiverso,you-n-g/multiverso,zhengsx/multiverso,Microsoft/multiverso,zhengsx/multiverso,liming-vie/multiverso,liming-vie/multiverso,you-n-g/multiverso,Microsoft/multiverso,zhengsx/multiverso,liming-vie/multiverso,liming-vie/multiverso,Microsoft/multive... | binding/python/multiverso/api.py | binding/python/multiverso/api.py | #!/usr/bin/env python
# coding:utf8
import ctypes
from utils import Loader
import numpy as np
mv_lib = Loader.get_lib()
def init(args=[]):
'''Initialize mutliverso.
This should be called only once before training at the beginning of the
whole project.
'''
n = len(args)
args_type = ctypes.c... | #!/usr/bin/env python
# coding:utf8
import ctypes
from utils import Loader
import numpy as np
mv_lib = Loader.get_lib()
WORKER_ID = None
def init(args=[]):
'''Initialize mutliverso.
This should be called only once before training at the beginning of the
whole project.
'''
n = len(args)
arg... | mit | Python |
4795c58f3cfacb20e3b991fec7b78d59a8dcabff | Use SO_REUSEADDR to avoid errors on quick restart. | Timmenem/micropython,ChuckM/micropython,dxxb/micropython,MrSurly/micropython,AriZuu/micropython,SungEun-Steve-Kim/test-mp,mhoffma/micropython,ryannathans/micropython,hosaka/micropython,martinribelotta/micropython,MrSurly/micropython,kerneltask/micropython,hiway/micropython,hosaka/micropython,xyb/micropython,aethaniel/m... | examples/unix/sock-server.py | examples/unix/sock-server.py | try:
import rawsocket as socket
except:
import socket
CONTENT = """\
HTTP/1.0 200 OK
Hello #{} from MicroPython!
"""
s = socket.socket()
ai = socket.getaddrinfo("127.0.0.1", 8080)
print("Bind address info:", ai)
addr = ai[0][4]
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(addr)
s.listen(... | try:
import rawsocket as socket
except:
import socket
CONTENT = """\
HTTP/1.0 200 OK
Hello #{} from MicroPython!
"""
s = socket.socket()
ai = socket.getaddrinfo("127.0.0.1", 8080)
print("Bind address info:", ai)
addr = ai[0][4]
s.bind(addr)
s.listen(5)
print("Listening, connect your browser to http://127.... | mit | Python |
1dc28f250a0323acf456bf4f85731625b80670ac | Switch to webracer | p/google-proxy | app.py | app.py | import flask
import urllib
import re
import cgi
import xml.sax.saxutils
import webracer.session
app = flask.Flask(__name__)
#app.debug = True
def replace(match):
url = match.group(1)
url = xml.sax.saxutils.unescape(url)
url = url[:url.find('&')]
#url = url[:url.find('&')]
url = urllib.unquote(... | import flask
import urllib
import re
import cgi
import xml.sax.saxutils
import curlfe
app = flask.Flask(__name__)
#app.debug = True
def replace(match):
url = match.group(1)
url = xml.sax.saxutils.unescape(url)
url = url[:url.find('&')]
#url = url[:url.find('&')]
url = urllib.unquote(url)
#... | bsd-2-clause | Python |
4b9f40dea7c8aaa45e174c7f4371cec543dcf26d | Make captcha required | freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net,freifunk-berlin/ca.berlin.freifunk.net | app.py | app.py | #!/bin/env python
from flask import Flask, request, render_template, flash, redirect, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from wtforms import Form, TextField, validators
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
app.config['SECRET_KEY'] = 'foobar'
db = SQLA... | #!/bin/env python
from flask import Flask, request, render_template, flash, redirect, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from wtforms import Form, TextField, validators
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
app.config['SECRET_KEY'] = 'foobar'
db = SQLA... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.