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 |
|---|---|---|---|---|---|
# minqlx - Extends Quake Live's dedicated server with extra functionality and scripting.
# Copyright (C) 2015 Mino <mino@minomino.org>
# This file is part of minqlx.
# minqlx 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 Softw... | mgaertne/minqlx-plugin-tests | src/main/python/minqlx/_core.py | Python | bsd-3-clause | 16,459 |
# -*- coding: utf-8 -*-
#
# Graph : graph package
#
# Copyright or Copr. 2006 INRIA - CIRAD - INRA
#
# File author(s): Jerome Chopard <jerome.chopard@sophia.inria.fr>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at
# http://www.cecill.in... | revesansparole/oacontainer | src/openalea/container/graph.py | Python | mit | 14,189 |
""" Test functions for stats module
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_array_equal, assert_almost_equal, assert_array_almost_equal, \
assert_allclose, assert_, assert_raises, rand, dec
from numpy.tes... | sargas/scipy | scipy/stats/tests/test_distributions.py | Python | bsd-3-clause | 42,192 |
#!/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.
"""Generate keyboard layout and hotkey data for the keyboard overlay.
This script fetches data from the keyboard layout and hotkey... | ds-hwang/chromium-crosswalk | tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py | Python | bsd-3-clause | 17,124 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: Dialog.py
from Tkinter import *
from Tkinter import _cnfmerge
if TkVersion <= 3.6:
DIALOG_ICON = 'warning'
else:
DIALOG_ICON = 'questhead'
c... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/lib-tk/Dialog.py | Python | unlicense | 1,325 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | eicher31/compassion-modules | sbc_compassion/controllers/__init__.py | Python | agpl-3.0 | 426 |
from distutils.core import setup
setup(name='thonmux',
packages=['thonmux'],
version='0.0.6',
description='Interact with tmux in a pythonic way',
author='Gabriel Lima',
author_email='ewilazarus@gmail.com',
url='https://github.com/ewilazarus/thonmux',
download_url='https://gith... | ewilazarus/thonmux | setup.py | Python | mit | 416 |
class BundleConfiguration(object):
def PIPELINE_CSS(self):
return {
'client': {
'source_filenames': [
'font-awesome/css/font-awesome.css',
'css/client.less',
],
'output_filename': 'css/client.css',
... | mythmon/edwin | edwin/bundles.py | Python | mpl-2.0 | 584 |
# -*- coding: utf-8 -*-
"""
Framework-independant wrappers.
Those functions are proxies for the framework's functions.
"""
from __future__ import absolute_import, unicode_literals, print_function
import chardet
def _is_flask():
try:
from flask import current_app
current_app.name
except (Imp... | vivekanand1101/fresque | fresque/lib/utils.py | Python | agpl-3.0 | 1,578 |
#!/usr/bin/env python
import codecs
import imp
import os
from setuptools import find_packages, setup
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
app = imp.load_source('s_analyzer', os.path.join(ROOT, 'src', 's_analyzer', '__init__.py'))
def read(*files):
content = []
for f in files:
... | iaga84/securities-analyzer | setup.py | Python | mit | 1,471 |
import sys
from modelBuild import *
from constants import *
from PyQt4.QtGui import QPixmap, QImage, QPen, QGraphicsPixmapItem, QGraphicsLineItem
from PyQt4.QtCore import pyqtSignal
from kkitUtil import *
from setsolver import *
from PyQt4 import QtSvg
from moose import utils
class GraphicalView(QtGui.QGraphicsView):... | dilawar/moose-full | moose-gui/plugins/kkitViewcontrol.py | Python | gpl-2.0 | 58,605 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_featurestore_service_batch_create_features_sync.py | Python | apache-2.0 | 1,861 |
#!/usr/bin/env python
# coding=utf-8
import os
import tempfile
import shutil
import imp
from contextlib import closing
from zipfile import ZipFile, ZIP_DEFLATED
class Provider(object):
def __init__(self, user, password,
database,
host, port):
super(Provider, self).__in... | exherb/dbacker | dbacker/providers/provider.py | Python | mit | 2,369 |
import matplotlib.pyplot as plt
import numpy as np
import os
from inference import error_fn, infer_interactions, choose_J_from_general_form, solve_true_covariance_from_true_J
from pitchfork_langevin import jacobian_pitchfork, gen_multitraj, steadystate_pitchfork
from settings import DEFAULT_PARAMS, FOLDER_OUTPUT, TAU
... | mattsmart/biomodels | transcriptome_clustering/baseline_reconstruction_error.py | Python | mit | 7,422 |
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
this.val = val
this.left, this.right = None, None
"""
class Solution:
"""
@param root: The root of binary tree.
@return: An integer
"""
def maxDepth(self, root):
# write your code here
if root ... | shootsoft/practice | lintcode/NineChapters/03/maximum-depth-of-binary-tree.py | Python | apache-2.0 | 469 |
import os
from nose import SkipTest
import copy
import numpy as np
import pandas as pd
from pandas import DataFrame
from pandas.util.testing import TestCase
import pandas.util.testing as tm
# this is a mess. Getting failures on a python 2.7 build with
# whenever we try to import jinja, whether it's installed or not.
... | pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pandas/tests/test_style.py | Python | gpl-2.0 | 23,908 |
import grpc
import pandas as pd
import skl_pb2
import predict_pb2
import model_pb2
from utils import pandas_to_proto
def run():
df = pd.DataFrame(columns=list('abc'), data=pd.np.random.rand(10, 3))
channel = grpc.insecure_channel('localhost:50051')
stub = skl_pb2.PredictionServiceStub(channel)
print... | pprett/grpc-kubernetes-skl-tutorial | skl-server/skl_client.py | Python | bsd-3-clause | 592 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-29 19:49
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import swapper
from ..util import add_continents as util_add_continents
def get_model(... | coderholic/django-cities | cities/migrations/0002_continent_models_and_foreign_keys.py | Python | mit | 2,948 |
# text2numbers.py
# A program to convert a textual message into a sequence of
# numbers, utilizing the underlying Unicode encoding.
def main():
print("This program converts a textual message into a sequence")
print("of numbers representing the Unicode encoding of the message.\n")
#... | cynthiacarter/Code-ch05 | text2numbers.py | Python | mit | 639 |
# Copyright (c) 2013 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 ... | projectcalico/calico-neutron | neutron/tests/unit/ml2/test_type_gre.py | Python | apache-2.0 | 3,430 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
('community', '0006_auto_20150208_0818'),
]
operations = [
migrations.CreateModel(
... | willingc/portal | systers_portal/membership/migrations/0001_initial.py | Python | gpl-2.0 | 1,027 |
import numpy
import shocktube
import vtktools
import matplotlib.pyplot as plt
import matplotlib as mpl
import subprocess
import sys
time_levels=numpy.arange(0,99)
filename_part='shocktube_'
for time_level in time_levels:
filename_in = filename_part + str(time_level) + '.vtu'
filename_out = filename_part + str(for... | rjferrier/fluidity | tests/shocktube_1d/animate_plot.py | Python | lgpl-2.1 | 2,232 |
import os
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# WEBROOT is the location relative to Webserver root
# should end with a slash.
WEBROOT = '/'
# LOGIN_URL = WEBROOT + 'auth/login/'
# LOGOUT_URL = WEBROOT + 'auth/logout... | sandvine/os-ansible-deployment-lite | ansible/roles/horizon/templates/local_settings.py | Python | apache-2.0 | 22,975 |
"""
Django settings for mediapanel project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | Ultimatum22/MediaPanel | mediapanel/settings.py | Python | apache-2.0 | 2,171 |
#!/usr/bin/env python
# this program is used to test latency
# don't test RTT bigger than 3 secs - it will break
# we make sure that nothing breaks if there is a packet missing
# this can rarely happen
import select
import socket
import time
import sys
import struct
def pong():
# easy, receive and send back
... | olbat/distem | test/experimental_testing/exps/latency.py | Python | gpl-3.0 | 1,573 |
# Copyright (C) 2011 Daniele Simonetti
#
# 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 dist... | tectronics/l5rcm | sinks/sink_3.py | Python | gpl-3.0 | 4,505 |
from __future__ import unicode_literals
import importlib
import logging
from celery.signals import worker_process_init
from django.conf.urls import include, url
from django.contrib.auth.models import User, AnonymousUser
from django.conf import settings
from temba.channels.views import register, sync
from django.views... | tsotetsi/textily-web | temba/urls.py | Python | agpl-3.0 | 3,662 |
""" Module matching %GC compo distribution b/w fg and bg. """
import sys
import random
from Bio import SeqIO
from utils import GC
def fg_GC_bins(fg_file):
"""
Compute G+C content for all sequences in the foreground.
It computes the %GC content and store the information in a list. To each
G+C percen... | wassermanlab/BiasAway | GC_compo_matching.py | Python | gpl-3.0 | 10,757 |
# -*- coding: utf-8 -*-
'''
Copyright 2013 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 applic... | smallyear/linuxLearn | salt/salt/cloud/clouds/gce.py | Python | apache-2.0 | 60,909 |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2012 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | walterbender/turtleconfusion | TurtleArt/util/odf/attrconverters.py | Python | mit | 75,191 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | kaczmarj/neurodocker | neurodocker/_version.py | Python | apache-2.0 | 18,468 |
"""
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
from framework.controller import *
import framework.util as util
import giveaminute.project as mProject
import giveaminute.idea as mIdea
import giveaminute.projectResource as mProjectReso... | localprojects/Change-By-Us | controllers/project.py | Python | agpl-3.0 | 20,727 |
# myaixterm.py: custom color mappings for the aixterm 256-color palette.
# Copyright (c) cxw 2015
import itertools
import csv
import os
_DEF_COLOR_FN= 'myaixterm-db.txt'
aix_colors={}
def get_all_colors():
return aix_colors
def aix_fg(color):
""" Returns a string that will set the foreground to _color_, wh... | fareskalaboud/pybugger | pybugger/myaixterm.py | Python | gpl-3.0 | 1,472 |
import logging
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.exceptions import (
DistributionNotFound,
InstallationError,
UnsupportedPythonVersion,
UnsupportedWheel,
)
from pip._internal.models.wheel import Wheel
from pip._internal.req.req_install import InstallRequireme... | RalfBarkow/Zettelkasten | venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py | Python | gpl-3.0 | 16,888 |
import sys
import types
import pkg_resources
import pytest
import pandas.util._test_decorators as td
import pandas
dummy_backend = types.ModuleType("pandas_dummy_backend")
setattr(dummy_backend, "plot", lambda *args, **kwargs: "used_dummy")
@pytest.fixture
def restore_backend():
"""Restore the plotting backen... | pandas-dev/pandas | pandas/tests/plotting/test_backend.py | Python | bsd-3-clause | 3,593 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | crossroadchurch/paul | openlp/plugins/songs/songsplugin.py | Python | gpl-2.0 | 15,565 |
# -*- coding: utf-8 -*-
def command():
return "edit-instance-vmware"
def init_argument(parser):
parser.add_argument("--instance-no", required=True)
parser.add_argument("--instance-type", required=True)
parser.add_argument("--key-name", required=True)
parser.add_argument("--compute-resource", requi... | primecloud-controller-org/pcc-cli | src/pcc/api/instance/edit_instance_vmware.py | Python | apache-2.0 | 1,746 |
#!/usr/bin/env python
# coding=utf-8
"""
Excel工具类, 简化操作
"""
class ExcelUtil(object):
"""
Excel工具类, 简化操作
"""
def __init__(self):
pass
| ctrlzhang/java_dto_generator | ExcelUtil.py | Python | apache-2.0 | 202 |
#!/usr/bin/env python3
#
# Migration test direct invokation command
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the Licens... | dslutz/qemu | tests/migration/guestperf.py | Python | gpl-2.0 | 862 |
NAME="Local Audio Player Backend"
AUTHOR="Martin Altmayer"
VERSION="1.0"
DESCRIPTION="Provides an audio backend using the QtMultimedia framework."
| maestromusic/maestro | maestro/plugins/localplay/__init__.py | Python | gpl-3.0 | 147 |
def __init__(self, enum):
self._enum = enum
def typify(self, character):
v = ord(character)
u = character
if 65 <= v and v <= 90 or 97 <= v and v <= 122 or \
v == 95 or 48 <= v and v <=57:
return self._enum.ALPHA_DIGIT_OR_UNDERSCORE
if u == '`':
return self._enum.QUOTE_SYMBOL
if u in ['(', ')', '[', ']', '... | BourgondAries/Unnamed-Language | CxyP/lex/typify/Typifier.py | Python | gpl-3.0 | 665 |
"""
matplotlib includes a framework for arbitrary geometric
transformations that is used determine the final position of all
elements drawn on the canvas.
Transforms are composed into trees of :class:`TransformNode` objects
whose actual value depends on their children. When the contents of
children change, their pare... | lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/matplotlib/transforms.py | Python | mit | 88,425 |
"""Contains the drivers and interface code for pinball machines which
use the Multimorphic R-ROC hardware controllers.
This code can be used with P-ROC driver boards, or with Stern SAM, Stern
Whitestar, Williams WPC, or Williams WPC95 driver boards.
Much of this code is from the P-ROC drivers section of the pyprocgam... | qcapen/mpf | mpf/platform/p_roc.py | Python | mit | 55,296 |
#!/usr/bin/python
# Try to acquire the lock that indicates which host is the master.
# If we successfully acquire the lock, but retain the lock forever. (If we leave the cluster, another host can get the lock.)
#
# Usage:
# acquire_master_lock.py <path-to-sr>
import fcntl
import sys
import time
import subprocess
im... | stefanopanella/xapi-storage-plugins | overlay/usr/libexec/xapi/cluster-stack/corosync/acquire_master_lock.py | Python | lgpl-2.1 | 1,526 |
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
# Importing the dataset
datas = pd.read_csv('data.csv')
datas
X = datas.iloc[:, 0:1].values
y = datas.iloc[:, 1].value... | ldbc/ldbc_snb_datagen | tools/sfs/predict.py | Python | gpl-3.0 | 980 |
"""
Representation and parsing of HTTP-style status + headers
"""
from six.moves import range
from six import iteritems
from warcio.utils import to_native_str, headers_to_str_headers
import uuid
from six.moves.urllib.parse import quote
import re
#=================================================================
cla... | webrecorder/warcio | warcio/statusandheaders.py | Python | apache-2.0 | 11,625 |
import sublime
import sublime_plugin
import os.path
from .notifier import log_fail, log_info
class DiscontinuationCommand(sublime_plugin.ApplicationCommand):
@property
def command_name(self):
return "Discontinuation"
def run(self):
msg = "The Telerik Platform product is retired as of May 1... | Icenium/appbuilder-sublime-package | app_builder/discontinuation_command.py | Python | apache-2.0 | 922 |
# _*_ coding:utf-8 _*_
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
'''文章(Post)、 分类(Tag)、 标签(Category)'''
class Category(models.Model):
"""
Djamgo要求模型必须继承models.Model类。
... | TwocatWhelp/lizhen | blog/models.py | Python | gpl-3.0 | 4,691 |
import sys
import json
has_answers = set()
for line in open(sys.argv[1]):
answers = json.loads(line.strip().split("\t")[2])
if answers != []:
has_answers.add(line.split("\t")[0])
for line in sys.stdin:
if line.startswith("#") or line.strip() == "":
continue
sent = json.loads(line)
... | sivareddyg/UDepLambda | scripts/select_only_answerable_questions.py | Python | apache-2.0 | 387 |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.txt')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
'pyramid',
'pyramid_chameleon',
'pyramid_d... | Akagi201/learning-python | pyramid/MyShop/setup.py | Python | mit | 1,213 |
from django import forms
from django.forms.formsets import formset_factory
from formsetfield.fields import FormSetField
class AdultForm(forms.Form):
fullname = forms.CharField()
passport = forms.CharField()
class ChildForm(forms.Form):
fullname = forms.CharField()
birth_certificate = forms.CharFi... | yumike/django-formsetfield | example/orders/forms.py | Python | isc | 491 |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import unittest
from telemetry.core import browser_finder
from telemetry.unittest import simple_mock
from telemetry.unittest imp... | aospx-kitkat/platform_external_chromium_org | tools/telemetry/telemetry/core/chrome/form_based_credentials_backend_unittest_base.py | Python | bsd-3-clause | 4,461 |
import timeit
import unittest
class TestBasicFunctions(unittest.TestCase):
def test_add_feature_performance(self):
print timeit.timeit(
"rollout.add_feature(Feature('feature_for_all', groups=['ALL']))",
setup='from pyrollout import Rollout; from pyrollout.feature import Feature; ro... | brechin/pyrollout | tests/test_performance.py | Python | mit | 2,150 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | tylertian/Openstack | openstack F/horizon/horizon/dashboards/syspanel/overview/urls.py | Python | apache-2.0 | 971 |
def foo(a, b, *c):
pass
x = (5,6)
foo(<arg1>1, <arg2>2, <arg3>4, <arg4>*x)
| asedunov/intellij-community | python/testData/paramInfo/StarredParamAndArg.py | Python | apache-2.0 | 80 |
'''
Plot learning curve.
From: examples/model_selection/plot_learning_curve.py in the sklearn repo
'''
import numpy as np
import matplotlib.pyplot as plt
from sklearn.learning_curve import learning_curve
def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None,
n_jobs=1, train_size... | e-koch/Phys-595 | project_code/Machine Learning/plot_learning_curve.py | Python | mit | 2,524 |
# Copyright (c) 2008-2010, 2013 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
"""
unit test for the ext... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/pylint/test/unittest_pyreverse_diadefs.py | Python | apache-2.0 | 6,195 |
"""
Title: Using pre-trained word embeddings
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2020/05/05
Last modified: 2020/05/05
Description: Text classification on the Newsgroup20 dataset using pre-trained GloVe word embeddings.
"""
"""
## Setup
"""
import numpy as np
import tensorflow as tf
from ten... | keras-team/keras-io | examples/nlp/pretrained_word_embeddings.py | Python | apache-2.0 | 8,473 |
import sympy
import tempfile
import os
from sympy import symbols, Eq, Mod
from sympy.external import import_module
from sympy.tensor import IndexedBase, Idx
from sympy.utilities.autowrap import autowrap, ufuncify, CodeWrapError
from sympy.utilities.pytest import skip
numpy = import_module('numpy', min_module_version='... | kaushik94/sympy | sympy/external/tests/test_autowrap.py | Python | bsd-3-clause | 9,687 |
# (C) British Crown Copyright 2011 - 2017, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | decvalts/cartopy | lib/cartopy/tests/mpl/__init__.py | Python | gpl-3.0 | 13,516 |
from django.conf.urls import patterns, url
from links import views
urlpatterns = patterns('links.views',
url(r'^link/settings/$', views.settings, name = 'settings'),
url(r'^link/donate/(?P<url>[\d\w.]+)$', views.kintera_redirect, name = 'donate'),
url(r'^link/rider/(?P<url>[\d\w.]+)$', views.t4k_redirect, ... | ethanperez/t4k-rms | links/urls.py | Python | mit | 340 |
from django.shortcuts import render
from django.contrib.auth.models import User
from django.shortcuts import redirect, get_object_or_404
from django.core.urlresolvers import reverse
from .forms import RegistroUserForm, EditarUserForm
from .models import UserProfile
from django.contrib.auth import authenticate, login, l... | vimeworks/ImpaQto | accounts/views.py | Python | mit | 4,370 |
# Run these tests with 'nosetests':
# install the 'python-nose' package (Fedora/CentOS or Ubuntu)
# run 'nosetests' in the root of the repository
import unittest
import pkg
class RpmTests(unittest.TestCase):
def setUp(self):
# 'setUp' breaks Pylint's naming rules
# pylint: disable=C0103
... | simonjbeaumont/planex | tests/test_pkg.py | Python | lgpl-2.1 | 5,676 |
from ffthompy.general.base import *
__author__ = "Jaroslav Vondrejc"
__copyright__ = """Copyright 2016, Jaroslav Vondrejc"""
__email__ = "vondrejc@gmail.com"
| vondrejc/FFTHomPy | ffthompy/__init__.py | Python | mit | 159 |
'''
URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based view... | coco-project/coco | coco/urls.py | Python | bsd-3-clause | 1,211 |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class Noticia(models.Model):
Publicado = 'Publicado'
Borrador = 'Borrador'
Titulo = models.CharField(max_length=30)
Subtitulo = models.CharField(max_length=50)
Imagen = mode... | magvugr/AT | AppAdiccionTic/models.py | Python | gpl-3.0 | 1,704 |
"""File system wrapper.
"""
import os
def read_file(path):
"""Return decoded file content for specified path
"""
fptr = open(path, 'r')
content = fptr.read()
fptr.close()
return content.decode('latin1')
def dir_contents(path, sort=True):
"""Return list of all entries in a directory for s... | mharrys/spam-filter | fs.py | Python | lgpl-2.1 | 741 |
import os
from collections import namedtuple
from enum import Enum
import logging
log = logging.getLogger(__name__)
class LoadState(Enum):
INITIAL = 0
LOADING = 1
DONE = 2
FAILED = 3
BookData = namedtuple('BookData', ['filename', 'width', 'height',
'page_number',... | Bristol-Braille/canute-ui | ui/book/book_file.py | Python | gpl-3.0 | 1,397 |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | CMUSV-VisTrails/WorkflowRecommendation | vistrails/gui/common_widgets.py | Python | bsd-3-clause | 31,635 |
from django.test import TestCase
from gdz.models import GdzClas
from django.test import Client
from django.core.urlresolvers import reverse
class TestGdzClas(TestCase):
fixtures = ['gdz_clas.json']
def test_clas_view(self):
clases = GdzClas.objects.all()
client = Client()
for clas in ... | audiua/shkolyar_django | gdz/tests/tests_gdz_clas.py | Python | mit | 458 |
from .formSubmission import FormSubmission
from django.contrib.auth.models import User
from django.db import models
from django.template.defaultfilters import slugify
class Log(models.Model):
"""
Form Submission Log Database Model
Attributes:
* owner - user submitting the message
* submission - ... | ConstellationApps/Forms | constellation_forms/models/log.py | Python | isc | 1,879 |
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | capturePointer/or-tools | examples/python/eq10.py | Python | apache-2.0 | 3,143 |
from opendc.models.memory import Memory
from opendc.util.rest import Response
def GET(request):
"""Get a list of the specifications of all Memories."""
# Get the Memories
memories = Memory.query()
# Return the Memories
return Response(
200,
'Successfully retrieved Memories.',
... | atlarge-research/opendc-web-server | opendc/api/v1/specifications/memories/endpoint.py | Python | mit | 365 |
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
from abc import ABCMeta
from abc import abstractmethod
impo... | toslunar/chainerrl | chainerrl/agents/dpp.py | Python | mit | 3,779 |
"""empty message
Revision ID: 2ab86fbb564b
Revises: 3f049a4d4de8
Create Date: 2014-12-23 22:55:08.182385
"""
# revision identifiers, used by Alembic.
revision = '2ab86fbb564b'
down_revision = '3f049a4d4de8'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | ossifrage/cliffdivers | migrations/versions/2ab86fbb564b_.py | Python | bsd-3-clause | 506 |
from flask_bootstrap import __version__ as FLASK_BOOTSTRAP_VERSION
from flask_nav import Nav
from flask_nav.elements import Link, Navbar, Separator, Subgroup, Text, View
nav = Nav()
nav.register_element('frontend_top', Navbar(
View('Flask-Bootstrap', '.index'),
View('Home', '.index'),
View('Forms Example'... | katakumpo/noscrapy | noscrapy/app/nav/controllers.py | Python | mit | 1,089 |
# -*- coding: utf-8 -*-
##############################################################################
# Taobao OpenERP Connector
# Copyright 2013 OSCG
#
# 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 ... | Johnzero/OE7 | openerp/addons-fg/taobao/taobao_refund.py | Python | agpl-3.0 | 8,384 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\specgram_dlg.ui'
#
# Created: Thu Jun 19 11:21:55 2014
# by: sparkle.QtWrapper UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from sparkle.QtWrapper import QtCore, QtGui
try:
_fromUtf8 = QtCore.... | Joel-U/sparkle | sparkle/gui/dialogs/specgram_dlg_form.py | Python | gpl-3.0 | 4,157 |
#!/usr/bin/python2
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
from lxml import etree
import dns.name
from ipapython import ipa_log_manager, ipautil
# hack: zone object UUID is stored as path to imaginary zone file
ENTRYUUID_PREFIX = "/var/lib/ipa/dns/zone/entryUUID/"
ENTRYUUID_PREFIX_LEN ... | ofayans/freeipa | ipapython/dnssec/odsmgr.py | Python | gpl-3.0 | 7,203 |
"""
Copyright (C) 2014-2015, Michele Cappellari
E-mail: michele.cappellari_at_physics.ox.ac.uk
http://purl.org/cappellari
V1.0: Created to emulate my IDL procedure with the same name.
Michele Cappellari, Oxford, 28 March 2014
V1.1: Included reversed colormap. MC, Oxford, 9 August 2015
... | TimothyADavis/KinMSpy | kinms/utils/sauron_colormap.py | Python | mit | 4,448 |
# Example for: restraints.reindex()
# This will reindex restraints obtained previously for a simpler topology so
# that they will now apply to a more complicated topology.
from modeller import *
from modeller.scripts import complete_pdb
env = environ()
env.io.atom_files_directory = ['../atom_files']
tpl = env.libs.t... | bjornwallner/proq2-server | apps/modeller9v8/examples/commands/reindex_restraints.py | Python | gpl-3.0 | 1,309 |
#!/usr/bin/env python
import os, pygame
from pygame.compat import xrange_
main_dir = os.path.split(os.path.abspath(__file__))[0]
data_dir = os.path.join(main_dir, 'data')
def show (image):
screen = pygame.display.get_surface()
screen.fill ((255, 255, 255))
screen.blit (image, (0, 0))
pygame.display.fl... | mark-me/Pi-Jukebox | venv/Lib/site-packages/pygame/examples/pixelarray.py | Python | agpl-3.0 | 3,318 |
# -*- coding: utf-8 -*-
import common_sale_contract
import test_sale_contract
| tvtsoft/odoo8 | addons/sale_contract/tests/__init__.py | Python | agpl-3.0 | 78 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright: Slobodni programi d.o.o., Zagreb
# Contributions:
#... | BorgERP/borg-erp-6of3 | l10n_hr/l10n_hr/__openerp__.py | Python | agpl-3.0 | 2,748 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import os
import sys
import pytest
import numpy as np
from mne.utils import... | mne-tools/mne-python | mne/viz/backends/tests/test_renderer.py | Python | bsd-3-clause | 6,762 |
from __future__ import absolute_import
from sentry import http
from sentry.identity.oauth2 import OAuth2Provider
def get_user_info(url, access_token):
session = http.build_session()
resp = session.get(
u"https://{}/api/v3/user".format(url),
params={"access_token": access_token},
heade... | mvaled/sentry | src/sentry/identity/github_enterprise/provider.py | Python | bsd-3-clause | 1,065 |
# Copyright 2020 Tecnativa - Sergio Teruel
# Copyright 2020 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
inventory_availability = fields.Selection(selection_add=[
... | Vauxoo/e-commerce | website_sale_stock_force_block/models/product_template.py | Python | agpl-3.0 | 416 |
#!/usr/bin/env python
"""
Title : Java program file
Author : JG
Date : dec 2016
Objet : script to create Propertie File Program
in : get infos from yml
out : print infos in properties file
"""
import sys,os
import yaml
import util as u
from random import randint
# =====================================... | JeGoi/IPa2 | packages/java_properties.py | Python | mit | 6,870 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
import os, re, pyText2pdf
from sys import argv
from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
def usage():
print "Usage: %s <directory>" %(argv[0])
exit(0)
def find(path,dir):
for i in os.listdir(path)[::-1]:
if os.path.isfile(path+"/%s"%i):
file1.app... | aliagdeniz/dir2pdf | dir2pdf.py | Python | gpl-3.0 | 3,135 |
import unittest
import warnings
import scrubadub
import scrubadub.detectors.catalogue
import scrubadub.utils
class OldAPITestCase(unittest.TestCase):
def setUp(self):
from scrubadub.detectors.text_blob import TextBlobNameDetector
scrubadub.detectors.catalogue.register_detector(TextBlobNameDetecto... | datascopeanalytics/scrubadub | tests/test_api_older.py | Python | mit | 4,276 |
"""
Glue execution module to link to the :mod:`fx2 proxymodule <salt.proxy.fx2>`.
Depends: :mod:`iDRAC Remote execution module (salt.modules.dracr) <salt.modules.dracr>`
For documentation on commands that you can direct to a Dell chassis via proxy,
look in the documentation for :mod:`salt.modules.dracr <salt.modules.... | saltstack/salt | salt/modules/chassis.py | Python | apache-2.0 | 1,556 |
import unittest
class NotificationManagerTest(unittest.TestCase):
def test(self):
self.assertEqual(4, 4)
| dashford/sentinel | tests/Notification/test_notification_manager.py | Python | mit | 119 |
__author__ = 'jdaniel'
from GaiaSolve.common import ModelInfo
from GaiaSolve.common import GaiaException
class Host(object):
def __init__(self):
self.model = None
self.algorithm = None
def set_model(self, model):
self.model = model
self.model.set_host(self)
def set_algor... | jldaniel/Gaia | GaiaSolve/host.py | Python | mit | 3,913 |
# 4
# / \
# 2 6
# / \ / \
# 1 3 5 7
class Node:
rChild, lChild, data = None, None, None
def __init__(self, data):
self.rChild = None
self.lChild = None
self.data = data
INT_MIN = -4294967296
INT_MAX = 4294967296
def inorder(root... | ruchikd/Algorithms | Python/FindIsBSTaBST/isBSTaBST.py | Python | gpl-3.0 | 1,012 |
# Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import division
import locale
import logging
import time
from portage import os, _unicode_decode
from portage.exception import PortageException
from portage.localization import _
from portage.ou... | ptisserand/portage | pym/portage/sync/old_tree_timestamp.py | Python | gpl-2.0 | 2,161 |
# This code is meant to be run after loading the model in 'Axon.g'.
# 'Axon.g' loads 2 identical copies of an linear, passive neuron.
#
# These are helper functions to scale passive parameters Cm, Rm, Ra,
# diameter and length. By default the second copy ('/axon1') is
# modified.
#
# After scaling a passive parameter, ... | BhallaLab/moose-thalamocortical | DEMOS/axon-passive/Axon.py | Python | lgpl-2.1 | 1,610 |
import math
import numpy as np
from scipy.optimize import fsolve
AIR_DENSITY = 1.2754 # kg/m^3
class Quartet:
'''An arbitrary class that holds the four corner values of a car.'''
def __init__(self, fr, fl, rr, rl):
self.quartet = [fr, fl, rr, rl]
@property
def quartet(self):
retur... | kktse/uwfm | ymd/model/Vehicle.py | Python | apache-2.0 | 17,595 |
"""Track most recent submission time on profile
Used to prevent scans on submission for determining when
a user most recently posted something, for ordering
marketplace search results
Revision ID: 83e6b2a46191
Revises: a49795aa2584
Create Date: 2017-01-07 03:21:10.114125
"""
# revision identifiers, used by Alembic.... | Weasyl/weasyl | libweasyl/libweasyl/alembic/versions/83e6b2a46191_track_most_recent_submission_time.py | Python | apache-2.0 | 975 |
#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the JennyCoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
i... | JennyCoin-Project/JennyCoin | share/qt/clean_mac_info_plist.py | Python | mit | 899 |
from xml.dom import minidom
class Schedule(object):
def __init__(self):
self._fixedtasks = []
self._tasks = []
self._fitness = 0
def __ne__(self, other):
return not self == other
def __eq__(self, other):
for t in self.tasks:
for t2 in other.tasks:
if t == t2:
continue
return False
for ... | fredmorcos/attic | projects/autocal/attic/autocal-py/libautocal/schedule.py | Python | isc | 2,209 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.