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
twitchyliquid64/misc-scripts
s3tool/boto/ec2/elb/listelement.py
185
1512
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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 wi...
mit
edesmontils/Linked-Data-Query-Profiler
test.py
2
2776
import networkx as nx import networkx.algorithms.isomorphism as iso from pprint import pprint def equals(g1, g2): #--- assert isinstance(g1, nx.Graph) and isinstance(g2, nx.Graph) #--- return nx.algorithms.isomorphism.DiGraphMatcher(g1, g2, #node_match=nm, node_match=iso.categorical_n...
gpl-3.0
Rain-Ma/Rain-Elm
node_modules/node-gyp/gyp/pylib/gyp/input.py
578
116086
# Copyright (c) 2012 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
Venturi/cms
env/lib/python2.7/site-packages/unidecode/x058.py
252
4678
data = ( 'Ku ', # 0x00 'Ke ', # 0x01 'Tang ', # 0x02 'Kun ', # 0x03 'Ni ', # 0x04 'Jian ', # 0x05 'Dui ', # 0x06 'Jin ', # 0x07 'Gang ', # 0x08 'Yu ', # 0x09 'E ', # 0x0a 'Peng ', # 0x0b 'Gu ', # 0x0c 'Tu ', # 0x0d 'Leng ', # 0x0e '[?] ', # 0x0f 'Ya ', # 0x10 'Qian ', ...
gpl-2.0
kosz85/django
tests/m2m_through/models.py
72
4434
from datetime import datetime from django.db import models # M2M described on one of the models class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ('name',) def __str__(self): return self.name class Group(models.Model): name = models.CharFie...
bsd-3-clause
patilsangram/erpnext
erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py
22
17501
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import sys from frappe import _ from frappe.model.document import Document from frappe.utils import getdate class Variabl...
gpl-3.0
fujunwei/chromium-crosswalk
tools/auto_bisect/PRESUBMIT.py
30
3514
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for auto-bisect. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit ...
bsd-3-clause
mafintosh/phantomjs
src/breakpad/src/tools/gyp/test/sibling/gyptest-all.py
151
1061
#!/usr/bin/env python # Copyright (c) 2009 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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pygame/tests/test_utils/run_tests.py
6
12020
import sys if __name__ == '__main__': sys.exit("This module is for import only") test_pkg_name = '.'.join(__name__.split('.')[0:-2]) is_pygame_pkg = test_pkg_name == 'pygame.tests' test_runner_mod = test_pkg_name + '.test_utils.test_runner' if is_pygame_pkg: from pygame.tests.test_utils import import_submodu...
gpl-3.0
schieb/angr
angr/analyses/identifier/functions/memset.py
3
1193
import random from ..func import Func, TestData def rand_str(length, byte_list=None): if byte_list is None: return "".join(chr(random.randint(0, 255)) for _ in range(length)) return "".join(random.choice(byte_list) for _ in range(length)) class memset(Func): non_null = [chr(i) for i in range(1...
bsd-2-clause
softak/webfaction_demo
vendor-local/lib/python/django/core/mail/message.py
151
12967
import mimetypes import os import random import time from email import Charset, Encoders try: from email.generator import Generator except ImportError: from email.Generator import Generator # TODO: Remove when remove Python 2.4 support from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMult...
bsd-3-clause
PetrDlouhy/django
tests/admin_custom_urls/models.py
78
2482
from functools import update_wrapper from django.contrib import admin from django.core.urlresolvers import reverse from django.db import models from django.http import HttpResponseRedirect from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Action(models.Model): name ...
bsd-3-clause
pschmitt/home-assistant
homeassistant/components/google_assistant/__init__.py
4
3875
"""Support for Actions on Google Assistant Smart Home Control.""" import logging from typing import Any, Dict import voluptuous as vol # Typing imports from homeassistant.const import CONF_NAME from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.helpers import config_validation as cv from .c...
apache-2.0
ResolveWang/algrithm_qa
binarytree/q1.py
1
3054
""" 问题描述:分别用递归和非递归方式实现二叉树的先序、中序、和后续遍历 思路:使用非递归的方式需要使用辅助栈代替函数栈 """ from binarytree.toolcls import Node class RecursiveVisit: @classmethod def visit_in_first_order(cls, head): if head is None: return print(head.value, end=' ') cls.visit_in_first_order(head.left) cl...
mit
Gjacquenot/AcousticBEM
Python/HelmholtzIntegralsRAD.py
1
15968
# --------------------------------------------------------------------------- # Copyright (C) 2017 Frank Jargstorff # # This file is part of the AcousticBEM library. # AcousticBEM 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 So...
gpl-3.0
aroche/django
django/contrib/gis/geoip2/base.py
73
8630
import os import socket import geoip2.database from django.conf import settings from django.core.validators import ipv4_re from django.utils import six from django.utils.ipv6 import is_valid_ipv6_address from .resources import City, Country # Creating the settings dictionary with any settings, if needed. GEOIP_SETT...
bsd-3-clause
bastibe/PySoundCard
pysoundcard.py
1
26373
import sys import os from cffi import FFI import atexit import numpy as np import warnings """PySoundCard is an audio library based on PortAudio, CFFI and NumPy PySoundCard can play and record audio data. Audio devices are supported through PortAudio[1], which is a free, cross-platform, open-source audio I/O library ...
bsd-3-clause
Maximilian-Reuter/SickRage-1
lib/pgi/overrides/Gdk.py
19
15527
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab # # Copyright (C) 2009 Johan Dahlin <johan@gnome.org> # 2010 Simon van der Linden <svdlinden@src.gnome.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Ge...
gpl-3.0
Newman101/scipy
tools/validate_runtests_log.py
75
2532
#!/usr/bin/env python """ Take the test runner log output from the stdin, looking for the magic line nose runner prints when the test run was successful. In an ideal world, this should be done directly in runtests.py using the nose API, some failure modes are fooling nose to terminate the python process with zero exi...
bsd-3-clause
gnu-sandhi/gnuradio
gr-howto-write-a-block/docs/doxygen/swig_doc.py
21
11528
# # Copyright 2010-2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later versi...
gpl-3.0
plaufer/wikiwsd
wsd/database/mysqlbuildview.py
1
7099
import MySQLdb import logging import time MYSQL_DEAD_LOCK_ERROR = 1213 class MySQLBuildView: """The MySQLBuildView class allows database access optimized to build the disambiguation database """ def __init__(self, db_connection): """constructor @param db_connector the database ...
mit
kynikos/wiki-scripts
ws/autopage.py
2
5587
#! /usr/bin/env python3 import datetime import logging import mwparserfromhell from ws.interactive import edit_interactive logger = logging.getLogger(__name__) __all__ = ["AutoPage"] class AutoPage: """ A quick interface for maintaining automatic content on wiki pages. :param api: an :py:class:`ws....
gpl-3.0
bancek/egradebook
src/lib/compressor/filters/yui.py
1
1339
from subprocess import Popen, PIPE from compressor.conf import settings from compressor.filters import FilterBase, FilterError from compressor.utils import cmd_split class YUICompressorFilter(FilterBase): def output(self, **kwargs): arguments = '' if self.type == 'js': arguments = se...
gpl-3.0
defionscode/ansible
lib/ansible/modules/network/cloudengine/ce_bgp_neighbor.py
43
72401
#!/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
docwalter/py3status
py3status/modules/scratchpad_async.py
5
2160
# -*- coding: utf-8 -*- """ Display number of windows and urgency hints asynchronously. Configuration parameters: always_show: always display the format (default False) format: display format for this module (default "{counter} ⌫") Format placeholders: {counter} number of scratchpad windows Requires: ...
bsd-3-clause
zestrada/nova-cs498cc
nova/tests/api/openstack/compute/contrib/test_flavors_extra_specs.py
8
8461
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 University of Southern California # 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 # # htt...
apache-2.0
yousafsyed/casperjs
bin/Lib/test/test_pep3151.py
84
7483
import builtins import os import select import socket import sys import unittest import errno from errno import EEXIST from test import support class SubOSError(OSError): pass class SubOSErrorWithInit(OSError): def __init__(self, message, bar): self.bar = bar super().__init__(message) class ...
mit
scode/pants
src/python/pants/backend/jvm/tasks/jvm_compile/analysis_parser.py
5
5292
# 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 import re ...
apache-2.0
airbnb/airflow
tests/providers/google/cloud/operators/test_gcs_system.py
8
1675
# # 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...
apache-2.0
JimCircadian/ansible
test/units/modules/network/nxos/test_nxos_vpc.py
40
2567
# (c) 2016 Red Hat Inc. # # 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 dis...
gpl-3.0
gnarula/eden_deployment
modules/tropo.py
33
22336
""" The TropoPython module. This module implements a set of classes and methods for manipulating the Voxeo Tropo WebAPI. Usage: ---- from tropo import Tropo tropo = Tropo() tropo.say("Hello, World") json = tropo.RenderJson() ---- You can write this JSON back to standard output to get Tropo to perform the action. Fo...
mit
ruba9/HotelChatbot
my_env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/escsm.py
2930
7839
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
calebfoss/tensorflow
tensorflow/python/framework/graph_util_impl.py
29
10901
# Copyright 2015 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...
apache-2.0
whereskenneth/Dwarfsquad
dwarfsquad/lib/build/from_export/build_compound_methods.py
1
6738
from dwarfsquad.lib.build.from_export.helpers import build_reference_map from dwarfsquad.lib.utils import to_stderr from dwarfsquad.model.Calibration import Calibration from dwarfsquad.model.ChromatogramMethod import ChromatogramMethod from dwarfsquad.model.CompoundMethod import CompoundMethod from dwarfsquad.model.Pea...
mit
paypal/support
support/socket_pool.py
1
6787
''' Protocol-agnostic socket pooler. This code is both extremely tested and hard to test. Modify with caution :-) "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious de...
bsd-3-clause
coolbombom/CouchPotato
cherrypy/_cpserver.py
82
8010
"""Manage HTTP servers with CherryPy.""" import warnings import cherrypy from cherrypy.lib import attributes from cherrypy._cpcompat import basestring, py3k # We import * because we want to export check_port # et al as attributes of this module. from cherrypy.process.servers import * class Server(ServerAdapter): ...
gpl-3.0
tudennis/LeetCode---kamyu104-11-24-2015
Python/design-snake-game.py
2
2223
# Time: O(1) per move # Space: O(s), s is the current length of the snake. from collections import defaultdict, deque class SnakeGame(object): def __init__(self, width,height,food): """ Initialize your data structure here. @param width - screen width @param height - screen height...
mit
nanditav/15712-TensorFlow
tensorflow/python/user_ops/user_ops.py
33
1024
# Copyright 2015 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...
apache-2.0
jhawkesworth/ansible-modules-extras
cloud/vmware/vmware_vmkernel_ip_config.py
75
3851
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
nesdis/djongo
tests/django_tests/tests/v22/tests/check_framework/test_multi_db.py
32
1666
from unittest import mock from django.db import connections, models from django.test import SimpleTestCase from django.test.utils import isolate_apps, override_settings class TestRouter: """ Routes to the 'other' database if the model name starts with 'Other'. """ def allow_migrate(self, db, app_labe...
agpl-3.0
JulyKikuAkita/PythonPrac
cs15211/RangeModule.py
1
7564
__source__ = 'https://leetcode.com/problems/range-module/' # Time: O(logK) to O(K) # Space: O(A+R), the space used by ranges. # # Description: Leetcode # 715. Range Module # # A Range Module is a module that tracks ranges of numbers. # Your task is to design and implement the following interfaces in an efficient manne...
apache-2.0
manazhao/tf_recsys
tensorflow/contrib/input_pipeline/python/ops/input_pipeline_ops.py
49
4117
# Copyright 2016 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...
apache-2.0
nicolargo/intellij-community
python/lib/Lib/site-packages/django/core/serializers/json.py
107
2053
""" Serialize data to/from JSON """ import datetime import decimal from StringIO import StringIO from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as PythonDeserializer from django.utils import datetime_safe from django.utils import simpl...
apache-2.0
agrpallav/qemu-copypaste
tests/qemu-iotests/iotests.py
20
9652
# Common utilities and Python wrappers for qemu-iotests # # Copyright (C) 2012 IBM Corp. # # 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) ...
gpl-2.0
zeeshanali/blaze
blaze/datadescriptor/json_data_descriptor.py
7
2681
from __future__ import absolute_import, division, print_function import os import datashape from .data_descriptor import IDataDescriptor from .. import py2help from dynd import nd from .dynd_data_descriptor import DyNDDataDescriptor, Capabilities def json_descriptor_iter(array): for row in array: yield...
bsd-3-clause
waynenilsen/statsmodels
statsmodels/tsa/base/tests/test_base.py
27
2106
import numpy as np from pandas import Series from pandas import date_range from statsmodels.tsa.base.tsa_model import TimeSeriesModel import numpy.testing as npt from statsmodels.tools.testing import assert_equal def test_pandas_nodates_index(): from statsmodels.datasets import sunspots y = sunspots.load_panda...
bsd-3-clause
jthrun/sdl_android
baseAndroid/make_symbolic_links.py
1
2232
import os import pathlib from pathlib import Path import re def has_admin(): if os.name == 'nt': try: # only windows users with admin privileges can read the C:\windows\temp temp = os.listdir(os.sep.join([os.environ.get('SystemRoot', 'C:\\windows'), 'temp'])) except: ...
bsd-3-clause
fhe-odoo/odoo
addons/sale_analytic_plans/__openerp__.py
52
1725
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
RayMick/scikit-learn
examples/semi_supervised/plot_label_propagation_digits.py
268
2723
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
bsd-3-clause
fxfitz/ansible
lib/ansible/modules/files/archive.py
58
17351
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ben Doherty <bendohmv@gmail.com> # Sponsored by Oomph, Inc. http://www.oomphinc.com # 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_impor...
gpl-3.0
courtarro/gnuradio
gr-utils/python/modtool/modtool_base.py
51
9386
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
xiangke/pycopia
mibs/pycopia/mibs/DOCS_IETF_QOS_MIB_OID.py
1
11335
# python # This file is generated by a program (mib2py). import DOCS_IETF_QOS_MIB OIDMAP = { '1.3.6.1.2.1.127': DOCS_IETF_QOS_MIB.docsIetfQosMIB, '1.3.6.1.2.1.127.0': DOCS_IETF_QOS_MIB.docsIetfQosNotifications, '1.3.6.1.2.1.127.1': DOCS_IETF_QOS_MIB.docsIetfQosMIBObjects, '1.3.6.1.2.1.127.2': DOCS_IETF_QOS_MIB.docsI...
lgpl-2.1
mushtaqak/edx-platform
lms/djangoapps/shoppingcart/exceptions.py
191
1043
""" Exceptions for the shoppingcart app """ # (Exception Class Names are sort of self-explanatory, so skipping docstring requirement) # pylint: disable=missing-docstring class PaymentException(Exception): pass class PurchasedCallbackException(PaymentException): pass class InvalidCartItem(PaymentException)...
agpl-3.0
triplekill/linux
tools/perf/scripts/python/netdev-times.py
1544
15191
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
matejc/searx
utils/fabfile.py
8
2621
from fabric.api import cd, run, sudo, put from cStringIO import StringIO base_dir = '/usr/local' hostname = 'searx.me' searx_dir = base_dir + '/searx' searx_ve_dir = searx_dir + '/searx-ve' current_user = run('whoami').stdout.strip() uwsgi_file = ''' [uwsgi] # Who will run the code uid = {user} gid = {user} # Numbe...
agpl-3.0
CIGIHub/django-ga-puller
setup.py
1
1369
from setuptools import setup # Always prefer setuptools over distutils import os README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-ga-puller', ...
mit
tedsunnyday/SE-Server
server/lib/jinja2/testsuite/imports.py
90
5331
# -*- coding: utf-8 -*- """ jinja2.testsuite.imports ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the import features (with includes). :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environm...
apache-2.0
JamesShaeffer/QGIS
tests/src/python/test_qgscore.py
45
2518
# -*- coding: utf-8 -*- """QGIS Unit tests for core functions .. 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 License, or (at your option) any later version. """ __a...
gpl-2.0
malavolti/ansible-shibboleth
roles/idp/files/statistics/conf/questionario.py
4
1593
#!/usr/bin/env python #-*- coding: utf-8 -*- from xml.dom.minidom import parse, parseString import sys, json import commands import os from optparse import OptionParser parser = OptionParser() usage = "usage: %prog [options] [files ....]" parser = OptionParser(usage) parser.add_option("-m", "--metadata", help="Feder...
apache-2.0
BEASTLICK-INTERNET-POLICY-COMMISSION/bipcoin
external/gtest/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, 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 list...
lgpl-3.0
elviswf/chainer
chainer/functions/caffe/caffe_pb2.py
27
209364
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: caffe.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import...
mit
skarra/PRS
libs/sqlalchemy/testing/schema.py
2
3712
# testing/schema.py # Copyright (C) 2005-2019 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 from . import config from . import exclusions from .. import event from .. import ...
agpl-3.0
ftalex/buffelgrass_mapper
BuffelWeb/Model.py
1
1562
""" Classes for use with genshi, these are the basic datastructres that are used to create populate the values of the templaes. """ __author__ = "Alex Warren" __copyright__ = "Copyright 2015, Autonomous Mapping Project" __credits__ = ["Alex Warren", "Rachel Powers", "Thomas Schuker", "Travis Kible...
bsd-2-clause
jruiperezv/ANALYSE
cms/djangoapps/contentstore/views/tests/test_unit_page.py
222
2775
""" Unit tests for the unit page. """ from contentstore.views.tests.utils import StudioPageTestCase from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.factories import ItemFactory from xmodule.x_module import STUDENT_VIEW class UnitPageTestCase(StudioPageTestCase): """ Unit tes...
agpl-3.0
guewen/l10n-switzerland
__unported__/l10n_ch_dta/wizard/unicode2ascii.py
7
27557
# -*- coding: utf-8 -*- """Convert many unicode characters to ascii characters that are like them. I want to collate names, with the property that a last name starting with O-umlaut will be in with the last name's starting with O. Horrors! So I want that many Latin-1 characters have their umlaute's, etc., strippe...
agpl-3.0
movmov/cc
nova/tests/__init__.py
2
1080
# Copyright [2010] [Anso Labs, LLC] # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
ampax/edx-platform
lms/djangoapps/notifier_api/tests.py
49
9811
import itertools import ddt from django.conf import settings from django.test.client import RequestFactory from django.test.utils import override_settings from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory from django_comment_common.models import Role, Permission from lang_pref import LANGU...
agpl-3.0
Stonelinks/jsbsim
tests/CheckOutputRate.py
2
6059
# CheckOutputRate.py # # A regression test on the output features that allow to set the output rate # including enabling/disabling the output. # # Copyright (c) 2015 Bertrand Coconnier # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as publ...
lgpl-2.1
mrnamingo/vix4-34-enigma2-mips
lib/python/Components/AVSwitch.py
1
30068
from config import config, ConfigSlider, ConfigSelection, ConfigSubDict, ConfigYesNo, ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave from Components.About import about from Tools.CList import CList from Tools.HardwareInfo import HardwareInfo from enigma import eAVSwit...
gpl-2.0
haradashinya/flask-admin
flask_admin/contrib/geoa/fields.py
9
1845
import geoalchemy2 from shapely.geometry import shape from sqlalchemy import func from flask_admin.form import JSONField from .widgets import LeafletWidget class GeoJSONField(JSONField): widget = LeafletWidget() def __init__(self, label=None, validators=None, geometry_type="GEOMETRY", srid...
bsd-3-clause
KontorConsulting/odoo
addons/hr_evaluation/__init__.py
432
1084
# -*- encoding: 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 G...
agpl-3.0
DarkEnergySurvey/ugali
tests/test_imf.py
2
1680
#!/usr/bin/env python """ Generic python script. """ __author__ = "Alex Drlica-Wagner" import numpy as np import ugali.analysis.imf import ugali.isochrone MASSES = np.array([0.1, 0.5, 1.0, 10.0]) SEED = 1 IMFS = ['Salpeter1955','Kroupa2001','Chabrier2003'] def test_imf(): dn_dm = ugali.analysis.imf.chabrierIMF(M...
mit
jlegendary/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_parser2.py
451
2119
from __future__ import absolute_import, division, unicode_literals import io from . import support # flake8: noqa from html5lib import html5parser from html5lib.constants import namespaces from html5lib import treebuilders import unittest # tests that aren't autogenerated from text files class MoreParserTests(un...
mpl-2.0
kalaidin/luigi
luigi/contrib/hdfs/config.py
32
4886
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
hguemar/cinder
cinder/volume/drivers/windows/smbfs.py
1
10774
# Copyright (c) 2014 Cloudbase Solutions SRL # 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 # # Unle...
apache-2.0
QuLogic/cartopy
lib/cartopy/tests/crs/test_eckert.py
2
8441
# Copyright Cartopy Contributors # # This file is part of Cartopy and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Tests for the Eckert family of coordinate systems. """ import numpy as np from numpy.testing import assert_almost_e...
lgpl-3.0
hellobond/python-smartypants
lib/smartypants.py
1
34216
#!/usr/bin/env python # -*- coding: utf-8 -*- r""" ============== smartypants.py ============== ---------------------------- SmartyPants ported to Python ---------------------------- Ported by `Chad Miller`_ Copyright (c) 2004, 2007 Chad Miller original `SmartyPants`_ by `John Gruber`_ Copyright (c) 2003 John Grube...
bsd-3-clause
DMLoy/ECommerceBasic
lib/python2.7/site-packages/django/http/multipartparser.py
82
22856
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import cgi from django.conf import settings from django.core.exceptions import SuspiciousOperation fro...
mit
florianjacob/linkchecker
linkcheck/mimeutil.py
9
3657
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005-2014 Bastian Kleineidam # # 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 versi...
gpl-2.0
sharifulgeo/google-appengine-wx-launcher
coverage.py
28
3017
#!/usr/bin/env python # # Copyright 2008 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
ppries/tensorflow
tensorflow/python/training/moving_averages_test.py
6
15047
# Copyright 2015 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...
apache-2.0
goldmedal/spark
python/pyspark/sql/tests/test_pandas_udf.py
5
10122
# # 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 us...
apache-2.0
rapyuta/autobahn_rce
examples/websocket/streaming/streaming_producer_client.py
23
3146
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
apache-2.0
F5Networks/f5-openstack-agent
f5_openstack_agent/lbaasv2/drivers/bigip/test/test_esd_filehandler.py
1
3416
# coding=utf-8 # Copyright (c) 2017,2018, F5 Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
inares/edx-platform
cms/djangoapps/contentstore/tests/test_course_create_rerun.py
126
2423
""" Test view handler for rerun (and eventually create) """ from django.test.client import RequestFactory from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from student.roles import CourseInstr...
agpl-3.0
matthiasdiener/spack
var/spack/repos/builtin/packages/py-pyfftw/package.py
5
1846
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
jounex/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/templatetags/highlighting.py
41
3098
""" Similar to syntax_color.py but this is intended more for being able to copy+paste actual code into your Django templates without needing to escape or anything crazy. http://lobstertech.com/2008/aug/30/django_syntax_highlight_template_tag/ Example: {% load highlighting %} <style> @import url("http://lobsterte...
apache-2.0
jacobraj/MAMA
mama/c_cpp/src/regression/c_cpp/scripts/regressioncpp.py
16
7112
#!/usr/bin/python import subprocess import unittest from common import (start_app, start_javaapp, call_wait4text, call_wait4text, check_env, kill_process, call_comparelog, my_print ) class TestOpenmamacpp(unittest.TestCase): def setUp(self): pass def test_pubsubcpp(self): '''publish mess...
lgpl-2.1
openstates/bobsled
bobsled/tests/test_environment.py
1
1546
import os import pytest from unittest import mock from ..environment import EnvironmentProvider from ..base import Environment @pytest.fixture def simpleenv(): filename = os.path.join(os.path.dirname(__file__), "environments.yml") return EnvironmentProvider(filename) @pytest.mark.asyncio async def test_get_...
mit
LegNeato/cwsy
docs/conf.py
50
7243
# -*- coding: utf-8 -*- # # playdoh documentation build configuration file, created by # sphinx-quickstart on Tue Jan 4 15:11:09 2011. # # 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...
bsd-3-clause
Taapat/enigma2-openpli-fulan
lib/python/Components/Converter/PliExtraInfo.py
6
12757
# shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat) from enigma import iServiceInformation, iPlayableService from Components.Converter.Converter import Converter from Components.Element import cached from Components.config import config from Tools.Transponder import ConvertToHumanReadable, getChannelNu...
gpl-2.0
broferek/ansible
lib/ansible/modules/network/fortios/fortios_system_replacemsg_alertmail.py
13
10143
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
shishkander/gae-pytz
pytz/tzfile.py
118
4340
#!/usr/bin/env python ''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' from cStringIO import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo from pytz.tzinfo import memorized_datetime, memorized_timede...
mit
multiSnow/secure-gappproxy
localproxy/pkcs5.py
2
1529
#! /usr/bin/env python # coding=utf-8 #====================================================================== # SecureGAppProxy is a security-strengthened version of GAppProxy. # http://secure-gappproxy.googlecode.com # This file is a part of SecureGAppProxy. # Copyright (C) 2011 nleven <www.nleven.com i@nleven.com> #...
gpl-3.0
lidakanari/NeuroM
neurom/tests/test_import.py
7
1814
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
mkaluza/external_chromium_org
tools/perf/metrics/startup_metric.py
23
4948
# 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. import collections import json import logging from metrics import Metric from metrics import histogram_util from telemetry.core import util class StartupM...
bsd-3-clause
jendap/tensorflow
tensorflow/contrib/layers/python/layers/normalization.py
11
16620
# 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...
apache-2.0
michalkurka/h2o-3
h2o-py/tests/testdir_misc/pyunit_upload_file.py
8
1807
from __future__ import print_function from builtins import zip import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def upload_file(): a = h2o.upload_file(pyunit_utils.locate("smalldata/logreg/prostate.csv")) print(a.describe()) from h2o import H2OFrame # using list...
apache-2.0
ging/keystone
keystone/cli.py
1
11656
# Copyright 2012 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 or agreed to in...
apache-2.0
ualikhansars/Gwent
lib/python2.7/site-packages/setuptools/command/build_ext.py
130
13026
import os import sys import itertools import imp from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distutils.errors import DistutilsError from d...
mit