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
ewheeler/rapidpro
temba/values/tests.py
1
20667
from __future__ import unicode_literals import json from datetime import timedelta from django.core.urlresolvers import reverse from django.utils import timezone from mock import patch from temba.contacts.models import ContactField from temba.flows.models import RuleSet from temba.orgs.models import Language from tem...
agpl-3.0
rdelval/aurora
src/test/python/apache/thermos/cli/commands/test_simplerun.py
13
1425
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
daskos/mentos
mentos/utils.py
2
4957
from __future__ import (absolute_import, division, print_function, unicode_literals) import logging from binascii import a2b_base64, b2a_base64 from contextlib import contextmanager from multiprocessing.pool import ThreadPool from mentos.exceptions import (DetectorClosed, NoLeadingMaster, ...
apache-2.0
mwrlabs/veripy
contrib/rfc3736/__init__.py
1
6086
from veripy.models import ComplianceTestSuite from veripy.models.decorators import must, should import client #import relay_agent import server class StatelessDHCPv6ServiceClientSpecification(ComplianceTestSuite): """ Stateless Dynamic Host Configuration Protocol Service for IPv6 (DHCPv6 Client) These te...
gpl-3.0
tpokorra/pykolab
pykolab/cli/cmd_remove_mailaddress.py
1
3257
# -*- coding: utf-8 -*- # Copyright 2010-2013 Kolab Systems AG (http://www.kolabsys.com) # # Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com> # # 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-3.0
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/build/gyp/test/win/gyptest-link-pgo.py
239
2993
#!/usr/bin/env python # Copyright (c) 2013 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. """ Make sure PGO is working properly. """ import TestGyp import os import sys if sys.platform == 'win32': test = TestGyp.TestGyp(forma...
apache-2.0
toshywoshy/ansible
lib/ansible/plugins/lookup/k8s.py
38
11371
# # Copyright 2018 Red Hat | Ansible # # 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. # # ...
gpl-3.0
nealtodd/django
tests/admin_custom_urls/models.py
288
2513
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
jpwhite3/wilmu-linux-toolkit
lab_toolkit/includes/linecache2/tests/test_linecache.py
17
6508
""" Tests for the linecache module """ import linecache2 as linecache import unittest2 as unittest import os.path import tempfile from fixtures import NestedTempfile FILENAME = os.__file__ if FILENAME.endswith('.pyc'): FILENAME = FILENAME[:-1] NONEXISTENT_FILENAME = FILENAME + '.missing' INVALID_NAME = '!@$)(!@#...
mit
daviddupont69/CouchPotatoServer
libs/sqlalchemy/sql/__init__.py
18
1138
# sql/__init__.py # Copyright (C) 2005-2013 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 sqlalchemy.sql.expression import ( Alias, ClauseElement, ColumnCollec...
gpl-3.0
robynbergeron/ansible-modules-extras
network/f5/bigip_node.py
77
13267
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Matt Hite <mhite@hotmail.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...
gpl-3.0
lonvia/osgende
tools/osgende-mapserv-falcon.py
1
9619
# This file is part of Osgende # Copyright (C) 2020 Sarah Hoffmann # # This 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 any later version. # # This program is distribu...
gpl-3.0
Softmotions/edx-platform
common/test/acceptance/tests/studio/test_studio_settings_details.py
19
7658
""" Acceptance tests for Studio's Settings Details pages """ from unittest import skip from .base_studio_test import StudioCourseTest from ...fixtures.course import CourseFixture from ...pages.studio.settings import SettingsPage from ...pages.studio.overview import CourseOutlinePage from ...tests.studio.base_studio_te...
agpl-3.0
dhuang/incubator-airflow
airflow/www/api/experimental/endpoints.py
2
8145
# -*- 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
jinzo/django-dbpool-backend
django_dbpool_backends/mysql/creation.py
311
3019
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict_...
bsd-3-clause
tumbl3w33d/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_disk.py
9
34453
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty...
gpl-3.0
ddayguerrero/blogme
flask/lib/python3.4/site-packages/pip/index.py
45
40374
"""Routines related to PyPI, indexes""" import sys import os import re import mimetypes import posixpath from pip.log import logger from pip.util import Inf, normalize_name, splitext, is_prerelease from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled, InstallationE...
mit
jontrulson/upm
examples/python/aeotecdsb09104.py
7
2756
#!/usr/bin/python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2016 Intel Corporation. # # 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 l...
mit
dshen1/trading-with-python
lib/functions.py
76
11627
# -*- coding: utf-8 -*- """ twp support functions @author: Jev Kuznetsov Licence: GPL v2 """ from scipy import polyfit, polyval import datetime as dt #from datetime import datetime, date from pandas import DataFrame, Index, Series import csv import matplotlib.pyplot as plt import numpy as np import p...
bsd-3-clause
nicoboss/Floatmotion
pygame/tests/run_tests__tests/print_stdout/fake_3_test.py
18
1249
import sys if __name__ == '__main__': import os pkg_dir = (os.path.split( os.path.split( os.path.split( os.path.abspath(__file__))[0])[0])[0]) parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and ...
agpl-3.0
popazerty/e2-gui
lib/python/Components/Renderer/RollerCharLCD.py
7
1894
from Components.config import config from Renderer import Renderer from enigma import eLabel, eTimer from boxbranding import getMachineProcModel from Components.VariableText import VariableText class RollerCharLCD(VariableText, Renderer): def __init__(self): Renderer.__init__(self) VariableText.__init__(self) i...
gpl-2.0
molebot/brython
www/tests/test_strings.py
4
2887
# strings assert 'a'.__class__ == str assert isinstance('a',str) hello = "This is a rather long string containing\n\ several lines of text just as you would do in C.\n\ Note that whitespace at the beginning of the line is\ significant." hello = """\ Usage: thingy [OPTIONS] -h Display...
bsd-3-clause
dyoung418/tensorflow
tensorflow/tools/dist_test/python/mnist_replica.py
44
10714
# 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
nephila/django-knocker
docs/conf.py
1
8313
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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. # # ...
bsd-3-clause
Romain-Geissler-1A/avro
lang/py/src/avro/protocol.py
64
7963
# 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
gtrensch/nest-simulator
pynest/nest/tests/test_facetshw_stdp.py
20
5894
# -*- coding: utf-8 -*- # # test_facetshw_stdp.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the Lice...
gpl-2.0
bixbydev/Bixby
google/dist/gdata-2.0.18/tests/gdata_tests/blogger/live_client_test.py
39
5831
#!/usr/bin/env python # # Copyright (C) 2009 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
gpl-3.0
sdoran35/hate-to-hugs
venv/lib/python3.6/site-packages/pip/_vendor/appdirs.py
327
22368
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See <http://github.com/ActiveState/appdirs> for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # ...
mit
bingopodcast/bingos
bingo_emulator/graphics/super_7.py
1
58578
import pygame import random pygame.display.set_caption("Multi Bingo") screen = pygame.display.set_mode((0,0)) screen.fill([0,0,0]) pygame.mouse.set_visible(False) meter = pygame.image.load('graphics/assets/black_register_cover.png').convert() odds = pygame.image.load('super_7/assets/odds.png').convert_alpha() eb = p...
gpl-3.0
luotao1/Paddle
python/paddle/fluid/tests/unittests/test_ir_memory_optimize_pass.py
2
3516
# Copyright (c) 2018 PaddlePaddle 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 appli...
apache-2.0
namccart/gnuradio
gr-digital/examples/example_costas.py
49
5316
#!/usr/bin/env python # # Copyright 2011-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 optio...
gpl-3.0
wskplho/fontuley
src/third_party/fontTools/Lib/fontTools/ttLib/__init__.py
2
30232
"""fontTools.ttLib -- a package for dealing with TrueType fonts. This package offers translators to convert TrueType fonts to Python objects and vice versa, and additionally from Python to TTX (an XML-based text format) and vice versa. Example interactive session: Python 1.5.2c1 (#43, Mar 9 1999, 13:06:43) [CW PP...
apache-2.0
dracos/QGIS
python/plugins/processing/tools/translation.py
12
3016
# -*- coding: utf-8 -*- """ *************************************************************************** classification.py --------------------- Date : July 2015 Copyright : (C) 2015 by Arnaud Morvan Email : arnaud dot morvan at camptocamp dot com **********...
gpl-2.0
redhat-openstack/horizon
openstack_dashboard/dashboards/settings/password/forms.py
63
3043
# Copyright 2013 Centrin Data Systems Ltd. # # 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
unclechu/avto-lux161
avto-lux/app/adm/routes/main.py
1
5434
# -*- coding: utf-8 -*- import os, time import hashlib import datetime from warnings import warn from .helpers import request_except_handler, require_auth from app.configparser import config from app.utils import get_json_localization from app.mixins.auth import AuthMixin from app.mixins.routes import JsonResponseM...
agpl-3.0
dpetzold/django
django/contrib/gis/geos/mutable_list.py
238
10705
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Released under the New BSD license. """ This module contains a base type which provides list-style mutations without specific data storage methods. See also http://static.aryehleib.com/oldsite/MutableLists.html Author: Aryeh Leib Taurog. """ from fun...
bsd-3-clause
tbabej/astropy
astropy/visualization/wcsaxes/tests/test_frame.py
2
5298
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import matplotlib.pyplot as plt from ....wcs import WCS from ....tests.helper import pytest, remote_data from .. import WCSAxes from ..frame import BaseFrame from ....tests.image_tests import IMAGE_REFERENCE_DIR from .test_images imp...
bsd-3-clause
krzysztof/invenio-pidrelations
invenio_pidrelations/contrib/versioning.py
1
6972
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015, 2016 CERN. # # Invenio 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 optio...
gpl-2.0
CasparLi/calibre
src/calibre/ebooks/compression/tcr.py
24
5143
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import re class TCRCompressor(object): ''' TCR compression takes the form header+code_dict+coded_text. The header is always "!!8-Bit!!". The code dict is a list...
gpl-3.0
ruslanloman/nova
nova/tests/unit/api/openstack/compute/contrib/test_hosts.py
25
18124
# Copyright (c) 2011 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
eusi/MissionPlanerHM
Lib/site-packages/numpy/oldnumeric/typeconv.py
101
1622
__all__ = ['oldtype2dtype', 'convtypecode', 'convtypecode2', 'oldtypecodes'] import numpy as np oldtype2dtype = {'1': np.dtype(np.byte), 's': np.dtype(np.short), # 'i': np.dtype(np.intc), # 'l': np.dtype(int), # 'b': np.dtype(np.ubyte), ...
gpl-3.0
jaredkipe/mongo-connector
mongo_connector/doc_managers/formatters.py
1
5486
import base64 import datetime import re from uuid import UUID from math import isnan, isinf import logging LOG = logging.getLogger(__name__) import bson import bson.json_util from mongo_connector.compat import PY3 if PY3: long = int unicode = str RE_TYPE = type(re.compile("")) try: from bson.regex im...
apache-2.0
jtyuan/racetrack
src/arch/x86/isa/insts/general_purpose/string/compare_strings.py
91
3952
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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
jamesgk/robofab
Scripts/RoboFabIntro/intro_GeneratingFonts.py
8
1526
#FLM: RoboFab Intro, Generating Fonts # # # demo generating fonts with robofab # # # Generating fonts with RoboFab is super easy! Let's have a look. # (you will need to have a font open in FontLab) from robofab.world import CurrentFont import os # A little function for making folders. we'll need it later. def make...
bsd-3-clause
matthiasdiener/spack
var/spack/repos/builtin/packages/dealii-parameter-gui/package.py
1
1726
############################################################################## # Copyright (c) 2013-2017, 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
symbolicdata/code
src/sdeval/classes/templates/comp/SOL_R_poly_sys/Z3/template_sol.py
1
2437
""" This is the template for extracting the solution for the computation problem of computing real solution of a polynomial system of equations RR from the output of the computer algebra system Z3. .. moduleauthor:: Albert Heinle <albert.heinle@uwaterloo.ca> """ import xml.dom.minidom as dom import re #-------------...
gpl-3.0
Pointedstick/ReplicatorG
skein_engines/skeinforge-31/fabmetheus_utilities/miscellaneous/nophead/layers.py
23
2549
from vector3 import Vector3 import Image, ImageDraw def bounding_cube(layers): min_x = 999999 min_y = 999999 min_z = 999999 max_x = -999999 max_y = -999999 max_z = -999999 for layer in layers: for thread in layer: for point in thread: if point.x > max_x: ...
gpl-2.0
wenhuizhang/neutron
neutron/tests/api/test_metering_extensions.py
47
6880
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
nickanderson/ansible
lib/ansible/color.py
134
2388
# (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
mconstantin/watchdog
tools/bootstrap.py
8
10448
# # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE...
apache-2.0
MartijnBraam/CouchPotatoServer
libs/pyasn1/codec/cer/decoder.py
261
1230
# CER decoder from pyasn1.type import univ from pyasn1.codec.ber import decoder from pyasn1.compat.octets import oct2int from pyasn1 import error class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, ...
gpl-3.0
AugurProject/sidecoin
contrib/spendfrom/spendfrom.py
2
10094
#!/usr/bin/env python # # Use the raw transactions API to spend sidecoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a sidecoind or S...
mit
Permutatrix/servo
tests/wpt/mozilla/tests/webgl/conformance-2.0.0/py/tex_image_test_generator.py
27
9132
#!/usr/bin/env python # Copyright (c) 2015 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and/or associated documentation files (the # "Materials"), to deal in the Materials without restriction, including # without limitation the rights to use...
mpl-2.0
stanbellcom/webapp_politik
sites/all/modules/annotator/lib/store-plugin/pyenv/lib/python2.7/site-packages/pyes/pyesthrift/ttypes.py
2
11651
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class Method: GET ...
gpl-2.0
JohnOrlando/gnuradio-bitshark
gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
9
14686
# # Copyright 2005,2006,2007,2009 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 l...
gpl-3.0
bollu/sandhi
modules/gr36/docs/sphinx/hieroglyph/nodes.py
25
7930
__author__ = 'Robert Smallshire' class Node(object): def __init__(self, indent=None, lines=None, parent=None): if indent is not None: self.indent = indent else: self.indent = 0 if lines is not None: self.lines = lines else: ...
gpl-3.0
magicrub/mavlink
pymavlink/generator/lib/genxmlif/xmlifBase.py
82
5371
# # genxmlif, Release 0.9.0 # file: xmlifbase.py # # XML interface base classes # # history: # 2005-04-25 rl created # 2006-08-18 rl some methods for XML schema validation support added # 2007-05-25 rl performance optimization (caching) added, bugfixes for XPath handling # 2007-07-04 rl complete re-de...
lgpl-3.0
scascketta/LostNumber
LostNumber/process_msg.py
1
1758
from twilio.rest import TwilioRestClient from twilio import TwilioRestException from redis import StrictRedis import time import details account_sid = details.twilio_account_sid auth_token = details.twilio_auth_token client = TwilioRestClient(account_sid, auth_token) twilio_number = details.twilio_num r = StrictRed...
mit
franck-talbart/codelet_tuning_infrastructure
src/cti_hapi/alias.py
1
5818
#************************************************************************ # Codelet Tuning Infrastructure # Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ # # 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 # th...
gpl-3.0
tonybaloney/st2
st2common/tests/unit/test_policies.py
6
2603
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
saurabhjn76/sympy
sympy/physics/mechanics/lagrange.py
45
18428
from __future__ import print_function, division __all__ = ['LagrangesMethod'] from sympy import diff, zeros, Matrix, eye, sympify from sympy.physics.vector import dynamicsymbols, ReferenceFrame from sympy.physics.mechanics.functions import (find_dynamicsymbols, msubs, _f_list_parser) from sympy.physics.mechan...
bsd-3-clause
qiqjiao/study
jsoncpp/tags/svn-release-0.6.0-rc2/doxybuild.py
44
6791
"""Script to generate doxygen documentation. """ import re import os import os.path import sys import shutil from devtools import tarball def find_program(*filenames): """find a program in folders path_lst, and sets env[var] @param filenames: a list of possible names of the program to search for @return: ...
lgpl-3.0
danielvdende/incubator-airflow
airflow/contrib/operators/bigquery_to_gcs.py
7
4491
# -*- 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
escapewindow/python-scriptharness
scriptharness/exceptions.py
2
2349
#!/usr/bin/env python # -*- coding: utf-8 -*- """Scriptharness exceptions. These exceptions are written with several things in mind: #. the exceptions should be unicode-capable in python 2.7 (py3 gets that for free), #. the exceptions should differentiate between user-facing exceptions and developer-facing ...
mpl-2.0
gqwest-erp/server
openerp/tools/lru.py
204
2946
# -*- coding: utf-8 -*- # taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/ import threading from func import synchronized __all__ = ['LRU'] class LRUNode(object): __slots__ = ['prev', 'next', 'me'] def __init__(self, prev, me): self.prev = prev ...
agpl-3.0
bollu/vispy
examples/demo/gloo/brain.py
18
4553
#!/usr/bin/env python # -*- coding: utf-8 -*- # vispy: gallery 2 # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ 3D brain mesh viewer. """ from timeit import default_timer import numpy as np from vispy import gloo from vispy import app from ...
bsd-3-clause
jhuapl-boss/intern
intern/service/cv/project.py
1
4848
# Copyright 2020 The Johns Hopkins University Applied Physics Laboratory # # 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
sonaht/ansible
lib/ansible/module_utils/aws/core.py
50
5402
# # Copyright 2017 Michael De La Rue | Ansible # # 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
aurofable/medhack-server
venv/lib/python2.7/encodings/uu_codec.py
383
3738
""" Python 'uu_codec' Codec - UU content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were adapted from uu.py which was written by Lance Ell...
mit
mpetyx/palmdrop
venv/lib/python2.7/site-packages/django/contrib/admindocs/utils.py
216
3801
"Misc. utility functions/classes for admin documentation generator." import re from email.parser import HeaderParser from email.errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes try: import docuti...
apache-2.0
mcgachey/edx-platform
setup.py
11
3320
""" Setup script for the Open edX package. """ from setuptools import setup setup( name="Open edX", version="0.5", install_requires=["setuptools"], requires=[], # NOTE: These are not the names we should be installing. This tree should # be reorganized to be a more conventional Python tree. ...
agpl-3.0
roberthawdon/toonbot
subprocesses/post-queue.py
1
6346
#!/usr/bin/env python # Toon Bot - Poster Bot Subprocess # # _____ U ___ u U ___ u _ _ ____ U ___ u _____ # |_ " _| \/"_ \/ \/"_ \/ | \ |"| U | __")u \/"_ \/|_ " _| # | | | | | | | | | |<| \| |> \| _ \/ | | | | | | # /| |\.-,_| |_| |.-,_| |_| |U| |\ |u ...
gpl-3.0
jitka/weblate
weblate/trans/tests/__init__.py
2
1838
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
gpl-3.0
ChrisTruncer/EyeWitness
Python/modules/reporting.py
1
17673
import os import sys import urllib.parse try: from fuzzywuzzy import fuzz except ImportError: print('[*] fuzzywuzzy not found.') print('[*] Please run the script in the setup directory!') sys.exit() def process_group( data, group, toc, toc_table, page_num, section, sectionid, html): ...
gpl-3.0
RKrahl/pytest-dependency
pytest_dependency.py
1
6492
"""$DOC""" __version__ = "$VERSION" import logging import pytest logger = logging.getLogger(__name__) _automark = False _ignore_unknown = False def _get_bool(value): """Evaluate string representation of a boolean value. """ if value: if value.lower() in ["0", "no", "n", "false", "f", "off"]: ...
apache-2.0
trondhindenes/ansible
lib/ansible/plugins/action/aruba.py
21
3677
# # (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 d...
gpl-3.0
yfu/tools
circ/find_circ/merge_bed.py
4
1854
#!/usr/bin/env python import sys,os from collections import defaultdict def read_to_hash(fname,ds=0,de=0,flank=0,cover=False): #print "loading",fname pos = {} for line in file(fname): if line.startswith("#"): continue line = line.strip() chrom,start,end,name,score,sense...
gpl-3.0
incnone/necrobot
necrobot/race/publicrace/raceroom.py
1
11742
# A necrobot "casual" race room. import asyncio import datetime import discord from necrobot.botbase.botchannel import BotChannel from necrobot.botbase.necrobot import Necrobot from necrobot.config import Config from necrobot.race import cmd_race from necrobot.race import raceinfo from necrobot.race.publicrace impor...
mit
morphis/home-assistant
homeassistant/util/temperature.py
18
1188
"""Temperature util functions.""" from homeassistant.const import ( TEMP_CELSIUS, TEMP_FAHRENHEIT, UNIT_NOT_RECOGNIZED_TEMPLATE, TEMPERATURE ) def fahrenheit_to_celsius(fahrenheit: float) -> float: """Convert a Fahrenheit temperature to Celsius.""" return (fahrenheit - 32.0) / 1.8 def celsiu...
apache-2.0
hoverinc/three.js
utils/converters/fbx/convert_to_threejs.py
16
76649
# @author zfedoran / http://github.com/zfedoran import os import sys import math import operator import re import json import types import shutil # ##################################################### # Globals # ##################################################### option_triangulate = True option_textures = True o...
mit
fidodaj/project2
server/lib/werkzeug/debug/tbtools.py
311
16785
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import json import inspect import ...
apache-2.0
wangscript/libjingle-1
trunk/tools/python/google/path_utils.py
191
2910
# Copyright (c) 2011 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. """Some utility methods for getting and manipulating paths.""" # TODO(pamg): Have the buildbot use these, too. import errno import os import sys clas...
bsd-3-clause
uclouvain/osis
education_group/views/access_requirements/create.py
1
3536
# # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business involves the administration of students, teachers, # courses, progr...
agpl-3.0
dpetzold/django
tests/middleware/tests.py
13
34932
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import random import re from io import BytesIO from unittest import skipIf from django.conf import settings from django.core import mail from django.core.exceptions import PermissionDenied from django.http import ( FileResponse, HttpReque...
bsd-3-clause
leviroth/praw
praw/models/reddit/subreddit.py
1
101559
"""Provide the Subreddit class.""" # pylint: disable=too-many-lines from copy import deepcopy from json import dumps, loads from os.path import basename, dirname, join from urllib.parse import urljoin from prawcore import Redirect import websocket from ...const import API_PATH, JPEG_HEADER from ...exceptions import A...
bsd-2-clause
infoxchange/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
51
1463
from django.conf.urls.defaults import * class URLObject(object): def __init__(self, app_name, namespace): self.app_name = app_name self.namespace = namespace def urls(self): return patterns('', url(r'^inner/$', 'empty_view', name='urlobject-view'), url(r'^inner/...
gpl-3.0
matsjoyce/python-krunner
src/krunner.py
1
2880
import _krunner import abc from PyQt5 import QtCore __all__ = ["AbstractRunner", "QueryMatch", "RunnerContext", "RunnerSyntax"] for name in __all__[1:]: cls = getattr(_krunner.Plasma, name) globals()[name] = cls cls.__module__ = __name__ del name del cls class ARMeta(type(_krunner.Plasma.AbstractRunne...
lgpl-3.0
e-mission/e-mission-server
emission/analysis/plotting/leaflet_osm/ipython_helper.py
2
1415
""" Helper functions that can display leaflet maps inline in an ipython notebook """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins i...
bsd-3-clause
MakMukhi/grpc
src/python/grpcio_tests/tests/unit/_junkdrawer/__init__.py
901
1528
# Copyright 2015, 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 f...
bsd-3-clause
blisseth/ThinkStats2
code/regression.py
62
9652
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import math import pandas import random import numpy as np import statsmode...
gpl-3.0
joferkington/numpy
doc/postprocess.py
143
1481
#!/usr/bin/env python """ %prog MODE FILES... Post-processes HTML and Latex files output by Sphinx. MODE is either 'html' or 'tex'. """ from __future__ import division, absolute_import, print_function import re import optparse import io def main(): p = optparse.OptionParser(__doc__) options, args = p.parse_...
bsd-3-clause
arne-cl/pattern
pattern/web/pdf/encodingdb.py
56
1548
#!/usr/bin/env python2 import re from psparser import PSLiteral from glyphlist import glyphname2unicode from latin_enc import ENCODING ## name2unicode ## STRIP_NAME = re.compile(r'[0-9]+') def name2unicode(name): """Converts Adobe glyph names to Unicode numbers.""" if name in glyphname2unicode: retu...
bsd-3-clause
sekikn/incubator-airflow
airflow/providers/amazon/aws/operators/s3_bucket.py
7
3993
# # 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
roselleebarle04/django
tests/flatpages_tests/test_sitemaps.py
380
1326
from __future__ import unicode_literals from django.apps import apps from django.contrib.sites.models import Site from django.test import TestCase from django.test.utils import modify_settings, override_settings @override_settings( ROOT_URLCONF='flatpages_tests.urls', SITE_ID=1, ) @modify_settings( INSTA...
bsd-3-clause
blaggacao/odoo
addons/mail/tests/test_mail_group.py
140
3964
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
meetsandeepan/meetsandeepan.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/token.py
365
5662
# -*- coding: utf-8 -*- """ pygments.token ~~~~~~~~~~~~~~ Basic token types and the standard tokens. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ class _TokenType(tuple): parent = None def split(self): buf = [] ...
mit
sameetb-cuelogic/edx-platform-test
lms/djangoapps/certificates/migrations/0006_auto__chg_field_generatedcertificate_certificate_id.py
188
7408
# 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): # Changing field 'GeneratedCertificate.certificate_id' db.alter_column('certificates_generatedcertificate', 'cert...
agpl-3.0
pymedusa/SickRage
ext/guessit/rules/properties/video_codec.py
4
4959
#!/usr/bin/env python # -*- coding: utf-8 -*- """ video_codec and video_profile property """ from rebulk import Rebulk, Rule, RemoveMatch from rebulk.remodule import re from ..common import dash from ..common.pattern import is_disabled from ..common.validators import seps_after, seps_before, seps_surround def video_...
gpl-3.0
ZhangXinNan/tensorflow
tensorflow/python/saved_model/loader_impl.py
5
14273
# 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