repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
samaitra/kafka
tests/kafkatest/tests/connect_test.py
12
4906
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
alexanderturner/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_nacl_facts.py
45
6624
#!/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 distributed...
gpl-3.0
SerCeMan/intellij-community
python/lib/Lib/site-packages/django/core/mail/message.py
87
11220
import mimetypes import os import random import time from email import Charset, Encoders from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.Header import Header from email.Utils import formatdate, getaddresses, formataddr from django.conf im...
apache-2.0
cnsoft/kbengine-cocos2dx
demo/res/scripts/base/Avatar.py
1
3197
# -*- coding: utf-8 -*- import KBEngine import random import wtimer import d_spaces import d_avatar_inittab from KBEDebug import * from interfaces.GameObject import GameObject from interfaces.Teleport import Teleport class Avatar(KBEngine.Proxy, GameObject, Teleport): def __init__(self): KBEngin...
lgpl-3.0
ol-loginov/intellij-community
plugins/hg4idea/testData/bin/mercurial/commands.py
90
216701
# commands.py - command processing for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import hex, bin, nullid, nullrev, short from lock import release fro...
apache-2.0
jk1/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/ntdll.py
102
22847
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
apache-2.0
epandurski/django
tests/foreign_object/models.py
73
5770
import datetime from django.db import models from django.db.models.fields.related import \ ReverseSingleRelatedObjectDescriptor from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import get_language @python_2_unicode_compatible class Country(models.Model): # Table Col...
bsd-3-clause
LejoFlores/python-oauth2
oauth2/clients/smtp.py
884
1680
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
mit
alex8224/storm-orm
storm/zope/adapters.py
6
1095
# # Copyright (c) 2006, 2007 Canonical # # Written by Gustavo Niemeyer <gustavo@niemeyer.net> # # This file is part of Storm Object Relational Mapper. # # Storm is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Found...
lgpl-2.1
simonpessemesse/seguinus
easyPoS/admin.py
1
1447
from easyPoS.models import Tva, Categorie, Produit, MoyenPaiement, Facture, Paiement, LigneFacture, DonneesEntreprise, \ Arrhe, Famille, RemiseCheque, PreparationFacture, LogFacture from django.contrib import admin from chambres.models import Client class ResaInline(admin.StackedInline): model = Client...
gpl-2.0
hurricup/intellij-community
python/lib/Lib/encodings/cp863.py
593
34508
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
apache-2.0
qma/pants
tests/python/pants_test/targets/test_java_agent.py
12
3411
# 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) from pants.backend.j...
apache-2.0
Codefans-fan/odoo
addons/document/wizard/document_configuration.py
381
4895
# -*- 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
Ayear0608/myhadoop
src/contrib/hod/hodlib/Common/desc.py
182
7484
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
billyhunt/osf.io
website/addons/zotero/tests/test_views.py
8
12020
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa import httpretty import mock from tests.base import OsfTestCase from tests.factories import AuthUserFactory, ProjectFactory import urlparse from framework.auth.core import Auth from website.addons.zotero.tests.factories import ( ZoteroAccountFact...
apache-2.0
walteranderson/python-koans
python3/koans/about_control_statements.py
56
2178
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutControlStatements(Koan): def test_if_then_else_statements(self): if True: result = 'true value' else: result = 'false value' self.assertEqual(__, result) def test_if_then_statem...
mit
Metaswitch/calico-neutron
neutron/plugins/vmware/extensions/maclearning.py
54
1781
# Copyright 2013 VMware, 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 a...
apache-2.0
sloanyang/aquantic
Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py
119
3754
# 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 list of conditions and the ...
gpl-2.0
hynnet/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/ctypes/test/test_buffers.py
62
2726
from ctypes import * import unittest class StringBufferTestCase(unittest.TestCase): def test_buffer(self): b = create_string_buffer(32) self.assertEqual(len(b), 32) self.assertEqual(sizeof(b), 32 * sizeof(c_char)) self.assertTrue(type(b[0]) is str) b = create_string_buffer...
gpl-2.0
nzbget/VideoSort
lib/dateutil/parser.py
7
34480
# -*- coding:iso-8859-1 -*- """ This module offers a generic date/time string parser which is able to parse most known formats to represent a date and/or time. """ from __future__ import unicode_literals import datetime import string import time import collections from io import StringIO from six import text_type, bi...
gpl-3.0
GLMeece/namebench
nb_third_party/dns/rdataset.py
215
11527
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
stweil/ocropy
OLD/lineseg.py
15
15654
from pylab import * from scipy.ndimage import filters,morphology,measurements import morph from toplevel import * @checks(AFLOAT2,alpha=RANGE(0.0,20.0),r=RANGE(0,20)) def dpcuts(image,alpha=0.5,r=2): """Compute dynamic programming cuts through an image. The image contains the costs themselves, `alpha` is the ...
apache-2.0
endlessm/chromium-browser
third_party/chromite/scripts/sysmon/loop_unittest.py
1
1666
# -*- coding: utf-8 -*- # Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for loop.""" # pylint: disable=protected-access from __future__ import absolute_import from __future__ import prin...
bsd-3-clause
waldocarter/p2pool
p2pool/main.py
41
29688
from __future__ import division import base64 import gc import json import os import random import sys import time import signal import traceback import urlparse if '--iocp' in sys.argv: from twisted.internet import iocpreactor iocpreactor.install() from twisted.internet import defer, reactor, protocol, tcp f...
gpl-3.0
arameshkumar/nuxeo-drive
nuxeo-drive-client/nxdrive/osi/darwin/pyNotificationCenter.py
4
2289
# Python integration with Mountain Lion's notification center import Foundation, objc NSUserNotification = objc.lookUpClass('NSUserNotification') NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') NSObject = objc.lookUpClass('NSObject') class NotificationDelegator(NSObject): def __init__(s...
lgpl-2.1
ageron/tensorflow
tensorflow/python/saved_model/model_utils/export_utils.py
5
14763
# 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
filgf/grow3.js
utils/GenerateExamplesServer.py
1
1249
import cgi import urlparse from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer # Handler for receiving POST-requests and saving them to disk # NOT fail-safe at all! class MyHandler(BaseHTTPRequestHandler): def do_POST(self): ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))...
mit
diagramsoftware/l10n-spain
l10n_es_dua_sii/models/account_invoice.py
6
2513
# -*- coding: utf-8 -*- # Copyright 2017 Consultoría Informática Studio 73 S.L. # Copyright 2017 Comunitea Servicios Tecnológicos S.L. # Copyright 2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api class AccountInvoice(models.Model)...
agpl-3.0
polimediaupv/edx-platform
common/lib/xmodule/xmodule/modulestore/mongo/base.py
34
81686
""" Modulestore backed by Mongodb. Stores individual XModules as single documents with the following structure: { '_id': <location.as_dict>, 'metadata': <dict containing all Scope.settings fields> 'definition': <dict containing all Scope.content fields> 'definition.children': <list of all child locati...
agpl-3.0
Sbalbp/DIRAC
WorkloadManagementSystem/Client/IgnoreMissingInputData.py
10
1371
######################################################################## # $HeadURL: svn+ssh://svn.cern.ch/reps/dirac/DIRAC/trunk/DIRAC/WorkloadManagementSystem/Client/IgnoreMissingInputData.py $ # File : IgnoreMissingInputData.py # Author : Ricardo Graciani #########################################################...
gpl-3.0
naucoin/VTKSlicerWidgets
Examples/Infovis/Python/selection_domain.py
17
2017
from vtk import * import os.path def setup_view(link, file, domain1, domain2, hue_range): reader = vtkDelimitedTextReader() reader.SetHaveHeaders(True) reader.SetFileName(file) ttg = vtkTableToGraph() ttg.SetInputConnection(0, reader.GetOutputPort()) ttg.AddLinkVertex(domain1, domain1, False) ttg.AddLin...
bsd-3-clause
RealImpactAnalytics/airflow
airflow/contrib/hooks/ftp_hook.py
3
8059
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
ARM-software/CMSIS_5
CMSIS/DSP/Testing/DebugScripts/debug.py
2
3123
import numpy as np from pylab import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show,semilogx, semilogy import scipy.fftpack import os.path import struct import argparse import PatternGeneration.DebugTools as d # Example script to read patterns and test outputs parser = argparse.ArgumentParse...
apache-2.0
havard024/prego
crm/lib/python2.7/site-packages/docutils/parsers/rst/languages/nl.py
128
3708
# $Id: nl.py 7119 2011-09-02 13:00:23Z milde $ # Author: Martijn Pieters <mjpieters@users.sourceforge.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be...
mit
erikrose/pip
pip/compat/__init__.py
248
3402
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import ...
mit
with-git/tensorflow
tensorflow/python/ops/rnn.py
15
59373
# 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
uwafsl/MissionPlanner
Lib/distutils/emxccompiler.py
59
12250
"""distutils.emxccompiler Provides the EMXCCompiler class, a subclass of UnixCCompiler that handles the EMX port of the GNU C compiler to OS/2. """ # issues: # # * OS/2 insists that DLLs can have names no longer than 8 characters # We put export_symbols in a def-file, as though the DLL can have # an arb...
gpl-3.0
ppalex7/SourcePawnCompletions
watchdog/observers/__init__.py
8
3149
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 Google, 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 # # ...
gpl-3.0
fidomason/kbengine
kbe/res/scripts/common/Lib/unittest/test/test_break.py
81
9812
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
lgpl-3.0
nikistoianov/TechMod-homeworks
CalculatorPHP/vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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, modify, merge, publish, distrib...
mit
damonkohler/sl4a
python/src/Tools/framer/framer/function.py
48
4246
"""Functions.""" from framer import template from framer.util import cstring, unindent METH_O = "METH_O" METH_NOARGS = "METH_NOARGS" METH_VARARGS = "METH_VARARGS" def parsefmt(fmt): for c in fmt: if c == '|': continue yield c class Argument: def __init__(self, name): sel...
apache-2.0
babble/babble
include/jython/Lib/test/test_mmap.py
12
13023
from test.test_support import verify, vereq, TESTFN import mmap import os, re PAGESIZE = mmap.PAGESIZE def test_both(): "Test mmap module on Unix systems and Windows" # Create a file to be mmap'ed. if os.path.exists(TESTFN): os.unlink(TESTFN) f = open(TESTFN, 'w+') try: # unlink TESTF...
apache-2.0
tkoolen/MatlabGitBisect
src/matlabGitBisect.py
1
4556
#!/usr/bin/python # encoding: utf-8 ''' matlabGitBisect -- a git bisect run script for Matlab projects @author: Twan Koolen ''' import sys import signal import os import subprocess from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter __all__ = [] __version__ = 0.1 __date__ = '201...
mit
ojengwa/oh-mainline
vendor/packages/django-authopenid/django_authopenid/context_processors.py
25
1361
# -*- coding: utf-8 -*- # Copyright 2007, 2008,2009 by Benoît Chesneau <benoitc@e-engura.org> # # 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...
agpl-3.0
WindCanDie/spark
examples/src/main/python/als.py
121
3267
# # 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
vmindru/ansible-modules-core
cloud/azure/azure_rm_securitygroup_facts.py
46
11123
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
ylatuya/jhbuild
jhbuild/buildbot/status/web/waterfall.py
3
20614
# jhbuild - a build script for GNOME 1.x and 2.x # Copyright (C) 2008 Igalia S.L., John Carr, Frederic Peters # # waterfall.py: custom waterfall display # # 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 ...
gpl-2.0
Debian/openjfx
modules/web/src/main/native/Tools/jhbuild/jhbuildrc_common.py
3
3849
#!/usr/bin/env python # Copyright (C) 2011 Igalia S.L. # Copyright (C) 2012 Intel Corporation # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at y...
gpl-2.0
pjg101/SickRage
lib/chardet/euctwfreq.py
290
31621
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
gpl-3.0
liorvh/golismero
golismero/managers/networkmanager.py
8
6667
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Manager for network connections. """ __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistrib...
gpl-2.0
grundprinzip/Impala
tests/beeswax/impala_beeswax.py
6
16926
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Talk to an impalad through beeswax. # Usage: # * impalad is a string with the host and port of the impalad # with which the connection should be established. # The format is "<hostname>:<port>" # * query_string is the query t...
apache-2.0
mwrightevent38/MissionPlanner
Lib/site-packages/scipy/linalg/scons_support.py
64
1289
from os.path import join as pjoin, splitext, basename as pbasename from interface_gen import generate_interface def do_generate_interface(target, source, env): """Generate a .pyf file from another pyf file (!).""" # XXX: do this correctly target_name = str(target[0]) source_name = str(source[0]) ...
gpl-3.0
twz915/django
tests/select_related_onetoone/tests.py
39
10733
from django.core.exceptions import FieldError from django.test import SimpleTestCase, TestCase from .models import ( AdvancedUserStat, Child1, Child2, Child3, Child4, Image, LinkedList, Parent1, Parent2, Product, StatDetails, User, UserProfile, UserStat, UserStatResult, ) class ReverseSelectRelatedTestCa...
bsd-3-clause
bcoca/ansible
test/units/module_utils/basic/test_filesystem.py
113
5190
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (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 ...
gpl-3.0
kamenim/samba
python/samba/tests/kcc/ldif_import_export.py
19
7924
# Unix SMB/CIFS implementation. Tests for samba.kcc.ldif_import_export. # Copyright (C) Andrew Bartlett 2015 # # Written by Douglas Bagnall <douglas.bagnall@catalyst.net.nz> # # 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 # ...
gpl-3.0
neerajvashistha/pa-dude
bin/pilconvert.py
2
2373
#!/home/cipher/pa-dude/bin/python # # The Python Imaging Library. # $Id$ # # convert image files # # History: # 0.1 96-04-20 fl Created # 0.2 96-10-04 fl Use draft mode when converting images # 0.3 96-12-30 fl Optimize output (PNG, JPEG) # 0.4 97-01-18 fl Made optimize an option (PNG, JPEG) # 0....
mit
xodus7/tensorflow
tensorflow/contrib/distribute/python/tpu_strategy.py
2
13762
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
cce/kombu
kombu/log.py
32
4168
from __future__ import absolute_import import logging import numbers import os import sys from logging.handlers import WatchedFileHandler from .five import string_t from .utils import cached_property from .utils.encoding import safe_repr, safe_str from .utils.functional import maybe_evaluate __all__ = ['LogMixin', ...
bsd-3-clause
mrquim/mrquimrepo
repo/script.module.pycryptodome/lib/Crypto/SelfTest/PublicKey/__init__.py
12
2175
# -*- coding: utf-8 -*- # # SelfTest/PublicKey/__init__.py: Self-test for public key crypto # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedic...
gpl-2.0
sstrigger/Sick-Beard
lib/tvdb_api/tvdb_api.py
16
33364
#!/usr/bin/env python #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) """Simple-to-use Python interface to The TVDB's API (thetvdb.com) Example usage: >>> from tvdb_api import Tvdb >>> t = Tvdb() >>> t['Lost'][4][11]['episodename...
gpl-3.0
rue89-tech/edx-platform
common/djangoapps/util/models.py
56
2768
"""Models for the util app. """ import cStringIO import gzip import logging from django.db import models from django.db.models.signals import post_init from django.utils.text import compress_string from config_models.models import ConfigurationModel logger = logging.getLogger(__name__) # pylint: disable=invalid-na...
agpl-3.0
jorsea/vertical-ngo
logistic_order_donation/model/sale_order.py
1
4068
# -*- coding: utf-8 -*- # # # Copyright 2014 Camptocamp SA # Author: Yannick Vaucher # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License,...
agpl-3.0
40223125/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/stat.py
765
4304
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # Indices for stat struct members in the tuple returned by os.stat() ST_MODE = 0 ST_INO = 1 ST_DEV = 2 ST_NLINK = 3 ST_UID = 4 ST_GID = 5 ST_SIZE = 6 ST_ATIME = 7 ST_MTIME = 8 ST_CTIME = 9 ...
gpl-3.0
prutseltje/ansible
lib/ansible/modules/cloud/azure/_azure.py
25
23782
#!/usr/bin/python # # Copyright (c) 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['depreca...
gpl-3.0
prashanthr/wakatime
wakatime/packages/pygments_py2/pygments/formatters/rtf.py
73
5049
# -*- coding: utf-8 -*- """ pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_i...
bsd-3-clause
LLNL/spack
lib/spack/spack/abi.py
2
4489
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from llnl.util.lang import memoized import spack.spec from spack.build_environment import dso_suffix from spac...
lgpl-2.1
vestor/YouTubeMP3Uploader
uploader.py
1
6635
import httplib import httplib2 import random import sys import time from googleapiclient.discovery import build from googleapiclient.errors import HttpError from googleapiclient.http import MediaFileUpload from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client.t...
mit
miketamis/CouchPotatoServer
libs/enzyme/mp4.py
97
16165
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2007 Thomas Schueppel <stain@acm.org> # Copyright 2003-2007 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
msegado/edx-platform
common/djangoapps/cache_toolbox/templatetags/cache_toolbox.py
239
2059
from django import template from django.core.cache import cache from django.template import Node, TemplateSyntaxError, Variable from django.template import resolve_variable register = template.Library() class CacheNode(Node): def __init__(self, nodelist, expire_time, key): self.nodelist = nodelist ...
agpl-3.0
rismalrv/edx-platform
lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py
114
6426
# -*- 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 model 'CourseAuthorization' db.create_table('bulk_email_courseauthorization', ( ('id', ...
agpl-3.0
brittanystoroz/kitsune
kitsune/products/tests/__init__.py
6
1557
# -*- coding: utf-8 -*- from django.template.defaultfilters import slugify import factory import factory.fuzzy import factory.django from kitsune.products.models import Product, Topic, Version from kitsune.sumo.tests import FuzzyUnicode class ProductFactory(factory.DjangoModelFactory): class Meta: model...
bsd-3-clause
libo/Enigma2
lib/python/Plugins/SystemPlugins/Videomode/plugin.py
1
7622
from Screens.Screen import Screen from Plugins.Plugin import PluginDescriptor from Components.SystemInfo import SystemInfo from Components.ConfigList import ConfigListScreen from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider from Components.Sources.StaticText import Sta...
gpl-2.0
caisq/tensorflow
tensorflow/contrib/timeseries/examples/predict_test.py
80
2487
# 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
renhaoqi/gem5-stable
src/python/m5/options.py
88
5158
# Copyright (c) 2005 The Regents of The University of Michigan # 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 ...
bsd-3-clause
deemoowoor/.vim
ftplugin/python/pyflakes/pyflakes/test/test_imports.py
39
16828
from sys import version_info from pyflakes import messages as m from pyflakes.test import harness class Test(harness.Test): def test_unusedImport(self): self.flakes('import fu, bar', m.UnusedImport, m.UnusedImport) self.flakes('from baz import fu, bar', m.UnusedImport, m.UnusedImport) def t...
unlicense
AnishShah/tensorflow
tensorflow/contrib/training/python/training/resample.py
39
5844
# 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
SHTOOLS/SHTOOLS
examples/python/SHRotations/SHRotations.py
2
1545
#!/usr/bin/env python3 """ This script tests the rotation of spherical harmonic coefficients """ import numpy as np import pyshtools from pyshtools import rotate pyshtools.utils.figstyle() def main(): test_SHRotations() def test_SHRotations(): # ---- input parameters ---- lmax = 3 alpha, beta, gam...
bsd-3-clause
frumiousbandersnatch/supybot-code
plugins/Later/__init__.py
15
2509
### # Copyright (c) 2005, Jeremiah Fincher # 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 of conditi...
bsd-3-clause
jonparrott/gcloud-python
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
2
54866
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
sander76/home-assistant
tests/components/atag/test_init.py
3
1026
"""Tests for the ATAG integration.""" from homeassistant.components.atag import DOMAIN from homeassistant.config_entries import ENTRY_STATE_SETUP_RETRY from homeassistant.core import HomeAssistant from . import init_integration, mock_connection from tests.test_util.aiohttp import AiohttpClientMocker async def test...
apache-2.0
caseyrollins/osf.io
osf_tests/test_search_views.py
3
15202
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import pytest from nose.tools import * # noqa PEP8 asserts from osf_tests import factories from tests.base import OsfTestCase from website.util import api_url_for from website.views import find_bookmark_collect...
apache-2.0
Lektorium-LLC/edx-platform
common/test/acceptance/tests/discussion/test_cohorts.py
11
5947
""" Tests related to the cohorting feature. """ from uuid import uuid4 from nose.plugins.attrib import attr from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.acceptance.pages.lms.courseware import...
agpl-3.0
MycChiu/tensorflow
tensorflow/contrib/framework/python/ops/arg_scope_test.py
115
7232
# 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
kovetskiy/ultisnips
pythonx/UltiSnips/test_position.py
29
1829
#!/usr/bin/env python # encoding: utf-8 # pylint: skip-file import unittest from position import Position class _MPBase(object): def runTest(self): obj = Position(*self.obj) for pivot, delta, wanted in self.steps: obj.move(Position(*pivot), Position(*delta)) self.assert...
gpl-3.0
jelly/calibre
src/calibre/ebooks/docx/numbering.py
2
14868
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import re, string from collections import Counter, defaultdict from functool...
gpl-3.0
yoer/hue
desktop/core/ext-py/Mako-0.8.1/mako/_ast_util.py
57
25615
# mako/_ast_util.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ ast ~~~ The `ast` module helps Python applications to process trees of the Pyth...
apache-2.0
odiroot/PyGPMP
gpmp/ui/playlists.py
1
1246
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'gpmp/ui/playlists.ui' # # Created: Tue Sep 11 21:11:37 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exce...
bsd-3-clause
StevenVanAcker/mitmproxy
mitmproxy/tools/console/grideditor/col_text.py
3
1335
""" Welcome to the encoding dance! In a nutshell, text columns are actually a proxy class for byte columns, which just encode/decodes contents. """ from mitmproxy.tools.console import signals from mitmproxy.tools.console.grideditor import col_bytes class Column(col_bytes.Column): def __init__(self, heading, enc...
mit
dribnet/kerosene
examples/mnist.py
1
2353
from __future__ import absolute_import from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from kerosene.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Co...
mit
dustymabe/ansible-modules-core
system/selinux.py
198
6903
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Derek Carter<goozbach@friocorte.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 ...
gpl-3.0
WhiteVell/Amber
node-v0.10.20/tools/closure_linter/closure_linter/common/error.py
155
2070
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
mit
sergiocallegari/PyDSM
pydsm/delsig/_padding.py
1
5506
# -*- coding: utf-8 -*- # Copyright (c) 2012, Sergio Callegari # All rights reserved. # This file is part of PyDSM. # PyDSM 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, o...
gpl-3.0
vipul-sharma20/oh-mainline
vendor/packages/whoosh/src/whoosh/lang/porter2.py
117
8314
"""An implementation of the Porter2 stemming algorithm. See http://snowball.tartarus.org/algorithms/english/stemmer.html Adapted from pyporter2 by Michael Dirolf. This algorithm is more correct but (at least in this implementation) several times slower than the original porter algorithm as implemented in stemming.por...
agpl-3.0
usc-isi/essex-baremetal-support
nova/db/sqlalchemy/migrate_repo/versions/006_add_provider_data_to_volumes.py
5
2117
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara. # 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.apac...
apache-2.0
akuks/pretix
src/pretix/base/models.py
1
63477
import copy import random import string import uuid from datetime import datetime from itertools import product import six from django.conf import settings from django.contrib.auth.models import ( AbstractBaseUser, BaseUserManager, PermissionsMixin, ) from django.core.validators import RegexValidator from django.d...
apache-2.0
alexferrer/xcsoar_map_generator
lib/xcsoar/mapgen/country_codes.py
5
5777
__codes = { 'AD': 'ANDORRA', 'AE': 'UNITED ARAB EMIRATES', 'AF': 'AFGHANISTAN', 'AG': 'ANTIGUA AND BARBUDA', 'AI': 'ANGUILLA', 'AL': 'ALBANIA', 'AM': 'ARMENIA', 'AN': 'NETHERLANDS ANTILLES', 'AO': 'ANGOLA', 'AQ': 'ANTARCTICA', 'AR': 'ARGENTINA', 'AS': 'AMERICAN SAMOA', ...
gpl-2.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/pkgutil.py
234
20346
"""Utilities to support packages.""" # NOTE: This module must remain compatible with Python 2.3, as it is shared # by setuptools for distribution with Python 2.3 and up. import os import sys import imp import os.path from types import ModuleType __all__ = [ 'get_importer', 'iter_importers', 'get_loader', 'find_l...
gpl-2.0
Cristofori/kmud
bots/create_unit_users.py
1
1847
#!/usr/bin/python import pexpect, sys, exceptions host = "localhost" port = 8945 baseUsername = "unit" password = "unit123" def usage(): print "Usage: %s [count] [host] [port]" % sys.argv[0] sys.exit(1) if len(sys.argv) < 2: usage() try: userCount = int(sys.argv[1]) except exceptions.ValueError: ...
mit
knowsis/django
tests/utils_tests/test_module_loading.py
56
7454
import os import sys import imp from zipimport import zipimporter from django.core.exceptions import ImproperlyConfigured from django.utils import unittest from django.utils.importlib import import_module from django.utils.module_loading import import_by_path, module_has_submodule from django.utils._os import upath ...
bsd-3-clause
elkingtonmcb/shogun
examples/example-generation/tests/test_translate_java.py
11
6945
from translate import Translator import json import unittest class TestJavaTranslator(unittest.TestCase): def setUp(self): with open("targets/java.json", "r") as targetFile: self.translator = Translator(json.load(targetFile)) def test_translateProgram(self): """ CSVFile tr...
gpl-3.0