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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
import sys
import codecs
import re
# ใใชๅคๆใใผใใซ
kana_table = {
'a': 'ใ', 'i': 'ใ', 'u': 'ใ', 'e': 'ใ', 'o': 'ใ',
'ka': 'ใ', 'ki': 'ใ', 'ku': 'ใ', 'ke': 'ใ', 'ko': 'ใ',
'sa': 'ใ', 'si': 'ใ', 'su': 'ใ', 'se': 'ใ', 'so': 'ใ',
'ta': 'ใ', 'ti': 'ใก', 'tu': 'ใค', 'te': 'ใฆ', 'to': 'ใจ',
... | chikuwayamada/kanaconvert | kanaconvert.py | Python | mit | 6,510 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('app.views',
(r'^$', 'home'),
(r'^account/(?P<account_id>.+)$', 'account'),
)
| cheddarfinancial/cheddar-oauth-demo | app/urls.py | Python | mit | 164 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2011, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010-2011, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modificatio... | aaryani/CoreTardisTemp | tardis/tardis_portal/auth/ldap_auth.py | Python | bsd-3-clause | 11,778 |
from django import forms
from common.forms import C2Form
from common.methods import generate_string_from_template_for_server
from utilities.logger import ThreadLogger
from utilities.forms import ConnectionInfoForm
logger = ThreadLogger(__name__)
class TintriEndpointForm(ConnectionInfoForm):
protocol = forms.Cho... | CloudBoltSoftware/cloudbolt-forge | ui_extensions/tintri/forms.py | Python | apache-2.0 | 2,981 |
# MolMod is a collection of molecular modelling tools for python.
# Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be>
#
# This file is part of MolMod.
#
# MolMod 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... | woutersmet/Molmodsummer | lib/molmod/io/mpqc/file_parsers.py | Python | gpl-3.0 | 11,970 |
# 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 use ... | guozhangwang/kafka | tests/setup.py | Python | apache-2.0 | 2,114 |
import csv, json, io, sys
from collections import OrderedDict
def write_dict_to_json(data):
"""This function pretty prints an input dictionary and returns
its string representation i.e. a json string
"""
jsonstring = json.dumps({"world_indices": [data[k] for k in data]}, indent=4)
return jsonst... | howsunjow/YahooFinance | yahoo_finance/utils.py | Python | mit | 1,081 |
"""
Mica permissions
"""
import mica.core
SUBJECT_TYPES = ('USER', 'GROUP')
PERMISSIONS = ('READER', 'EDITOR', 'REVIEWER')
def add_permission_arguments(parser):
"""
Add permission arguments
"""
parser.add_argument('--add', '-a', action='store_true', help='Add a permission')
parser.add_argument('--delete',... | Rima-B/mica2 | mica-python-client/src/main/python/mica/perm.py | Python | gpl-3.0 | 1,976 |
import threading
total = 0
lock = threading.Lock()
def actualizar_total(cantidad):
global total
with lock:
total += cantidad
print(total)
if __name__ == '__main__':
for x in range(10):
mi_hilo = threading.Thread(target=actualizar_total, args=(10,))
mi_hilo.start(... | ampotty/uip-pc4 | 05.Hilos/Ejemplo/app/hilo4.py | Python | mit | 323 |
# -*- coding: utf-8 -*-
# template 18
"""
Various tools at your fingertips.
The available tools are:
* cvt_csv_2_rst.py: convert csv file into rst file
* cvt_csv_2_xml.py: convert csv file into xml file
* cvt_script: parse bash script and convert to meet company standard
* gen_readme.py: generate documentation files,... | zeroincombenze/tools | wok_code/scripts/main.py | Python | agpl-3.0 | 6,236 |
# Copyright 2014, 2015, Nik Kinkel and David Johnston
# See LICENSE for licensing information
class NotEnoughBytes(Exception):
pass
class UnknownCellCommand(Exception):
pass
class BadCellPayloadLength(Exception):
pass
class BadPayloadData(Exception):
pass
class BadLinkSpecifier(Exception):
... | nskinkel/oppy | oppy/cell/exceptions.py | Python | bsd-3-clause | 416 |
# Copyright 2013 OpenStack Foundation
#
# 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 ... | rodrigods/keystone | keystone/trust/controllers.py | Python | apache-2.0 | 10,680 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Application'
db.create_table('hr_application', (
('id', self.gf('django.db.mod... | nikdoof/test-auth | app/hr/migrations/0001_initial.py | Python | bsd-3-clause | 13,994 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.forms import *
from django.forms.extras import SelectDateWidget
from django.forms.utils import ErrorList
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from django... | ZhaoCJ/django | tests/forms_tests/tests/test_extra.py | Python | bsd-3-clause | 37,066 |
# Copyright 2017 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... | meteorcloudy/tensorflow | tensorflow/contrib/data/python/ops/grouping.py | Python | apache-2.0 | 19,270 |
"""
smq/smq/experiment.py: library components for the experiment shell
(c) 2016 Oswald Berthold
"""
import argparse
# from robots import ...
# available robots: pointmass, simple arm, two-wheeled differential, ...
try:
import rospy
except Exception, e:
print "import rospy failed", e
from smq.utils import... | x75/smq | smq/experiments.py | Python | mit | 10,734 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright ยฉ 2013, W. van Ham, Radboud University Nijmegen
This file is part of Sleelab.
Sleelab 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 o... | wilberth/Rudolph | testImage.py | Python | gpl-3.0 | 2,798 |
with open('/home/matheus/Imagens/imagem.png', 'rb') as fonte:
with open('/home/matheus/Imagens/imagem3.png', 'wb') as destino:
byte = fonte.read(1)
while byte != b'':
destino.write(byte)
byte = fonte.read(1)
| matheusfarias/Python | codes/arquivos/arquivos9.py | Python | apache-2.0 | 264 |
import time
import os.path
from twisted.trial import unittest
from twisted.application import service
from twisted.internet import defer
from foolscap.api import eventually, fireEventually
from allmydata.util import fileutil, hashutil, pollmixin
from allmydata.storage.server import StorageServer, si_b2a
from allmydat... | david415/tahoe-lafs | src/allmydata/test/test_crawler.py | Python | gpl-2.0 | 16,765 |
"""This module implements the SocketServerPort, which basically implements
a serial like interface using a socket server.
"""
import select
class SocketPort(object):
def __init__(self, skt):
self.socket = skt
self.baud = 0
self.rx_buf_len = 0
def read_byte(self, block=False):
... | dhylands/bioloid3 | bioloid/socket_port.py | Python | mit | 1,363 |
from rest_framework import serializers
from user.models import User
class UserSerializer(serializers.ModelSerializer):
password = serializers.CharField(write_only=True, required=False)
# set required to false else with browsable api
# each put with empty file erase existing one
avatar = serializer... | Fenykepy/phiroom | src/api/user/serializers.py | Python | agpl-3.0 | 3,209 |
# -*- coding: utf-8 -*-
"""
Use a HistogramLUTWidget to control the contrast / coloration of an image.
"""
## Add path to library (just for examples; you do not need this)
import initExample
import numpy as np
from pyqtgraph.Qt import QtGui, Q... | UpSea/thirdParty | pyqtgraph-0.9.10/examples/HistogramLUT.py | Python | mit | 1,350 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'DjangoApplication1.views.home', name='home'),
# url(r'^DjangoApplication1/', include('... | jkorell/PTVS | Python/Tests/TestData/DjangoProject/urls.py | Python | apache-2.0 | 813 |
import time
from ctypes import *
from ctypes.wintypes import *
from comtypes import *
from comtypes.automation import *
import comtypes.client
import winKernel
import winUser
# Include functions from oleacc.dll in the module namespace.
m=comtypes.client.GetModule('oleacc.dll')
globals().update((key, val) for ... | ckundo/nvda | source/oleacc.py | Python | gpl-2.0 | 10,580 |
'''
AxelProxy XBMC Addon
Copyright (C) 2013 Eldorado
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 vers... | JamesLinEngineer/RKMC | addons/script.module.axel.downloader/lib/standalone_server.py | Python | gpl-2.0 | 1,470 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# # Display matplotlib animations as HTML5 video
#
# Based on [this notebook](http://nbviewer.ipython.org/url/jakevdp.github.io/downloads/notebooks/AnimationEmbedding.ipynb) by jakevdp. Updated with:
#
# - output video that works with chrome (pix_... | sebdiem/userpage | content/notebooks/mpl_animation_html.py | Python | mit | 1,312 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-15 09:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wizard_builder', '0024_remove_formquestion_added'),
]
operations = [
migrat... | SexualHealthInnovations/django-wizard-builder | wizard_builder/migrations/0025_auto_20170915_0948.py | Python | bsd-3-clause | 781 |
# -*- coding: utf-8 -*-
#
# Cork documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 8 13:40:17 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | mfedy/bottle-cork | docs/conf.py | Python | lgpl-3.0 | 8,280 |
# Copyright 2022 The etils Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | google/etils | etils/ecolab/colab_utils_test.py | Python | apache-2.0 | 753 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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... | ntt-sic/neutron | neutron/db/migration/alembic_migrations/versions/53bbd27ec841_extra_dhcp_opts_supp.py | Python | apache-2.0 | 2,051 |
# This class manages how and when to play shows.
import threading, time
from object import Object
from schedule import Schedule
from series import Series
from helpers import listDirs, listFiles
from week import getDate
import settings, schedule_settings
class Manager(Object, threading.Thread):
# INIT ------------... | bombpersons/MYOT | myot/manager.py | Python | gpl-3.0 | 1,578 |
"""JSON implementations of assessment.authoring searches."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected method... | mitsei/dlkit | dlkit/json_/assessment_authoring/searches.py | Python | mit | 12,132 |
x = 0
print 'Enter a test score between 60 and 100:'
while x < 10:
score = input()
if (score < 60):
print "Score:", score, "You can't follow directions, and you are stupid"
elif (score >= 60 and score < 70):
print "Score:", score, 'Your grade is D'
elif (score >= 70 and score < 80):
print "Score:", score, 'Yo... | jiobert/python | Horan_Colby/Assignments/scores-grades.py | Python | mit | 521 |
from django_filters import filterset, filters
from facebook_data.models import FacebookAdvert
class FacebookAdvertFilterSet(filterset.FilterSet):
class Meta:
model = FacebookAdvert
fields = ["person_id"]
person_id = filters.Filter(
field_name="person_id",
label="Person ID",
... | DemocracyClub/yournextrepresentative | ynr/apps/facebook_data/filters.py | Python | agpl-3.0 | 383 |
import json
import pytest
from allennlp.common.testing import ModelTestCase
class ModelWithIncorrectValidationMetricTest(ModelTestCase):
"""
This test case checks some validating functionality that is implemented
in `ensure_model_can_train_save_and_load`
"""
def setup_method(self):
super... | allenai/allennlp | tests/models/test_model_test_case.py | Python | apache-2.0 | 1,751 |
# 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/relay/frontend/caffe.py | Python | apache-2.0 | 32,058 |
from .main import PipelineElement
from .data import SimulationData
class Producer(PipelineElement):
def __init__(self):
PipelineElement.__init__(self)
self.output = None
def connect(self, mediator):
self._sink(mediator)
def disconnect(self, mediator=None):
if mediator is... | dilawar/moogli | moogli/visualization/pipeline/producer.py | Python | gpl-2.0 | 4,578 |
"""
Django settings for cbs 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, ...)
import... | max1k/cbs | cbs/settings.py | Python | gpl-2.0 | 2,196 |
# Copyright (C) 2010 Simon Wessing
# TU Dortmund University
#
# 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 v... | gbtimmon/ase16GBT | code/9/hypervolume.py | Python | unlicense | 10,567 |
from social_core.pipeline.utils import SERIALIZABLE_TYPES, partial_to_session, \
partial_from_session
| cjltsod/python-social-auth | social/pipeline/utils.py | Python | bsd-3-clause | 106 |
#!/usr/bin/python3 -u
# A script for install alive script
import subprocess
import argparse
import re
import os
import shutil
from subprocess import call
parser = argparse.ArgumentParser(description='A script for install alive script and cron')
parser.add_argument('--url', help='The url where notify that this serv... | paramecio/pastafari | scripts/monit/debian_jessie/alive.py | Python | gpl-2.0 | 4,578 |
import random
import re
from twisted.internet import reactor
from helga.plugins import command, preprocessor
silence_acks = (
u'silence is golden',
u'shutting up',
u'biting my tongue',
u'fine, whatever',
)
unsilence_acks = (
u'speaking once again',
u'did you miss me?',
u'FINALLY',
u... | shaunduncan/helga-stfu | helga_stfu.py | Python | mit | 2,274 |
# -*- encoding: UTF-8 -*-
#
# Note:
# ==================================================================================================
# This code have been copied from http://tools.cherrypy.org/wiki/AuthenticationAndAccessRestrictions
# and modified for the purposes of this project.
# ===============================... | jembi/openhim-webui | openhim-webui/auth.py | Python | mpl-2.0 | 5,651 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name="nanpy",
version="0.8",
description="Use your Arduino board with Python",
license="MIT",
author="Andrea Stagi",
author_email="stagi.andrea@gmail.com",
url="http://github.com/nanpy/nanpy",
packages = ... | pooyapooya/rizpardazande | setup.py | Python | mit | 405 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 12, transform = "Fisher", sigma = 0.0, exog_count = 100, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Fisher/trend_MovingAverage/cycle_12/ar_12/test_artificial_1024_Fisher_MovingAverage_12_12_100.py | Python | bsd-3-clause | 269 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/admin/info/tabs.py | Python | apache-2.0 | 3,905 |
from django.contrib import admin
from .models import (
Advisor, Album, Band, Bee, Car, CarTire, Event, Inventory, Member, Profile,
School, User,
)
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
cla... | nesdis/djongo | tests/django_tests/tests/v22/tests/admin_widgets/widgetadmin.py | Python | agpl-3.0 | 1,338 |
"""Meta functionality used for document creation."""
from __future__ import absolute_import
from .connection import Connection, get as get_connection
from .errors import OperationError
from .field import BaseField, Field
from bson import ObjectId
from .utils import to_snake_case
import six
class DocumentMeta(object):... | WiFast/bearfield | bearfield/meta.py | Python | bsd-3-clause | 6,598 |
"""Geometry functions.
Rectangle is a utility class for working with rectangles (unions and
intersections).
A point is represented as a tuple `(x, y)`.
"""
from __future__ import annotations
from math import sqrt
from typing import Iterable, Optional, Tuple, Union
Point = Tuple[float, float] # x, y
Rect = Tuple[fl... | amolenaar/gaphas | gaphas/geometry.py | Python | lgpl-2.1 | 19,490 |
# 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 optparse
import os
import sys
from telemetry.core import util
from telemetry.results import buildbot_output_formatter
from telemetry.results import c... | ondra-novak/chromium.src | tools/telemetry/telemetry/results/results_options.py | Python | bsd-3-clause | 5,323 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
flask_paginate
~~~~~~~~~~~~~~~~~~
Adds pagination support to your application.
:copyright: (c) 2013 by Lix Xu.
:license: BSD, see LICENSE for more details
"""
from __future__ import unicode_literals
import sys
from flask import request, url_for, ... | MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/flask_paginate/__init__.py | Python | mit | 13,862 |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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, ... | youtube/cobalt | third_party/websocket-client/websocket/_exceptions.py | Python | bsd-3-clause | 2,406 |
#!/usr/bin/python
#=======================================================================
# Copyright Nicholas Tuckett 2015.
# Distributed under the MIT License.
# (See accompanying file license.txt or copy at
# http://opensource.org/licenses/MIT)
#=====================================================================... | dozencrows/PiMony | PiMony.py | Python | mit | 2,894 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import serial
import time
import Queue
import thread
class Sercomm(object):
def __init__(self):
try:
self.ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate=19200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_O... | dora71/pyrigcontrol | sercomm.py | Python | agpl-3.0 | 1,642 |
#!/usr/bin/env python3
"""Retrieve results from the DuckDuckGo zero-click API in simple HTML format."""
import json as jsonlib
import logging
import re
import urllib.request, urllib.error, urllib.parse
__version__ = (1, 0, 0)
def results2html(results, results_priority=None, max_number_of_results=None,
... | nsubiron/SublimeSuricate | lib/thirdparty/duckduckgo2html.py | Python | gpl-3.0 | 8,822 |
#
# PicoTCP test library
# Author: Maarten Vandersteegen
#
import os
import time
from ctypes import *
#-----------------------------------------------------------------#
# Custom C data types #
#-----------------------------------------------------------------#
class pico_... | maartenvds/robot-framework-examples | python-c/lib/PicoTCP.py | Python | apache-2.0 | 3,265 |
from __future__ import absolute_import
from __future__ import unicode_literals
from . import Extension
from .abbr import AbbrExtension
from .align import AlignExtension
from .codehilite import CodeHiliteExtension
from .comments import CommentsExtension
from .customblock import CustomBlockExtension
from .delext import ... | zestedesavoir/Python-ZMarkdown | zmarkdown/extensions/zds.py | Python | bsd-3-clause | 5,411 |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Command for describing firewall rules."""
from googlecloudsdk.compute.lib import base_classes
class Describe(base_classes.GlobalDescriber):
"""Describe a Google Compute Engine firewall rule.
*{command}* displays all data associated with a Google Compute
Engi... | wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/firewall_rules/describe.py | Python | apache-2.0 | 750 |
# 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 applicable ... | karllessard/tensorflow | tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver_test.py | Python | apache-2.0 | 9,199 |
import _plotly_utils.basevalidators
class BValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="b", parent_name="layout.title.pad", **kwargs):
super(BValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | plotly/python-api | packages/python/plotly/plotly/validators/layout/title/pad/_b.py | Python | mit | 440 |
from django import template
from django.template.loader import render_to_string
from django.utils import six
from django.utils.html import mark_safe
import re
register = template.Library()
@register.filter
def messages_style(messages):
c = {}
c['messages'] = messages
return render_to_string('tag-message... | nirvaris/nirvaris-theme-default | themedefault/templatetags/theme_messages_tags.py | Python | mit | 339 |
# -*- coding: utf-8 -*-
import 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 'RuleGroup.action'
db.alter_column('rcal_rulegroup', 'action', self.gf('django.db.models.f... | apollo13/django-rcal | rcal/migrations/0002_chg_field_rulegroup_action.py | Python | bsd-3-clause | 5,667 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'apps... | biomassives/django-angular-docker-seed | backend/urls.py | Python | unlicense | 469 |
import os
import click
from keep import cli, utils
@click.command('run', short_help='Executes a saved command.',
context_settings=dict(ignore_unknown_options=True))
@click.argument('pattern')
@click.argument('arguments', nargs=-1, type=click.UNPROCESSED)
@click.option('--safe', is_flag=True, help='Igno... | paci4416/keep | keep/commands/cmd_run.py | Python | mit | 1,761 |
import base64
import os
from django.core.paginator import Paginator
from cda.integration import render_cda
from l2vi.integration import gen_cda_xml, send_cda_xml
import collections
from integration_framework.views import get_cda_data
from utils.response import status_response
from hospitals.models import Hospitals
im... | moodpulse/l2 | api/directions/views.py | Python | mit | 163,517 |
# -*- coding: utf-8 -*-
#
# Copyright ยฉ 2013 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
__version__ = '0.3.0.dev0'
# =============================================================================
# The following statements are required to register this 3rd... | spyder-ide/spyder.memory_profiler | spyder_memory_profiler/__init__.py | Python | mit | 490 |
# Copyright 2009 Jean-Francois Houzard, Olivier Roger
#
# This file is part of pypassport.
#
# pypassport 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... | tonikelope/python-passport-trace-attack | pypassport/doc9303/datagroup.py | Python | gpl-2.0 | 19,795 |
# -*- coding: utf-8 -*-
"""This file contains a plugin for parsing Google Analytics cookies."""
import urllib
from plaso.events import time_events
from plaso.lib import errors
from plaso.lib import eventdata
from plaso.parsers.cookie_plugins import interface
from plaso.parsers.cookie_plugins import manager
class Go... | jorik041/plaso | plaso/parsers/cookie_plugins/ganalytics.py | Python | apache-2.0 | 8,233 |
class LSA(object):
def __init__(self,input_path,output_path):
super(LSA,self).__init__()
self.input_path = input_path
self.output_path = output_path
self.hpfx = 'k, bins: [' | scottdaniel/LatentStrainAnalysis | LSA/LSA.py | Python | mit | 182 |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
"Preference"
import gettext
import gtk
import copy
from tryton.gui.window.view_form.screen import Screen
from tryton.config import TRYTON_ICON
import tryton.common as common
fr... | kret0s/gnuhealth-live | tryton/client/tryton/gui/window/preference.py | Python | gpl-3.0 | 3,674 |
#!/usr/bin/env python
#
# $Id$
#
"""Routines common to all posix systems."""
import os
import errno
import subprocess
import psutil
import socket
import re
import sys
import warnings
import time
from psutil.error import AccessDenied, NoSuchProcess, TimeoutExpired
from psutil._compat import namedtuple
def pid_exist... | elventear/psutil | psutil/_psposix.py | Python | bsd-3-clause | 10,468 |
#!/usr/bin/env python
############################################################################
#
# Copyright (C) 2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... | PX4/Firmware | Tools/px_process_module_doc.py | Python | bsd-3-clause | 4,029 |
# Copyright (C) 2011 Alexey Agapitov
# This file is part of Ktope.
#
# Ktope 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 option) any la... | marwinxxii/ktope | app.py | Python | agpl-3.0 | 2,718 |
import re
from wsgiref.simple_server import make_server
from wurfl_cloud import Cloud
from wurfl_cloud import utils
class WurflCheckMiddleware(object):
# Example WSGI Middleware library to detect visitor device
# and load its capablities in the local WSGI environment
def __init__(self, wrap_app):
... | WURFL/wurfl-cloud-client-python | examples/example_web.py | Python | gpl-2.0 | 4,451 |
"""Unit test suite for HXL proxy."""
import os
import re
import hxl
import unittest.mock
#
# Mock URL access for local testing
#
def mock_open_url(url, allow_local=False, timeout=None, verify_ssl=True, http_headers=None):
"""
Open local files instead of URLs.
If it's a local file path, leave it alone; ot... | HXLStandard/hxl-proxy | tests/__init__.py | Python | unlicense | 1,532 |
# -*- coding: utf-8 -*-
#
# 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
#... | Fokko/incubator-airflow | airflow/contrib/hooks/gcp_mlengine_hook.py | Python | apache-2.0 | 1,125 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
This module contains utilities for doing coverage analysis on the RPC
interface.
It provides a way t... | sinraf96/electrum | qa/rpc-tests/test_framework/coverage.py | Python | mit | 2,932 |
#!/usr/bin/env python
# Copyright 2014-2015 @gitagon. For alternative licenses contact the author.
#
# This file is part of streamsearch-py.
# streamsearch-py 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 Found... | gitagon/streamsearch-py | streamsearch/buffer.py | Python | agpl-3.0 | 1,503 |
"""Viessmann ViCare sensor device."""
from __future__ import annotations
from contextlib import suppress
from dataclasses import dataclass
import logging
from PyViCare.PyViCareUtils import (
PyViCareInvalidDataError,
PyViCareNotSupportedFeatureError,
PyViCareRateLimitError,
)
import requests
from homeass... | jawilson/home-assistant | homeassistant/components/vicare/binary_sensor.py | Python | apache-2.0 | 6,640 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space 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 Lice... | OuterDeepSpace/OuterDeepSpace | shared/res/rules/alter/rules.py | Python | gpl-2.0 | 8,361 |
"""
This module provides some useful tools for ``vcs`` like annotate/diff html
output. It also includes some internal helpers.
"""
import time
import datetime
def makedate():
lt = time.localtime()
if lt[8] == 1 and time.daylight:
tz = time.altzone
else:
tz = time.timezone
return time.... | msabramo/kallithea | kallithea/lib/vcs/utils/__init__.py | Python | gpl-3.0 | 4,852 |
from __future__ import print_function
from nose.tools import assert_equal
from matplotlib.testing.decorators import knownfailureif
import sys
def test_simple():
assert_equal(1+1,2)
@knownfailureif(True)
def test_simple_knownfail():
assert_equal(1+1,3)
from pylab import *
def test_override_builtins():
ok_... | lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/matplotlib/tests/test_basic.py | Python | mit | 907 |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 8 17:29:58 2013
@author: cbarbosa
Program to verify results from MCMC runs.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from scipy.optimize import fmin, fminbound
from scipy.integrate import quad
import matplotlib.cm as c... | kadubarbosa/hydra1 | mcmc_analysis.py | Python | gpl-2.0 | 11,798 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | JioCloud/horizon | openstack_dashboard/dashboards/project/data_processing/cluster_templates/tests.py | Python | apache-2.0 | 2,216 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mnn.model import MNnModel
# Single disc
model = MNnModel()
model.add_disc('z', 1.0, 10.0, 100.0)
# Evaluating density and potential :
print(model.evaluate_density(1.0, 2.0, -0.5))
print(model.evaluate_potential(1.0, 2.0, -... | mdelorme/MNn | mnn/examples/simple_model.py | Python | mit | 1,497 |
#!/usr/bin/env python
# -*- coding: ISO-8859-15 -*-
#
# Copyright (C) 2005-2007 David Guerizec <david@guerizec.net>
#
# Last modified: 2007 Dec 08, 20:11:32 by david
#
# 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... | OutOfOrder/sshproxy | lib/ini_db/acl.py | Python | gpl-2.0 | 3,328 |
import unittest
from QGL import *
from QGL.tools.euler_angles import *
from QGL.tools.matrix_tools import *
from QGL.tools.clifford_tools import C1
import QGL.config
try:
from helpers import setup_test_lib
except:
from .helpers import setup_test_lib
class EulerDecompositions(unittest.TestCase):
N_test = 1000
... | BBN-Q/QGL | tests/test_Euler.py | Python | apache-2.0 | 1,183 |
# @package ITDCHelper
# @author Avtandil Kikabidze aka LONGMAN
# @copyright Copyright (c) 2008-2015, Avtandil Kikabidze (akalongman@gmail.com)
# @link http://long.ge
# @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
import os
import sys
import sublime
import ... | itdc/sublimetext-itdchelper | ITDCHelperAsana.py | Python | mit | 12,157 |
#
# Copyright (C) 2008, Brian Tanner
#
#http://rl-glue-ext.googlecode.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 requ... | okkhoy/mo-rlglue-python-codec | tests/test_1_environment.py | Python | mit | 2,322 |
import os
import numpy as np
from dipy.viz import actor, window
import numpy.testing as npt
from nibabel.tmpdirs import TemporaryDirectory
from dipy.tracking.streamline import center_streamlines, transform_streamlines
from dipy.align.tests.test_streamlinear import fornix_streamlines
from dipy.testing.decorators impor... | villalonreina/dipy | dipy/viz/tests/test_fvtk_actors.py | Python | bsd-3-clause | 8,239 |
# MNIST and Dropout
import tensorflow as tf
import random
from tensorflow.examples.tutorials.mnist import input_data
tf.set_random_seed(777) # reproducibility
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# parameters
learning_rate = 0.001
training_epochs = 15
batch_size = 100
# input place hol... | ram1993/neuralnetwork | Tensorflow/deep_nn_mnist.py | Python | mit | 3,041 |
from template import Template
from template.test import TestCase, main
class CaseTest(TestCase):
def testCase(self):
ttdef = Template({ 'POST_CHOMP': 1 })
ttanycase = Template({ 'ANYCASE': 1, 'POST_CHOMP': 1 })
tts = (('default', ttdef), ('anycase', ttanycase))
self.Expect(DATA, tts, self._callsign(... | gsnedders/Template-Python | t/case_test.py | Python | artistic-2.0 | 1,008 |
from .selection import split_selection
| twolfson/sublime-plugin-tests | sublime_plugin_tests/utils/__init__.py | Python | unlicense | 39 |
# -*- coding: utf-8 -*-
import time
import datetime
from nose.tools import * # noqa; PEP8 asserts
from osf_tests.factories import ProjectFactory, NodeFactory, AuthUserFactory
from tests.base import OsfTestCase
from framework.auth.decorators import Auth
from website.profile import utils
class TestContributorUtils... | laurenrevere/osf.io | tests/test_contributors_views.py | Python | apache-2.0 | 4,701 |
""" io on the clipboard """
import warnings
from pandas.compat import StringIO, PY2, PY3
from pandas.core.dtypes.generic import ABCDataFrame
from pandas import compat, get_option, option_context
def read_clipboard(sep=r'\s+', **kwargs): # pragma: no cover
r"""
Read text from clipboard and pass to read_tabl... | kdebrab/pandas | pandas/io/clipboards.py | Python | bsd-3-clause | 4,885 |
from puq import *
def run():
p1 = UniformParameter('x', 'x', min=-5, max=5)
host = InteractiveHost()
uq = Smolyak([p1], level=2)
# call the wrapper with a=1, b=2, c=3
# example using bash wrapper
prog = TestProgram(desc='Quadratic using bash wrapper',
exe="./sim_wrap.sh... | c-PRIMED/puq | examples/wrappers/basic/quad.py | Python | mit | 515 |
#derived from ENSEMBLs example client, https://github.com/Ensembl/ensembl-rest/wiki/Example-Python-Client
#tested on Python 3.2.3
#see also: http://rest.ensembl.org/documentation
import sys
import urllib.error
import urllib.parse
import urllib.request
import json
import time
import datetime
DEFAULT_SERVER ... | LKBecker/ENSEMBL-API | ENSEMBL_API.py | Python | gpl-3.0 | 24,404 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | odoousers2014/odoo | addons/mail/mail_thread.py | Python | agpl-3.0 | 106,607 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Swiss Postfinance File Delivery Services module for Odoo
# Copyright (C) 2014 Compassion CH
# @author: Nicolas Tran
#
# This program is free software: you can redistribute it and/or modify
# ... | ndtran/l10n-switzerland | l10n_ch_fds_postfinance/model/fds_postfinance_files.py | Python | agpl-3.0 | 6,014 |
#!/usr/bin/env python
import os
from askgod import create_app, db
from askgod.models import *
import askgod.views
from flask.ext.script import Manager, Shell
from flask.ext.script.commands import Server
from flask.ext.migrate import Migrate, MigrateCommand
my_app = create_app(os.getenv('FLASK_CONFIG') or 'default')
... | ppepos/drunken-shame | containers/askgod/app/src/run.py | Python | mit | 846 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.