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
04142e3bd0c09e6f712669529e780a18c11c7076
Add script to validate files are valid DocBook.
savinash47/openstack-doc-tools,openstack/openstack-doc-tools,openstack/openstack-doc-tools,savinash47/openstack-doc-tools,savinash47/openstack-doc-tools
validate.py
validate.py
#!/usr/bin/env python ''' Usage: validate.py [path] Validates all xml files against the DocBook 5 RELAX NG schema. Options: path Root directory, defaults to <repo root>/doc/src/doc/docbkx Ignores pom.xml files and subdirectories named "target". Requires Python 2.7 or greater (for argparse) and the lxml...
apache-2.0
Python
7cb62f554fa293a2ba4d0456ed8d04e8f277d2c1
Add migrations/0146_clean_lexeme_romanised_3.py
lingdb/CoBL-public,lingdb/CoBL-public,lingdb/CoBL-public,lingdb/CoBL-public
ielex/lexicon/migrations/0146_clean_lexeme_romanised_3.py
ielex/lexicon/migrations/0146_clean_lexeme_romanised_3.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function from django.db import migrations def forwards_func(apps, schema_editor): Lexeme = apps.get_model("lexicon", "Lexeme") replaceMap = { 'λ': 'ʎ', 'φ': 'ɸ' } for lexeme in Lexeme.objects.all(): if l...
bsd-2-clause
Python
8f1b1ef01e74782f57da9c9489a3a7f6555bbee6
Add tests for reports views.
birkbeckOLH/annotran,birkbeckOLH/annotran,birkbeckOLH/annotran
annotran/reports/test/views_test.py
annotran/reports/test/views_test.py
# -*- coding: utf-8 -*- import mock import pytest from pyramid import httpexceptions from annotran.reports import views _SENTINEL = object()
mit
Python
691ae15cb0f46400762c27305fb74f57fa1ffccf
Implement account.py
ThomasLee969/net.tsinghua,ThomasLee969/net.tsinghua,ThomasLee969/net.tsinghua
src/account.py
src/account.py
from datetime import datetime from hashlib import md5 from re import match, search, DOTALL from requests.sessions import Session from bs4 import BeautifulSoup BASE_URL = 'https://usereg.tsinghua.edu.cn' LOGIN_PAGE = BASE_URL + '/do.php' INFO_PAGE = BASE_URL + '/user_info.php' class Account(object): """Tsinghua Ac...
mit
Python
940299a7bfd967653899b176ce76e6f1cf02ca83
Add script to generate pairs of LIWC categories
NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts
liwcpairs2es.py
liwcpairs2es.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from elasticsearch import Elasticsearch, helpers from collections import Counter from datetime import datetime def find_pairs(list1, list2): pairs = [] if list1 and list2: for item1 in list1: for item2 in list2: pairs.append(u'{...
apache-2.0
Python
73292532767d736a77ec8b122cfd4ff19b7d991b
Create Account dashboard backend
lakewik/storj-gui-client
UI/account_dash.py
UI/account_dash.py
# -*- coding: utf-8 -*- import threading from PyQt4 import QtCore, QtGui from qt_interfaces.account_dash_ui import Ui_AccountDash from engine import StorjEngine from utilities.tools import Tools # Synchronization menu section # class AccountDashUI(QtGui.QMainWindow): def __init__(self, parent=None,): QtG...
mit
Python
53258a9ffd869dd958fd818874b2c8406acca143
add pytest for util.store
tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status
pytests/util/test_store.py
pytests/util/test_store.py
import pytest import util.store @pytest.fixture def emptyStore(): return util.store.Store() @pytest.fixture def store(): return util.store.Store() def test_get_of_unset_key(emptyStore): assert emptyStore.get("any-key") == None assert emptyStore.get("any-key", "default-value") == "default-value" ...
mit
Python
5bde5b5904abc30506e56865cd58fd88a97942aa
Add `deprecated` decorator
tavultesoft/keymanweb,tavultesoft/keymanweb
linux/keyman-config/keyman_config/deprecated_decorator.py
linux/keyman-config/keyman_config/deprecated_decorator.py
#!/usr/bin/python3 # based on https://stackoverflow.com/a/40301488 import logging string_types = (type(b''), type(u'')) def deprecated(reason): if isinstance(reason, string_types): # The @deprecated is used with a 'reason'. def decorator(func1): def new_func1(*args, **kwargs): ...
apache-2.0
Python
f6519493dd75d7f5a8b65a952b5d7048bd101ec4
Create locationanalysis.py
MagnoMithos/GoogleMapsLocationAnalysis
locationanalysis.py
locationanalysis.py
import json print 'test' f = open('location.json', 'r') jsoncontent = f.read() print jsoncontent location = json.loads(jsoncontent) print len(location)
mit
Python
f6d417e69efa4554008bc441a5c82a5b9f93a082
Add sql.conventions.objects.Items
clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage
garage/sql/conventions/objects.py
garage/sql/conventions/objects.py
__all__ = [ 'Items', ] from garage.functools import nondata_property from garage.sql.utils import insert_or_ignore, make_select_by class Items: """A thin layer on top of tables of two columns: (id, value)""" def __init__(self, table, id_name, value_name): self.table = table self.value_na...
mit
Python
313f5c8c54002a736a323410c5d9ec96fcc2f50b
Create RespostaVer.py
AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb
backend/Models/Predio/RespostaVer.py
backend/Models/Predio/RespostaVer.py
from Framework.Resposta import Resposta from Models.Campus.Campus import Campus as ModelCampus class RespostaVer(Resposta): def __init__(self,campus): self.corpo = ModelCampus(campus)
mit
Python
95f5b7cd2325a61f537bffb783e950b30c97da5f
Add a demo about learning the shape parameter of gamma dist
bayespy/bayespy,fivejjs/bayespy,jluttine/bayespy,SalemAmeen/bayespy
bayespy/demos/gamma_shape.py
bayespy/demos/gamma_shape.py
from bayespy import nodes from bayespy.inference import VB def run(): a = nodes.GammaShape(name='a') b = nodes.Gamma(1e-5, 1e-5, name='b') tau = nodes.Gamma(a, b, plates=(1000,), name='tau') tau.observe(nodes.Gamma(10, 20, plates=(1000,)).random()) Q = VB(tau, a, b) Q.update(repeat=1000)...
mit
Python
3c618e8424e64a62168c2a2c683748d2496ef7cb
Add Urban Dictionary module.
billyvg/piebot
modules/urbandictionary.py
modules/urbandictionary.py
"""Looks up a term from urban dictionary @package ppbot @syntax ud <word> """ import requests import json from modules import * class Urbandictionary(Module): def __init__(self, *args, **kwargs): """Constructor""" Module.__init__(self, kwargs=kwargs) self.url = "http://www.urbandictiona...
mit
Python
d8fff759f2bff24f20cdbe98370ede9e5f3b7b13
Add 2D helmholtz convergence test
thomasgibson/firedrake-hybridization
convergence_tests/2D_helmholtz.py
convergence_tests/2D_helmholtz.py
from __future__ import absolute_import, division from firedrake import * import numpy as np def helmholtz_mixed(x, V1, V2): # Create mesh and define function space mesh = UnitSquareMesh(2**x, 2**x) V1 = FunctionSpace(mesh, *V1, name="V") V2 = FunctionSpace(mesh, *V2, name="P") W = V1 * V2 # D...
mit
Python
5206a15d59bc8881629c48bb4136bb1a9cb7b4d0
Create ms_old_identifiers.py
Bindernews/TheHound
identifiers/ms_old_identifiers.py
identifiers/ms_old_identifiers.py
from identifier import * import collections CFBInfo = collections.namedtuple('CFBInfo', ['name', 'descripion', 'pattern']) OFFICE_PATTERNS = [ 'D0 CF 11 E0 A1 B1 1A E1' ] FILE_PATTERNS = [ CFBInfo('DOC', 'Microsoft Word 97-2003', bytes.fromhex('EC A5 C1 20')), CFBInfo('XLS', 'Microsoft Excel 97-2003',...
mit
Python
835a7b9bea1b006b5a096665d706b64b778d45ab
fix default param
FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE
python/federatedml/ensemble/test/hack_encrypter.py
python/federatedml/ensemble/test/hack_encrypter.py
class HackDecrypter(): def encrypt(self, val): return val def decrypt(self, val): return val
apache-2.0
Python
aeb671484bc8e68a8aba3eaa80523ae153b8e9c9
Add files via upload
fumen/kihon,fumen/kihon,fumen/kihon
youtube_list.py
youtube_list.py
from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.tools import argparser import pafy DEVELOPER_KEY = "AIzaSyCsrKjMf7_mHYrT6rIJ-oaA6KL5IYg389A" YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" def youtube_search(options): youtube = build(YOUTUBE_API_SERVIC...
mit
Python
0770fab7c4985704e2793ab98150c9f1a2729e01
Create easy_17_ArrayAdditionI.py
GabrielGhe/CoderbyteChallenges,GabrielGhe/CoderbyteChallenges
easy_17_ArrayAdditionI.py
easy_17_ArrayAdditionI.py
import itertools ################################################# # This function will see if there is any # # possible combination of the numbers in # # the array that will give the largest number # ################################################# def ArrayAdditionI(arr): #sort, remove last ele...
mit
Python
1cc15f3ae9a0b7fa5b2dae4bcdd9f0f3c061ce4d
Fix relate_name on Bug model
mozilla/reclama,mozilla/reclama,mozilla/reclama,mozilla/reclama
reclama/sprints/migrations/0002_auto_20150130_1751.py
reclama/sprints/migrations/0002_auto_20150130_1751.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0001_initial'), ] operations = [ migrations.AlterField( model_name='bug', name='event', ...
mpl-2.0
Python
de65724abf0a01660e413189d1738a72d5afd297
add simple test for create_wininst.
cournape/Bento,cournape/Bento,cournape/Bento,cournape/Bento
bento/commands/tests/test_wininst.py
bento/commands/tests/test_wininst.py
import os import shutil import tempfile import zipfile import os.path as op import mock import bento.commands.build_wininst from bento.commands.build_wininst \ import \ create_wininst from bento.compat.api.moves \ import \ unittest from bento.core.node \ import \ create_base_node...
bsd-3-clause
Python
edfd6ddf8e7af41a8b5ed228360b92377bfc8964
add 167. First 200 problems have been finished!
zeyuanxy/project-euler,zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler,EdisonAlgorithms/ProjectEuler,zeyuanxy/project-euler
vol4/167.py
vol4/167.py
import time def ulam(a, b): yield a yield b u = [a, b] even_element = 0 while even_element == 0 or u[-1] < 2 * even_element: sums = {} for i in range(len(u)): for j in range(i + 1, len(u)): sums[u[i] + u[j]] = sums.get(u[i] + u[j], 0) + 1 u.append(min(k for k, v in sums.iteritems() if v == 1 and k > ...
mit
Python
e4d222c4e1b05f8d34b2236d05269827c345b0c7
Handle also running rebot
moto-timo/robotframework,yahman72/robotframework,stasiek/robotframework,suvarnaraju/robotframework,alexandrul-ci/robotframework,joongh/robotframework,nmrao/robotframework,JackNokia/robotframework,ashishdeshpande/robotframework,rwarren14/robotframework,fingeronthebutton/robotframework,un33k/robotframework,Colorfulstan/r...
src/robot/jarrunner.py
src/robot/jarrunner.py
# Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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...
# Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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...
apache-2.0
Python
76399574b7fb914d1baa2719a0e493d4b22bb730
Create PedidoEditar.py
AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb
backend/Models/Grau/PedidoEditar.py
backend/Models/Grau/PedidoEditar.py
from Framework.Pedido import Pedido from Framework.ErroNoHTTP import ErroNoHTTP class PedidoEditar(Pedido): def __init__(self,variaveis_do_ambiente): super(PedidoEditar, self).__init__(variaveis_do_ambiente) try: self.nome = self.corpo['nome'] except: raise ErroNoHTTP(400) def getNome(self): ...
mit
Python
df146818d004e65102cc6647373b0fddb0d383fd
add basic integration tests
objectified/vdist,objectified/vdist
integration-tests/test_builder.py
integration-tests/test_builder.py
import os import subprocess import tempfile from vdist.builder import Builder from vdist.source import git, git_directory, directory def test_generate_deb_from_git(): builder = Builder() builder.add_build( app='vdist-test-generate-deb-from-git', version='1.0', source=git( ...
mit
Python
dc0ecffd6c4115019cfcbcc13b17a20511888c9b
Add ut for fused ops
chengduoZH/Paddle,baidu/Paddle,tensor-tang/Paddle,chengduoZH/Paddle,baidu/Paddle,baidu/Paddle,luotao1/Paddle,baidu/Paddle,luotao1/Paddle,baidu/Paddle,luotao1/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,PaddlePaddle/Paddle,tensor-tang/Paddle,luotao1/...
python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py
python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
Python
a852de81afdf8426cb243115a87856e2767a8d40
Add construct test for known bad inplace string operations.
kayhayen/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,wfxiang08/Nuitka,wfxiang08/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka
tests/benchmarks/constructs/InplaceOperationStringAdd.py
tests/benchmarks/constructs/InplaceOperationStringAdd.py
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar where # it's copied from other people. In these cases, that will normally be # indicated. # # Li...
apache-2.0
Python
60880e780d611f32a3358bcae76f4eed22feb2d7
Create a module to add "Basic string search algorithms"
fleith/coding,fleith/coding,fleith/coding
string_search.py
string_search.py
'''String search algorithms''' _naive_iterations = 0 def naive_search(string, pattern): '''Naïve string search algorithm Pseudo code: string[1..n] and pattern[1..m] for i from 1 to n-m+1 for j from 1 to m if s[i+j-1] ≠ pattern[j] ...
unlicense
Python
28df83848a04e45059f4c672fde53f4f84dbd28d
Add module module_pubivisat.py
hannupekka/pyfibot-modules
module_pubivisat.py
module_pubivisat.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 from bs4 import BeautifulSoup def command_pubivisat(bot, user, channel, args): """Fetches todays pub quizzes for Tampere from pubivisat.fi""" url = "http://pubivisat.fi/tampere" f = urllib2.urlopen(url) d = f.read() f.close() bs = BeautifulSoup(d) d...
apache-2.0
Python
e5736370568adab1334f653c44dd060c06093fae
add basic twisted soap server.
martijnvermaat/rpclib,martijnvermaat/rpclib,martijnvermaat/rpclib,arskom/spyne,arskom/spyne,arskom/spyne
src/rpclib/test/interop/server/soap_http_basic_twisted.py
src/rpclib/test/interop/server/soap_http_basic_twisted.py
#!/usr/bin/env python # # rpclib - Copyright (C) Rpclib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ...
lgpl-2.1
Python
e83edea432f16ed6a2c9edcaa6da70c928d75eb5
Create module containing constants
khalim19/gimp-plugin-export-layers,khalim19/gimp-plugin-export-layers
export_layers/pygimplib/constants.py
export_layers/pygimplib/constants.py
# # This file is part of pygimplib. # # Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com> # # pygimplib is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
bsd-3-clause
Python
0421adb2eb391c57d02dfa0b1b14e3c620c53dfc
Create tarea7.py
JOSUEXLION/prog3-uip,JOSUEXLION/prog3-uip
tareas/tarea7.py
tareas/tarea7.py
#josue de leon # Tarea 7 #8-876-2357 '''1.Crear una aplicacion en Kivy que maneje un registro de asistencia. Basicamente la aplicacion debe contener una etiqueta que diga "Nombre: ", un campo para ingresar cadenas de texto, un boton que diga "Guardar" y otro botin que diga "Exportar". El botn para guardar agrega el...
mit
Python
b260040bc3ca48b4e76d73c6efe60b964fa5c108
Add test of removing unreachable terminals
PatrikValkovic/grammpy
tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py
tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:23 :Licence GNUv3 Part of grammpy-transforms """ from unittest import main, TestCase from grammpy import * from grammpy_transforms import * class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class D(Nonterminal):...
mit
Python
c82473efdeb7b1713f44370de761ec9022d02b5e
Add management command to fill and clear cache
akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr
akvo/rsr/management/commands/populate_project_directory_cache.py
akvo/rsr/management/commands/populate_project_directory_cache.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. """Popula...
agpl-3.0
Python
4e6f2ede0a8a9291befe262cbec77d3e7cd873b0
add new package (#26514)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/py-rsatoolbox/package.py
var/spack/repos/builtin/packages/py-rsatoolbox/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyRsatoolbox(PythonPackage): """Representational Similarity Analysis (RSA) in Python.""" ...
lgpl-2.1
Python
0ac0c81a3427f35447f52c1643229f5dbe607002
Add a merge migration and bring up to date
mfraezz/osf.io,erinspace/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,adlius/osf.io,erinspace/osf.io,cslzchen/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,icereval/osf.io,mfraezz/osf.io,icereval/osf.io,caseyrollins/osf.io,caseyrollins/osf.io,baylee-d/osf.io,HalcyonCh...
osf/migrations/0099_merge_20180426_0930.py
osf/migrations/0099_merge_20180426_0930.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-26 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0098_merge_20180416_1807'), ('osf', '0096_add_provider_doi_prefixes'), ] op...
apache-2.0
Python
2731aba68f86c0adcb26f4105c7418ffa35e3d09
add first auto-test
JonathonReinhart/bgrep,JonathonReinhart/bgrep
test/run_test.py
test/run_test.py
#!/usr/bin/env python import sys import os from subprocess import Popen, PIPE import re class TestFailure(Exception): pass def do_bgrep(pattern, paths, options=[], retcode=0): bgrep_path = '../bgrep' args = [bgrep_path] args += list(options) args.append(pattern.encode('hex')) args += list(pat...
apache-2.0
Python
d6315d28ed55b76f3caa3fff26141815f7da7dec
add migration
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0027_modify_video_url_help_text.py
accelerator/migrations/0027_modify_video_url_help_text.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.14 on 2018-12-05 16:27 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import embed_video.fields class Migration(migrations.Migration): dependencies = [ ('accelerator', '0026_startup_ackn...
mit
Python
d573d33cc37ad666d3a4f47a5ac9dfec5a9b5fc5
add app config
imndszy/voluntary,StarInworld/voluntary,StarInworld/voluntary,StarInworld/voluntary,imndszy/voluntary,imndszy/voluntary
app/appconfig.py
app/appconfig.py
# -*- coding:utf8 -*- # Author: shizhenyu96@gamil.com # github: https://github.com/imndszy HOST = "https://www.njuszy.cn/"
mit
Python
592145cf644262a21d9f5ac8850c1d59eeac83fe
bring over from other repo
toomanycats/IndeedScraper,toomanycats/IndeedScraper,toomanycats/IndeedScraper,toomanycats/IndeedScraper
GrammarParser.py
GrammarParser.py
''' https://gist.github.com/alexbowe/879414#file-nltk-intro-py-L34''' from nltk.corpus import stopwords import nltk stopwords = stopwords.words('english') lemmatizer = nltk.WordNetLemmatizer() stemmer_alt = nltk.stem.porter.PorterStemmer() # Used when tokenizing words sentence_re = r'''(?x) # set flag to allow v...
mit
Python
ffc32773953da2cf9e1d6e84aed1b53debc2c7c7
Create __init__.py
TylerKirby/cltk,kylepjohnson/cltk,D-K-E/cltk,diyclassics/cltk,cltk/cltk,LBenzahia/cltk,TylerKirby/cltk,LBenzahia/cltk
cltk/stem/middle_english/__init__.py
cltk/stem/middle_english/__init__.py
mit
Python
c7529927174b1626a0dc34f635b1d5939f565add
Add problem77.py
mjwestcott/projecteuler,mjwestcott/projecteuler,mjwestcott/projecteuler
euler_python/problem77.py
euler_python/problem77.py
""" problem77.py It is possible to write ten as the sum of primes in exactly five different ways: 7 + 3 5 + 5 5 + 3 + 2 3 + 3 + 2 + 2 2 + 2 + 2 + 2 + 2 What is the first value which can be written as the sum of primes in over five thousand different ways? """ from itertools import count, takewhi...
mit
Python
11cbc92e292a54b219f8b5ec64ae8ab58577362d
add standalone davidson test w/ near-degeneracies
jjgoings/McMurchie-Davidson
tests/test021.py
tests/test021.py
import numpy as np from mmd.utils.davidson import davidson def test_davidson(): np.random.seed(0) dim = 1000 A = np.diag(np.arange(dim,dtype=np.float64)) A[1:3,1:3] = 0 M = np.random.randn(dim,dim) M += M.T A += 1e-4*M roots = 5 E, C = davidson(A, roots) E_true, C_true = np....
bsd-3-clause
Python
781d43e48e83f00e4cd18e805efed7558b570adf
introduce btc select command
bittorrent/btc,kissiel/btc
btc/btc_select.py
btc/btc_select.py
import argparse import fnmatch import sys import os import re from .btc import encoder, decoder, error, ordered_dict _description = 'select some values' def main(): parser = argparse.ArgumentParser() parser.add_argument('keys', metavar='KEY', nargs='+', default=None, help='keys associa...
mit
Python
f947e6766c77f58a6cc1bd0d97758e43d6750c7f
add barycentric coordinates
compas-dev/compas
src/compas/geometry/interpolation/barycentric.py
src/compas/geometry/interpolation/barycentric.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division from compas.geometry import subtract_vectors from compas.geometry import dot_vectors __all__ = [ 'barycentric_coordinates' ] def barycentric_coordinates(point, triangle): """Compute the barycentric ...
mit
Python
ab946575b1050e67e2e6b4fdda237faa2dc342f5
add conversion script for BDDMPipeline
huggingface/diffusers
scripts/conversion_bddm.py
scripts/conversion_bddm.py
import argparse import torch from diffusers.pipelines.bddm import DiffWave, BDDMPipeline from diffusers import DDPMScheduler def convert_bddm_orginal(checkpoint_path, noise_scheduler_checkpoint_path, output_path): sd = torch.load(checkpoint_path, map_location="cpu")["model_state_dict"] noise_scheduler_sd = ...
apache-2.0
Python
922513b2e0e26432fd4e4addfe83e2b84d631d4f
Create change_function_signature.py
amorgun/python-trickery
change_function_signature.py
change_function_signature.py
def foo(a): print(a) def bar(a, b): print(a, b) func = foo func(10) func.__code__ = bar.__code__ func(10, 20)
mit
Python
a3b31137ac96bf3480aaecadd5faf3ca051fc4b0
Add bare ConnectionState
nullpixel/litecord,nullpixel/litecord
litecord/gateway/state.py
litecord/gateway/state.py
class ConnectionState: """State of a connection to the gateway over websockets Attributes ---------- session_id: str Session ID this state refers to. events: `collections.deque`[dict] Deque of sent events to the connection. Used for resuming This is filled up when the ...
mit
Python
83f2e11d63168e022d99075d2f35c6c813c4d37d
add a simple linear regression model
astromme/classify-handwritten-characters,astromme/classify-handwritten-characters
gnt_model.py
gnt_model.py
import tensorflow as tf from utils.gnt_record import read_and_decode, BATCH_SIZE with open('label_keys.list') as f: labels = f.readlines() tfrecords_filename = "hwdb1.1.tfrecords" filename_queue = tf.train.string_input_producer( [tfrecords_filename], num_epochs=10) # Even when reading in multiple threads, s...
mit
Python
15970841d53e14d3739d8f512f815e8e3c19bf02
Create Opcao.py
AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb
backend/Database/Models/Opcao.py
backend/Database/Models/Opcao.py
from Database.Controllers.Curso import Curso class Opcao(object): def __init__(self,dados=None): if dados is not None: self.id = dados ['id'] self.nome = dados ['nome'] self.id_curso = dados ['id_curso'] def getId(self): return self.id def setNome(self,nome): self.nome = nome def getNome(self...
mit
Python
3f50dcf6d91192253af320aaf72fcb13d307e137
add new package
iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/memsurfer/package.py
var/spack/repos/builtin/packages/memsurfer/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Memsurfer(PythonPackage): """MemSurfer is a tool to compute and analyze membrane surfaces...
lgpl-2.1
Python
76cfd2931f3aaacf37e39218833d2307233ddd04
Add tests for bson serialization functions
dwavesystems/dimod,dwavesystems/dimod
tests/test_serialization_bson.py
tests/test_serialization_bson.py
import unittest import dimod from dimod.serialization.bson import bqm_bson_decoder, bqm_bson_encoder import numpy as np try: import bson _bson_imported = True except ImportError: _bson_imported = False class TestBSONSerialization(unittest.TestCase): def test_empty_bqm(self): bqm = dimod.Bina...
apache-2.0
Python
b5db8d8b0620491169d54eaf05bb57e5a61903e1
add bash8 tool (like pep8, but way hackier)
openstack-dev/bashate,openstack-dev/bashate,locke105/bash8
bash8.py
bash8.py
#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
apache-2.0
Python
db4ba2ca4e0ea96c9bc3f7e9d3eb61e7c7c3bc23
Create softmax
ueser/Toolbox
softmax.py
softmax.py
#! /usr/bin/env python """ Author: Umut Eser Program: softmax.py Date: Friday, September 30 2016 Description: Softmax applied over rows of a matrix """ import numpy as np def softmax(X): """ Calculates softmax of the rows of a matrix X. Parameters ---------- X : 2D numpy array Return --...
mit
Python
28696b671a5f80f781c67f35ae5abb30efd6379c
Solve Time Conversion in python
deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr...
solutions/uri/1019/1019.py
solutions/uri/1019/1019.py
import sys h = 0 m = 0 for t in sys.stdin: t = int(t) if t >= 60 * 60: h = t // (60 * 60) t %= 60 * 60 if t >= 60: m = t // 60 t %= 60 print(f"{h}:{m}:{t}") h = 0 m = 0
mit
Python
9876f372100bbc4c272378fe9a06f7d7ddd90308
Add twitter daily backup script
dazzyd/bin,dazzyd/bin,yukixz/bin,dazzyd/bin,yukixz/bin
twitter/daily.py
twitter/daily.py
#!/usr/bin/env python3 import json from datetime import datetime import pymysql from requests_oauthlib import OAuth1Session class Twitter(): def __init__(self): self.session = OAuth1Session( client_key="{consumer_key}", client_secret="{consumer_secret}", resource_owne...
apache-2.0
Python
69005d995aa0e6d291216101253197c6b2d8260a
Add module for command-line interface
starcalibre/microscopium,jni/microscopium,microscopium/microscopium,microscopium/microscopium,Don86/microscopium,jni/microscopium,Don86/microscopium
husc/main.py
husc/main.py
import argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch.add_argument('quadrant_image', nargs=4, help="The images ...
bsd-3-clause
Python
10440cbcde68ecf16c8b8b326ec96d1d7f8c6d6d
add basic PID for sial position
smaria/autonomous-sailing-robot,Southampton-Maritime-Robotics/autonomous-sailing-robot
src/boat_pid_control/src/boat_pid_control/sailPID.py
src/boat_pid_control/src/boat_pid_control/sailPID.py
""" PID control for the sailing robot controling sail position based on goal sail direction Inputs: - current heading - goal heading Output: - Change in motor position/motor position TODO: consider tack and jibe """ import rospy PROPORTIONAL_GAIN = 0.1 INTEGRAL_GAIN = 0 DERIVATIVE_GAIN = 0 currentHeading = 23 ...
bsd-2-clause
Python
ea0087970b0c0adfd8942123899ff0ec231afa03
Handle stealable element with utils
AleksNeStu/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,selahsse...
test/selenium/src/lib/page/extended_info.py
test/selenium/src/lib/page/extended_info.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
apache-2.0
Python
1f47c575cfd310fd4bee18673f7cbb69eb622959
Create block_params.py
bluewitch/Code-Blue-Python
block_params.py
block_params.py
# block_params.py # Demonstration of a blockchain 2 of 3 components GENESIS_INDEX = 0 GENESIS_PREVIOUS_HASH = '0' GENESIS_TIMESTAMP = 1495851743 GENESIS_DATA = 'first block' class BlockParams(): def __init__(self, index, previous_hash, timestamp, data): self.index = index self.previous_hash = pr...
mit
Python
aa4f01690c4db950144e520cf11466d7d92de291
Fix for output ports
eubr-bigsea/tahiti,eubr-bigsea/tahiti,eubr-bigsea/tahiti,eubr-bigsea/tahiti
migrations/versions/910243d8f820_fix_output_ports_with_models.py
migrations/versions/910243d8f820_fix_output_ports_with_models.py
"""fix output ports with models Revision ID: 910243d8f820 Revises: 500f09c2325d Create Date: 2017-12-19 16:19:33.927563 """ import json from alembic import context from alembic import op from sqlalchemy import String, Integer from sqlalchemy.orm import sessionmaker from sqlalchemy.sql import table, column # revisio...
apache-2.0
Python
65dc2f12d8540d3aa494447033e022fe3995701b
correct language mistake
kissiel/btc,bittorrent/btc
btc_download.py
btc_download.py
#! /usr/bin/env python import argparse import sys import os from btc import encoder, decoder, error, warning, list_to_dict, dict_to_list, client _description = 'download torrent file locally' def main(): parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', default='.') parser.add_a...
#! /usr/bin/env python import argparse import sys import os from btc import encoder, decoder, error, warning, list_to_dict, dict_to_list, client _description = 'download torrent file locally' def main(): parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', default='.') parser.add_a...
mit
Python
7922b24882894cbc83bd4247c11d8c4a66b4b218
Add utility script for database setup
leaffan/pynhldb
_setup_database.py
_setup_database.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions if __name__ == '__main__': # migrating teams from json file to database migrate_teams(simulation=True) # creating divisions from division configuration file c...
mit
Python
af436dd269a959324b495885b9406610f3737a7a
Create addtoindex.py
wdyer0726/CS101
udacity/webcrawler/addtoindex.py
udacity/webcrawler/addtoindex.py
# Define a procedure, add_to_index, # that takes 3 inputs: # - an index: [[<keyword>,[<url>,...]],...] # - a keyword: String # - a url: String # If the keyword is already # in the index, add the url # to the list of urls associated # with that keyword. # If the keyword is not in the index, # add an entry to the inde...
apache-2.0
Python
93621f9441af4df77c8364050d7cc3dc2b1b43b2
Add tests for `check` command
igordejanovic/textX,igordejanovic/textX,igordejanovic/textX
tests/functional/registration/test_check.py
tests/functional/registration/test_check.py
""" Test check/validation command. """ import os import subprocess this_folder = os.path.abspath(os.path.dirname(__file__)) def test_check_metamodel(): """ Meta-model is also a model """ metamodel_file = os.path.join(this_folder, 'projects', 'flow_dsl', 'flow_dsl', ...
mit
Python
720e288aba61ecc2214c8074e33d181c0d4584f5
Add do_datasets module
CartoDB/cartodb-python,CartoDB/carto-python
carto/do_datasets.py
carto/do_datasets.py
""" Module for working with Data Observatory Datasets .. module:: carto.do_datasets :platform: Unix, Windows :synopsis: Module for working with Data Observatory Datasets .. moduleauthor:: Jesús Arroyo <jarroyo@carto.com> """ from pyrestcli.fields import CharField from .resources import Resource, Manager fro...
bsd-3-clause
Python
69939f351cd9c9d555fa1cd091b67314558e862b
Add __future__ import
lukw00/powerline,lukw00/powerline,magus424/powerline,Liangjianghao/powerline,wfscheper/powerline,darac/powerline,firebitsbr/powerline,magus424/powerline,Liangjianghao/powerline,Liangjianghao/powerline,seanfisk/powerline,xfumihiro/powerline,kenrachynski/powerline,junix/powerline,EricSB/powerline,s0undt3ch/powerline,Doct...
powerline/segments/tmux.py
powerline/segments/tmux.py
# vim:fileencoding=utf-8:noet from __future__ import absolute_import, unicode_literals, division, print_function from powerline.bindings.tmux import get_tmux_output def attached_clients(pl, minimum=1): '''Return the number of tmux clients attached to the currently active session :param int minimum: The minimum ...
# vim:fileencoding=utf-8:noet from powerline.bindings.tmux import get_tmux_output def attached_clients(pl, minimum=1): '''Return the number of tmux clients attached to the currently active session :param int minimum: The minimum number of attached clients that must be present for this segment to be visible. ...
mit
Python
6e8c3147938c72114b2fd18db47cca8a23fd147e
fix tests
SpringerPE/cf-configuration-exporter
test/mutations_test.py
test/mutations_test.py
import unittest from exporter.mutations import TerraformMutation, ManifestMutation from exporter.exceptions import FieldNotOptionalException cf_dict = { "cf_orgs":[{ "name": "first_org", "spaces": [ { "name": "first_space", "org": "first_org", "quota": "m", "allow_ssh": True, "asgs": [], "m...
mit
Python
ba76ae145c570fce671f0ab115d4a0740a29cde4
add hadoop
mihaisoloi/conpaas,mihaisoloi/conpaas,mihaisoloi/conpaas,mihaisoloi/conpaas,mihaisoloi/conpaas
conpaas-client/cps/hadoop.py
conpaas-client/cps/hadoop.py
import sys from cps.base import BaseClient class Client(BaseClient): def info(self, service_id): service = BaseClient.info(self, service_id) def usage(self, cmdname): BaseClient.usage(self, cmdname)
bsd-3-clause
Python
2476e7202933c197004688d32994d3b24a7ce74f
Add missing fulltoc for Sphinx documentation.
heuermh/adam,bigdatagenomics/adam,heuermh/adam,bigdatagenomics/adam,bigdatagenomics/adam,heuermh/adam,bigdatagenomics/adam,heuermh/adam
docs/vendor/sphinxcontrib/fulltoc.py
docs/vendor/sphinxcontrib/fulltoc.py
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.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 # # ...
apache-2.0
Python
0822547f3fcd79a5332c450d78cd24999e5e81d0
Migrate huts
c2corg/v6_api,c2corg/v6_api,c2corg/v6_api
c2corg_api/scripts/migration/documents/waypoints/huts.py
c2corg_api/scripts/migration/documents/waypoints/huts.py
from c2corg_api.scripts.migration.documents.waypoints.waypoint import \ MigrateWaypoints class MigrateHuts(MigrateWaypoints): def get_name(self): return 'huts' def get_count_query(self): return ( 'select count(*) from app_huts_archives;' ) def get_query(self): ...
agpl-3.0
Python
c994c1c86df7e6698ccef342b1b2101f03c01587
Add daily stats
hansjorg/rust-ci,hansjorg/rust-ci,youprofit/rust-ci-1,youprofit/rust-ci-1,youprofit/rust-ci-1,youprofit/rust-ci-1
tpt/ppatrigger/management/commands/dailystats.py
tpt/ppatrigger/management/commands/dailystats.py
import traceback import pytz from datetime import datetime, timedelta from django.core.management.base import BaseCommand from ppatrigger.models import Package from ppatrigger.models import DailyStats from ppatrigger.models import Build class Command(BaseCommand): args = '' help = 'Compile daily stats for all ...
apache-2.0
Python
7c2095c0330d14382db76bef944efae5f8d76faf
Add file with tests from rainbow categorical type example
cpcloud/dynd-python,insertinterestingnamehere/dynd-python,michaelpacer/dynd-python,izaid/dynd-python,insertinterestingnamehere/dynd-python,pombredanne/dynd-python,michaelpacer/dynd-python,pombredanne/dynd-python,michaelpacer/dynd-python,michaelpacer/dynd-python,izaid/dynd-python,insertinterestingnamehere/dynd-python,cp...
dynd/tests/test_types_categorical.py
dynd/tests/test_types_categorical.py
import sys import unittest from dynd import nd, ndt class TestDType(unittest.TestCase): def test_make_categorical(self): # Create categorical type with 256 values tp = ndt.make_categorical(nd.range(0, 512, 2)) self.assertEqual(tp.type_id, 'categorical') self.assertEqual(tp.storage_t...
bsd-2-clause
Python
9f73e60ba9d3775ef4dda9c815412f28ed80b518
Add new package: lzop (#17098)
LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/lzop/package.py
var/spack/repos/builtin/packages/lzop/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Lzop(CMakePackage): """lzop is a file compressor which is very similar to gzip. lzop uses ...
lgpl-2.1
Python
1f5158d7c24e304b1b2ed2c374cd05aa662aa333
Add LruCache object.
strinking/statbot,strinking/statbot
statbot/cache.py
statbot/cache.py
# # cache.py # # statbot - Store Discord records for later analysis # Copyright (c) 2017 Ammon Smith # # statbot is available free of charge under the terms of the MIT # License. You are free to redistribute and/or modify it under those # terms. It is distributed in the hopes that it will be useful, but # WITHOUT ANY W...
mit
Python
0eb573afa067e23422c5a5495563a6f4d87a549d
Create soundcloud.py
nortxort/tinybot
apis/soundcloud.py
apis/soundcloud.py
""" Contains functions to fetch info from api.soundcloud.com """ from utilities import web # Soundcloud API key. SOUNDCLOUD_API_KEY = '4ce43a6430270a1eea977ff8357a25a3' def soundcloud_search(search): """ Searches soundcloud's API for a given search term. :param search: str the search term to search for....
mit
Python
cc55fc564e84718710e1c29ca7e29be522aa70c5
Create OutputNeuronGroup_Liquid.py
ricardodeazambuja/BrianConnectUDP
examples/OutputNeuronGroup_Liquid.py
examples/OutputNeuronGroup_Liquid.py
''' Example of a spike receptor (only receives spikes) In this example spikes are received and processed creating a raster plot at the end of the simulation. ''' from brian import * import numpy from brian_multiprocess_udp import BrianConnectUDP # The main function with the NeuronGroup(s) and Synapse(s) must be na...
cc0-1.0
Python
5feef18ca3dda099f33568bf0f2b189fe297a3e0
add test function rosenbrock
albahnsen/pyea
pyea/functions/__init__.py
pyea/functions/__init__.py
#TODO: Add documentation import numpy as np def func_rosenbrock(pop, a=1, b=100): # http://en.wikipedia.org/wiki/Rosenbrock_function x = pop[:, 0] y = pop[:, 1] return (a - x)**2 + b * (y - x**2)**2 def print_func(func, **kwargs): from mpl_toolkits.mplot3d import Axes3D import matplotlib.py...
bsd-3-clause
Python
378bd7f4d647243a1e736f4dc0bfd0742d5f3d0b
Create Combinations.py
UmassJin/Leetcode
Array/Combinations.py
Array/Combinations.py
``` Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] ``` class Solution: # @return a list of lists of integers def combine(self, n, k): def combine_helper...
mit
Python
c042f640b1d841b6779cd69393b47ef65cfedfea
add problem 11
kulapard/projecteuler.net
python/problem_11.py
python/problem_11.py
# -*- coding: utf-8 -*- """ Largest product in a grid https://projecteuler.net/problem=11 """ GRID = """ 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56...
mit
Python
474c5f977ab5b035567f0107c457622c51189ac6
Add new topics migration file
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
csunplugged/topics/migrations/0086_auto_20171108_0840.py
csunplugged/topics/migrations/0086_auto_20171108_0840.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-08 08:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0085_auto_20171030_0035'), ] operations = [ migrations.AddField( ...
mit
Python
afe0f8fc731639cbe28798bb2a554c84ccbd8b2a
Create test_script.py
botlabio/autonomio,botlabio/autonomio
test_script.py
test_script.py
print "hello world"
mit
Python
a2bc05454ba166e3931fba130e44f49f66a79080
Add virtualshackles crawler
jodal/comics,jodal/comics,jodal/comics,datagutten/comics,klette/comics,datagutten/comics,datagutten/comics,datagutten/comics,klette/comics,jodal/comics,klette/comics
comics/comics/virtualshackles.py
comics/comics/virtualshackles.py
import re from comics.aggregator.crawler import CrawlerBase, CrawlerResult from comics.meta.base import MetaBase class Meta(MetaBase): name = 'Virtual Shackles' language = 'en' url = 'http://www.virtualshackles.com/' start_date = '2009-03-27' rights = 'Jeremy Vinar and Mike Fahmie' class Crawler(...
agpl-3.0
Python
c13014c18496f35c4c94f156a18d442d3859f73b
Add assembly testing module
thomasgibson/firedrake-hybridization
testing_ops.py
testing_ops.py
from __future__ import absolute_import, print_function, division from firedrake import * mesh = UnitSquareMesh(2, 2, quadrilateral=False) n = FacetNormal(mesh) degree = 1 V = FunctionSpace(mesh, "RT", degree) U = FunctionSpace(mesh, "DG", degree - 1) W = V * U u, p = TrialFunctions(W) v, q = TestFunctions(W) a = (...
mit
Python
71afe426a84789b65953ccd057014d17a11de859
Add a command to extend the generation_high from generation 1 to 2
mysociety/pombola,geoffkilpin/pombola,ken-muturi/pombola,geoffkilpin/pombola,geoffkilpin/pombola,hzj123/56th,geoffkilpin/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,ken-muturi/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,mysociety/pombola,mysociety/pombola,ken-mutu...
mzalendo/core/management/commands/core_extend_areas_to_generation_2.py
mzalendo/core/management/commands/core_extend_areas_to_generation_2.py
# The import of data into Kenyan MapIt had the constituencies in # generation 2, while all the other area types were in generation 1. # This is unfortunate since it makes it appear to later import scripts # that the district type disappeared between generation 1 and 3. # # This script just extends the generation_high t...
agpl-3.0
Python
17fddbb1df78420aaebb811785b8e99769b45fa9
Create keyradius.py
meaton00/class_project
bin/keyradius.py
bin/keyradius.py
import csv from numpy import sqrt # Midpoint for Key Bridge x1 = 38.902543 y1 = -77.069830 # Threshold marker x2 = 38.900122 y2 = -77.071176 radius_squared = (x2 - x1)**2 + (y2 - y1)**2 radius = sqrt(radius_squared) data_file = open("IncidentData_24OCT14.csv", "rU") data = csv.DictReader(data_file) results = []...
mit
Python
fbc92f8400d4565a86b81329053a1302ce21c2f8
Add English Unique Pupil Number (UPN)
arthurdejong/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,holvi/python-stdnum
stdnum/gb/upn.py
stdnum/gb/upn.py
# upn.py - functions for handling English UPNs # # Copyright (C) 2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your opt...
lgpl-2.1
Python
c27e97ea959a9863e57ce12b0afc5fa092562548
Create Character.py
jtrip/slackrun
Character.py
Character.py
import untangle class Character(object): def __init__(self, data): assert isinstance(data, dict) self.__dict__ = data def get_data(character): ''' :param character: String, character name :return: Dictionary, character data ''' path = 'tests\\' filepath = path + ch...
bsd-2-clause
Python
983d6b12db4050ff7d252e1717adbfe39add2f49
Add missing file
apache/incubator-allura,lym/allura-git,leotrubach/sourceforge-allura,apache/incubator-allura,leotrubach/sourceforge-allura,apache/allura,apache/allura,heiths/allura,heiths/allura,heiths/allura,lym/allura-git,apache/allura,heiths/allura,lym/allura-git,Bitergia/allura,leotrubach/sourceforge-allura,Bitergia/allura,apache/...
Allura/allura/lib/widgets/auth_widgets.py
Allura/allura/lib/widgets/auth_widgets.py
import ew as ew_core import ew.jinja2_ew as ew from ew.core import validator from pylons import request from formencode import Invalid from webob import exc from .forms import ForgeForm from allura.lib import plugin class LoginForm(ForgeForm): submit_text='Login' style='wide' class fields(ew_core.NameLi...
apache-2.0
Python
c349e8df72c09a98fe6b038c763c41008bef70a2
add migration for reimporting universities
hydroshare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare
hs_dictionary/migrations/0005_reimport_universities.py
hs_dictionary/migrations/0005_reimport_universities.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import csv import os from django.db import migrations, models from hs_dictionary.models import University def forwards(apps, schema_editor): University.objects.all().delete() with open(os.path.dirname(__file__) + "/world-universities.csv") as ...
bsd-3-clause
Python
d77e8df3fa913e7a60c1870e49a6b6197d7a9125
Add tests for zerver/views/realm_emoji.py.
zulip/zulip,dhcrzf/zulip,souravbadami/zulip,showell/zulip,brockwhittaker/zulip,rishig/zulip,blaze225/zulip,kou/zulip,Juanvulcano/zulip,dattatreya303/zulip,Jianchun1/zulip,krtkmj/zulip,arpith/zulip,jphilipsen05/zulip,synicalsyntax/zulip,hackerkid/zulip,dhcrzf/zulip,sonali0901/zulip,vikas-parashar/zulip,eeshangarg/zulip,...
zerver/tests/test_realm_emoji.py
zerver/tests/test_realm_emoji.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from zerver.lib.actions import get_realm, check_add_realm_emoji from zerver.lib.test_helpers import AuthedTestCase import ujson class RealmEmojiTest(AuthedTestCase): def test_list(self): self.login("iago@zulip.com") realm = get_realm(...
apache-2.0
Python
6cb66978e44d447fd210dd92de194659b5f33fb3
Add debug util for WORKSPACE.
googlecloudrobotics/core,googlecloudrobotics/core,googlecloudrobotics/core
bazel/debug_repository.bzl
bazel/debug_repository.bzl
"""Debug util for repository definitions.""" def debug_repository(repo, *fields): """debug_repository(repo) identifies which version of a repository has been defined in the WORKSPACE by printing some of its fields. Example: # at the bottom of the WORKSPACE file load("//bazel:debug_repository.bzl", "de...
apache-2.0
Python
316bef330c0770739e95f9c1108e07697655d27e
fix when multi python version bug
wufeifei/cobra,wufeifei/cobra,braveghz/cobra,wufeifei/cobra,braveghz/cobra,40huo/cobra,braveghz/cobra,wufeifei/cobra,braveghz/cobra,40huo/cobra,40huo/cobra,40huo/cobra,wufeifei/cobra,40huo/cobra,braveghz/cobra,wufeifei/cobra,braveghz/cobra,40huo/cobra
cobra/__version__.py
cobra/__version__.py
import sys import platform __title__ = 'cobra' __description__ = 'Code Security Audit' __url__ = 'https://github.com/wufeifei/cobra' __issue_page__ = 'https://github.com/wufeifei/cobra/issues/new' __python_version__ = sys.version.split()[0] __platform__ = platform.platform() __version__ = '2.0.0-alpha' __author__ = 'F...
import sys import platform __title__ = 'cobra' __description__ = 'Code Security Audit' __url__ = 'https://github.com/wufeifei/cobra' __issue_page__ = 'https://github.com/wufeifei/cobra/issues/new' __python_version__ = sys.version.split()[0] __platform__ = platform.platform() __version__ = '2.0.0-alpha' __author__ = 'F...
mit
Python
b67041367fcc10da7879c123ab44671f258ef649
support script in python for bootstrapping erlang on a new erts
ericbmerritt/sinan,erlware-deprecated/sinan,ericbmerritt/sinan,ericbmerritt/sinan,erlware-deprecated/sinan,erlware-deprecated/sinan
support/build.py
support/build.py
#! /bin/python """Support for building sinan, bootstraping it on a new version of erlang""" import sys import os import commands from optparse import OptionParser class BuildError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) ERTS_VERSI...
mit
Python
1483b352683ecf126e1063c3a6fa2f07dcdb7720
add new module.wq
cellnopt/cellnopt,cellnopt/cellnopt
cno/core/gtt.py
cno/core/gtt.py
import numpy as np import pylab import pandas as pd from biokit.rtools import RSession from cno.core import CNORBase from easydev import TempFile __all__ = ['GTTBool'] class GTTBool(CNORBase): """ :: from cno import * c = cnorbool.CNORbool(cnodata("PKN-ToyMMB.sif"), cnodata("MD-ToyMMB.csv")...
bsd-2-clause
Python
e307bf72a8aa21088d491c90efd9a731014e63f1
move states into separate file
State/stacks,cfstacks/stacks
stacks/states.py
stacks/states.py
FAILED_STACK_STATES = [ 'CREATE_FAILED', 'ROLLBACK_FAILED', 'DELETE_FAILED', 'UPDATE_ROLLBACK_FAILED' ] COMPLETE_STACK_STATES = [ 'CREATE_COMPLETE', 'UPDATE_COMPLETE', ] ROLLBACK_STACK_STATES = [ 'ROLLBACK_COMPLETE', 'UPDATE_ROLLBACK_COMPLETE', ] IN_PROGRESS_STACK_STATES = [ 'CREATE_...
mit
Python
13dfb4f7d4972edbc7ccc0e4f62ea3db1a5b16f4
Add ctx module
mindriot101/srw
srw/ctx.py
srw/ctx.py
def wd2jd(wd): jd_ref = 2453005.5 return (wd / 86400.) + jd_ref
mit
Python
19acf7ad2a14b71f672d02cb8cb47a4393665bc7
Add benchmarks
sgillies/geometry-collections
bin/serialize.py
bin/serialize.py
"""Timing serializtion of deeply nested geometry collections. To and from JSON using dumps and loads from Python's json module. I'm happy to report that writing such GeoJSON geometry collections is more expensive than parsing them and, at least for Python, deeply nested geometry collections aren't an asymmetric attack...
mit
Python
7c9b97a81d4c8e41ce81cc881d30323dfb1f9c72
Add layer normalization
ronekko/chainer,wkentaro/chainer,wkentaro/chainer,anaruse/chainer,jnishi/chainer,chainer/chainer,tkerola/chainer,hvy/chainer,cupy/cupy,kashif/chainer,niboshi/chainer,ktnyt/chainer,ktnyt/chainer,chainer/chainer,wkentaro/chainer,rezoo/chainer,ysekky/chainer,jnishi/chainer,ktnyt/chainer,okuta/chainer,okuta/chainer,pfnet/c...
chainer/links/normalization/layer_normalization.py
chainer/links/normalization/layer_normalization.py
from chainer import functions from chainer import initializers from chainer import link from chainer import links class LayerNormalization(link.Chain): """Layer normalization layer on outputs of linear functions. This is a link of "Layer Normalization". This layer normalizes, scales and shifts input uni...
mit
Python
b88b97c7d56506804fc9eb93ce7074454fc492f3
Add the migration for designations.
hello-base/web,hello-base/web,hello-base/web,hello-base/web
base/apps/people/migrations/0002_auto_20141223_0316.py
base/apps/people/migrations/0002_auto_20141223_0316.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('people', '0001_initial'), ] operations = [ migrations.CreateModel( name='Designation', fields=[ ...
apache-2.0
Python
f3dbe9bb2aa627b3485c2ed44f889a1bc5463081
Bump to version 3.1.3
delinhabit/django-rest-framework,callorico/django-rest-framework,ajaali/django-rest-framework,wangpanjun/django-rest-framework,antonyc/django-rest-framework,kylefox/django-rest-framework,sbellem/django-rest-framework,kennydude/django-rest-framework,thedrow/django-rest-framework-1,wzbozon/django-rest-framework,Alexandre...
rest_framework/__init__.py
rest_framework/__init__.py
""" ______ _____ _____ _____ __ | ___ \ ___/ ___|_ _| / _| | | | |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__ | /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / | |\ \| |___/\__/ / | | | | | | | (_| | | | ...
""" ______ _____ _____ _____ __ | ___ \ ___/ ___|_ _| / _| | | | |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__ | /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / | |\ \| |___/\__/ / | | | | | | | (_| | | | ...
bsd-2-clause
Python