repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
ichuang/sympy
sympy/mpmath/tests/test_matrices.py
11
5643
from sympy.mpmath import * def test_matrix_basic(): A1 = matrix(3) for i in range(3): A1[i,i] = 1 assert A1 == eye(3) assert A1 == matrix(A1) A2 = matrix(3, 2) assert not A2._matrix__data A3 = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) assert list(A3) == list(range(1, 10)) A3...
bsd-3-clause
andrewmchen/incubator-airflow
airflow/contrib/operators/emr_create_job_flow_operator.py
45
2306
# -*- 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 in writing, software ...
apache-2.0
dhaitz/CalibFW
plotting/modules/plot_sandbox.py
1
75936
# -*- coding: utf-8 -*- """ plotting sanbox module for merlin. This module is to be used for testing or development work. """ import plotbase import copy import plot1d import getroot import math import plotresponse import plotfractions import plot2d import plot_tagging import fit import os def recogen_a...
gpl-2.0
baccenfutter/cpassdb
cpassdb/protocols/client.py
1
19784
"""cpassdb - Client Protocol Classes""" __author__ = "Brian Wiborg <baccenfutter@c-base.org>" __license__ = "GNU/GPLv2" import os import sys import json import base64 import commands from twisted.internet import reactor from twisted.protocols.basic import LineReceiver class ClientProtocol(LineReceiver): """Abstr...
gpl-2.0
nonapod/gzinflatekiller
gzinflatekiller.py
1
3114
#!/bin/env python #:############################################ #: GZINFLATEKILLER #: by Les Cordell #: #: Hunt through files containing a base64 #: GZInflate Command #: #: Written on 07/08/2013 #: last modified @ 07/08/2013 #:############################################ import sys, os, re #: Extensions constant, th...
mit
mcking49/apache-flask
Python/Lib/site-packages/pip/_vendor/cachecontrol/controller.py
152
12996
""" The httplib2 algorithms ported for use with requests. """ import logging import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer logger = logging.getLogger(__name__) ...
mit
thypad/brew
skensemble/generation/bagging.py
3
2140
import numpy as np from sklearn.ensemble import BaggingClassifier from brew.base import Ensemble from brew.combination.combiner import Combiner import sklearn from .base import PoolGenerator class Bagging(PoolGenerator): def __init__(self, base_classifier=None, n_classifiers=1...
mit
L1NT/django-training-log
log/models.py
1
5458
from django.db import models # Create your models here. class Sport(models.Model): """ don't use models.choices because we want the list to be transactional data example list: [ 'bike', 'run', 'swim', 'measurements', 'yoga', 'weights', # for multi-sp...
gpl-2.0
steven-murray/pydftools
setup.py
1
2408
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages import io import os import re with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() requirements = [ "s...
mit
chaosk/trinitee
trinitee/forums/migrations/0001_initial.py
1
14851
# 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 'Category' db.create_table('forums_category', ( ('id', self.gf('django.db.model...
bsd-3-clause
pgroudas/pants
src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile_strategy.py
1
8647
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from abc i...
apache-2.0
adonoho/twitter
twitter/archiver.py
10
16733
"""USAGE twitter-archiver [options] <-|user> [<user> ...] DESCRIPTION Archive tweets of users, sorted by date from oldest to newest, in the following format: <id> <date> <<screen_name>> <tweet_text> Date format is: YYYY-MM-DD HH:MM:SS TZ. Tweet <id> is used to resume archiving on next run. Archive ...
mit
BaichuanWu/Blog_on_django
site-packages/PIL/GifImagePlugin.py
15
21396
# # The Python Imaging Library. # $Id$ # # GIF file handling # # History: # 1995-09-01 fl Created # 1996-12-14 fl Added interlace support # 1996-12-30 fl Added animation support # 1997-01-05 fl Added write support, fixed local colour map bug # 1997-02-23 fl Make sure to load raster data in getdata() # 1997-07...
mit
jindaxia/xbmc-addons-chinese
plugin.video.cntv-live/epgservice.py
8
6351
# -*- coding: utf-8 -*- import xbmc import xbmcaddon import datetime import re import shutil import traceback import urllib2 addon = xbmcaddon.Addon(id="plugin.video.cntv-live") addon_path = xbmc.translatePath(addon.getAddonInfo("path")) def updateChannel(fHandle, channelID, channelName): try: print("Updating ch...
gpl-2.0
ruhan/django-silk-mongoengine
silk/profiling/profiler.py
1
6695
import inspect import logging import time import traceback from django.conf import settings from django.utils import timezone import six from silk.collector import DataCollector from silk.config import SilkyConfig from silk.models import _time_taken Logger = logging.getLogger('silk') # noinspection PyPep8Naming c...
mit
mmauroy/SickRage
lib/hachoir_core/field/bit_field.py
95
1777
""" Bit sized classes: - Bit: Single bit, value is False or True ; - Bits: Integer with a size in bits ; - RawBits: unknown content with a size in bits. """ from hachoir_core.field import Field from hachoir_core.i18n import _ from hachoir_core import config class RawBits(Field): """ Unknown content with a siz...
gpl-3.0
olafdietsche/scrapy
scrapy/utils/trackref.py
120
2081
"""This module provides some functions and classes to record and report references to live object instances. If you want live objects for a particular class to be tracked, you only have to subclass from object_ref (instead of object). About performance: This library has a minimal performance impact when enabled, and ...
bsd-3-clause
sourlows/rating-cruncher
src/lib/six.py
878
29664
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
apache-2.0
j0057/ansible-1
lib/ansible/runner/action_plugins/async.py
141
1915
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
FenceAtMHacks/flaskbackend
fence-api/flask/lib/python2.7/site-packages/setuptools/command/install_scripts.py
71
2041
from distutils import log import distutils.command.install_scripts as orig import os from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): ori...
mit
djangocali/portal
config/wsgi.py
5
1458
""" WSGI config for djangocali-portal project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPL...
bsd-3-clause
mkaluza/external_chromium_org
chrome/test/functional/chromoting/auth.py
68
1258
#!/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. """Chromoting authentication related test cases.""" import chromoting_base import pyauto class ChromotingAuth(chromoting_base.Ch...
bsd-3-clause
alxgu/ansible
lib/ansible/modules/utilities/logic/set_fact.py
29
3757
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Dag Wieers (@dagwieers) <dag@wieers.com> # 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 ANSIBLE_METADATA = {'metadata_ve...
gpl-3.0
sandz-in/twilio_trello
twilio_sms_handler/views.py
1
1174
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import HttpResponse from django.views.decorators.http import require_POST from twilio.twiml.messaging_response import MessagingResponse # Create your views here. from twilio_sms_handler.TrelloQuery import TrelloQuery from twilio_trello.tw...
mit
bzhou26/NRA-Crawler
openpyxl/drawing/line.py
3
4378
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Float, Integer, Bool, MinMax, Set, NoneSet, String, Alias, Sequence ) from openpyxl.descriptors.excel im...
mit
spoqa/sqlalchemy-utils
sqlalchemy_utils/query_chain.py
12
3971
""" QueryChain is a wrapper for sequence of queries. Features: * Easy iteration for sequence of queries * Limit, offset and count which are applied to all queries in the chain * Smart __getitem__ support Initialization ^^^^^^^^^^^^^^ QueryChain takes iterable of queries as first argument. Additionally...
bsd-3-clause
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractKeztranslationsWordpressCom.py
1
1210
def extractKeztranslationsWordpressCom(item): ''' Parser for 'keztranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('FOD', 'Quickly Wear the Face of the Devil', ...
bsd-3-clause
vongochung/buiquocviet
django/db/backends/util.py
88
4767
import datetime import decimal import hashlib from time import time from django.conf import settings from django.utils.log import getLogger from django.utils.timezone import utc logger = getLogger('django.db.backends') class CursorWrapper(object): def __init__(self, cursor, db): self.cursor = cursor ...
bsd-3-clause
llvm-mirror/lldb
packages/Python/lldbsuite/test/arm/emulation/TestEmulations.py
13
1526
""" Test some ARM instruction emulation. """ from __future__ import print_function import os import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ARMEmulationTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @no_deb...
apache-2.0
dvida/UWO-PA-Python-Course
Lecture 3/L3_lecture.py
1
5075
from __future__ import print_function ### READING FILES file_name = 'data.txt' # Reading in and parsing file contents data_list = [] with open(file_name) as f: # SKip the header (the first line) next(f) for line in f: # Remove newline char line = line.replace('\n', ...
mit
ktnyt/chainer
tests/chainer_tests/datasets_tests/test_tuple_dataset.py
14
1737
import unittest import numpy from chainer.backends import cuda from chainer import datasets from chainer import testing from chainer.testing import attr class TestTupleDataset(unittest.TestCase): def setUp(self): self.x0 = numpy.random.rand(3, 4) self.x1 = numpy.random.rand(3, 5) self.z...
mit
amite/ghostblog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/__init__.py
269
2974
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
mit
konstruktoid/ansible-upstream
lib/ansible/modules/network/cloudengine/ce_bgp.py
43
80680
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
mattstep/ansible
lib/ansible/plugins/action/synchronize.py
3
7160
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012-2013, Timothy Appnel <tim@appnel.com> # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
terna/SLAPP3
6 objectSwarmObserverAgents_AESOP_turtleLib_NetworkX/$$slapp$$/txtxFunctions.py
1
1888
import os def executeFormula(fIn, fOu, nrow, n, s): # v=0 #init. not required; it can interfere with the try/except structure pos = s.find("v") if pos == -1: print("missing 'v' in formula, row", nrow, "\nexecution stopped in error") fIn.close() fOu.close() os...
cc0-1.0
hunch/hunch-gift-app
django/contrib/gis/geos/prototypes/misc.py
12
1477
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import c_int, c_double, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_st...
mit
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.5/django/conf/locale/ka/formats.py
106
1849
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'l, j F, Y' TIME_FORMAT = 'h:i:s a' DATETIME_FORMAT = 'j F, Y h:i:s a' YEA...
mit
rnixx/kivy
examples/frameworks/twisted/echo_client_app.py
13
2352
# install_twisted_rector must be called before importing the reactor from __future__ import unicode_literals from kivy.support import install_twisted_reactor install_twisted_reactor() # A Simple Client that send messages to the Echo Server from twisted.internet import reactor, protocol class EchoClient(protocol.Pr...
mit
kkk669/mxnet
example/mxnet_adversarial_vae/convert_data.py
18
3059
# 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...
apache-2.0
ddico/odoo
addons/hr_holidays/tests/test_holidays_flow.py
6
13649
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from datetime import datetime from dateutil.relativedelta import relativedelta from psycopg2 import IntegrityError from odoo import fields from odoo.exceptions import AccessError, ValidationError, UserError ...
agpl-3.0
darmaa/odoo
openerp/addons/base/res/res_country.py
33
4249
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
joansmith/openmicroscopy
components/tools/OmeroPy/src/omero/util/text.py
9
9960
#!/usr/bin/env python # -*- coding: utf-8 -*- # # OMERO Text handling utilities # # Copyright 2010-2015 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # # The following classes (ALIGN, Column, Table) were originally from # http://code.activestate.com/recipes/57...
gpl-2.0
xyos/horarios
horarios/migrations/0004_auto__chg_field_subject_name.py
1
2406
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Subject.name' db.alter_column(u'horarios_subject', 'na...
mit
squilter/ardupilot
Tools/mavproxy_modules/lib/geodesic_grid.py
108
2058
# Copyright (C) 2016 Intel Corporation. All rights reserved. # # This file is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This fi...
gpl-3.0
dsweet04/rekall
rekall-core/rekall/plugins/linux/netstat.py
7
6774
# Rekall Memory Forensics # # Copyright 2013 Google Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at # your option) any later v...
gpl-2.0
vladikoff/fxa-mochitest
tests/venv/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.py
367
13497
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re from . import DistlibEx...
mpl-2.0
zhoucen/gunicorn
scripts/update_thanks.py
22
1128
#!/usr/bin/env python # Usage: git log --format="%an <%ae>" | python update_thanks.py # You will get a result.txt file, you can work with the file (update, remove, ...) # # Install # ======= # pip install validate_email pyDNS # from __future__ import print_function import os import sys from validate_email import valid...
mit
pilou-/ansible
lib/ansible/modules/cloud/docker/docker_container.py
6
124853
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['prev...
gpl-3.0
attdona/NAIS
pynais/msg.py
1
2142
import struct import pynais as ns class Profile: def __init__(self, uid=None, pwd=None): self.uid = uid self.pwd = pwd def __str__(self): return "Profile uid: [%s], pwd: [%s]" % (self.uid, self.pwd) def set_protobuf(self, obj): obj.uid = self.uid obj.pwd = self...
gpl-3.0
xysec/xysec_adb
xysec_adb/pylib/utils/reraiser_thread.py
36
4669
# Copyright 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. """Thread and ThreadGroup that reraise exceptions on the main thread.""" # pylint: disable=W0212 import logging import sys import threading import traceback...
apache-2.0
liuslevis/handwrite_dataset_generator
3_gen_digit_data_label.py
1
2918
import os import shutil DEBUG = False img_suffix = ['.jpeg','.jpg','.png','.tiff'] def gen_img_unique_file_name(count,total): assert(count<=total) name = '' for i in range(len(str(total)) - len(str(count))): name+='0' offset = str(count) name+=offset return name def copy_img_file(s...
mit
tomncooper/heron
heron/shell/src/python/handlers/filehandler.py
4
1784
#!/usr/bin/env python # -*- encoding: 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...
apache-2.0
redkyn/grader
redkyn-grader/grader/commands/report.py
2
3020
'''TODO: Report command docs ''' import itertools import jinja2 import logging import os import yaml from grader.models import Grader from grader.utils.config import require_grader_config logger = logging.getLogger(__name__) help = "Generate reports using a gradesheet template" def setup_parser(parser): parser...
mit
dims/neutron
neutron/tests/api/admin/test_dhcp_agent_scheduler.py
2
4093
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
Innovahn/cybex
addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py
384
1414
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
nrz/ylikuutio
external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_alternating_legs_env_randomizer.py
2
2810
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called. The randomization include swing_offset, extension_offset of all legs that mimics bent legs, desired_pitch from user input, battery voltage and motor damping. """ import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in...
agpl-3.0
frankvdp/django
tests/aggregation/test_filter_argument.py
38
3635
import datetime from decimal import Decimal from django.db.models import Case, Count, F, Q, Sum, When from django.test import TestCase from .models import Author, Book, Publisher class FilteredAggregateTests(TestCase): @classmethod def setUpTestData(cls): cls.a1 = Author.objects.create(name='test', ...
bsd-3-clause
leiferikb/bitpop
src/native_client/build/package_version/revision_info_test.py
3
7154
#!/usr/bin/python # Copyright (c) 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests for packages info.""" import json import os import sys import unittest sys.path.append(os.path.join(os.path.dirname(__f...
gpl-3.0
willcast/kernel_manta
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
dreaming-dog/kaldi-long-audio-alignment
scripts/classes/entry_manager.py
1
2096
# Copyright 2017 Speech Lab, EE Dept., IITM (Author: Srinivas Venkattaramanujam) from entry import Entry class EntryManager: __statuses__ = ['PENDING','DONE'] def __init__(self): self.entries=[] def add_entry(self,entry): # Problem: # add new entries to the existing list such that: # 1) the start and end ...
apache-2.0
mxjl620/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
azaghal/ansible
test/units/plugins/connection/test_winrm.py
21
15652
# -*- coding: utf-8 -*- # (c) 2018, Jordan Borean <jborean@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from io import Strin...
gpl-3.0
iRGBit/QGIS
python/plugins/fTools/tools/doMeanCoords.py
11
8882
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # #-----------------------------...
gpl-2.0
TobbeEdgeware/shaka-player
third_party/gjslint/python-gflags-2.0/tests/gflags_validators_test.py
139
8320
#!/usr/bin/env python # Copyright (c) 2010, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this l...
apache-2.0
hirochachacha/apython
bpython/completion/completers/import_completer.py
1
9006
# The MIT License # # Copyright (c) 2009-2011 Andreas Stuehrk # # 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 the rights # to use, copy, mo...
mit
julzhk/codekata
instant_runoff_voting.py
1
1947
from collections import defaultdict, Counter def runoff(voters): """ a function that calculates an election winner from a list of voter selections using an Instant Runoff Voting algorithm. https://en.wikipedia.org/wiki/Instant-runoff_voting Each voter selects several candidates in order of preference. ...
mit
cornhundred/ipywidgets
ipywidgets/widgets/interaction.py
4
19214
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. """Interact with functions using widgets.""" from __future__ import print_function from __future__ import division try: # Python >= 3.3 from inspect import signature, Parameter except ImportError: from IPyth...
bsd-3-clause
brev/nupic
src/nupic/support/__init__.py
23
23477
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
pratikmallya/heat
heat_integrationtests/functional/test_encryption_vol_type.py
9
3883
# 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 # d...
apache-2.0
kjaym/pypif
pypif/obj/common/classification.py
3
1278
import numbers from six import string_types from pypif.obj.common.pio import Pio class Classification(Pio): """ Information about a classification. """ def __init__(self, name=None, value=None, tags=None, **kwargs): """ Constructor. :param name: String with the name of the cl...
apache-2.0
ged-lab/khmer
sandbox/collect-reads.py
2
6588
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
bsd-3-clause
brinbois/Sick-Beard
tests/scene_helpers_tests.py
67
7197
import unittest import test_lib as test import sys, os.path sys.path.append(os.path.abspath('..')) from sickbeard import show_name_helpers, scene_exceptions, common, name_cache import sickbeard from sickbeard import db from sickbeard.databases import cache_db from sickbeard.tv import TVShow as Show c...
gpl-3.0
openstack/tempest
tempest/api/compute/certificates/test_certificates.py
1
1501
# Copyright 2012 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 requ...
apache-2.0
personalunion/glimpse_client-1
3rdparty/breakpad/src/tools/gyp/test/rules/gyptest-all.py
221
1753
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple rules when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('no_acti...
bsd-3-clause
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/django/template/backends/dummy.py
113
1720
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import io import string from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import TemplateDoesNotExist from django.utils.html import conditio...
gpl-2.0
factorlibre/carrier-delivery
delivery_carrier_ups/model/ups_config.py
1
2330
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 FactorLibre (http://www.factorlibre.com) # Hugo Santos <hugo.santos@factorlibre.com> # # This program is free software: you can redistribute it and/o...
agpl-3.0
forio/julia-studio
tests/system/suite_SCOM/tst_SCOM04/test.py
1
1991
source("../../shared/qtcreator.py") source("../../shared/suites_qtta.py") # entry of test def main(): # expected error texts - for different compilers expectedErrorAlternatives = ["'SyntaxError' was not declared in this scope", "'SyntaxError' : undeclared identifier"] start...
gpl-3.0
gennad/Django-nonrel-stub-for-Google-App-Engine
django/core/exceptions.py
292
2767
""" Global Django exception and warning classes. """ class DjangoRuntimeWarning(RuntimeWarning): pass class ObjectDoesNotExist(Exception): "The requested object does not exist" silent_variable_failure = True class MultipleObjectsReturned(Exception): "The query returned multiple objects when only one w...
bsd-3-clause
deyton/swift
utils/gyb_syntax_support/PatternNodes.py
8
3437
from Child import Child from Node import Node # noqa: I201 PATTERN_NODES = [ # enum-case-pattern -> type-identifier? '.' identifier tuple-pattern? Node('EnumCasePattern', kind='Pattern', children=[ Child('TypeIdentifier', kind='TypeIdentifier', is_optional=True), ...
apache-2.0
cchurch/ansible
docs/docsite/_extensions/pygments_lexer.py
36
7216
# -*- coding: utf-8 -*- # pylint: disable=no-self-argument # # Copyright 2006-2017 by the Pygments team, see AUTHORS at # https://bitbucket.org/birkenfeld/pygments-main/raw/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/AUTHORS # Copyright by Norman Richards (original author of JSON lexer). # # Licensed under BSD license: # ...
gpl-3.0
PetrDlouhy/django
django/middleware/locale.py
358
2983
"This is the locale selecting middleware that will look at accept headers" from django.conf import settings from django.core.urlresolvers import ( LocaleRegexURLResolver, get_resolver, get_script_prefix, is_valid_path, ) from django.http import HttpResponseRedirect from django.utils import translation from django....
bsd-3-clause
t794104/ansible
lib/ansible/modules/storage/netapp/na_elementsw_backup.py
17
9175
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ Element Software Backup Manager """ from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
rdeheele/odoo
addons/l10n_co/__openerp__.py
49
1812
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Ivan ...
agpl-3.0
sajeeshcs/nested_quota_final
nova/tests/unit/api/openstack/compute/contrib/test_server_password.py
3
2712
# Copyright 2012 Nebula, 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 ...
apache-2.0
jtyr/ansible
test/units/compat/unittest.py
156
1302
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
zixan/bitcoin
qa/rpc-tests/signrawtransactions.py
171
4631
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class SignR...
mit
baseblack/ReproWeb
3rdParty/python/jinja2/testsuite/ext.py
90
17664
# -*- coding: utf-8 -*- """ jinja2.testsuite.ext ~~~~~~~~~~~~~~~~~~~~ Tests for the extensions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, DictLoader...
bsd-2-clause
kuwa32/chainer
chainer/functions/dropout.py
6
2158
import numpy from chainer import cuda from chainer import function from chainer.utils import type_check class Dropout(function.Function): """Dropout regularization.""" def __init__(self, dropout_ratio): self.dropout_ratio = dropout_ratio def check_type_forwrad(self, in_types): type_che...
mit
wenhuchen/ETHZ-Bootstrapped-Captioning
visual-concepts/coco/PythonAPI/pycocotools/coco.py
1
16953
__author__ = 'tylin' __version__ = '2.0' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Pleas...
bsd-3-clause
timothycrosley/frosted
frosted/checker.py
2
36119
"""frosted/checker.py. The core functionality of frosted lives here. Implements the core checking capability models Bindings and Scopes 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 res...
mit
tomazc/orange-bio
orangecontrib/bio/kegg/tests/test_entry.py
1
1064
from six import StringIO import doctest import unittest from orangecontrib.bio.kegg.entry import parser, fields, DBEntry, entry_decorate TEST_ENTRY = """\ ENTRY test_id something else NAME test DESCRIPTION This is a test's description. it spans multiple lines SUB This...
gpl-3.0
prisae/pelican-plugins
liquid_tags/spotify.py
313
1304
""" Spotify Tag --------- This implements a Liquid-style spotify tag for Pelican, based on the jekyll / octopress youtube tag [1]_ Syntax ------ {% spotify id %} Example ------- {% spotify 1HNZcRFlIKwHAJD3LxvX4d %} Output ------ <iframe src='https://embed.spotify.com/?uri=spotify:track:1HNZcRFlIKwHAJD3LxvX4d' ...
agpl-3.0
mhugo/QGIS
python/plugins/processing/tests/Grass7AlgorithmsImageryTest.py
36
1890
# -*- coding: utf-8 -*- """ *************************************************************************** Grass7AlgorithmsImageryTest.py ------------------------------ Date : May 2016 Copyright : (C) 2016 by Médéric Ribreux Email : mederic dot ribreux at meds...
gpl-2.0
bcoca/ansible
test/support/integration/plugins/module_utils/aws/iam.py
60
2118
# 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 import traceback try: from botocore.exceptions import ClientError, NoCredentialsError except Im...
gpl-3.0
abhijitkamb/Template_MEANjs
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
1835
1748
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
mit
Nitaco/ansible
lib/ansible/utils/plugin_docs.py
38
4587
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
srikantbmandal/ansible
test/units/modules/cloud/amazon/test_api_gateway.py
59
2551
# # (c) 2016 Michael De La Rue # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible...
gpl-3.0
blackball/an-test6
net/migrations/0004_update_calibrations.py
1
22054
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from astrometry.net.settings import * from astrometry.util.util import Tan import math import os class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods ...
gpl-2.0
suneeth51/neutron
neutron/cmd/netns_cleanup.py
24
6272
# Copyright (c) 2012 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...
apache-2.0
billygoo/dev-365
python/flask/minitwit/venv/Lib/site-packages/pip/_vendor/distlib/locators.py
191
46946
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
gpl-2.0