code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program 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 option) any later version.
#
# This program is distributed i... | Erethon/synnefo | astakosclient/setup.py | Python | gpl-3.0 | 5,686 |
import os
import json
from unittest import TestCase
from elasticgit import EG
from elasticgit.commands.avro import serialize
from elasticgit.search import ESManager
from unicore.distribute.utils import get_index_prefix
class DistributeTestCase(TestCase):
destroy = 'KEEP_REPO' not in os.environ
WORKING_DIR... | universalcore/unicore.distribute | unicore/distribute/tests/base.py | Python | bsd-2-clause | 2,201 |
import os
import MooseDocs
from MooseTextPatternBase import MooseTextPatternBase
from FactorySystem import ParseGetPot
class MooseInputBlock(MooseTextPatternBase):
"""
Markdown extension for extracting blocks from input files.
"""
CPP_RE = r'^!input\s+(.*?)(?:$|\s+)(.*)'
def __init__(self, **kwar... | katyhuff/moose | python/MooseDocs/extensions/MooseInputBlock.py | Python | lgpl-2.1 | 1,834 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | DeepThoughtTeam/tensorflow | tensorflow/python/client/session_test.py | Python | apache-2.0 | 31,683 |
import os
import sys
from PyQt4 import pyqtconfig
if len(sys.argv) < 2:
raise RuntimeError('output directory was not specified!')
else:
build_dir = os.path.normpath(sys.argv[1])
defines = sys.argv[2:]
sources_dir = os.path.dirname(__file__)
build_file = os.path.join(build_dir, "documents.sbf")
install_dir = ... | zenwarr/microhex | src/documents/configure.py | Python | mit | 1,003 |
#from xml.dom import minidom
from bs4 import BeautifulSoup
import simplejson
import csv
print "Reading input ..."
#xmldoc = minidom.parse("timhortons.xml")
#markers = xmldoc.getElementsByTagName('markers')
with open("timhortons.xml","r") as f:
html = f.read()
soup = BeautifulSoup(html)
#exit()
markers = soup.findAl... | thequbit/tapir | data/genfiles.py | Python | gpl-3.0 | 1,424 |
import os, shutil, sys, unittest
test_root = os.path.abspath(os.path.dirname(__file__))
import breezedb
db = os.path.join(test_root, 'dbtemp.brdb')
class TestTable(unittest.TestCase):
def test_create_table(self):
breezedb.create_table('new_table', db)
def test_create_table_existing(self):
... | rmed/breezedb_python | test/test_table.py | Python | gpl-2.0 | 3,002 |
__version__='1.10.1'
# py3 stuff
py3 = False
try:
unicode('')
punicode = unicode
pstr = str
punichr = unichr
except NameError:
punicode = str
pstr = bytes
py3 = True
punichr = chr
long = int
def get_version():
return __version__
| karstenw/nodebox-pyobjc | nodebox/__init__.py | Python | mit | 272 |
# -*- coding: utf-8 -*-
import wx, os
from hachoir_core.i18n import _
def file_open_dialog():
dialog_style = wx.OPEN | wx.FILE_MUST_EXIST
dialog = wx.FileDialog(
None, message = _('Open'),
defaultDir = os.getcwd(),
defaultFile = '', style = dialog_style)
return dialog
def f... | foreni-packages/hachoir-wx | hachoir_wx/dialogs.py | Python | gpl-2.0 | 532 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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 L... | ressu/SickGear | sickbeard/versionChecker.py | Python | gpl-3.0 | 30,354 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | staranjeet/fjord | vendor/packages/requests-2.7.0/requests/packages/chardet/constants.py | Python | bsd-3-clause | 1,333 |
# Example code, do not run :)
import os
from datetime import datetime
counter = 123
def greet(name=None):
if not name:
print 'Who are you?'
else:
print 'Hello, %s' % name
class SuperObject(object):
"""
Awesome super object
"""
@property
def name(self):
return ... | honza/solarized-pygments | reference/python.py | Python | bsd-2-clause | 481 |
# This file is part of Maker Keeper Framework.
#
# Copyright (C) 2017-2018 reverendus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | makerdao/keeper | tests/dss_token.py | Python | agpl-3.0 | 2,619 |
import unittest
from pymodbus3.other_message import *
class ModbusOtherMessageTest(unittest.TestCase):
"""
This is the unittest for the pymodbus3.other_message module
"""
def setUp(self):
self.requests = [
ReadExceptionStatusRequest,
GetCommEventCounterRequest,
... | gregorschatz/pymodbus3 | test/test_other_messages.py | Python | bsd-3-clause | 4,015 |
import spade
from spade.SWIKB import SWIKB as KB
import time
from random import random, randint, choice
from os.path import isfile, join
class ExclusiveBehaviour( spade.Behaviour.OneShotBehaviour ):
'''Makes sure that two behaviours of this type do not run in parallel'''
def wait( self ):
if not hasattr( self.myA... | tomicic/ModelMMORPG | TMWbehavs.py | Python | gpl-3.0 | 49,312 |
# Copyright (c) 2014 OpenStack Foundation
# 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 ... | saeki-masaki/cinder | cinder/scheduler/weights/volume_number.py | Python | apache-2.0 | 2,096 |
from itertools import count, islice, takewhile
from functools import reduce
def product(it):
return reduce(lambda x, y: x * y, it)
def first(it):
return next(it)
def last(it):
return reduce(lambda old, new: new, it)
def nth(it, n):
return next(islice(it, n, None))
__all__ = ['count', 'takewhile', 'reduce', 'pr... | Undeterminant/euler-python | euler/iters.py | Python | cc0-1.0 | 352 |
# Generated by Django 3.0.2 on 2020-01-20 19:58
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("testruns", "0008_test_execution_statu... | kiwitcms/Kiwi | tcms/testruns/migrations/0009_remove_autofield.py | Python | gpl-2.0 | 2,576 |
# :title: fabfile.py
# :author: John A. Marohn (jam99@cornell.edu)
# :date: 2014-07-26
# :subject: substitute/extend "make html" and "make open"
# :ref: http://docs.fabfile.org/en/1.4.1/tutorial.html
# :ref: http://ipython.org/ipython-doc/1/interactive/nbconvert.html
from fabric.api import *
from fabric.context_manage... | ryanpdwyer/crossplatformshell | docs/fabfile.py | Python | mit | 2,116 |
# original test file
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pyfits as pf
import pickle
import gzip
#import pymultinest ###### Removed temporary ! #######
import os, threading, subprocess
import matplotlib.pyplot as plt
import json
import time
import pysco
'''------------... | benjaminpope/pysco | test.py | Python | gpl-3.0 | 2,422 |
"""alloccli subcommand for billing time for work done."""
from alloc import alloc
import sys
import datetime
import time
import threading
class timer(threading.Thread):
"""Stopwatch, the timer should stop counting when ctrl-z/paused"""
started = datetime.datetime.now()
seconds = 0
def run(self):
... | mattcen/alloc | bin/alloccli/work.py | Python | agpl-3.0 | 9,330 |
# ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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/LICENS... | abhikeshav/ydk-py | core/ydk/mdt/proto_to_dict.py | Python | apache-2.0 | 2,788 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-12 07:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mords_api', '0021_learningword'),
]
operations = [
migrations.RenameField(
... | TeppieC/M-ords | mords_backend/mords_api/migrations/0022_auto_20161212_0008.py | Python | mit | 441 |
#!/usr/bin/python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import os
imp... | zats/chisel | commands/FBFlickerCommands.py | Python | bsd-3-clause | 4,903 |
from django import forms
from django.utils.safestring import mark_safe
from repanier.const import (
PERMANENCE_OPENED,
PERMANENCE_CLOSED,
PERMANENCE_SEND,
PERMANENCE_PLANNED,
)
from repanier.models.deliveryboard import DeliveryBoard
from repanier.tools import get_repanier_template_name
class SelectAd... | pcolmant/repanier | repanier/widget/select_admin_delivery.py | Python | gpl-3.0 | 1,521 |
""" Git Branch Trail model """
from django.db import models
class GitBranchTrailEntry(models.Model):
""" Git Branch Trail """
project = models.ForeignKey('gitrepo.GitProjectEntry', related_name='git_trail_project')
branch = models.ForeignKey('gitrepo.GitBranchEntry', related_name='git_trail_branch')
c... | imvu/bluesteel | app/logic/gitrepo/models/GitBranchTrailModel.py | Python | mit | 826 |
import time
import urlparse
import logging
from paython.exceptions import MissingDataError
from paython.lib.api import PostGateway
logger = logging.getLogger(__name__)
class USAePay(PostGateway):
""" usaepay.com Payment Gatway Interface
Based on the CGI Transaction Gateway API v2.17.1
The method names ... | vauxoo-dev/Paython | paython/gateways/usaepay.py | Python | mit | 11,360 |
from flask import render_template, redirect, request, url_for, flash
from flask.ext.login import login_user, current_user, logout_user, login_required
from . import auth
from ..models import User, AnonymousUser
from .forms import LoginForm, RegistrationForm, ChangePasswordForm, \
PasswordResetRequestForm, PasswordR... | AguNnamdi/flask_microblog | app/auth/views.py | Python | mit | 5,982 |
#!/usr/bin/env python
'''
@file fundamental_frequency.py
@brief Sandbox for "Fundamental frequency extraction" algorithm tests
@author gm
@copyright gm 2014
This file is part of Chartreuse
Chartreuse is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... | G4m4/chartreuse | scripts/fundamental_frequency.py | Python | gpl-3.0 | 7,201 |
# Copyright 2014 The Oppia 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 applicable ... | AllanYangZhou/oppia | core/domain/email_manager_test.py | Python | apache-2.0 | 78,772 |
###
# utilities used by owping command
#
from owping_defaults import *
import configparser
import pscheduler
#Role constants
CLIENT_ROLE = 0
SERVER_ROLE = 1
log = pscheduler.Log(prefix="tool-owping", quiet=True)
##
# Determine whether particpant will act as client or server
def get_role(participant, test_spec): ... | perfsonar/pscheduler | pscheduler-tool-owping/owping/owping_utils.py | Python | apache-2.0 | 1,200 |
# Create a program to compute statistics means that you won't have to whip out your calculator and manually crunch numbers. All you'll have to do is #supply a new set of numbers and our program does all of the hard work.
grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
def print_grades(grades):
... | gitsubham/Python-Tuts | scripts/Exam_statistics.py | Python | apache-2.0 | 1,060 |
from PyQt4 import QtCore
import util
from notificatation_system.ns_hook import NsHook
import notificatation_system as ns
"""
Settings for notifications: if a player receive a team invite
"""
class NsHookTeamInvite(NsHook):
def __init__(self):
NsHook.__init__(self, ns.NotificationSystem.TEAM_INVITE)
... | HaraldWeber/client | src/notificatation_system/hook_teaminvite.py | Python | gpl-3.0 | 353 |
#!/usr/bin/env python
# Copyright (C) 2011 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program 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 2... | bks/veusz | tests/runselftest.py | Python | gpl-2.0 | 10,008 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio 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 2 of the
## License, or (at your opt... | kaplun/invenio | modules/bibcheck/lib/bibcheck_task.py | Python | gpl-2.0 | 29,486 |
../../../../share/pyshared/jockey/xorg_driver.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/jockey/xorg_driver.py | Python | gpl-3.0 | 48 |
from model.contact import Contact
from .helpers.base_list import BaseList
class ContactsList(BaseList):
def __init__(self,app):
super(ContactsList, self).__init__(app)
self.members = self.app.contact.get_contacts_list()
self.key = Contact.id_or_max
#self.normalize()
def __eq__(s... | alenickwork/python_training | model/contacts_list.py | Python | apache-2.0 | 467 |
#
# DBus structures for the language and locale data.
#
# Copyright (C) 2022 Red Hat, Inc. All rights reserved.
#
# This program 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 2 of the Licens... | jkonecny12/anaconda | pyanaconda/modules/common/structures/language.py | Python | gpl-2.0 | 3,705 |
# 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... | jbedorf/tensorflow | tensorflow/compiler/tests/adadelta_test.py | Python | apache-2.0 | 5,729 |
"""Stack documentation build system.
"""
__all__ = ("build_stack_docs",)
import logging
import os
from pathlib import Path
from typing import Dict, List, Optional, Union
from ..sphinxrunner import run_sphinx
from .doxygen import (
DoxygenConfiguration,
get_doxygen_default_conf_path,
preprocess_package_do... | lsst-sqre/sphinxkit | documenteer/stackdocs/build.py | Python | mit | 11,575 |
"""Add contact_details to House
Revision ID: 1f97f799a477
Revises: 2df9ce70bad
Create Date: 2018-08-08 10:58:44.869939
"""
# revision identifiers, used by Alembic.
revision = '1f97f799a477'
down_revision = '2df9ce70bad'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated ... | Code4SA/pmg-cms-2 | migrations/versions/1f97f799a477_add_contact_details_to_house.py | Python | apache-2.0 | 631 |
class A: pass
class B: pass
class C: pass
class D(A): pass
class E(A,B): pass
class F(E,C): pass
a,b,c,d,e,f = A(),B(),C(),D(),E(),F()
print isinstance(a, A)
print isinstance(a, B)
print isinstance(a, C)
print isinstance(a, D)
print isinstance(a, E)
print isinstance(a, F)
print "---"
print isinstance(b, A)
print isin... | ArcherSys/ArcherSys | skulpt/test/run/t251.py | Python | mit | 1,037 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'SurveyInstance.user'
db.alter_column(u'appulet_surveyi... | MoveLab/erulet-server | appulet/migrations/0012_auto__chg_field_surveyinstance_user.py | Python | gpl-3.0 | 26,240 |
from filecmp import cmp
import time
t1 = time.time()
print(cmp('diff_test1.txt', 'diff_test2.txt'))
t2 = time.time()
print((t2-t1)*900000)
| ZingBallyhoo/OverwatchDataManager | trials & tests/diff_test.py | Python | mit | 141 |
from django.test import TestCase
from xblock.models import Xblock
class XblockTest(TestCase):
def test_model(self):
Xblock.objects.create(
name='test',
packages='test',
description='An xblock for testing',
version='1,0',
author='Tester',
... | vkaracic/Xblocks-Directory | xblock/tests/test_model.py | Python | mit | 550 |
"""
You are given an odd-length array of integers, in which all of them are the same, except for one single number.
Implement the method stray which accepts such array, and returns that single different number.
The input array will always be valid! (odd-length >= 3)
Examples:
[1, 1, 2] => 2
[17, 17, 3, 17, 17, 17,... | aadithpm/code-a-day | py/Find The Stray Number.py | Python | unlicense | 468 |
"""
@package mi.instrument.wetlabs.ac_s.ooicore.test.test_driver
@file marine-integrations/mi/instrument/wetlabs/ac_s/ooicore/driver.py
@author Rachel Manoni
@brief Test cases for ooicore driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver -u [-t tes... | ooici/marine-integrations | mi/instrument/wetlabs/ac_s/ooicore/test/test_driver.py | Python | bsd-2-clause | 32,665 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-10-22 13:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('emgapi', '0028_auto_20200706_1823'),
]
operations = [
migrations.AlterFiel... | EBI-Metagenomics/emgapi | emgapi/migrations/0029_auto_20201022_1359.py | Python | apache-2.0 | 503 |
# Selective cleanup (deletion) of files (based on category and extension)
# For use by a SABnzbd+ external post-processing script
# Version: 1.05
# Date: 2009/07/19
# License: As-is; public domain
# Requirements: Python 3.1, SABnzbd+ 0.4.11
# Description: This script clean's up (deletes) files with specific extension... | ActiveState/code | recipes/Python/573440_Selective_cleandeletifiles__based_category/recipe-573440.py | Python | mit | 1,503 |
from pushmanager.testing.testservlet import TemplateTestCase
import pushmanager.testing as T
class NewRequestTemplateTest(TemplateTestCase):
authenticated = True
newrequest_page = 'modules/newrequest.html'
form_elements = ['title', 'tags', 'review', 'repo', 'branch', 'description', 'comments', 'watchers'... | hashbrowncipher/pushmanager | pushmanager/tests/test_template_newrequest.py | Python | apache-2.0 | 2,206 |
import calendar
from django import template
register = template.Library()
@register.filter
def month_name(month_number):
return calendar.month_name[month_number]
| atiro/culture-board | visitors/templatetags/visitors_extras.py | Python | bsd-3-clause | 166 |
#=======================================================================
# verilator_sim.py
#=======================================================================
from __future__ import print_function
import os
import sys
import filecmp
import verilog
from os.path import exists
from verilator_cffi import ve... | cornell-brg/pymtl | pymtl/tools/translation/verilator_sim.py | Python | bsd-3-clause | 3,084 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/worker/protocols/pb.py | Python | gpl-2.0 | 10,627 |
# -*- coding: utf-8 -*-
import unittest
import os
import random
import string
from qiniu import rs
from qiniu import conf
def r(length):
lib = string.ascii_uppercase
return ''.join([random.choice(lib) for i in range(0, length)])
conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
conf.SECRET_KEY = os.getenv("QI... | davidvon/pipa-pay-server | site-packages/qiniu/rs/test/rs_test.py | Python | apache-2.0 | 2,667 |
"""
LTag Extension for Python-Markdown
====================================
See https://regex101.com/r/g2Zjqn/2/ for regex tests
"""
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from markdown.blockprocessors import BlockProcessor
from markdown.util import etree
import re
... | olaurendeau/v6_ui | c2corg_ui/format/ltag.py | Python | agpl-3.0 | 4,175 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django_pgjson.fields
import django.utils.timezone
import django.db.models.deletion
import djorm_pgarray.fields
import taiga.projects.history.models
class Migration(migratio... | 19kestier/taiga-back | taiga/projects/migrations/0001_initial.py | Python | agpl-3.0 | 6,634 |
#!/usr/bin/python
# Copyright 2013 Google Inc.
#
# This file is part of Ansible
#
# Ansible 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 option) any later vers... | mschurenko/ansible-modules-core | cloud/google/gce_pd.py | Python | gpl-3.0 | 9,518 |
import zmq
import kombu
from ryu.app import simple_switch_13
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
class PacketInForwarder(simple_switch_13.SimpleSwitch13):
def __init__(self, *args, **kwargs):
... | ntts-clo/mld-ryu | mld/sample/packet_forwarder_amqp.py | Python | apache-2.0 | 652 |
# Created By: Eric Mc Sween
# Created On: 2008-05-29
# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licens... | hsoft/currency_server | hscommon/gui/table.py | Python | bsd-3-clause | 10,693 |
from pudzu.charts import *
# generate map
df = pd.read_csv("datasets/eujewish.csv").set_index("country")
FONT = arial
CUTOFFS = [10, 5, 2, 1, 0.5, 0.2, 0]
PALETTE = [
"#ece7f2",
"#d0d1e6",
"#a6bddb",
"#74a9cf",
"#3690c0",
"#0570b0",
"#034e7b"
]
#PALETTE = ["#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0",... | Udzu/pudzu | dataviz/eujewish.py | Python | mit | 1,806 |
from django.conf.urls import (patterns,
url)
from .views import ResultsetStatusView
urlpatterns = patterns(
'',
url(r'^resultset-status/(?P<repository>[\w-]{0,50})/(?P<revision>\w+)/$',
ResultsetStatusView.as_view(), name="resultset_status"),
)
| adusca/treeherder | treeherder/embed/urls.py | Python | mpl-2.0 | 293 |
"""
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and 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 So... | twz915/django | django/utils/archive.py | Python | bsd-3-clause | 7,462 |
def make_choices(cs):
dcs = dict(
(l.lower(), l) for l in cs
)
dcs[''] = 'Unknown' # add the default
return dcs
USAGE_FREQUENCY = make_choices((
'Constantly',
'Daily',
'Periodicly',
'Occasionally',
'Rarely',
'Never',
'Unknown'
))
IMPACT = make_choices((
'High'... | rtucker-mozilla/inventory | core/service/constants.py | Python | bsd-3-clause | 350 |
from AccessControl import ClassSecurityInfo
from Products.ATContentTypes.content import schemata
from Products.Archetypes import atapi
from Products.Archetypes.ArchetypeTool import registerType
from Products.CMFCore import permissions
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import ... | hocinebendou/bika.gsoc | bika/lims/controlpanel/bika_storagelocations.py | Python | mit | 9,319 |
#!/usr/bin/env python
# https://medium.com/@mshockwave/using-llvm-lit-out-of-tree-5cddada85a78
# To run lit-based test suite:
# cd xyz/qmlcore/test && ./lit.py -va .
from lit.main import main
import os
if __name__ == '__main__':
if not os.path.exists(".cache/core.Item"):
print("Note that first run may t... | pureqml/qmlcore | test/lit.py | Python | mit | 381 |
import _plotly_utils.basevalidators
class CmaxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmax", parent_name="scatter.marker.line", **kwargs):
super(CmaxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/scatter/marker/line/_cmax.py | Python | mit | 472 |
# pylint: disable=no-self-use,invalid-name
from deep_qa.models.reading_comprehension import GatedAttentionReader
from deep_qa.common.params import Params
from ...common.test_case import DeepQaTestCase
class TestGatedAttention(DeepQaTestCase):
def test_cloze_train_does_not_crash(self):
self.write_who_did_... | matt-gardner/deep_qa | tests/models/reading_comprehension/gated_attention_reader_test.py | Python | apache-2.0 | 5,062 |
# coding=utf-8
from merepresenta.tests.volunteers import VolunteersTestCaseBase
from merepresenta.tse_processor import TSEProcessorMixin
from elections.models import Area
from merepresenta.models import Candidate, Partido, Coaligacao
from django.core.management import call_command
from django.conf import settings
from ... | ciudadanointeligente/votainteligente-portal-electoral | merepresenta/tests/management_command_tests.py | Python | gpl-3.0 | 3,419 |
from opencog.type_constructors import *
from opencog_b.python.blending.util.blend_logger import debug_log, fine_log, \
blend_log
from opencog_b.python.blending.util.general_util import Singleton
from opencog_b.python.blending.util.py_cog_execute import PyCogExecute
__author__ = 'DongMin Kim'
# noinspection PyTyp... | kim135797531/opencog-python-blending | opencog_b/python/blending/util/blend_config.py | Python | agpl-3.0 | 10,988 |
from libnow.apps import LibnowConfig
from libnow.src.business.exceptions.BusinessException import BusinessException
from libnow.src.persistence.entities.system.MainframeControl import MainframeControl
class MainframeControlService(object):
@staticmethod
def get_session_timeout():
"""
Obtiene e... | keikenuro/kaiju-libnow | kaiju_libnow/libnow/src/business/services/system/MainframeControlService.py | Python | gpl-3.0 | 883 |
from collections import defaultdict
import logging
log = logging.getLogger(__name__)
class Tool(object):
"""
Tool represents a program that runs over source code. It returns a nested
dictionary structure like:
{'relative_filename': {'line_number': [error1, error2]}}
eg: {'imhotep/app.py': {'... | richtier/imhotep | imhotep/tools.py | Python | mit | 2,970 |
"""Support for control of ElkM1 sensors."""
from elkm1_lib.const import (
SettingFormat,
ZoneLogicalStatus,
ZonePhysicalStatus,
ZoneType,
)
from elkm1_lib.util import pretty_const, username
import voluptuous as vol
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import... | sander76/home-assistant | homeassistant/components/elkm1/sensor.py | Python | apache-2.0 | 9,367 |
""" Python test discovery, setup and run of test functions. """
from __future__ import absolute_import, division, print_function
import fnmatch
import inspect
import sys
import os
import collections
import warnings
from textwrap import dedent
from itertools import count
import py
import six
from _pytest.mark import ... | vwvww/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/_pytest/python.py | Python | mpl-2.0 | 45,166 |
# download from:
# https://raw.githubusercontent.com/pytorch/vision/master/torchvision/models/resnet.py
#
import os
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
... | chicm/carvana | car-segment/net/imagenet/resnet_old.py | Python | apache-2.0 | 7,032 |
"""Collection of views that together constitute the 'show database'.
"""
from django.views.generic import DetailView
from schedule.models import Show, Season, Timeslot
from django.shortcuts import get_object_or_404
from django.http import Http404
def relative_season(show_id, season_num):
"""Attempts to find the... | CaptainHayashi/lass | urysite/schedule/views/showdb.py | Python | gpl-2.0 | 1,856 |
# -*- coding: utf8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)
"""
SLIP: a Simple Library for Image Processing.
See http://pythonhosted.org/SLIP
"""
import numpy as np
def imread(URL, grayscale=True, rgb2gray=[0.2989, 0.5870, 0.1140]):
"""
Loads whatever image. Re... | bicv/SLIP | SLIP/SLIP.py | Python | gpl-2.0 | 34,612 |
"""
WSGI config for redminerouter project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "redminerouter.settings")
from d... | fetux/redslack | redminerouter/wsgi.py | Python | lgpl-3.0 | 401 |
<<<<<<< HEAD
<<<<<<< HEAD
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | ArcherSys/ArcherSys | Lib/site-packages/github/tests/Issue140.py | Python | mit | 8,909 |
"""
Tests for discussion pages
"""
from uuid import uuid4
import pytest
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.fixtures.discussion import (
Comment,
Response,
SingleThreadViewFixture,
Thread,
)
from common.test.acceptance.pages... | msegado/edx-platform | common/test/acceptance/tests/discussion/test_discussion.py | Python | agpl-3.0 | 17,053 |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General Public
## Licens... | cherry-wb/SideTools | examples/widgets/spinboxes.py | Python | apache-2.0 | 8,097 |
import inspect
import os
import yaml
def parse_settings(name="deploy/settings.yaml"):
return _read_yaml(_path_from_root(name))
def _path_from_root(name):
root_path = os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), "..", "..")
file_path = os.path.join(root_path, name)
return fi... | chapmanb/cloudbiolinux | cloudbio/deploy/config.py | Python | mit | 437 |
# -*- coding: utf-8 -*-
"""Tests around prompting for and handling of choice variables."""
import click
import pytest
from cookiecutter.prompt import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4"""
@pyt... | luzfcb/cookiecutter | tests/test_read_user_choice.py | Python | bsd-3-clause | 1,291 |
#!/usr/bin/env python3
#CSCI 1300 - Assignment 6 Grader
#THESE LINES ARE NEEDED TO ADD THE GradingScriptLibrary path to the system path so they can be imported!!!
import os,sys,inspect
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"../../../... | Jackman3005/CUAutograding | CUAutogradingScripts/CourseFiles/CSCI-1300/HW7/HW7Grader.py | Python | agpl-3.0 | 6,478 |
import unittest
from katas.kyu_6.rainfall import mean, variance
class RainfallTestCase(unittest.TestCase):
def setUp(self):
self.test = 'Rome:Jan 81.2,Feb 63.2,Mar 70.3,Apr 55.7,May 53.0,Jun ' \
'36.4,Jul 17.5,Aug 27.5,Sep 60.9,Oct 117.7,Nov 111.0,De' \
'c 97.9\nLo... | the-zebulan/CodeWars | tests/kyu_6_tests/test_rainfall.py | Python | mit | 2,428 |
#!c:\users\montes\documents\github\fluid-designer\win64-vc\2.78\python\bin\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
try:
from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL
exc... | Microvellum/Fluid-Designer | win64-vc/2.78/Python/Scripts/enhancer.py | Python | gpl-3.0 | 1,649 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-19 15:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('probes', '0003_cellline'),
]
operations = [
m... | LeeYiFang/Carkinos | src/probes/migrations/0004_auto_20160119_2300.py | Python | mit | 1,551 |
"""This module provides classes that allow Numpy-type access
to VTK datasets and arrays. This is best described with some examples.
To normalize a VTK array:
import vtk
import vtk.numpy_interface.dataset_adapter as dsa
import vtk.numpy_interface.algorithms as algs
rt = vtk.vtkRTAnalyticSource()
rt.Update()
image = d... | keithroe/vtkoptix | Wrapping/Python/vtk/numpy_interface/dataset_adapter.py | Python | bsd-3-clause | 41,486 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import logging
import sys
from mopy.android import AndroidShell
from mopy.config import Config
from mopy.paths import ... | guorendong/iridium-browser-ubuntu | mojo/tools/android_mojo_shell.py | Python | bsd-3-clause | 1,770 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 fileencoding=utf-8
import json
from django.conf import settings
from django.core.management import BaseCommand
from django.utils import timezone
from django.utils.dateparse import parse_datetime
from django.utils.translation import ugettext_lazy
from odk_logger.models ... | eHealthAfrica/formhub | odk_logger/management/commands/sync_deleted_instances_fix.py | Python | bsd-2-clause | 1,538 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from base import FirefoxUIArguments
class UpdateBaseArguments(object):
name = 'Firefox UI Update Tests'
args =... | galgeek/firefox-ui-tests | firefox_ui_harness/arguments/update.py | Python | mpl-2.0 | 2,325 |
from otp.ai.AIBaseGlobal import *
from direct.distributed.ClockDelta import *
from otp.ai.MagicWordGlobal import *
import DistributedBossCogAI
from direct.directnotify import DirectNotifyGlobal
from otp.avatar import DistributedAvatarAI
import DistributedSuitAI
from toontown.battle import BattleExperienceAI
from direct... | Spiderlover/Toontown | toontown/suit/DistributedLawbotBossAI.py | Python | mit | 34,338 |
"""
BaseOAuth is inspired from Darren Kempiners YahooAPI https://github.com/dkempiners/python-yahooapi/blob/master/yahooapi.py
"""
from __future__ import absolute_import
try:
input = raw_input
except NameError:
pass
import json
import time
import logging
import webbrowser
import base64
from rauth.utils impo... | josuebrunel/yahoo-oauth | yahoo_oauth/oauth.py | Python | mit | 8,812 |
from django.db.models import Model, CharField, DateField, BooleanField, ForeignKey, Manager
# this app
from autoslug import AutoSlugField
from autoslug.settings import slugify as default_slugify
class SimpleModel(Model):
name = CharField(max_length=200)
slug = AutoSlugField()
class ModelWithUniqueSlug(Mod... | jpaulodit/django-autoslug | autoslug/tests/models.py | Python | lgpl-3.0 | 4,707 |
from pytz import timezone
USE_REQUEST_TRANSPORT_TYPE = True
REQUEST_TRANSPORT_TRANSIENT_ERROR_RETRIES = 5
REQUEST_TRANSPORT_TIMEOUT_CONNECT_WAIT = 4
REQUEST_TRANSPORT_TIMEOUT_RESPONSE_WAIT = 27
REQUEST_TRANSPORT_TIMEOUT_SEND_WAIT = 27
DISABLE_SSL_WARNINGS = True
SUPPORTED_SUDS_VERSION = 0.7
LOCAL_TZ='Europe/London'
AUT... | MattParr/python-atws | atws/constants.py | Python | mit | 1,123 |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | Kiesum/tfrs-1 | server/models/User.py | Python | apache-2.0 | 1,685 |
import unittest
import Util
import time
import selectBrowser
from selenium import webdriver
from flaky import flaky
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected... | ajm-asiaa/test | carta/html5/common/skel/source/class/skel/simulation/tAxis.py | Python | gpl-2.0 | 9,402 |
#!/usr/bin/env python
import subprocess
import sys
import pyinotify
import pynotify
import os
import time
class OnWriteHandler(pyinotify.ProcessEvent):
def my_init(self):
self.extensions = ('scss', 'sass')
pynotify.init('SassWatcher')
self.happy = 'file://' + os.path.abspath(os.path.curdir)... | krschmidt/SassWatcher | sasswatcher.py | Python | mit | 3,096 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | canarie/openstack-dashboard | django-openstack/src/django_openstack/nova/views/instances.py | Python | apache-2.0 | 9,293 |
# -*- coding: utf-8 -*-
from django.db.backends import BaseDatabaseIntrospection
import sybpydb as Database
SQL_AUTOFIELD = -777555
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Map type codes to Django Field types.
data_types_reverse = {
'bigdatetime': 'DateTimeField',
'bigdateti... | VanyaDNDZ/django-sybase-backend | sqlsybase_server/pyodbc/introspection.py | Python | unlicense | 12,072 |
#!/usr/bin/env python2
import datetime
import time
t = datetime.time(2, 3, 4)
print t
tt = datetime.time()
print tt
now = time.time()
print 'Now timestamp', now
print 'Date convert from ts' , datetime.date.fromtimestamp(now)
today = datetime.date.today()
print 'Today ', today
one_day = datetime.timedelta(days=1)
... | familug/FAMILUG | Python/datetimelib.py | Python | bsd-2-clause | 800 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.