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 |
|---|---|---|---|---|---|
from django.conf.urls import patterns, include, url
from django.contrib import admin
import questproj.views as views
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^googlefd8980378f4a07d2.html$', views.google_verify),
# url(r'', include('django_stormpath.urls')),
# url(r'^questapp/', includ... | hillscottc/quest | questproj/urls.py | Python | gpl-2.0 | 801 |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import unittest, os, argparse
def find_tests():
from calibre.utils.run_... | jelly/calibre | src/tinycss/tests/main.py | Python | gpl-3.0 | 1,952 |
# Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | Erethon/synnefo | contrib/snf-pithos-tools/pithos/tools/lib/fuse.py | Python | gpl-3.0 | 22,723 |
# Sulley EXception Class
class SullyRuntimeError(Exception):
pass | 0x90/wifuzzit | sulley/sex.py | Python | gpl-3.0 | 70 |
from social.tests.models import User
from social.tests.actions.actions import BaseActionTest
class LoginActionTest(BaseActionTest):
def test_login(self):
self.do_login()
def test_login_with_partial_pipeline(self):
self.do_login_with_partial_pipeline()
def test_fields_stored_in_session(se... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/social/tests/actions/test_login.py | Python | agpl-3.0 | 2,639 |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_elementwise_nn_grad.py | Python | apache-2.0 | 12,057 |
class Error(Exception):
pass
class PathError(Error, ValueError):
pass
class NotFoundError(Error, IOError):
pass
| codedcolors/pygrow | grow/pods/storage/errors.py | Python | mit | 122 |
#!/usr/bin/python2.2
import __future__
import os
import pexpect
import popen2
import re
import select
import sys
import time
import traceback
# swiped from doctest.py
class _SpoofOut:
def __init__(self):
self.clear()
def write(self, s):
self.buf.append(s)
def get(self):
guts = "".j... | stevegt/isconf4 | t/docgen.py | Python | gpl-2.0 | 7,279 |
'''
Requires paramiko >=1.8.0 (paramiko had an issue with multiprocessing prior
to this)
Example code showing how to use netmiko for multiprocessing. Create a
separate process for each ssh connection. Each subprocess executes a
'show version' command on the remote device. Use a multiprocessing.queue to
pass data fr... | nonemaw/pynet | python_netmiko_example/multiprocess_example.py | Python | gpl-2.0 | 2,939 |
import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="colorbar", parent_name="scatterternary.marker", **kwargs
):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotly/python-api | packages/python/plotly/plotly/validators/scatterternary/marker/_colorbar.py | Python | mit | 10,906 |
# Copyright (c) 2015 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... | eonpatapon/neutron | neutron/db/ipam_non_pluggable_backend.py | Python | apache-2.0 | 24,399 |
import web
import string
import random
import json
import datetime
@web.memoize
def get_db():
if 'database_url' in web.config:
return web.database(web.config.database_url)
else:
return web.database(**web.config.db_parameters)
class ResultSet:
"""Iterator wrapper over database result.
... | fsmk/fsmkschool | broadgauge/models.py | Python | bsd-3-clause | 9,468 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | zhimin711/nova | nova/tests/functional/api_sample_tests/test_keypairs.py | Python | apache-2.0 | 8,913 |
"""Tests for polynomial module.
"""
from __future__ import division
import numpy as np
import numpy.polynomial.polynomial as poly
from numpy.testing import *
def trim(x) :
return poly.polytrim(x, tol=1e-6)
T0 = [ 1]
T1 = [ 0, 1]
T2 = [-1, 0, 2]
T3 = [ 0, -3, 0, 4]
T4 = [ 1, 0, -8, 0, 8]
T5 = [ 0... | dagss/numpy_svn | numpy/polynomial/tests/test_polynomial.py | Python | bsd-3-clause | 16,380 |
import pytest
import torch
from sklearn import metrics
from torch.testing import assert_allclose
from allennlp.common.checks import ConfigurationError
from allennlp.common.testing import (
AllenNlpTestCase,
multi_device,
global_distributed_metric,
run_distributed_test,
)
from allennlp.training.metrics ... | allenai/allennlp | tests/training/metrics/auc_test.py | Python | apache-2.0 | 5,421 |
# -*- coding: utf-8 -*-
"""
Bridge to the pandas library.
.. autosummary::
:toctree: _toctree/pandas_bridge
spiketrain_to_dataframe
event_to_dataframe
epoch_to_dataframe
multi_spiketrains_to_dataframe
multi_events_to_dataframe
multi_epochs_to_dataframe
slice_spiketrain
:copyright: Cop... | INM-6/elephant | elephant/pandas_bridge.py | Python | bsd-3-clause | 22,237 |
import csv
import json
import numpy as np
import pandas as pd
def read_delim(filepath):
"""
Reads delimited file (auto-detects delimiter + header). Returns list.
:param filepath: (str) location of delimited file
:return: (list) list of records w/o header
"""
f = open(filepath, 'r')
diale... | FordyceLab/AcqPack | acqpack/utils.py | Python | mit | 6,206 |
#
# ElementTree
# $Id: ElementInclude.py 3225 2007-08-27 21:32:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.module.elementtree/lib/elementtree/ElementInclude.py | Python | gpl-2.0 | 5,051 |
import numpy as np
import matplotlib.pyplot as plt
plt.figure(1)
# ax1=plt.subplot(211)
x = np.linspace(-60,0,50)
y = 2/(1+np.exp((-x-15)/10))
for i in xrange(1,50):
plt.figure(1)
plt.plot(x,y)
plt.show() | xinghalo/DMInAction | src/test/07/time4.py | Python | apache-2.0 | 207 |
# Copyright 2014 Red Hat, 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 agre... | JioCloud/oslo.config | oslo_config/cfgfilter.py | Python | apache-2.0 | 12,758 |
#!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| django-debug-toolbar/django-debug-toolbar | example/manage.py | Python | bsd-3-clause | 314 |
from __future__ import division
from __future__ import print_function
from builtins import str
from builtins import range
from scipy import signal
from scipy.stats import uniform, norm
import numpy as np
import seaborn as sns
import matplotlib.mlab as ml
import matplotlib.pyplot as plt
from sima import spikes
######... | jzaremba/sima | examples/spikeinference.py | Python | gpl-2.0 | 4,351 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | NeCTAR-RC/nova | nova/tests/functional/api_sample_tests/test_agents.py | Python | apache-2.0 | 4,255 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Satpy developers
#
# This file is part of Satpy.
#
# Satpy 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, ... | pytroll/satpy | satpy/tests/reader_tests/test_mirs.py | Python | gpl-3.0 | 14,863 |
#!/usr/bin/env python
import numpy
import os
import random
import cPickle as pickle
import argparse
class Namegen(object):
PROB_PATH = 'prob.pickle'
def __init__(self, corpus='male.txt'):
if not os.path.exists(Namegen.PROB_PATH):
self.prob, self.sums = self.read_corpus(corpus)
... | volker48/namegen | namegen.py | Python | mit | 3,338 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Laurawly/tvm-1 | python/tvm/exec/popen_worker.py | Python | apache-2.0 | 3,340 |
from django.views.generic.base import TemplateView, View
from django.http import (
HttpResponse,
HttpResponseNotAllowed,
HttpResponseRedirect)
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.models import User
from django.contrib.auth import login
class SPAView(TemplateView):
... | andela-sjames/Django-ReactJS-Library-App | reactlibapp/libraryapp/views.py | Python | mit | 362 |
#!/usr/bin/env python
# -*- coding: ascii -*-
# flake8: noqa
#
# Copyright 2011, 2012
# Andr\xe9 Malo or his licensors, as applicable
#
# 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
#
# h... | ofer43211/unisubs | apps/unisubs_compressor/contrib/rjsmin.py | Python | agpl-3.0 | 10,789 |
#find L.C.M using recursion
print ('hi krishnakant welcome in python')
def lcm(x, y):
if x > y:
grt = x
else:
grt = y
while(True):
if((grt % x == 0) and (grt % y == 0)):
lcm = grt
break
grt += 1
return lcm
num1 = int(input("Enter first number: "))
num2 = int... | krishnakantkumar0/Simple-Python | 38.py | Python | gpl-3.0 | 410 |
#!/usr/bin/env python3
import os
import launch_jobs
import path_utils
class CustomTask(launch_jobs.BaseTask):
def get_desc(self):
return "rm"
def _read_params(self):
target_path = None
ignore_non_pre_existence = "ignore_non_pre_existence" in self.params
# target_path
... | mvendra/mvtools | launchers/launch_jobs_plugins/tasks/rm_plugin.py | Python | mit | 1,147 |
import asyncio
import time
from generic.game import REGISTERED_GAMES
from generic.game.exeptions import GameAlreadyExists, GameNotExists
from generic.game.signals import Signal
class game(type):
def __new__(cls, name, bases, attrs):
new_cls = type.__new__(cls, name, bases, attrs)
if attrs['slug']... | devova/SimpleCommander | command_server/generic/game/base.py | Python | mit | 2,994 |
from exp.views.analytics import * # noqa
from exp.views.contact import * # noqa
from exp.views.dashboard import * # noqa
from exp.views.lab import * # noqa
from exp.views.responses import * # noqa
from exp.views.study import * # noqa
from exp.views.user import * # noqa
from exp.views.video import * # noqa
| CenterForOpenScience/lookit-api | exp/views/__init__.py | Python | apache-2.0 | 315 |
#!/usr/bin/env python
"""Installer for radeontray program
Copyright 2012-2013 Francisco Pina Martins <f.pinamartins@gmail.com>
and Mirco Tracolli.
This file is part of Radeon-tray.
Radeon-tray is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
t... | StuntsPT/Radeon-tray | setup.py | Python | gpl-3.0 | 2,772 |
from django.conf import settings
from django.shortcuts import render
from django.db.models import F
import django_tables2 as tables
import django_filters as filters
from django_filters.views import FilterView
from django_peeringdb.models import Network, IXLan, InternetExchange
from peercollect.models import Peering
f... | paravoid/peerassist | peermatch/views.py | Python | apache-2.0 | 3,980 |
"""
Views which allow users to create and activate accounts.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from registration.forms import Regist... | umitproject/openmonitor-aggregator | registration/views.py | Python | agpl-3.0 | 5,801 |
# minent.settings
# Settings module for the Minimum Entropy application
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Tue Jul 05 14:10:19 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: __init__.py [737e142] benjamin@bengfort.com $
... | DistrictDataLabs/minimum-entropy | minent/settings/__init__.py | Python | apache-2.0 | 542 |
#! /usr/bin/env python
import sys
import random
import math
from sets import Set
# adds node attribute of which shard node should be placed on
num_shards = 8
num_runs = 1
capacity = 84000/num_shards
assignments = dict()
shard_sizes = [0] * num_shards
LDG = True
G = {}
def load(argv):
assert(len(argv) == 2)
p... | Determinant/weaver | tests/static_partitioning/stream_partition.py | Python | bsd-3-clause | 3,924 |
#!/usr/bin/env python
import sys
import oauth2 as oauth
import time
import json
import urllib
TWEET_SIZE = 140
INITIAL_MSG = ".@NSAGov @stupidhackathon I just want a safer America"
TWEET_PREFIX = ".@NSAGov @stupidhackathon "
RATE_BUFFER_SECS = 7.0
# Set up instances of our Token and Consumer. The Consumer.key and
#... | komizutama/OptIn | publisher.py | Python | artistic-2.0 | 2,143 |
import angr
import claripy
import os
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
def test_i386():
p = angr.Project(os.path.join(test_location, 'i386', 'test_strcasecmp'), auto_load_libs=False)
arg1 = claripy.BVS('arg1', 20*8)
s = p.factory.en... | angr/angr | tests/test_strcasecmp.py | Python | bsd-2-clause | 780 |
# Copyright (C) 2009-2012 Lars Wirzenius
#
# 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 License, or
# (at your option) any later version.
#
# This program is distribu... | perryl/morph | cliapp/plugin.py | Python | gpl-2.0 | 4,073 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | kayhayen/Nuitka | tests/benchmarks/constructs/InplaceOperationStringAdd.py | Python | apache-2.0 | 1,500 |
#! /usr/bin/env python2
from SimpleHTTPServer import SimpleHTTPRequestHandler
import BaseHTTPServer
class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Access-Control-Allow-Origin', '*')
SimpleHTTPRequestHandler.end_headers(self)
if __name__ == '__main__'... | warehouseman/trello-swagger-generator | dev/http_cors_server.py | Python | mit | 394 |
import _plotly_utils.basevalidators
class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hovertextsrc", parent_name="contour", **kwargs):
super(HovertextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | plotly/python-api | packages/python/plotly/plotly/validators/contour/_hovertextsrc.py | Python | mit | 453 |
##############################################################################
#
# Copyright (c) 2008-2010 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
# General contacts <info@kndati.lv>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the who... | Micronaet/micronaet-migration | __UNPORTED__/report_aeroo_gpb/order_line.py | Python | agpl-3.0 | 5,034 |
# Copyright (c) 2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import re
from . import AWSObject, AWSProperty, Tags
from .validators import boolean, integer, network_port
def validate_node_group_id(node_group_id):
if re.match(r'\d{1,4}', node_group_id):
ret... | ikben/troposphere | troposphere/elasticache.py | Python | bsd-2-clause | 5,785 |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | alfasin/st2 | st2common/tests/unit/test_db_trace.py | Python | apache-2.0 | 7,466 |
"""
sentry.templatetags.sentry_helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
# XXX: Import django-paging's template tags so we don't have to worry about
# INSTALLED_APPS
from __future__ import... | argonemyth/sentry | src/sentry/templatetags/sentry_helpers.py | Python | bsd-3-clause | 13,614 |
# coding=utf-8
# Copyright 2018 The Batfish Open Source Project
#
# 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 requi... | batfish/pybatfish | pybatfish/datamodel/flow.py | Python | apache-2.0 | 57,636 |
#-------------------------------------------------------------------------------
# Name: IENA
# Purpose: Class to pack and unpack IENA packets
#
# Author: DCollins
#
# Created: 19/12/2013
#
# Copyright 2014 Diarmuid Collins
#
# This program is free software; you can redistribute it and/... | douglaskastle/AcraNetwork | AcraNetwork/IENA.py | Python | gpl-2.0 | 4,674 |
from .secret import *
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + TESTING_APPS + CUSTOM_APPS + DEBUG_APPS
DEBUG = True
TEMPLATE_DEBUG = DEBUG
| cpscanarias/ssfinder-back-end | ssfinder_back_end/ssfinder_back_end/projects_settings/local.py | Python | gpl-3.0 | 151 |
#chunk_size = 64
freq_table = {'Xeon 3.2Ghz': 3.2*1024*1024*1024,
'Xeon 3.0Ghz': 3.0*1024*1024*1024,
'Xeon 2.5GHz L5420': 2.5*1000*1000*1000,
'2.4Ghz': 2.3*1024*1024*1024,
'2.3Ghz': 2.3*1024*1024*1024,
'2.0Ghz': 2.0*1024*1024*1024,
'1.8Ghz': 1.5*1024*1024*1024,
'1.6Ghz': 1.5*1024*1024*1024,
}
... | toomanyjoes/mrperfcs386m | internetTest/hadoop_conf.py | Python | mit | 952 |
# Copyright 2019 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... | tensorflow/kfac | kfac/python/ops/kfac_utils/data_reader.py | Python | apache-2.0 | 5,162 |
from django.contrib import admin
from .models import Message
# Register your models here.
admin.site.register(Message)
| lyubomir1993/AlohaServer | admin.py | Python | apache-2.0 | 121 |
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class ShopifyAccount(ProviderAccount):
pass
class ShopifyProvider(OAuth2Provider):
id = 'shopify'
name = 'Shopify'
a... | wli/django-allauth | allauth/socialaccount/providers/shopify/provider.py | Python | mit | 1,032 |
import os, olefile, re, tempfile
from joblib import Parallel, delayed
from datetime import date
def create_tsv(di, file):
file.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' % (di['name'].decode(), di['prod code'].decode(), di['sku'].decode(), di['density'].decode(), di['sku_letter'].decode(), di['form_factor... | NaveenGop/projects | Intel/WordParse.py | Python | apache-2.0 | 9,074 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
'''Class for reading GRD files into memory, without processing them.
'''
import os.path
import types
import xml.sax
import xml.sax... | JoKaWare/WTL-DUI | tools/grit/grit/grd_reader.py | Python | bsd-3-clause | 5,542 |
# 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... | tensorflow/tensorflow | tensorflow/python/ops/ragged/ragged_gather_op_test.py | Python | apache-2.0 | 19,868 |
# lock.py
# DNF Locking Subsystem.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dist... | atodorov/dnf | dnf/lock.py | Python | gpl-2.0 | 5,154 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | alexlo03/ansible | lib/ansible/modules/windows/win_scheduled_task.py | Python | gpl-3.0 | 17,525 |
#!/usr/bin/python
#
# Cppcheck - A tool for static C/C++ code analysis
# Copyright (C) 2007-2015 Daniel Marjamaeki and Cppcheck team.
#
# 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 ver... | bolbol2night/cppcheck | tools/extracttests.py | Python | gpl-3.0 | 10,086 |
#!/usr/bin/python -u
#
#
#
#################################################################################
# Start off by implementing a general purpose event loop for anyones use
#################################################################################
import sys
import getopt
import os
import libvirt
impor... | utkarshsins/baadal-libvirt-python | examples/event-test.py | Python | gpl-2.0 | 22,504 |
# converts incoming data array from temperature measurments
# The incoming data should be of the form [Temp, Time, Date] this is put into a dictionary
# The dictionary can then be converted into a comma delimited file at the end of the program
import os
import time
import Temp
dire = "/home/pi/brewing/temps/"
def int... | Mr-President/brewing | dataman.py | Python | bsd-2-clause | 686 |
from Sire.IO import *
from Sire.Mol import *
from Sire.System import *
from Sire.MM import *
from Sire.Units import *
amber = Amber()
print("Loading the molecules...")
(molecules, space) = amber.readCrdTop("test/io/SYSTEM.crd", "test/io/SYSTEM.top")
print("...all loaded :-)")
protein = molecules[MolNum(2)].molecule... | chryswoods/SireTests | unittests/SireMM/testintracutoff.py | Python | gpl-2.0 | 1,618 |
from ccs import constants
from ccs import default
##################################################################################
# HOSTNAME #
##################################################################################
HOSTNAME = "api.th... | Honzin/ccs | dev/therocktraiding/configuration.py | Python | agpl-3.0 | 5,212 |
#! /usr/bin/python
#-*-coding: utf8-*-
import os.path
import collections
import jinja2
import random
import qrcode
import os
import sys
import pprint
import json
import scanresults
import argparse
database = collections.defaultdict(lambda: [])
questions_by_id = {}
restrictions = {}
restrictions_order = {}
test_id = ... | matcom/autoexam | gen.py | Python | mit | 15,531 |
# -*- coding: utf-8 -*-
"""
Pelican Mathjax Markdown Extension
==================================
An extension for the Python Markdown module that enables
the Pelican python blog to process mathjax. This extension
gives Pelican the ability to use Mathjax as a "first class
citizen" of the blog
"""
import markdown
from... | jprine/pelican-plugins | render_math/pelican_mathjax_markdown_extension.py | Python | agpl-3.0 | 6,633 |
from config import *
from flask_wtf import Form
from wtforms import IntegerField, TextAreaField, TextField, BooleanField, SubmitField, SelectMultipleField, validators
class CustomForm(Form):
def __init__(self,*args):
super(CustomForm,self).__init__(*args)
self.__delitem__('csrf_token')
sel... | JohnDoorenbos/courseFinder | forms.py | Python | mit | 1,537 |
#Filters:
import os
import re
import tRNASeqTools.extractor as extractor
class IsTRNA:
def __init__(self, output_path):
self.ANTICODON_LOOP_GUIDELINES = [0, (('T'), ('A', 'G')), [], [], 0]
self.allowed_pairings = {"G":("C", "T"), "T":("A", "G"), "C":("G"), "A":("T"), "N": ()}
self.sub_si... | merenlab/tRNA-seq-tools | tRNASeqTools/filters.py | Python | gpl-3.0 | 10,988 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
BANKS = {
'RBC Banque Royale': {
'protocol': 'https',
'domain': 'www1.royalbank.com',
'path': '/cgi-bin/rbaccess/rbunxcgi?F6=1&F7=IB&F21=IB&F22=IB&REQUEST=ClientSignin&LANGUAGE=FRENCH',
},
'TD Canada Trust': {
'protocol': 'ht... | savoirfairelinux/quebec-monitoring | scripts/banks.py | Python | agpl-3.0 | 3,447 |
# 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 sockjs.tornado import SockJSRouter, SockJSConnection
from snorky.client import Client
import json
class SockJSCli... | ntrrgc/snorky | snorky/request_handlers/sockjs.py | Python | mpl-2.0 | 2,177 |
tracebacks = [
"""Traceback (most recent call last):
File "/lib/python2.6/site-packages/django_some_really_cool_module-py2.6.egg/module/class.py", line 99, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/mnt/services/airship/lib/python2.6/site-packages/Django-... | gmcquillan/firetower | firetower/tracebacks.py | Python | mit | 5,887 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing f... | aptivate/django-organizations | organizations/migrations/0004_auto__chg_field_organization_name__chg_field_organization_slug.py | Python | bsd-2-clause | 7,240 |
# -*- coding: utf-8 -*-
import re
korean_regex = r'.[a-zA-Z][a-zA-Z0-9][test.com]$'
kl_pattern = re.compile(korean_regex)
title_list = [
u'aaa.test.com',
u'1.test.com',
u'-.test.com',
u'bbb.bbb.test.com',
u'cc.cc.cc12.test.com',
u'dd.dd.ddtest.com/dd',
]
for title in title_list:
#... | motobyus/moto | util/regularExpression/subdomain.py | Python | mit | 469 |
from django.conf import settings
from django.db import models
# Create your models here.
User = settings.AUTH_USER_MODEL
def upload_location(instance, filename):
#extension = filename.split(".")[1]
location = str(instance.user.username)
return "%s/%s" %(location, filename)
class Profile(models.Model):
user = ... | pachinko/matchmaker_profile | src/profiles/models.py | Python | mit | 563 |
#!/usr/bin/env python3.7
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | chrismattmann/drat | distribution/src/main/resources/bin/list-ghe-repos.py | Python | apache-2.0 | 1,171 |
"""
Support for Neato Connected Vaccums switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.neato/
"""
import logging
import requests
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.helpers.entity import ToggleEntity
fr... | MungoRae/home-assistant | homeassistant/components/switch/neato.py | Python | apache-2.0 | 4,019 |
from django.db.models import Q
import sal.plugin
TITLES = {
'ok': 'Machines with Gatekeeper enabled',
'alert': 'Machines without Gatekeeper enabled',
'unknown': 'Machines with unknown Gatekeeper status'}
PLUGIN_Q = Q(pluginscriptsubmission__plugin='Gatekeeper')
SCRIPT_Q = Q(pluginscriptsubmission__plugin... | salopensource/sal | server/plugins/gatekeeper/gatekeeper.py | Python | apache-2.0 | 1,854 |
# Copyright 2018 Capital One Services, LLC
#
# 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... | Sutto/cloud-custodian | tools/c7n_gcp/c7n_gcp/resources/resourcemanager.py | Python | apache-2.0 | 2,882 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/py-pytest-mock/package.py | Python | lgpl-2.1 | 1,766 |
import bpy
from math import sqrt, asin, sin, cos, atan, pi
from functools import reduce
from fashion_project.modules.draw.lines import is_one_of_lines, get_line_length, selection_is_contour
from fashion_project.modules.draw.lines.line_for_dart import LineForDart
from fashion_project.modules.draw.points.point import P... | TriumphLLC/FashionProject | modules/operators/tools/details/modeling.py | Python | gpl-3.0 | 10,909 |
import keras
import pickle
from videotest import VideoTest
import sys
sys.path.append("..")
from ssd import SSD300 as SSD
input_shape = (300,300,3)
# Change this if you run with other classes than VOC
class_names = ["background", "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", ... | rykov8/ssd_keras | testing_utils/videotest_example.py | Python | mit | 826 |
# -*- coding: utf-8 -*-
from orator.orm import Factory, Model, belongs_to, has_many
from orator.connections import SQLiteConnection
from orator.connectors import SQLiteConnector
from .. import OratorTestCase, mock
class FactoryTestCase(OratorTestCase):
@classmethod
def setUpClass(cls):
Model.set_con... | sdispater/orator | tests/orm/test_factory.py | Python | mit | 4,197 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matthias Klumpp <mak@debian.org>
# Copyright (C) 2013 Wilson Xu <imwilsonxu@gmail.com>
#
# 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 ve... | limba-project/limba-hub | lihub/user/views.py | Python | gpl-3.0 | 1,576 |
#!/usr/bin/env python
# @package vfnow
# \author Ed Bueler and Constantine Khroulev, University of Alaska Fairbanks, USA
# \brief A script for verification of numerical schemes in PISM.
# \details It specifies a refinement path for each of Tests ABCDEFGIJKL and runs
# pismv accordingly.
# Copyright (C) 2007--2013, 201... | talbrecht/pism_pik | test/vfnow.py | Python | gpl-3.0 | 13,390 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
Zona = {
"Zona_1":["La Boca","Calzada de Amador"],
"Zona_2":["San Felipe","Chorrillo","Santa Ana","Ancón"],
"Zona_3":["Calidonia","San Miguel","Albrook","Altos de Diablo"],
"Zona_4":["Punta Paitilla","Bella Vista","Universidad"] ,
"Zona_5":["Punta Pacífica","El Dorado","La... | mdmirabal/Parcial2-Prog3 | zona.py | Python | mit | 683 |
EMAIL_PORT = 1025
ROOT_URLCONF = 'django_mailer.apptest.urls'
SECRET_KEY = 'yo secret yo'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'django_mailer.sqlite',
},
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django_maile... | maykinmedia/django-mailer-2 | django_mailer/testapp/settings.py | Python | mit | 354 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-08 14:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0052_baseexporttask_2'),
]
operations = [
migrations.AlterField... | onaio/rapidpro | temba/contacts/migrations/0053_auto_20170208_1450.py | Python | agpl-3.0 | 837 |
import sys
import pytest
import yaml
from distributed import Client
from distributed.scheduler import COMPILED
from distributed.utils_test import gen_test, popen
@pytest.mark.skipif(COMPILED, reason="Fails with cythonized scheduler")
@gen_test(timeout=120)
async def test_text():
with popen(
[
... | dask/distributed | distributed/cli/tests/test_dask_spec.py | Python | bsd-3-clause | 2,830 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Raul Melo
# Written by Raul Melo <raulmelo@gmail.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_impo... | tsdmgz/ansible | lib/ansible/modules/packaging/os/swdepot.py | Python | gpl-3.0 | 6,161 |
"""
PaStA - Patch Stack Analysis
Copyright (c) OTH Regensburg, 2016-2019
Author:
Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
This work is licensed under the terms of the GNU GPL, version 2. See
the COPYING file in the top-level directory.
"""
from logging import getLogger
log = getLogger(__name__[-15:])
c... | lfd/PaStA | pypasta/Clustering.py | Python | gpl-2.0 | 8,421 |
# Generated by Django 2.2.24 on 2021-07-08 05:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cyklomapa', '0008_czechiaaccidents_priciny_nehody'),
]
operations = [
migrations.AddField(
model_name='czechiaaccidents',
... | auto-mat/prahounakole | apps/cyklomapa/migrations/0009_czechiaaccidents_lokalita.py | Python | gpl-3.0 | 423 |
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
# Uncomment below in order to disallow redirects
#REDIRECT_ENABLED = False
# Uncomment this to lessen the spider's output
#LOG_LEVEL = 'INFO'
BOT_NAME = 'quickscan_spider'
SPIDER_MODULES = ['quickscan.spiders']
NEWSPIDER_MODULE = 'quickscan.spiders'
# ... | DanMcInerney/quickscan | quickscan/settings.py | Python | gpl-2.0 | 1,328 |
# -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2001 - 2020 Massimo Gerardi all rights reserved.
#
# Author: Massimo Gerardi massimo.gerardi@gmail.com
#
# Copyright (c) 2020 Qsistemi.com. All rights reserved.
#
# Viale Giorgio Ribotta, 11 (Roma)
# 00144 Roma (RM) - Italy
# Phone: (+39) 06.87.163
#
#
# Si veda ... | phasis/phasis | phasis/ordi/ordini.py | Python | gpl-2.0 | 131,879 |
# coding=utf-8
import unittest
"""482. License Key Formatting
https://leetcode.com/problems/license-key-formatting/description/
You are given a license key represented as a string S which consists only
alphanumeric character and dashes. The string is separated into N+1 groups by
N dashes.
Given a number K, we would ... | openqt/algorithms | leetcode/python/lc482-license-key-formatting.py | Python | gpl-3.0 | 1,788 |
class World:
"""Znaki z ktorych sklada sie mapa swiata."""
EXIT = 'W'
"""Znak umieszczany mapie oznaczajacy pole z wyjsciem."""
CAVE = 'J'
"""Znak umieszczany mapie oznaczajacy pole z jama."""
EMPTY = '.'
"""Znak umieszczany mapie oznaczajacy puste pole."""
| uHappyLogic/lost-wumpus | world.py | Python | mit | 289 |
#=============================================================================
# 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) ... | hdlj/MongooseOS | Resource/Example2/app2.py | Python | gpl-3.0 | 1,153 |
from pprint import pprint as pp
from RMPY import RMRigTools
from RMPY import nameConvention
from RMPY import RMRigShapeControls
import re
import pymel.core as pm
from RMPY.AutoRig.Hand import RMGenericHandStructure
class RMGenericHandRig(object):
def __init__(self, NameConv=None):
if not NameConv:
... | rendermotion/RMPY | AutoRig/Hand/RMGenericHandRig.py | Python | lgpl-3.0 | 12,164 |
#!/usr/bin/python
#
# Copyright 2010 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 requir... | mashery/io-wraps | google-apis-client-generator/src/googleapis/codegen/library_package.py | Python | mit | 3,328 |
#!/usr/bin/python
from __future__ import print_function
import sys
from time import sleep, time
from argparse import ArgumentParser
import os
import sqlite3
from datetime import datetime
import errno
import socket
from select import select
import traceback
from collections import deque, defaultdict, namedtuple
try:
... | bwduncan/autoboiler | autoboiler.py | Python | agpl-3.0 | 15,780 |
from know_me import models
from know_me.serializers import subscription_serializers
def test_serialize_inactive():
"""
If an inactive subscription is serialized, ``is_active`` should be
``False`` and all other fields should be ``None``.
"""
subscription = models.Subscription(is_active=False)
s... | knowmetools/km-api | km_api/know_me/journal/tests/serializers/test_subscription_serializer.py | Python | apache-2.0 | 1,653 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.