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 |
|---|---|---|---|---|---|---|---|---|
be530dc2e18ccbeeb3e4396f47d2a527364e6ab1 | Add migration for ADS.added_via | openmaraude/APITaxi,openmaraude/APITaxi | migrations/versions/f8c0bde5d368_match_sqlalchemy_defintion_and_actual_.py | migrations/versions/f8c0bde5d368_match_sqlalchemy_defintion_and_actual_.py | """Match sqlalchemy defintion and actual schema
Revision ID: f8c0bde5d368
Revises: ae904ac154cf
Create Date: 2019-11-19 11:24:40.555110
"""
# revision identifiers, used by Alembic.
revision = 'f8c0bde5d368'
down_revision = 'ae904ac154cf'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import... | agpl-3.0 | Python | |
50415300e3ce1e7cc10782aa4661da14d900d6de | Add code generation tests | opesci/devito,opesci/devito | benchmarks/regression/benchmarks/codegen.py | benchmarks/regression/benchmarks/codegen.py | from examples.seismic.tti.tti_example import tti_setup
repeat = 3
class TTI(object):
space_order = 12
def setup(self):
self.solver = tti_setup(space_order=TTI.space_order)
def time_forward(self):
self.solver.op_fwd()
def time_adjoint(self):
self.solver.op_adj()
| mit | Python | |
5dd3424e9d95c12c2fb4c770f527b85b928da705 | create a separate module for decoration/coloring | jeffersonmourak/pyTerm,jeffersonmourak/pyTerm,usmanayubsh/pyTerm,usmanayubsh/pyTerm | decorate.py | decorate.py | class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m' | mit | Python | |
89d08498f7f7e12fa5486eb88f64829621aa27f9 | Add missing migration | opennode/nodeconductor-saltstack | src/nodeconductor_saltstack/saltstack/migrations/0005_label_change.py | src/nodeconductor_saltstack/saltstack/migrations/0005_label_change.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('saltstack', '0004_remove_spl_state'),
]
operations = [
migrations.AlterModelOptions(
name='saltstackservice',
... | mit | Python | |
8cde7867eb98cc56533ab0156768ad2409e8c65e | Fix bug | madflow/seahub,Chilledheart/seahub,Chilledheart/seahub,Chilledheart/seahub,cloudcopy/seahub,cloudcopy/seahub,cloudcopy/seahub,madflow/seahub,miurahr/seahub,madflow/seahub,madflow/seahub,madflow/seahub,miurahr/seahub,Chilledheart/seahub,cloudcopy/seahub,Chilledheart/seahub,miurahr/seahub,miurahr/seahub | user_notification.py | user_notification.py | #!/usr/bin/python
# encoding: utf-8
from datetime import datetime
import string
from django.core.mail import send_mail
from notifications.models import UserNotification
import settings
email_template = u'''${username}您好:
您有${cnt}条新消息,请点击下面的链接查看:
${msg_url}
感谢使用我们的网站!
${site_name}团队
'''
today = datetime.now()
sit... | #!/usr/bin/python
# encoding: utf-8
from datetime import datetime
import string
from django.core.mail import send_mail
from notifications.models import UserNotification
import settings
email_template = u'''${username}您好:
您有${cnt}条新消息,请点击下面的链接查看:
${msg_url}
感谢使用我们的网站!
${site_name}团队
'''
today = datetime.now()
sit... | apache-2.0 | Python |
6d8fb7d052dc7341ecd9fb3388b804b82f77fa0f | add example usage | pennlabs/penncoursereview-sdk-python | examples/scores.py | examples/scores.py | """Get a list of average scores for each professor in a department."""
import sys
from collections import defaultdict
import penncoursereview as pcr
def prof_scores(dept):
professor_scores = defaultdict(list)
dept = pcr.Department(dept)
for review in dept.reviews.values:
instructor = review.instr... | mit | Python | |
7dbc289897ecf35f0b709177ac3feacffd8691ca | add a test file | pypot/ek_book | ch_04/testfile.py | ch_04/testfile.py | #this is a test file for eclipse | mit | Python | |
50194e14a75c3300996f64c415a8593b1243af9f | Add api_helper for testing | j0gurt/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,vladan-m/ggrc-core,plamut/ggrc-core,uskudnik/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,uskudnik/ggrc-core,jmakov/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,hasanalom/ggrc-core,NejcZupec/ggrc-core,hyperNURb/ggrc-core,j0gurt/gg... | src/tests/ggrc/api_helper.py | src/tests/ggrc/api_helper.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: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from ggrc.app import app
from ggrc.services.common import Resource
from ggrc imp... | apache-2.0 | Python | |
2b1b1e1d5db7edf4350239b712d2e872e7769d84 | add problem 24 | branning/euler,branning/euler | euler024.py | euler024.py | #!/usr/bin/env python
def nextperm(s):
'''
http://en.wikipedia.org/wiki/Permutation#Generation_in_lexicographic_order
'''
k = None
for i in range(len(s)-1):
if s[i] < s[i+1]:
k = i
if k is None:
# sequence in descending order, last permutation
return None
l = None
for i in range(k+1, ... | mit | Python | |
03279bbc6193d3944dcd2542daa65701a1e0eded | Add solution for problem 26 | cifvts/PyEuler | euler026.py | euler026.py | #!/usr/bin/python
"""
For resolve this, we have to find the maximum
Full Reptend Prime int he given limit. To do that, we need
to check if the 10 is a primitive root of p.
See http://mathworld.wolfram.com/FullReptendPrime.html for details
"""
from sys import exit
for p in range(999, 7, -2):
for k in range(1, p)... | mit | Python | |
8373611a9c5b035953aee208bc65f4be92890314 | add the conversion script | idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven,joshua-cogliati-inl/raven,idaholab/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,idaholab/raven,joshua-cogliati-inl/raven,idaholab/raven,joshua-cogliati-inl/raven | scripts/conversionScripts/toTransformationNode.py | scripts/conversionScripts/toTransformationNode.py | import xml.etree.ElementTree as ET
import xml.dom.minidom as pxml
import os
def convert(tree,fileName=None):
"""
Converts input files to be compatible with merge request ....
change the attribute of node <variablesTransformation> from 'model' to 'distribution'
@ In, tree, xml.etree.ElementTree.ElementTre... | apache-2.0 | Python | |
55a35c642b64a6bdb8314b9470c1f7fedb16478f | print results | annarev/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,gautam1858/tensorflow,renyi533/tensorflow,renyi533/tensorflow,petewarden/tensorflow,gunan/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,gunan/tensorflow,paolodedios/tensorflow,gunan/tensorflow,xzturn/tensorflow,gautam1... | tensorflow/python/keras/utils/np_utils.py | tensorflow/python/keras/utils/np_utils.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | Python |
ae972cd7fe6856a1265981810ea1d03fc5efcf54 | write test for django admin | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | tests/organisations/test_admin.py | tests/organisations/test_admin.py | import pytest
from django.urls import reverse
@pytest.mark.django_db
def test_organisation_admin_form(client, organisation,
admin, user_factory,
group_factory):
client.login(username=admin, password='password')
url = reverse('admin:meinberlin_... | agpl-3.0 | Python | |
cce3b017f36de8fb8682971e13201c0143c524cf | add indexes to make deleting faster | openstack/aeromancer,stackforge/aeromancer,dhellmann/aeromancer | aeromancer/db/alembic/versions/a3d002d161a_add_indexes.py | aeromancer/db/alembic/versions/a3d002d161a_add_indexes.py | """add indexes
Revision ID: a3d002d161a
Revises: 22e0aa22ab8e
Create Date: 2014-11-24 14:24:29.824147
"""
# revision identifiers, used by Alembic.
revision = 'a3d002d161a'
down_revision = '22e0aa22ab8e'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_index('file_project_idx', 'file', [... | apache-2.0 | Python | |
234c03381209d860d7b6ff29263f927736822c1e | Add shellFlags.py (not yet integrated) | nth10sd/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,MozillaSecurity/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz | js/shellFlags.py | js/shellFlags.py | import random
import os
import subprocess
def memoize(f, cache={}):
'''Function decorator that caches function results.'''
# From http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/#c9
def g(*args, **kwargs):
key = ( f, tuple(args), frozenset(kwargs.items()) )
if key n... | mpl-2.0 | Python | |
61c2823b5da460001ca02db6b028fc770d204e32 | Add initial test case | tobbez/lys-reader | api_tests.py | api_tests.py | from flask import Flask, g
import unittest
import json
from simplekv.fs import FilesystemStore
from flaskext.kvsession import KVSessionExtension
from api import app, db
from common.database import Database
class APITest(unittest.TestCase):
def setUp(self):
global db
store = FilesystemStore('sessi... | isc | Python | |
72db299a3974b05f511420da5e5861f3bead0065 | Create solution_1.py | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | problem301/Python/solution_1.py | problem301/Python/solution_1.py | #!/usr/bin/env python
# coding=utf-8
def nim():
binary_map = [0,1]
total = 3
for k in range(28):
binary_map_new = []
for i in range(0, len(binary_map), 2):
if binary_map[i:i+2] == [0,0]:
binary_map_new.extend([0,0,0,1])
total += 3
elif ... | mit | Python | |
53bf5c12b77e19d54e3ab50ade8840843cca9649 | add sql group_by unit tests | machow/siuba | siuba/tests/test_verb_group_by.py | siuba/tests/test_verb_group_by.py | """
Note: this test file was heavily influenced by its dbplyr counterpart.
https://github.com/tidyverse/dbplyr/blob/master/tests/testthat/test-verb-group_by.R
"""
from siuba import _, group_by, ungroup, summarize
from siuba.dply.vector import row_number, n
import pytest
from .helpers import assert_equal_query, d... | mit | Python | |
c0d0496eb2675ba2dbd5dbaa9d4b4c701409308f | Allow IHaskellPrelude.hs to not be formatting checked | wyager/IHaskell,kfiz/IHaskell,kfiz/IHaskell,franklx/IHaskell,qzchenwl/IHaskell,wyager/IHaskell,wyager/IHaskell,gibiansky/IHaskell,franklx/IHaskell,beni55/IHaskell,gibiansky/IHaskell,sumitsahrawat/IHaskell,thomasjm/IHaskell,qzchenwl/IHaskell,artuuge/IHaskell,sumitsahrawat/IHaskell,artuuge/IHaskell,wyager/IHaskell,Frankl... | verify_formatting.py | verify_formatting.py | #!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import subprocess
def hindent(contents):
with open(".tmp3", "w") as f:
f.write(contents)
with open(".tmp3", "r") as f:
output = subprocess.check_output(["hindent", "--style", "gibiansky"],
... | #!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import subprocess
def hindent(contents):
with open(".tmp3", "w") as f:
f.write(contents)
with open(".tmp3", "r") as f:
output = subprocess.check_output(["hindent", "--style", "gibiansky"],
... | mit | Python |
930a8b1a7c980183df5469627a734033ca39a444 | Add functional tests for create_image | openstack-infra/shade,jsmartin/shade,dtroyer/python-openstacksdk,openstack/python-openstacksdk,stackforge/python-openstacksdk,openstack-infra/shade,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,jsmartin/shade,openstack/python-openstacksdk | shade/tests/functional/test_image.py | shade/tests/functional/test_image.py | # -*- coding: utf-8 -*-
# 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, softw... | apache-2.0 | Python | |
59ef02377c41041fd8010231f2c86d1aba072c0f | Complete recur sol | bowen0701/algorithms_data_structures | lc0105_construct_binary_tree_from_preorder_and_inorder_traversal.py | lc0105_construct_binary_tree_from_preorder_and_inorder_traversal.py | """Leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
Medium
URL: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
Given preorder and inorder traversal of a tree, construct the binary tree.
Note: You may assume that duplicates do not exist in the tree.
Fo... | bsd-2-clause | Python | |
9c045f7667e1bdc6c9137c3877292907f4623774 | Add a management command to check if URNs are present in the database | ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas | make_a_plea/management/commands/check_urns_in_db.py | make_a_plea/management/commands/check_urns_in_db.py | import csv
from django.core.management.base import BaseCommand
from apps.plea.models import DataValidation, Case
from apps.plea.standardisers import standardise_urn, format_for_region
class Command(BaseCommand):
help = "Build weekly aggregate stats"
def add_arguments(self, parser):
parser.add_argum... | mit | Python | |
4759cf1b058d1a1b5999882a8b44f84ad89a8a9a | Add tests file | saeschdivara/ArangoPy,saeschdivara/ArangoPy | arangodb/tests.py | arangodb/tests.py | # -*- coding: utf-8 -*-
| mit | Python | |
64b572a4e1e8359d781591e22439fb432c5860b6 | Create click_location.py | li8bot/OpenCV,li8bot/OpenCV | click_location.py | click_location.py | from PIL import Image
from pylab import *
im = array(Image.open('img.jpg'))
show()
while(1):
imshow(im)
print "Please click 3 points"
x = ginput(1)
print 'you clicked:',x
| mit | Python | |
607a73317e0497ee206bf8381f7cfa9fe46a1609 | add xml-row-to-vector script | AlexLamson/safebooru-predict | src/4_train_models/vectorize_data.py | src/4_train_models/vectorize_data.py | #!/usr/bin/python3
from bs4 import BeautifulSoup
from tqdm import tqdm
import numpy as np
import pickle
#http://stackoverflow.com/a/27518377/2230446
def get_num_lines(filename):
f = open(filename, "rb")
num_lines = 0
buf_size = 1024 * 1024
read_f = f.raw.read
buf = read_f(buf_size)
while buf:
... | mit | Python | |
d6e9971ceefc69f0eefc7440cc5e7035e7dcc05d | Add the middleware for reporting errors to gcloud. | fle-internal/content-curation,jonboiser/content-curation,jonboiser/content-curation,jayoshih/content-curation,aronasorman/content-curation,jayoshih/content-curation,fle-internal/content-curation,aronasorman/content-curation,jayoshih/content-curation,DXCanas/content-curation,jonboiser/content-curation,fle-internal/conte... | contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py | contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py | from google.cloud import error_reporting
class ErrorReportingMiddleware(object):
def __init__(self, *args, **kwargs):
self.client = error_reporting.Client()
def process_exception(self, request, exception):
self.client.report_exception()
| mit | Python | |
e3ab7c126f808864f0458b52f36518e485f546ca | Add a session class to help tie everything together in a convenient way. | 4degrees/harmony | source/harmony/session.py | source/harmony/session.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import os
from harmony.schema.collection import Collection
from harmony.schema.collector import FilesystemCollector
from harmony.schema.processor import MixinProcessor, ValidateProcessor
from harmony.schema.validat... | apache-2.0 | Python | |
c240f7bcd94b2fe6ead8568f6f6f5a69c1853b3a | Add a shelve/unshelve scenario | yamt/tempest,afaheem88/tempest,afaheem88/tempest_neutron,dkalashnik/tempest,nunogt/tempest,pandeyop/tempest,rzarzynski/tempest,vedujoshi/tempest,Vaidyanath/tempest,cisco-openstack/tempest,rakeshmi/tempest,hpcloud-mon/tempest,manasi24/jiocloud-tempest-qatempest,neerja28/Tempest,Vaidyanath/tempest,roopali8/tempest,tudorv... | tempest/scenario/test_shelve_instance.py | tempest/scenario/test_shelve_instance.py | # Copyright 2014 Scality
# 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 appli... | apache-2.0 | Python | |
c2036cd7629b93bfc12069eaf174f2427d47e769 | add another test | somic/paasta,Yelp/paasta,somic/paasta,Yelp/paasta | tests/monitoring/test_check_mesos_duplicate_frameworks.py | tests/monitoring/test_check_mesos_duplicate_frameworks.py | # Copyright 2015-2016 Yelp 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 writin... | apache-2.0 | Python | |
0b81997dd12f775fc9f814c19fb62ef35bde998e | Add ceres library | tuttleofx/sconsProject | autoconf/ceres.py | autoconf/ceres.py | from _external import *
from pthread import *
from amd import *
from gomp import *
from lapack import *
from suitesparse import *
from glog import *
ceres = LibWithHeaderChecker('ceres', 'ceres/ceres.h', 'c++', name='ceres', dependencies = [gomp,lapack,suitesparse,amd,pthread,glog],)
| mit | Python | |
681f73490fd7d333883134a417477492744ce22a | Add project permissions | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/project/permissions.py | src/python/expedient/clearinghouse/project/permissions.py | '''
Created on Aug 3, 2010
@author: jnaous
'''
from expedient.common.permissions.shortcuts import create_permission
from expedient.clearinghouse.permissionmgmt.utils import \
request_permission_wrapper
create_permission(
"can_create_project",
description=\
"Owners of this permission can create pro... | bsd-3-clause | Python | |
bd9fce88c235ea6be032a1d15a31bf41df14a444 | Fix missing migration | nephila/djangocms-blog,nephila/djangocms-blog,skirsdeda/djangocms-blog,skirsdeda/djangocms-blog,nephila/djangocms-blog,skirsdeda/djangocms-blog | djangocms_blog/migrations/0033_auto_20180226_1410.py | djangocms_blog/migrations/0033_auto_20180226_1410.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangocms_blog', '0032_auto_20180109_0023'),
]
operations = [
migrations.AlterField(
model_name='blogcategorytra... | bsd-3-clause | Python | |
7a0bbdb2395ca1e8579e0f2cc6ccd43807c51161 | Create 6kyu_alpha_to_numeric_and_numeric_to_alpha.py | Orange9000/Codewars,Orange9000/Codewars | Solutions/6kyu/6kyu_alpha_to_numeric_and_numeric_to_alpha.py | Solutions/6kyu/6kyu_alpha_to_numeric_and_numeric_to_alpha.py | import re
def AlphaNum_NumAlpha(string):
return ''.join(swap(s) for s in re.findall('\d{1,2}|[a-z]', string))
def swap(s):
return chr(int(s)+96) if s.isdigit() else str(ord(s)-96)
| mit | Python | |
20c51dbcd2d90bfa234efa5027254a4915995edd | add nmap_hosts migration | asrozar/perception | alembic/versions/13b7c3d4c802_create_nmap_hosts_table.py | alembic/versions/13b7c3d4c802_create_nmap_hosts_table.py | """create nmap_hosts table
Revision ID: 13b7c3d4c802
Revises: ecd5f49567a6
Create Date: 2017-07-21 08:19:17.849112
"""
from sqlalchemy.dialects import postgresql
from alembic import op
import sqlalchemy as sa
import datetime
def _get_date():
return datetime.datetime.now()
# revision identifiers, used by Alembi... | mit | Python | |
941985a561d0bdce1a8aba2e57fc60f90b6164fb | Add jrun main module so "python jrun" works | ctrueden/jrun,ctrueden/jrun | jrun/__main__.py | jrun/__main__.py | import jrun
if __name__ == '__main__':
jrun.jrun_main()
| unlicense | Python | |
b27b3089f393a84c3d004e8d89be43165862be1d | add match matrix | tingyuchang/my-algorithm | matrix_match.py | matrix_match.py | import random
w1 = int(raw_input(">>> w1: "))
h1 = int(raw_input(">>> h1: "))
w2 = int(raw_input(">>> w2: "))
h2 = int(raw_input(">>> h2: "))
r1 = int(raw_input(">>> r1: "))
r2 = int(raw_input(">>> r2: "))
# w1 = 20
# h1 = 20
# w2 = 3
# h2 = 3
matrix = [[random.randint(r1, r2) for x in range(w1)] for x in range(h1)... | mit | Python | |
40f92e6293bb13ee1462b932be15f5f11ceeee74 | Add initial implementation of TempType. | Renelvon/llama,Renelvon/llama | compiler/infer.py | compiler/infer.py | """
# ----------------------------------------------------------------------
# infer.py
#
# Type inference for Llama
# http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf
#
# Authors: Nick Korasidis <renelvon@gmail.com>
# Dimitris Koutsoukos <dim.kou.shmmy@gmail.com>
# --------------------------------... | mit | Python | |
a2e27feff324d5aed7220a520df651f688cd1829 | Add migration | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/assignments/migrations/0002_auto_20190529_1755.py | bluebottle/assignments/migrations/0002_auto_20190529_1755.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-05-29 15:45
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('assignments', '0001_initial'),
]
operations = [
migrations.RenameField(
... | bsd-3-clause | Python | |
9ca926d052edc754ca3b6f3663b1c00887b2965a | add migration with blank projects.Tag | brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc | brasilcomvc/projects/migrations/0004_tag_may_be_blank.py | brasilcomvc/projects/migrations/0004_tag_may_be_blank.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0003_project_tags'),
]
operations = [
migrations.AlterField(
model_name='project',
name=... | apache-2.0 | Python | |
77ce1e2606132a5a04bc8c1b86c14f6f590e458d | test script added for assessment_lookups | gnowledge/gstudio,gnowledge/gstudio,gnowledge/gstudio,gnowledge/gstudio,gnowledge/gstudio | doc/dlkit-gstudio-impl/assessment_lookup.py | doc/dlkit-gstudio-impl/assessment_lookup.py | from dlkit_runtime import PROXY_SESSION, RUNTIME
from dlkit_gstudio.gstudio_user_proxy import GStudioRequest
req_obj = GStudioRequest(id=1)
condition = PROXY_SESSION.get_proxy_condition()
condition.set_http_request(req_obj)
proxy = PROXY_SESSION.get_proxy(condition)
assessment_service_mgr = RUNTIME.get_service_manager(... | agpl-3.0 | Python | |
a6d3ae8b27f6e97e7e5b4388a20836f25953c26d | Add example config file | mgunyho/kiltiskahvi | config-example.py | config-example.py | """
Minimal config file for kahvibot. Just define values as normal Python code.
"""
# put your bot token here as a string
bot_token = ""
# the tg username of the bot's admin.
admin_username = ""
# if a message contains any of these words, the bot responds
trigger_words = [
"kahvi",
"\u2615", # coffee emoji
... | mit | Python | |
bcda14f8258daaf3475dd9d3ca3eb7b25aa0496c | Add py-voluptuous (#13457) | LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/py-voluptuous/package.py | var/spack/repos/builtin/packages/py-voluptuous/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 PyVoluptuous(PythonPackage):
"""Voluptous, despite the name, is a Python data validation l... | lgpl-2.1 | Python | |
93000ab88c489f720d0f7e6a8921dc69342d61f1 | Add migration | OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/PolicyBrain | webapp/apps/dynamic/migrations/0012_auto_20160616_1908.py | webapp/apps/dynamic/migrations/0012_auto_20160616_1908.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('dynamic', '0011_auto_20160614_1902'),
]
operations = [
migrations.RenameField(
model_name='dynamicbehaviorsavein... | mit | Python | |
662ad845a0ce729d8d8b72121a4c7c6f22e3eaa2 | support for phonetic similarity added | anoopkunchukuttan/indic_nlp_library | src/indicnlp/script/phonetic_sim.py | src/indicnlp/script/phonetic_sim.py | # Copyright Anoop Kunchukuttan 2014 - present
#
# This file is part of Indic NLP Library.
#
# Indic NLP Library 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 o... | mit | Python | |
30ea7b5c77acc0af8826e3aef6155f9d329ed419 | Create getCpuUsage2.py | david618/dcosadmin,david618/dcosadmin | mesosmetrics/getCpuUsage2.py | mesosmetrics/getCpuUsage2.py | import urllib
import json
import time
import sys
if __name__ == '__main__':
agent=sys.argv[1]
url = "http://" + agent + ":5051/monitor/statistics"
executors = {}
response = urllib.urlopen(url)
data = json.loads(response.read())
for itm in data:
executor = {}
id = itm["executor_id"]
executor["name"... | apache-2.0 | Python | |
93a41a7d406e5f7c264865d96c0f85b1181e5cb0 | add basic test | yuyu2172/chainercv,chainer/chainercv,pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv | tests/utils_tests/extension_tests/test_forward.py | tests/utils_tests/extension_tests/test_forward.py | import mock
import numpy as np
import unittest
import chainer
from chainer import testing
from chainercv.utils import forward
@testing.parameterize(*testing.product({
'in_shapes': [((3, 4),), ((3, 4), (5,))],
'out_shapes': [((3, 4),), ((3, 4), (5,))],
'variable': [True, False],
}))
class TestForward(uni... | mit | Python | |
4802b8fe149ed72303bbb0f1f924275dbc004b5a | Use the handy interruptible pool from emcee | e-koch/TurbuStat,Astroua/TurbuStat | Examples/interruptible_pool.py | Examples/interruptible_pool.py | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2010-2013 Daniel Foreman-Mackey & contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including wit... | mit | Python | |
133da92ed69aafc6c0a8d4466cf3b0266c5edc68 | Add migration for change in profile model. | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | userprofile/migrations/0006_auto_20180309_2215.py | userprofile/migrations/0006_auto_20180309_2215.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-03-09 22:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0005_auto_20171121_1923'),
]
operations = [
migrations.AlterFi... | mit | Python | |
4bce7685c39e7efbb674407184d0bf436cbdaec0 | Create ftxproxy.py | puluto/ftxproxy | ftxproxy.py | ftxproxy.py | #!/usr/bin/python
# This is a simple port-forward / proxy, written using only the default python
# library. If you want to make a suggestion or fix something you can contact-me
# at voorloop_at_gmail.com
# Distributed over IDC(I Don't Care) license
import socket
import select
import time
import sys
# Changing the buff... | bsd-2-clause | Python | |
350f7056e895dd8ddee756779ae50522f099f998 | Add tests for the oauth2 decorators | lorenzogil/yith-library-server,lorenzogil/yith-library-server,lorenzogil/yith-library-server | yithlibraryserver/oauth2/tests/test_decorators.py | yithlibraryserver/oauth2/tests/test_decorators.py | # Yith Library Server is a password storage server.
# Copyright (C) 2014 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | agpl-3.0 | Python | |
f93ae9f59dcbb834b93fa3a57d89d84c4520baa0 | Create collector.py | aiskov/cdn-collector | collector.py | collector.py | import os
from subprocess import Popen, PIPE
import tarfile
import json
import shutil
import re
def move(file, origin, destination):
if not file:
return
if not isinstance(file, basestring):
for entry in file:
move(entry, origin, destination)
return
destination_path =... | apache-2.0 | Python | |
0f1475eddf3f9237a1f746784b090a4f65d96226 | add import script for Swindon | chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_swindon.py | polling_stations/apps/data_collection/management/commands/import_swindon.py | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E06000030'
addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (11).tsv'
stations_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June20... | bsd-3-clause | Python | |
9366fe261b2f13f81678851fd5ae4a0035a811c7 | Add new package: py-walinuxagent (#18961) | iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-walinuxagent/package.py | var/spack/repos/builtin/packages/py-walinuxagent/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 PyWalinuxagent(PythonPackage):
"""Microsoft Azure Linux Guest Agent."""
homepage = "h... | lgpl-2.1 | Python | |
ce647d22a2a65ea40d259b064a6b4f611ca669af | Add test codes for wheels | peppaseven/iPeppaCar | wheels.py | wheels.py | #!/usr/bin/python2
#coding=utf-8
import RPi.GPIO as GPIO
import time
'''
2 L298N control 4 Motors.
SOC Control GPIO
Front Motor: (Left) 15-ENDA, 31-forward,33-backward
(Right)29-ENDB, 35-forward,37-backward
Rear Motor: (Left) 18-ENDB, 38-forward,40-backward
(Right)25-ENDA, 36-forward,32-b... | apache-2.0 | Python | |
f3db6608c2b4afeb214c3f1b94e0175609ad0b88 | Add migration file for event slug changes | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | cs4teachers/events/migrations/0018_auto_20170706_0803.py | cs4teachers/events/migrations/0018_auto_20170706_0803.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-06 08:03
from __future__ import unicode_literals
import autoslug.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0017_auto_20170705_0952'),
]
operations = [
migrat... | mit | Python | |
7d10648275e991fda42c6dccbce340d37d442115 | fix test on test_cell | fishstamp82/moltools,fishstamp82/moltools | src/test/test_cell.py | src/test/test_cell.py | import unittest, os
import numpy as np
from particles import PointDipoleList
from molecules import Cluster, Atom
from use_generator import Generator
import dstruct
FILE_XYZ = os.path.join( os.path.dirname(__file__), 'pna_waters.xyz' )
FILE_MOL = os.path.join( os.path.dirname(__file__), 'tip3p44_10qm.mol' )
FILE_PDB = ... | mit | Python | |
d03254dabaac466edd697de38c3433475828bd4f | Add tests for has_changes | joshfriend/sqlalchemy-utils,JackWink/sqlalchemy-utils,konstantinoskostis/sqlalchemy-utils,joshfriend/sqlalchemy-utils,cheungpat/sqlalchemy-utils,spoqa/sqlalchemy-utils,tonyseek/sqlalchemy-utils,marrybird/sqlalchemy-utils,rmoorman/sqlalchemy-utils,tonyseek/sqlalchemy-utils | tests/functions/test_has_changes.py | tests/functions/test_has_changes.py | import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_utils import has_changes
class TestHasChanges(object):
def setup_method(self, method):
Base = declarative_base()
class Article(Base):
__tablename__ = 'article_translation'
id =... | bsd-3-clause | Python | |
795cd6e190a1cc4d416c5524399780e586dc6c45 | Add better kitt script | OiNutter/microbit-scripts | kitt/kitt.py | kitt/kitt.py | from microbit import *
display.scroll("I am the Knight Industries 2000")
MAX_ROWS = 4
MAX_BRIGHTNESS = 9
MIN_BRIGHTNESS = 2
def scan(reverse=False):
for i in range(0, 9):
brightness = MAX_BRIGHTNESS
row_range = range(0, i+1) if not reverse else range(i, -1, -1)
counter = 0
for ... | mit | Python | |
a6ac5055a1867259ab17997a076299731e57c45b | Add Android extractor | qurami/strings2pot | strings2pot/extractors/android.py | strings2pot/extractors/android.py | # -*- coding: utf-8 -*-
import re
import xml.etree.ElementTree as ET
class AndroidExtractor:
def __init__(self, source_file, destination_file, context_id_generator):
self.source_file = source_file
self.destination_file = destination_file
self._create_context_id = context_id_generator
... | mit | Python | |
c711f62ef96d67a6e42e3bbe10c0b3cd64a23444 | add moviepy - text_hineinzoomen | openscreencast/video_snippets,openscreencast/video_snippets | moviepy/text_hineinzoomen.py | moviepy/text_hineinzoomen.py | #!/usr/bin/env python
# Video mit Text erzeugen, hineinzoomen (Text wird grösser)
# Einstellungen
text = 'Text' # Text
textgroesse = 150 # Textgroesse in Pixel
textfarbe_r = 0 # Textfarbe R
textfarbe_g = 0 # Textfarbe G
textfarbe_b = 0 # Textfarbe B
schrift ... | cc0-1.0 | Python | |
c61b1595709b6acd26cf7c43e7858e3ad5cb588f | Add missing module. | tlevine/csvkit,bradparks/csvkit__query_join_filter_CSV_cli,nriyer/csvkit,arowla/csvkit,metasoarous/csvkit,Jobava/csvkit,snuggles08/csvkit,jpalvarezf/csvkit,Tabea-K/csvkit,gepuro/csvkit,reubano/csvkit,barentsen/csvkit,kyeoh/csvkit,moradology/csvkit,unpingco/csvkit,aequitas/csvkit,wjr1985/csvkit,doganmeh/csvkit,onyxfish/... | csvkit/headers.py | csvkit/headers.py | #!/usr/bin/env python
def make_default_headers(n):
"""
Make a set of simple, default headers for files that are missing them.
"""
return [u'column%i' % (i + 1) for i in range(n)]
| mit | Python | |
1ad62b8fcffd88cc5aecb01418650e09aaa7ffad | Add deck_test.py, it's only a script for test when programming. | lanhin/deckAdvisor | deck_test.py | deck_test.py | import os
import json
from hearthstone.deckstrings import Deck
from hearthstone.enums import FormatType
from hearthstone.cardxml import load
from hearthstone.enums import Locale,Rarity
from collection import Collection
# Create a deck from a deckstring
deck = Deck()
deck.heroes = [7] # Garrosh Hellscream
deck.format ... | mit | Python | |
9b50da16238d2f816199c8fb8a20ec558edf5d46 | Create oie_compress.py | 9nlp/rie_gce,9nlp/rie_gce | oie_compress.py | oie_compress.py | # 1.0 much be paid on insurance claim
# 1.0 much is paid
# 1.0 much is paid on insurance claim
# 1.0 much be paid
# -----------------------------------------------------
# 1.0 channel joining two bodies
# 1.0 channel joining two larger bodies of water
# 1.0 channel joining two larger bodies
# 1.0 channel joining two bo... | apache-2.0 | Python | |
aad116d8bd35eee22d07edaff4cd8ddf80ea80be | Create 2.3Identify_SeasonalValues.py | WamdamProject/WaMDaM_UseCases | UseCases_files/3Figures_Python/2.3Identify_SeasonalValues.py | UseCases_files/3Figures_Python/2.3Identify_SeasonalValues.py | # Use Case 2.3Identify_SeasonalValues
# plot Seasonal data for multiple scenarios
# Adel Abdallah
# October 30, 2017
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
from random import randint
import pandas as pd
## read the input data from GitHub csv file which is a direct query output
# 3.... | bsd-3-clause | Python | |
302f98844487d894252d3dc3f4d30940fbcbd9e1 | Allow pex to be invoked using runpy (python -m pex). (#637) | jsirois/pex,pantsbuild/pex,pantsbuild/pex,jsirois/pex | pex/__main__.py | pex/__main__.py | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
from pex.bin import pex
__name__ == '__main__' and pex.main()
| apache-2.0 | Python | |
8f506c20ccad47ee6f2454a419145b1b2b48adba | Create bold-words-in-string.py | kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode | Python/bold-words-in-string.py | Python/bold-words-in-string.py | # Time: O(n * l), n is the length of S, l is the average length of words
# Space: O(t), t is the size of trie
class Solution(object):
def boldWords(self, words, S):
"""
:type words: List[str]
:type S: str
:rtype: str
"""
_trie = lambda: collections.defaultdict(_... | mit | Python | |
2623e5e18907c1ca13661e1f468368fb17bc50d9 | add preproc tests | timahutchinson/desispec,desihub/desispec,desihub/desispec,timahutchinson/desispec,gdhungana/desispec,gdhungana/desispec | py/desispec/test/test_preproc.py | py/desispec/test/test_preproc.py | import unittest
import numpy as np
from desispec.preproc import preproc, _parse_sec_keyword
class TestPreProc(unittest.TestCase):
def setUp(self):
hdr = dict()
hdr['CAMERA'] = 'b0'
hdr['DATE-OBS'] = '2018-09-23T08:17:03.988'
hdr['CCDSEC'] = '[1:200,1:150]'
hdr['BIASSEC... | bsd-3-clause | Python | |
228f4325aa5f1c8b616f45462280b4a7cb0792dd | Add test for empty files to csvjoin | wireservice/csvkit,dannguyen/csvkit,onyxfish/csvkit,doganmeh/csvkit | tests/test_utilities/test_csvjoin.py | tests/test_utilities/test_csvjoin.py | #!/usr/bin/env python
import sys
try:
from mock import patch
except ImportError:
from unittest.mock import patch
from csvkit.utilities.csvjoin import CSVJoin, launch_new_instance
from tests.utils import CSVKitTestCase, EmptyFileTests
class TestCSVJoin(CSVKitTestCase, EmptyFileTests):
Utility = CSVJoin
... | #!/usr/bin/env python
import sys
try:
from mock import patch
except ImportError:
from unittest.mock import patch
from csvkit.utilities.csvjoin import CSVJoin, launch_new_instance
from tests.utils import CSVKitTestCase
class TestCSVJoin(CSVKitTestCase):
Utility = CSVJoin
def test_launch_new_instanc... | mit | Python |
dbb127a6fbadfa17f5faad45e8d7ebb6b943a77d | add basic test for vamp_spectral_centroid | Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide | tests/test_vamp_spectral_centroid.py | tests/test_vamp_spectral_centroid.py | #! /usr/bin/env python
import unittest
from unit_timeside import TestRunner
from timeside.plugins.decoder.aubio import AubioDecoder as FileDecoder
from timeside.core import get_processor
from timeside.core.tools.test_samples import samples
class TestVampSpectralCentroid(unittest.TestCase):
proc_id = 'vamp_spect... | agpl-3.0 | Python | |
86c67f321ec4ee7c254fde4a7f942a83d5e35016 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/00734af980b920f9f963badf85fbeb12d576fde5. | Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,tensorflow/t... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "00734af980b920f9f963badf85fbeb12d576fde5"
TFRT_SHA256 = "0c136cdfb87ae3663c162ad807c5... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d1caeb8bdba1851194baf06c28ea09b5b67e5623"
TFRT_SHA256 = "e480ad7451b9e3ce45da61d71079... | apache-2.0 | Python |
8cf5b328d7596a9b74490b7dfd4a1b8aa1577b55 | Merge remote-tracking branch 'origin' into AC-9512 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py | accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py | from django.db import migrations
def remove_bucket_list_program_roles(apps, schema_editor):
BucketState = apps.get_model('accelerator', 'BucketState')
ProgramRole = apps.get_model('accelerator', 'ProgramRole')
ProgramRoleGrant = apps.get_model('accelerator', 'ProgramRoleGrant')
NodePublishedFor = apps... | mit | Python | |
5945fe5c527b3f5cb2ed104eccdf9266dc702eb1 | add second order constraint | hungpham2511/toppra,hungpham2511/toppra,hungpham2511/toppra | toppra/constraint/can_linear_second_order.py | toppra/constraint/can_linear_second_order.py | from .canonical_linear import CanonicalLinearConstraint
from .constraint import DiscretizationType
import numpy as np
class CanonicalLinearSecondOrderConstraint(CanonicalLinearConstraint):
""" A class to represent Canonical Linear Generalized Second-order constraints.
Parameters
----------
inv_dyn: (... | mit | Python | |
3020472569a49f01331ebb150f004e2684196b8e | add expression to improve the domain | ovnicraft/openerp-server,xrg/openerp-server,gisce/openobject-server,splbio/openobject-server,MarkusTeufelberger/openobject-server,splbio/openobject-server,MarkusTeufelberger/openobject-server,gisce/openobject-server,vnc-biz/openerp-server,splbio/openobject-server,vnc-biz/openerp-server,ovnicraft/openerp-server,xrg/open... | bin/tools/expression.py | bin/tools/expression.py | #!/usr/bin/env python
def _is_operator( element ):
return isinstance( element, str ) and element in ['&','|']
def _is_leaf( element ):
return isinstance( element, tuple ) and len( element ) == 3 and element[1] in ['=', '<>', '!=', '<=', '<', '>', '>=', 'like', 'not like', 'ilike', 'not ilike']
def _is_expre... | agpl-3.0 | Python | |
0226bec54c30a31c0005e7318b69c58a379cfbc9 | refactor output function | wolfg1969/my-stars-pilot,wolfg1969/oh-my-stars,wolfg1969/oh-my-stars | mystarspilot/view.py | mystarspilot/view.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from colorama import Fore, Back, Style
class SearchResultView(object):
def print_search_result(self, search_result, keywords=None):
if search_result is not None:
fo... | mit | Python | |
7e91549abc8d185deb231c937d7740606f9454ec | add pmi element unit test | jasonwbw/NLPbasic | test_pmi_element.py | test_pmi_element.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# The unit test case for pmi.TopkHeap and PMIElement
#
# @author: Jason Wu (Jasonwbw@yahoo.com)
from pmi import PMIElement
import sys
import unittest
class PMIElementTestCase(unittest.TestCase):
def setUp(self):
pass
def tearGt(self):
... | mit | Python | |
3c52683e759f146ad247c6e397d5d49dd1cc9966 | Create __init__.py | kushalmitruka/django-mongodb-testing | testing/__init__.py | testing/__init__.py | mit | Python | ||
a770c91ea6761d890387b4b6e130cb495817eea0 | Improve the sc2parse debugging script. | StoicLoofah/sc2reader,GraylinKim/sc2reader,ggtracker/sc2reader,ggtracker/sc2reader,GraylinKim/sc2reader,vlaufer/sc2reader,vlaufer/sc2reader,StoicLoofah/sc2reader | sc2reader/scripts/sc2parse.py | sc2reader/scripts/sc2parse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import sc2reader
import traceback
def main():
for argument in sys.argv[1:]:
for path in sc2reader.utils.get_files(argument):
try:
replay = sc2reader.load_replay(path, debug=True)
except sc2reader.exceptions.ReadError as e:
print e.replay.filena... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import sc2reader
def main():
for replay in sc2reader.load_replays(sys.argv[1:], verbose=True):
pass
if __name__ == '__main__':
main() | mit | Python |
98295608a2ba4519d12212532380253bba4372ed | Add script that recommends scrape task schedule based on recent run timings | openstates/bobsled,openstates/bobsled,openstates/bobsled,openstates/bobsled | scripts/frequency_analysis.py | scripts/frequency_analysis.py | import asyncio
import attr
import pprint
import dateutil.parser
from datetime import timedelta
from bobsled.core import bobsled
from bobsled.base import Status
def recommend_frequency_for_task(runs):
total_duration = timedelta(seconds=0)
longest_duration = timedelta(seconds=0)
for run in runs:
sta... | mit | Python | |
e6642dd9c9cad6aca3cb70e4cca53afe51494d4b | Add a test for checking setup.py | UCBerkeleySETI/blimpy,UCBerkeleySETI/blimpy | tests/test_setup.py | tests/test_setup.py | r""" Testspectra_gen functions"""
def test_setup():
import os
cmd = "python3 setup.py check"
os.system(cmd) | bsd-3-clause | Python | |
0424eb7dd8e55e2f88f088c3a84c8e962d89f06e | build perf from source | cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa,cyliustack/sofa | tools/perf_build.py | tools/perf_build.py | #!/usr/bin/env python
import platform
import subprocess
if subprocess.call('which sudo', shell=True) == 0:
with_sudo = 'sudo '
else:
with_sudo = ''
major = int(platform.release().split('.')[0])
minor = int(platform.release().split('.')[1])
revision = int(platform.release().split('.')[2].split('-')[0])
url_k... | apache-2.0 | Python | |
ef3e07794d4245b9d4a1d0007a0b9099d5bafaf9 | Add asteval wrapper | Snuggert/moda | project/asteval_wrapper.py | project/asteval_wrapper.py | from asteval import Interpreter
import functools
import re
class Script(object):
def __init__(self):
"""
Sets up an interpreter.
"""
self.interpreter = Interpreter()
self.symtable['re'] = re
@property
def symtable(self):
"""
Expose the internal sym... | mit | Python | |
126863fd6c2a13491b92d546d3e886d0e0da492b | Add experiment for nodejs. | arangodb/velocypack,arangodb/Jason,arangodb/velocypack,arangodb/velocypack,arangodb/velocypack,arangodb/Jason,arangodb/Jason,arangodb/Jason | swig/node/binding.gyp | swig/node/binding.gyp | {
"targets": [
{
"target_name": "velocypack",
"sources": [ "../../src/asm-functions.cpp",
"../../src/AttributeTranslator.cpp",
"../../src/Builder.cpp",
"../../src/Collection.cpp",
"../../src/Dumper.cpp",
".... | apache-2.0 | Python | |
ad0a1bf70dc2776c88115389400fd6958e49ecc8 | Add rsync package | tmerrick1/spack,lgarren/spack,LLNL/spack,iulian787/spack,EmreAtes/spack,iulian787/spack,LLNL/spack,EmreAtes/spack,lgarren/spack,LLNL/spack,TheTimmy/spack,tmerrick1/spack,TheTimmy/spack,skosukhin/spack,iulian787/spack,matthiasdiener/spack,mfherbst/spack,iulian787/spack,lgarren/spack,mfherbst/spack,EmreAtes/spack,iulian7... | var/spack/packages/rsync/package.py | var/spack/packages/rsync/package.py | from spack import *
class Rsync(Package):
"""rsync is an open source utility that provides fast incremental file transfer."""
homepage = "https://rsync.samba.org"
url = "https://download.samba.org/pub/rsync/rsync-3.1.1.tar.gz"
version('3.1.1', '43bd6676f0b404326eee2d63be3cdcfe')
# depends_on... | lgpl-2.1 | Python | |
5869091cc63afbe9c8bde2bf6e9f934c46d3c3f5 | Create generate_api_error.py | bigdig/vnpy,vnpy/vnpy,bigdig/vnpy,vnpy/vnpy,bigdig/vnpy,bigdig/vnpy | vnpy/api/tap/generator/generate_api_error.py | vnpy/api/tap/generator/generate_api_error.py | """"""
class DataTypeGenerator:
"""DataType生成器"""
def __init__(self, filename: str, prefix: str, name: str) -> None:
"""Constructor"""
self.filename: str = filename
self.prefix: str = prefix
self.name: str = name
def run(self) -> None:
"""主函数"""
self.f_cpp... | mit | Python | |
d205284e21f5fad8195d796ad356042cb5c47894 | add log test | MrLYC/test_py_logging,MrLYC/test_py_logging | py_logging/test_logging.py | py_logging/test_logging.py | #!/usr/bin/env python
# encoding: utf-8
import logging
import os
import time
from unittest import TestCase
class TestLogging(TestCase):
def setUp(self):
dir_path = os.path.dirname(__file__)
self.logfile = os.path.join(dir_path, "tmp.log")
self.logger = logging.getLogger(
"test... | mit | Python | |
9b2e0396f1121f94d6b66daa26c83bb85bc1a79a | format string tests | mitar/pychecker,mitar/pychecker | pychecker2/utest/format.py | pychecker2/utest/format.py | from pychecker2 import TestSupport
from pychecker2 import FormatStringChecks
class FormatTestCase(TestSupport.WarningTester):
def testGoodFormats(self):
self.silent('def f(x):\n'
' return "%s" % x\n')
self.silent('def f(x):\n'
" return ('%s' + '%s') %... | bsd-3-clause | Python | |
2e2bae00f7b098e5fd20f2901b4f70554e250d2d | add program to plot offset distribution | dmargala/blupe,dmargala/blupe,dmargala/blupe | python/plot_offset_dist.py | python/plot_offset_dist.py | #!/usr/bin/env python
import argparse
import numpy as np
import glob
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 10})
import matplotlib.pyplot as plt
def add_stat_legend(x):
textstr = '$\mathrm{N}=%d$\n$\mathrm{mean}=%.2f$\n$\mathrm{median}=%.2f$\n$\mathrm{std}=%.2f$' % (
l... | mit | Python | |
091432b795e3b5571887eb924fb831060d2fd53b | Add logging setup | google/turbinia,google/turbinia,google/turbinia,google/turbinia,google/turbinia | turbinia/config/logger.py | turbinia/config/logger.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 | Python | |
f9998701bafa24fce25156751fefdfa97074c801 | Add protocol conformance map | rudkx/swift,atrick/swift,glessard/swift,gregomni/swift,glessard/swift,gregomni/swift,rudkx/swift,gregomni/swift,benlangmuir/swift,rudkx/swift,JGiola/swift,JGiola/swift,glessard/swift,atrick/swift,atrick/swift,JGiola/swift,rudkx/swift,atrick/swift,glessard/swift,gregomni/swift,atrick/swift,roambotics/swift,rudkx/swift,a... | utils/gyb_syntax_support/protocolsMap.py | utils/gyb_syntax_support/protocolsMap.py | SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {
'ExpressibleAsConditionElement': [
'ExpressibleAsConditionElementList'
],
'ExpressibleAsDeclBuildable': [
'ExpressibleAsCodeBlockItem',
'ExpressibleAsMemberDeclListItem',
'ExpressibleAsSyntaxBuildable'
],
'ExpressibleAs... | apache-2.0 | Python | |
143eb4665e76065ec67b5dd42cfe84e238d50094 | use per post winner count if available to overide settings | mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextmp-popit | candidates/constants.py | candidates/constants.py | ELECTION_ID_REGEX = r'(?P<election>[^/]+)'
POST_ID_REGEX = r'(?P<post_id>[^/]+)'
| agpl-3.0 | Python | |
6aef9ab419b09822b2255141349144ac8978e862 | Add migration for h5p kind. | mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri | kolibri/core/content/migrations/0025_add_h5p_kind.py | kolibri/core/content/migrations/0025_add_h5p_kind.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-12-19 02:29
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("content", "0024_channelmetadata_public"),
]
operations = [
... | mit | Python | |
39b00572d7888895bcf552999f80b712c1738142 | Create BillboardIter.py | jameswenzel/billboard-grabber | BillboardIter.py | BillboardIter.py | from datetime import date, timedelta
class BillboardDates():
'''Iterator over valid Billboard Chart weeks, which is
supposed to be a per-class singleton for start quantization'''
def __init__(self, endDate=date.today()):
assert type(endDate) is str or type(endDate) is date
self.endDate =... | mit | Python | |
566850c873f6bdbed6632388330f8e4df6fbe613 | add migration for accordeon block on homepage | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | meinberlin/apps/cms/migrations/0021_add_accordeon_block.py | meinberlin/apps/cms/migrations/0021_add_accordeon_block.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-08 12:57
from __future__ import unicode_literals
from django.db import migrations
import meinberlin.apps.cms.blocks
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations.Migra... | agpl-3.0 | Python | |
ecfadf8478b8775d8579812a7bd835f6ebb1ffd4 | Add file lister for rclone export | jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar | util/rclone-list-files.py | util/rclone-list-files.py | #!/usr/bin/env python3
import glob
# For use with --files-from argument for Rclone
# This suits Edgar's structure with is
# SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip
for folder in glob.glob('*'):
occurrences = glob.glob(folder + '/occurrences/*')
projected_distrib... | bsd-3-clause | Python | |
629bd006bfd7e6210dcc95198be9b65614e4f051 | Convert optimization_test.py to PyTorch | huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/pytorch-transformers,huggingface/transformers | optimization_test_pytorch.py | optimization_test_pytorch.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 | Python | |
101bb07375d2a36a65d07d3de32625cdef8f916d | Add parser for Vietnamese edition. | elfxiong/wiktionary-translations-parser | parser/parse_vi.py | parser/parse_vi.py | import re
from bs4 import BeautifulSoup, Tag
import requests
tested_url = [
"https://vi.wiktionary.org/wiki/kh%C3%B4ng#Ti.E1.BA.BFng_Vi.E1.BB.87t",
"https://vi.wiktionary.org/wiki/c%C3%A1m_%C6%A1n#Ti.E1.BA.BFng_Vi.E1.BB.87t",
]
HEADING_TAG = re.compile(r'^h(?P<level>[1-6])$', re.I)
COMMA_OR_SEMICOLON = re.co... | mit | Python | |
7da53597f9cb4117cecbaed1dbb77f4693289815 | add a test for well locations endpoint | bcgov/gwells,bcgov/gwells,bcgov/gwells,bcgov/gwells | app/backend/wells/tests/test_wells.py | app/backend/wells/tests/test_wells.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
distri... | apache-2.0 | Python | |
32f7fe6562f4d1592dfab5a9b065154dca51f1d3 | Add rsync module | predat/pyIsis | pyIsis/rsync.py | pyIsis/rsync.py | # -*- coding: utf-8 -*-
import os
import subprocess
import logging
#RSYNC_PATH = os.path.join(
# os.path.abspath (os.path.dirname(__file__)), 'bin', 'rsync')
RSYNC_PATH = '/opt/rsync/bin/rsync'
RSYNC_CMD = '{cmd} {options} "{source}" "{destination}"'
rsync_logger = logging.getLogger('avidisis')
class rsync(obj... | mit | Python | |
01eaa6ba14c51568ea7aa3cc436d14fbffb78720 | Create downloader-v0.22pa.py | Keiiko/anime-manga-cz-downloader | downloader-v0.22pa.py | downloader-v0.22pa.py | import urllib2
import re
import os
def stahniHtml(url):
f = urllib2.urlopen(url)
obsah = f.read()
f.close()
return obsah
def nahled(url):
global chapter
global currpatch1
odkazy = vyberodkazux(url)
for odkaz in odkazy:
currpatch1 = odkaz.replace("index.html", "")
chapte... | mit | Python | |
d6b01b968b2ef97042bc7c3dfc1f1752fcbc98a4 | Create nnet3_compute_bnf.py | osadj/kaldi_nnet3,osadj/kaldi_nnet3 | nnet3_compute_bnf.py | nnet3_compute_bnf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 5 16:49:55 2017
@author: Omid Sadjadi <s.omid.sadjadi@gmail.com>
"""
import numpy as np
import nnet3read
def splice_feats(x, w=9):
""" This routine splices the feature vectors in x by stacking over a window
of length w frames (must be... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.