code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import sys
import os
sys.path.insert(0, os.path.abspath('../..'))
# -*- coding: utf-8 -*-
#
# PyGraphistry documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 21 19:30:19 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possi... | kcompher/pygraphistry | docs/source/conf.py | Python | bsd-3-clause | 11,851 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilities for managing assets."""
import argparse
import json
import os
import shlex
import shutil
import subprocess
import sys
INFRA_BOTS_DIR = os.path.ab... | youtube/cobalt | third_party/skia/infra/bots/assets/asset_utils.py | Python | bsd-3-clause | 11,910 |
#
# colors.py -- color definitions
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import re
color_dict = {
'aliceblue': (0.9411764705882353, 0.9725490196078431, 1.0... | eteq/ginga | ginga/colors.py | Python | bsd-3-clause | 48,361 |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | vasily-v-ryabov/pywinauto | pywinauto/unittests/test_win32functions.py | Python | bsd-3-clause | 5,560 |
"""
sentry.templatetags.sentry_admin_helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import datetime
from django import template
from django.db.models import Sum
register = template.Library()
@r... | alex/sentry | sentry/templatetags/sentry_admin_helpers.py | Python | bsd-3-clause | 965 |
from corehq.apps.commtrack.models import StockState
from custom.ilsgateway.models import SupplyPointStatus, SupplyPointStatusValues, SupplyPointStatusTypes
from custom.ilsgateway.tanzania.reminders import DELIVERY_PARTIAL_CONFIRM, NOT_DELIVERED_CONFIRM, \
DELIVERY_CONFIRM_DISTRICT, DELIVERY_CONFIRM_CHILDREN
from cu... | puttarajubr/commcare-hq | custom/ilsgateway/tanzania/test/delivered.py | Python | bsd-3-clause | 3,569 |
# -*- coding: utf-8 -*-
"""
pysteps.motion.lucaskanade
==========================
The Lucas-Kanade (LK) local feature tracking module.
This module implements the interface to the local `Lucas-Kanade`_ routine
available in OpenCV_.
For its dense method, it additionally interpolates the sparse vectors over a
regular g... | pySTEPS/pysteps | pysteps/motion/lucaskanade.py | Python | bsd-3-clause | 9,903 |
from __future__ import unicode_literals
import re
import sys
from textwrap import TextWrapper
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext, ugettext_lazy as _
# make use of a favourite... | erthalion/django-postman | postman/utils.py | Python | bsd-3-clause | 4,047 |
# -*- 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):
# Adding field 'ContentMetadata.iphone_gallery_id'
db.add_column(u'content_metadata_contentmetadata', 'iphon... | drawquest/drawquest-web | website/drawquest/apps/content_metadata/migrations/0004_auto__add_field_contentmetadata_iphone_gallery_id.py | Python | bsd-3-clause | 1,633 |
from plugit_proxy.management.commands.check_mail import *
| ebu/PlugIt | examples/standalone_proxy/plugIt/management/commands/check_mail.py | Python | bsd-3-clause | 58 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-01-08 11:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_workflow', '0005_auto_20180104_1559'),
]
operations = [
migrations.A... | dani0805/django_workflow | django_workflow/migrations/0006_transition_description.py | Python | bsd-3-clause | 518 |
"""
Unittests for gj2ascii CLI
"""
from __future__ import division
import os
import tempfile
import unittest
import click
import emoji
import fiona as fio
import pytest
import gj2ascii
from gj2ascii import cli
def test_complex(runner, expected_line_40_wide, line_file, compare_ascii):
result = runner.invoke(c... | geowurster/gj2ascii | tests/test_cli.py | Python | bsd-3-clause | 13,853 |
"""
==============================
CSC to learn LFP spiking atoms
==============================
Here, we show how CSC can be used to learn spiking
atoms from Local Field Potential (LFP) data [1].
[1] Hitziger, Sebastian, et al.
Adaptive Waveform Learning: A Framework for Modeling Variability in
Neurophysiolo... | alphacsc/alphacsc | examples/csc/plot_lfp_data.py | Python | bsd-3-clause | 4,048 |
from django.core import cache
from django.core.exceptions import MiddlewareNotUsed
from versionedcache.debug import CacheClass
class CacheDebugMiddleware(object):
def __init__(self):
if not isinstance(cache.cache, CacheClass):
raise MiddlewareNotUsed()
def process_request(self, request):
... | ella/django-versionedcache | versionedcache/middleware.py | Python | bsd-3-clause | 647 |
import unittest
import sys
import math
from llvm.core import (Module, Type, Function, Builder)
import llvm.core as lc
import llvm.ee as le
from .support import TestCase, BITS, tests
class TestIntrinsicBasic(TestCase):
def _build_module(self, float):
mod = Module.new('test')
functy = Type.func... | llvmpy/llvmpy | llvm/tests/test_intrinsic_basic.py | Python | bsd-3-clause | 3,537 |
from niprov.dependencies import Dependencies
from niprov.formatjson import JsonFormat
from niprov.formatxml import XmlFormat
from niprov.formatnarrated import NarratedFormat
from niprov.formatsimple import SimpleFormat
from niprov.formatdict import DictFormat
from niprov.formatobject import ObjectFormat
from niprov.pic... | ilogue/niprov | niprov/formatfactory.py | Python | bsd-3-clause | 1,093 |
from ..membership import Membership
def test_basic_invalid_membership():
""" Make sure that we can create an invalid membership and break """
membership = Membership("person_id", "orga_id")
membership.validate()
membership.person_id = None
try:
assert "nonsense" == membership.validate()
... | AGarrow/larvae | larvae/tests/test_membership.py | Python | bsd-3-clause | 694 |
# Standard imports
import unittest
import json
import logging
from datetime import datetime, timedelta
# Our imports
from emission.core.get_database import get_db, get_mode_db, get_section_db
from emission.analysis.result.precompute import precompute_results
from emission.core.wrapper.user import User
from emission.co... | joshzarrabi/e-mission-server | emission/tests/analysisTests/result_precompute/TestPrecomputeResults.py | Python | bsd-3-clause | 3,850 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
import django
import fancypages as fp
from configurations import Configuration, values
class Common(Configuration):
DEBUG = True
TEMPLATE_DEBUG = DEBUG
SECRET_KEY = values.Value('insecure secret key')
ADMINS ... | tangentlabs/django-fancypages | sandbox/settings/common.py | Python | bsd-3-clause | 4,089 |
""" WRITEME """
from __future__ import with_statement
try:
import sql
from cachesync_runner import cachesync_lock
import cachesync_runner
except:
pass
import os
import tempfile
import shutil
import socket
import optparse
import time
import random
import re
from optparse import OptionParser
from tools... | crmne/jobman | jobman/sql_runner.py | Python | bsd-3-clause | 39,656 |
from __future__ import unicode_literals
import hashlib
import hmac
import time
from base64 import standard_b64encode
from datetime import datetime
from urllib.parse import parse_qs, urlparse
from requests.auth import AuthBase
class ExoscaleAuth(AuthBase):
def __init__(self, key, secret):
self.key = key
... | exoscale/requests-exoscale-auth | exoscale_auth.py | Python | bsd-3-clause | 3,141 |
#!/usr/bin/python
# $Id$
#
# Copyright (c) 2007-2008 ReThought Limited and Peloton Contributors
# All Rights Reserved
# See LICENSE for details
""" Quick and dirty tool for tapping into the event bus and dumping events
posted to a given exchange and key. Key may be specified as a pattern in AMQP
format.
"""
from peloto... | aquamatt/Peloton | src/tools/ptap/evtap.py | Python | bsd-3-clause | 4,829 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Time and frequency utilities'''
import re
import numpy as np
import six
from ..util.exceptions import ParameterError
__all__ = ['frames_to_samples', 'frames_to_time',
'samples_to_frames', 'samples_to_time',
'time_to_samples', 'time_to_frames',
... | ruohoruotsi/librosa | librosa/core/time_frequency.py | Python | isc | 25,300 |
# Generated by Django 2.2.10 on 2020-05-26 13:30
from django.db import migrations, models
import waldur_core.core.validators
class Migration(migrations.Migration):
dependencies = [
('marketplace_checklist', '0003_add_category_and_correct_answer'),
]
operations = [
migrations.AddField(
... | opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/marketplace_checklist/migrations/0004_i18n_questions_and_checklists.py | Python | mit | 2,502 |
# -*- coding: utf-8 -*-
#
# imboclient-js documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 12 20:38:51 2014.
#
# 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.
#... | imbo/imboclient-js | docs/conf.py | Python | mit | 8,014 |
# 15/02/2019
# influenced heavily by Gprime5's solution
def flip(cards):
order = []
direction = True
for i, card in enumerate(cards):
if direction:
order.insert(0, str(i))
else:
order.append(str(i))
direction ^= (card == '1')
return ' '.join(order) if n... | tlseabra/dailyprogrammer | Python/intermediate/i375.py | Python | mit | 352 |
#!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import st... | TheAltcoinBoard/XAB-withoutSecp256k1 | contrib/linearize/linearize-hashes.py | Python | mit | 2,868 |
"""
WSGI config for todoapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | erdem/django-selenium-example | todoapp/todoapp/wsgi.py | Python | mit | 391 |
import sys
import re
import json
import hashlib
from ..console_write import console_write
class CachingDownloader(object):
"""
A base downloader that will use a caching backend to cache HTTP requests
and make conditional requests.
"""
def add_conditional_headers(self, url, headers):
"""
... | koery/win-sublime | Data/Packages/Package Control/package_control/downloaders/caching_downloader.py | Python | mit | 5,367 |
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
inventory: ini
version_added: "2.4"
short_description: Uses an Ansibl... | sgerhart/ansible | lib/ansible/plugins/inventory/ini.py | Python | mit | 16,758 |
# sql/types_api.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | sumedh123/debatify | venv/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py | Python | mit | 42,846 |
from django.shortcuts import render_to_response
from django.http import HttpResponse
# Create your views here.
def index(request):
return render_to_response('index.html') | kostya9/KPI.RelationalDatabases | Lab3/flights/core/views.py | Python | mit | 176 |
from bespin.errors import BadOption, MissingPlan
from input_algorithms.spec_base import NotSpecified
class Plan(object):
@classmethod
def find_stacks(kls, configuration, stacks, plan):
if plan in (None, NotSpecified):
raise BadOption("Please specify a plan", available=list(configuration["p... | realestate-com-au/bespin | bespin/operations/plan.py | Python | mit | 829 |
'''
DictAdapter
===========
.. versionadded:: 1.5
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
A :class:`~kivy.adapters.dictadapter.DictAdapter` is an adapter around a
python dictionary of records. It extends the list-like capabilities of the
:class:`~k... | Zen-CODE/kivy | kivy/adapters/dictadapter.py | Python | mit | 5,874 |
""" Authentication library
======================
A base authentication & authorization module.
Includes the base class BaseAuth.
Authentication and authorization in NIPAP
-----------------------------------------
NIPAP offers basic authentication with two different backends, a simple
two... | SoundGoof/NIPAP | nipap/nipap/authlib.py | Python | mit | 24,138 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | v-iam/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/compute/v2017_03_30/models/resource_sku_restrictions.py | Python | mit | 1,903 |
-
def __init__(self):
-
| chris-j-tang/GLS | test/integration/ConstructorStart/simple.py | Python | mit | 24 |
import webapp2
import os
from google.appengine.ext.webapp import template
from src.model.WorkModels import Work
class HomePage(webapp2.RequestHandler):
def get(self):
self.response.headers["Content-Type"]="text/html"
publishedWork=Work.gql("WHERE publish=True ORDER BY order ")
template_valu... | SubhasisDutta/subhasisdutta.com | src/controller/HomeContoller.py | Python | mit | 644 |
from setuptools import setup
setup(
# general meta
name='elasticity',
version='0.7',
author='Brian C. Dilley - Flipagram',
author_email='brian@flipagram.com',
description='Python based command line tool for managing ElasticSearch clusters.',
platforms='any',
url='https://github.com/Che... | flipagram/elasticity | setup.py | Python | mit | 752 |
from __future__ import absolute_import
from unet_collection.layer_utils import *
from tensorflow.keras.layers import Input, Conv2D
from tensorflow.keras.layers import BatchNormalization, Activation, concatenate, multiply
from tensorflow.keras.layers import ReLU, LeakyReLU, PReLU, ELU
from tensorflow.keras.models impo... | nci/drishti | bin/assets/scripts/unet3Plus/unet_collection/unet_2d.py | Python | mit | 6,569 |
# -*- coding: utf-8 -*-
# vim: set ts=4 et
import cgi
import requests
from six.moves.html_parser import HTMLParser
from plugin import *
content_types = (
'text/html',
'text/xml',
'application/xhtml+xml',
'application/xml'
)
class TitleParser(HTMLParser):
def __init__(self):
HTMLParser._... | jrspruitt/jkent-pybot | pybot/plugins/anyurl.py | Python | mit | 2,136 |
# fit and predict with known line segment x locations
# import our libraries
import numpy as np
import matplotlib.pyplot as plt
import pwlf
# your data
y = np.array([0.00000000e+00, 9.69801700e-03, 2.94350340e-02,
4.39052750e-02, 5.45343950e-02, 6.74104940e-02,
8.34831790e-02, 1.02580042e-... | cjekel/piecewiseLinearFitPython | examples/fitWithKnownLineSegmentLocations.py | Python | mit | 3,127 |
ID = "421"
def execute(self, sendMsg, msgprefix, command, params):
print "We received a 421: ", msgprefix, params | NightKev/Renol-IRC | IRCpackets/421_packet.py | Python | mit | 118 |
""" Tablib - DataFrame Support.
"""
import sys
if sys.version_info[0] > 2:
from io import BytesIO
else:
from cStringIO import StringIO as BytesIO
try:
from pandas import DataFrame
except ImportError:
DataFrame = None
import tablib
from tablib.compat import unicode
title = 'df'
extensions = ('df'... | htwenhe/DJOA | env/Lib/site-packages/tablib/formats/_df.py | Python | mit | 1,040 |
#!/usr/bin/env python
import math
import sys
import yaml
log = True
def main():
handle = open(sys.argv[1])
config = yaml.load(handle)
handle.close()
phase_limit = int(config['phase_limit'])
num_load = float(config['num_load'])
num_store = float(config['num_store'])
ops_per_point = float(config['ops... | jholewinski/ics-12-overlapped-tiling | scripts/new-model-2.py | Python | mit | 5,138 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_izaryx.iff"
result.attribute_template_id = 9
result.s... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_dressed_izaryx.py | Python | mit | 430 |
#!/usr/bin/env python
"""
Usage: python get_status.py <acceleration (mm/s/s)> <max velocity (mm/s) [<serial>]
Gets the status of all APT controllers, or of the one specified
"""
import pylibftdi
import pyAPT
def set_vel_params(serial, acc, max_vel):
with pyAPT.MTS50(serial_number=serial) as con:
print '\tSettin... | anthonyclays/pyAPT | set_velocity_params.py | Python | mit | 1,322 |
#!/usr/bin/env python
#
# Copyright (C) 2017 DL
#
from error_logger.net import email_notification
from error_logger.utils import logger
def send_sms(config, to_list, contents):
pass | JShadowMan/package | python/zdl/error_logger/error_logger/net/sms_notification.py | Python | mit | 187 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script creates new items on Wikidata based on certain criteria.
* When was the (Wikipedia) page created?
* When was the last edit on the page?
* Does the page contain interwiki's?
This script understands various command-line arguments:
-lastedit The minimum ... | xZise/pywikibot-core | scripts/newitem.py | Python | mit | 4,866 |
#!/usr/bin/python
from ops_i2cbase import I2CBase
# ===========================================================================
# SI1145 Class
#
# Ported from github.com/adafruit/Adafruit_SI1145_Library/
# ===========================================================================
class SI1145:
i2c = None
# SI1... | dudakp/rasPi_systemInfo | lib_si1145/lib_si1145.py | Python | mit | 2,472 |
# -*- coding: utf-8 -*-
"""
Log/output handling.
"""
from __future__ import print_function
import sys
import colors
CRITICAL = 50
ERROR = 40
WARNING = 30
INFO = 20
DEBUG = 10
_levels = [
CRITICAL,
ERROR,
WARNING,
INFO,
DEBUG,
]
_levels_to_names = {
CRITICAL: 'CRITICAL',
ERROR: 'ERROR',... | okdana/mp3civ | mp3sum/logging.py | Python | mit | 3,911 |
#!/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.
"""Test dashd with different proxy configuration.
Test plan:
- Start dashd's with different proxy configu... | dashpay/dash | test/functional/feature_proxy.py | Python | mit | 8,314 |
from __future__ import with_statement
__version__ = '0.31'
__license__ = 'MIT'
import re
import os
import sys
import finalseg
import time
import tempfile
import marshal
from math import log
import random
import threading
from functools import wraps
DICTIONARY = "dict.txt"
DICT_LOCK = threading.RLock()
trie = None # t... | seem-sky/newspaper | newspaper/packages/jieba/__init__.py | Python | mit | 11,308 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | GarySparrow/mFlaskWeb | venv/Lib/site-packages/foreman/environments.py | Python | mit | 937 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
import unittest
import os
from pymatgen.analysis.pourbaix.maker import PourbaixDiagram
from pymatgen.analysis.pourbaix.entry import PourbaixEntryIO
class TestPourbaix... | johnson1228/pymatgen | pymatgen/analysis/pourbaix/tests/test_maker.py | Python | mit | 1,116 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_rakir_banai_q2_needed.iff"
result.attribu... | obi-two/Rebelion | data/scripts/templates/object/tangible/mission/quest_item/shared_rakir_banai_q2_needed.py | Python | mit | 477 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_garm_bel_iblis.iff"
result.attribute_template_id = 9
... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_dressed_garm_bel_iblis.py | Python | mit | 447 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/mine/shared_wp_mine_xg.iff"
result.attribute_template_id = 10
result.s... | anhstudios/swganh | data/scripts/templates/object/weapon/mine/shared_wp_mine_xg.py | Python | mit | 434 |
class Solution(object):
def twoSum(self, nums, target):
return list([ (x, y) for x in range(len(nums)) for y in range(x, len(nums)) if nums[x] + nums[y] == target and (x != y) ][0])
if __name__ == '__main__':
solution = Solution()
print(solution.twoSum([3, 2, 4], 6))
print(solution.twoSu... | JShadowMan/package | python/LeetCode OJ/1.twoSum.py | Python | mit | 341 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'第 0010 题:使用 Python 生成类似于图中的字母验证码图片'
from PIL import Image, ImageDraw, ImageFont, ImageFilter
import random
# 随机字母:
def rndChar():
return chr(random.randint(65, 90))
# 随机颜色1:
def rndColor():
return (random.randint(64, 255), random.randint(64, 255), random.rand... | Show-Me-the-Code/python | Drake-Z/0010/0010.py | Python | mit | 1,049 |
######################################################################
# Preliminaries,
import scipy as sp
mat=sp.matrix
from scipy.linalg import inv
######################################################################
# an utility function to format a matrix for inclusion in a LaTeX file
def latex_print(data,name,fm... | boffi/boffi.github.io | dati_2016/07/exercise1.py | Python | mit | 3,949 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/intangible/pet/shared_3po_protocol_droid_silver.iff"
result.attribute_temp... | anhstudios/swganh | data/scripts/templates/object/intangible/pet/shared_3po_protocol_droid_silver.py | Python | mit | 438 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# lcmodels - Waqas Bhatti (wbhatti@astro.princeton.edu) - Oct 2017
# License: MIT. See the LICENSE file for more details.
'''This contains various light curve models for variable stars. Useful for
first order fits to distinguish between variable types, and for generating ... | lgbouma/astrobase | astrobase/lcmodels/__init__.py | Python | mit | 763 |
"""Common methods for request handlers."""
from rubberband.models import TestSet
def search(query):
"""
Execute a search to elasticsearch database, gives by default the 100 first results.
Parameters
----------
query : dict
Search parameters
Results
-------
Response
el... | xmunoz/rubberband | rubberband/handlers/common/__init__.py | Python | mit | 1,084 |
def update_time(sender, **kwargs):
"""
When a Comment is added, updates the Update to set "last_updated" time
"""
comment = kwargs['instance']
if comment.content_type.app_label == "happenings" and comment.content_type.name == "Update":
from .models import Update
item = Update.object... | tBaxter/tango-happenings | happenings/signals.py | Python | mit | 368 |
#!/usr/bin/env python
# -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
from StringIO import StringIO
import urlparse
import urllib
try:
from webob import Request as BaseRequest
except ImportError:
raise ImportError('WebOb (http://py... | arnaudsj/restkit | restkit/contrib/webob_api.py | Python | mit | 2,457 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------
# File: controller/controller_parser.py
# Created: 2015-01-17
# Purpose: Controll commandline arguments for parsing files
#
# Copyright
# ------------------------------------... | Ever-Never/smalisca | smalisca/controller/controller_parser.py | Python | mit | 10,504 |
__author__ = 'fahadadeel'
import jpype
import os.path
from WorkingWithPresentation import PptToPptx
asposeapispath = os.path.join(os.path.abspath("../../../"), "lib")
print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath
jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.... | asposeslides/Aspose_Slides_Java | Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py | Python | mit | 397 |
import sys
import traceback
def Die(Msg):
print >> sys.stderr
print >> sys.stderr
traceback.print_stack()
s = ""
for i in range(0, len(sys.argv)):
if i > 0:
s += " "
s += sys.argv[i]
print >> sys.stderr, s
print >> sys.stderr, "**ERROR**", Msg
print >> sys.stderr
print >> sys.stderr
sys.exit(1)
prin... | nioo-knaw/hydra | uparse_scripts/die.py | Python | mit | 446 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Installation()
result.template = "object/installation/faction_perk/turret/shared_block_sm.iff"
result.attribute_t... | anhstudios/swganh | data/scripts/templates/object/installation/faction_perk/turret/shared_block_sm.py | Python | mit | 460 |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | pyannote/pyannote-generators | pyannote/generators/__init__.py | Python | mit | 1,291 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/plain/shared_plain_coffee_table_s01.iff"
result.attribute... | anhstudios/swganh | data/scripts/templates/object/tangible/furniture/plain/shared_plain_coffee_table_s01.py | Python | mit | 463 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
... | kleientertainment/ds_mod_tools | pkg/win32/Python27/Lib/pydoc.py | Python | mit | 95,949 |
# Copyright (c) 2016 Egor Tensin <Egor.Tensin@gmail.com>
# This file is part of the "VK scripts" project.
# For details, see https://github.com/egor-tensin/vk-scripts.
# Distributed under the MIT License.
from enum import Enum
import re
class Platform(Enum):
MOBILE = 1
IPHONE = 2
IPAD = 3
ANDROID = 4... | egor-tensin/vk-scripts | vk/platform.py | Python | mit | 1,582 |
# 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/.
import asyncore
from datetime import datetime, timedelta
import socket
import os
import sys
from time import sleep
from... | lucashmorais/x-Bench | mozmill-env/python/Lib/site-packages/jsbridge/__init__.py | Python | mit | 1,601 |
# coding=utf-8
from django.contrib import admin
from ..models import TipoLaboratorio
@admin.register(TipoLaboratorio)
class TipoLaboratorioAdmin(admin.ModelAdmin):
"""
Especificación de la representación de TipoLaboratorio en la interfaz de administración.
"""
list_display = (
'nombre',
... | desarrollogt-frm-utn/reservas | app_reservas/admin/tipoLaboratorio.py | Python | mit | 341 |
import datetime
from loguru import logger
from flexget import plugin
from flexget.event import event
from flexget.utils.database import Session
logger = logger.bind(name='est_movies_bluray')
class EstimatesMoviesBluray:
@plugin.priority(2)
def estimate(self, entry):
if 'movie_name' not in entry:
... | ianstalk/Flexget | flexget/components/estimate_release/estimators/est_movies_bluray.py | Python | mit | 1,377 |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various fingerprinting protections.
If an stale block more than a month old or its header are requeste... | ionomy/ion | test/functional/p2p-fingerprint.py | Python | mit | 5,852 |
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from datetime import date, timedelta
from django.http import Http404
from django.test import RequestFactory, override_settings
from fr_notices.navigation import make_preamble_nav
from regulations.generator.layers import diff_applier
from re... | 18F/regulations-site | regulations/tests/views_preamble_tests.py | Python | cc0-1.0 | 10,884 |
# -*- coding: utf-8 -*-
from .env import *
from amoco.cas.expressions import regtype
from amoco.arch.core import Formatter, Token
def mnemo(i):
mn = i.mnemonic.lower()
return [(Token.Mnemonic, "{: <12}".format(mn))]
def deref(opd):
return "[%s+%d]" % (opd.a.base, opd.a.disp)
def opers(i):
s = []
... | LRGH/amoco | amoco/arch/eBPF/formats.py | Python | gpl-2.0 | 1,781 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | prculley/gramps | gramps/gui/editors/__init__.py | Python | gpl-2.0 | 4,028 |
from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop
from Components.config import ConfigSubsection,... | kingvuplus/PKT-gui2 | skin.py | Python | gpl-2.0 | 33,730 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 opti... | JamesLinEngineer/RKMC | addons/plugin.video.phstreams/resources/lib/sources/phdmovies_mv_tv.py | Python | gpl-2.0 | 6,645 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software 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, ... | System25/gecosws-config-assistant | firstboot_lib/Builder.py | Python | gpl-2.0 | 11,770 |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current di... | MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Lib/os.py | Python | gpl-2.0 | 26,337 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVectorLayer.
From build dir, run:
ctest -R PyQgsVectorLayer -V
.. note:: 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 Lic... | jgrocha/QGIS | tests/src/python/test_qgsvectorlayer.py | Python | gpl-2.0 | 159,533 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Delaunay.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | alexgleith/Quantum-GIS | python/plugins/sextante/algs/ftools/Delaunay.py | Python | gpl-2.0 | 4,431 |
#!/usr/bin/env python
## Testing for correct patchset estimation
# Structure of the test cvs repository
#
#Import of a trivial CVS repository fails due to a cvsps bug. Given the
#following series of commits:
#
# timestamp a b c message
# ------------------- --- --- --- -------
# 2012/... | petemoore/cvs-fast-export | tests/t9605.py | Python | gpl-2.0 | 1,379 |
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
class CommonViewsTestCase(TestCase):
def setUp(self):
self.client = Client()
def test_index_page(self):
"""Test index/landing page"""
index_url = reverse('index')
response = self.client.get(i... | willingc/portal | systers_portal/common/tests/test_views.py | Python | gpl-2.0 | 995 |
from mirrormanager.model import Product, Category, Arch, Directory
product = Product(name='RFRemix')
categories = {'RFRemix Linux':('releases/RFRemix','rsync://mirror.yandex.ru/fedora/russianfedora'),
'RFRemix Repo Fixes':('russianfedora/fixes/fedora', 'rsync://mirror.yandex.ru/fedora/russianfedora'),
... | vanaf/mirrormanager-rfremix | server/mirrormanager/rfremix.py | Python | gpl-2.0 | 1,543 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/test/unit/test_mq_connector.py | Python | gpl-2.0 | 3,377 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | pmghalvorsen/gramps_branch | gramps/gen/filters/rules/citation/_citationprivate.py | Python | gpl-2.0 | 1,680 |
#!/usr/bin/env python
# $Id: Parser.py,v 1.135 2007/11/16 18:26:01 tavis_rudd Exp $
"""Parser classes for Cheetah's Compiler
Classes:
ParseError( Exception )
_LowLevelParser( Cheetah.SourceReader.SourceReader ), basically a lexer
_HighLevelParser( _LowLevelParser )
Parser === _HighLevelParser (an alias)
Meta-... | carvalhomb/tsmells | lib/Cheetah/src/Parser.py | Python | gpl-2.0 | 101,244 |
../../../../../../../../share/pyshared/papyon/service/AddressBook/scenario/contacts/check_pending_invite.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/papyon/service/AddressBook/scenario/contacts/check_pending_invite.py | Python | gpl-3.0 | 107 |
#! /usr/bin/env python
## """
## Copyright(C) 2011 The Board of Trustees of the University of Illinois.
## All rights reserved.
##
## Developed by: Roger D. Serwy
## University of Illinois
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of th... | technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/idlexlib/idlexMain.py | Python | gpl-3.0 | 12,959 |
from urllib.request import urlopen
from multiprocessing.dummy import Pool as ThreadPool
import time
from datetime import timedelta
urls = ['http://www.python.org',
'http://www.python.org/about/',
'http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html',
'http://www.python.org/doc/',
... | mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.11 Multiprocessing and Threading/code/multi_2.py | Python | gpl-3.0 | 1,045 |
# -*- coding: utf-8 -*-
from resources.lib.util import cUtil
from resources.lib.parser import cParser
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.handler.ParameterHandler import ParameterHandler
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.gui.gui impo... | kabooom/plugin.video.xstream | sites/movie4k_to.py | Python | gpl-3.0 | 26,737 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | pferreir/indico-backup | indico/MaKaC/services/implementation/material.py | Python | gpl-3.0 | 16,757 |
import unittest
from p5.pmath.utils import (
constrain,
lerp,
remap,
normalize,
magnitude,
distance,
sq)
class TestUtils(unittest.TestCase):
def test_constrain(self):
self.assertEqual(constrain(5, 0, 10), 5)
self.assertEqual(constrain(-10, 0, 10), 0)
self.asse... | p5py/p5 | p5/pmath/tests/test_utils.py | Python | gpl-3.0 | 874 |
"""Initial table layout
Revision ID: 2758f36a2fb5
Revises: None
Create Date: 2014-03-11 09:56:35.692538
"""
# revision identifiers, used by Alembic.
revision = '2758f36a2fb5'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adju... | opatut/dudel | migrations/versions/2758f36a2fb5_initial.py | Python | gpl-3.0 | 4,644 |