repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ThomasBS/PanicButton
features/support/more/presspowr5times.py
13
1729
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice from subprocess import call import commands import sys import os #print "restart adb" #call(os.environ['ANDROID_HOME'] + '/platform-tools/adb kill-server', shell=True) #call(os.environ['ANDROID_HOME'] + '/platform-tools/adb start-server', shell=True) Mon...
gpl-3.0
Idematica/django-oscar
oscar/apps/wishlists/abstract_models.py
1
4592
import hashlib import random from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from oscar.core.compat import AUTH_USER_MODEL class AbstractWishList(models.Model): """ Represents a user's wish lists of products. A user can h...
bsd-3-clause
nanolearningllc/edx-platform-cypress-2
common/djangoapps/student/migrations/0046_auto__add_entranceexamconfiguration__add_unique_entranceexamconfigurat.py
93
16002
# -*- 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 'EntranceExamConfiguration' db.create_table('student_entranceexamconfiguration', ( ...
agpl-3.0
cosmoharrigan/rl-glue-ext
projects/codecs/Python/examples/skeleton/skeleton_environment.py
14
2634
# # Copyright (C) 2007, Mark Lee # #http://rl-glue-ext.googlecode.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...
apache-2.0
sevaseva/selenium
py/selenium/webdriver/support/expected_conditions.py
1
9762
# # Copyright 2012 WebDriver committers # Copyright 2012 Software Freedom Conservancy. # # 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 # # ...
apache-2.0
cmotc/toxcore
other/bootstrap_daemon/docker/get-nodes.py
13
1955
#!/usr/bin/env python3 """ Copyright (c) 2016 by nurupo <nurupo.contributions@gmail.com> 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 right...
gpl-3.0
ericzundel/pants
tests/python/pants_test/base/test_validation.py
16
1864
# coding=utf-8 # Copyright 2015 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 unittest fro...
apache-2.0
waheedahmed/edx-platform
cms/djangoapps/contentstore/views/course.py
4
71119
""" Views related to operations on course objects """ import copy import json import logging import random import string # pylint: disable=deprecated-module from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.core.u...
agpl-3.0
xcthulhu/periphondemand
src/bin/code/entityparser.py
1
2826
#! /usr/bin/python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Name: entityparser.py # Purpose: # Author: Fabien Marteau <fabien.marteau@armadeus.com> # Created: 06/05/2009 #----------------------------------------------------------------------------...
lgpl-2.1
kelsa-pi/unodit
examples/simple dialogs/src/pythonpath/simple_dialogs.py
1
16464
# -*- coding: utf-8 -*- #!/usr/bin/env python # ============================================================================= # # Simple dialogs # # Created: Sat Jul 9 15:16:06 2016 # by: unodit 0.5 # ============================================================================= import uno import unohelper from ...
gpl-3.0
jtacoma/geometriki
setup.py
1
2796
# This file is part of geometriki. # # geometriki 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, or (at your option) any later version. # # geometriki is distributed ...
agpl-3.0
davgibbs/django
tests/validators/tests.py
163
16552
# -*- coding: utf-8 -*- from __future__ import unicode_literals import io import os import re import types from datetime import datetime, timedelta from unittest import TestCase from django.core.exceptions import ValidationError from django.core.validators import ( BaseValidator, EmailValidator, MaxLengthValidato...
bsd-3-clause
dariubs/simplite.py
pylite/simplite.py
1
2957
# -*- coding: utf-8 -*- """ pylite ~~~~~~~~~ :copyright: (c) 2014 by Dariush Abbasi. :license: MIT, see LICENSE for more details. """ import sqlite3 #Intract with sqlite3 in python as simple as it can be. class Pylite: #first argument is name of database that store in same name file on disk def __init__(self,d...
mit
jcrugzz/lpvisualization
dbindexer/backends.py
74
18859
from django.db import models from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import JOIN_TYPE, LHS_ALIAS, LHS_JOIN_COL, \ TABLE_NAME, RHS_JOIN_COL from django.utils.tree import Node from djangotoolbox.fields import ListField from .lookups import StandardLookup OR = 'OR' #...
bsd-3-clause
iansf/sky_engine
build/android/pylib/device_settings.py
21
6455
# Copyright 2014 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 logging from pylib import constants from pylib import content_settings from pylib.device import device_errors _LOCK_SCREEN_SETTINGS_PATH = '/data/sy...
bsd-3-clause
katiewsimon/JP-Morgan-Hackathon-Project
jp_server/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
304
15086
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
mit
AuyaJackie/odoo
openerp/workflow/service.py
378
4972
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-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
hinerm/ITK
Wrapping/Generators/Python/Tests/ThresholdSegmentationLevelSetImageFilter.py
13
4206
#========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
yjydmlh/zerorpc-python
zerorpc/gevent_zmq.py
22
8249
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
mit
laginha/yard
src/yard/utils/swagger.py
1
4937
from yard.consts import RESOURCE_VERSION_RE from yard.consts.swagger import ( SWAGGER_CONSUMES, SWAGGER_PRODUCES, SWAGGER_RESPONSES_DEFINITIONS, SWAGGER_SECURITY_DEFINITIONS, SWAGGER_SECURITY, SWAGGER_TAGS, SWAGGER_EXTERNAL_DOCS, SWAGGER_DEFINITIONS, SWAGGER_PARAMETERS_DEFINITIONS, SWAGGER_INFO) from ...
mit
neerajvashistha/pa-dude
lib/python2.7/site-packages/six.py
2715
30098
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including with...
mit
revolutionaryG/phantomjs
src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_shuffle_test.py
3023
12549
#!/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 of...
bsd-3-clause
holdenk/spark
python/pyspark/conf.py
8
7831
# # 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
coderbone/SickRage
lib/markupsafe/__init__.py
701
10338
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
gpl-3.0
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/unidecode/x057.py
252
4631
data = ( 'Guo ', # 0x00 'Yin ', # 0x01 'Hun ', # 0x02 'Pu ', # 0x03 'Yu ', # 0x04 'Han ', # 0x05 'Yuan ', # 0x06 'Lun ', # 0x07 'Quan ', # 0x08 'Yu ', # 0x09 'Qing ', # 0x0a 'Guo ', # 0x0b 'Chuan ', # 0x0c 'Wei ', # 0x0d 'Yuan ', # 0x0e 'Quan ', # 0x0f 'Ku ', # 0x10 'F...
apache-2.0
wrouesnel/ansible
lib/ansible/cli/doc.py
11
22570
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed i...
gpl-3.0
praneethkumarpidugu/matchmaking
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py
2919
3678
######################## 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
rohitw1991/frappe
frappe/tests/test_translation.py
37
2218
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt import frappe, unittest, os import frappe.translate # class TestTranslations(unittest.TestCase): # def test_doctype(self, messages=None): # if not messages: # messages = frappe.translate.get_messages_from_doct...
mit
pdubroy/kurt
build/MacOS/PyInstaller/pyinstaller-svn-r812/hooks/hook-vtkpython.py
4
1321
# Copyright (C) 2005, Giovanni Bajo # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, 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 2 # of the...
gpl-2.0
unho/translate
translate/convert/html2po.py
1
3329
# -*- coding: utf-8 -*- # # Copyright 2004-2006 Zuza Software Foundation # # This file is part of translate. # # translate 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 # ...
gpl-2.0
CVML/hyperopt
hyperopt/tpe.py
8
30055
""" Graphical model (GM)-based optimization algorithm using Theano """ __authors__ = "James Bergstra" __license__ = "3-clause BSD License" __contact__ = "github.com/jaberg/hyperopt" import logging import time import numpy as np from scipy.special import erf import pyll from pyll import scope from pyll.stochastic imp...
bsd-3-clause
robertnishihara/ray
python/ray/util/sgd/torch/examples/image_models/util.py
3
1155
import random import os from os.path import join import numpy as np import PIL def mock_data(train_dir, val_dir): os.makedirs(train_dir, exist_ok=True) os.makedirs(val_dir, exist_ok=True) max_cls_n = 99999999 total_classes = 3 per_cls = max_cls_n // total_classes max_img_n = 99999999 to...
apache-2.0
singleman/linux
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
misterdanb/micropython
tests/basics/try_finally1.py
100
1110
print("noexc-finally") try: print("try") finally: print("finally") print("noexc-finally-finally") try: print("try1") try: print("try2") finally: print("finally2") finally: print("finally1") print() print("noexc-finally-func-finally") def func2(): try: print("try2") ...
mit
jalama/drupdates
drupdates/constructors/reports.py
1
1322
""" Parent class for plugins that print Drupdates final report. """ from drupdates.settings import Settings from drupdates.plugins import Plugin import abc class Reports(Plugin): """ Class for print reports. """ def __init__(self): # load the Plugin _plugins property self.settings = Settings()...
mit
nzavagli/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/plat-irix6/FILE.py
66
11296
# Generated by h2py from /usr/include/sys/file.h from warnings import warnpy3k warnpy3k("the FILE module has been removed in Python 3.0", stacklevel=2) del warnpy3k # Included from standards.h # Included from sys/types.h # Included from sgidefs.h _MIPS_ISA_MIPS1 = 1 _MIPS_ISA_MIPS2 = 2 _MIPS_ISA_MIPS3 = 3 _MIPS_ISA_...
mit
florian-dacosta/OpenUpgrade
addons/crm/wizard/crm_phonecall_to_meeting.py
381
2704
# -*- 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
garmoncheg/django-form-designer
form_designer/migrations/0002_auto__chg_field_formdefinitionfield_initial.py
9
6102
# encoding: utf-8 from form_designer.settings import VALUE_PICKLEFIELD DATA_FIELD_TYPE = 'picklefield.fields.PickledObjectField' if VALUE_PICKLEFIELD else 'django.db.models.fields.TextField' import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(Schem...
bsd-3-clause
luzheqi1987/nova-annotation
nova/tests/unit/test_ipv6.py
111
3452
# Copyright (c) 2011 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 applicab...
apache-2.0
dhylands/micropython
tests/wipy/time.py
67
2937
import time DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def is_leap(year): return (year % 4) == 0 def test(): seconds = 0 wday = 5 # Jan 1, 2000 was a Saturday for year in range(2000, 2049): print("Testing %d" % year) yday = 1 for month in range(1, ...
mit
tianweizhang/nova
nova/api/openstack/compute/contrib/server_external_events.py
18
6835
# Copyright 2014 Red Hat, 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 law or agre...
apache-2.0
richardcs/ansible
lib/ansible/modules/network/vyos/vyos_interface.py
22
13740
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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
knehez/edx-platform
common/djangoapps/enrollment/errors.py
35
1273
"""All Error Types pertaining to Enrollment.""" class CourseEnrollmentError(Exception): """Generic Course Enrollment Error. Describes any error that may occur when reading or updating enrollment information for a user or a course. """ def __init__(self, msg, data=None): super(CourseEnrollmen...
agpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/distutils/file_util.py
70
8131
"""distutils.file_util Utility functions for operating on single files. """ __revision__ = "$Id$" import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = {None: 'copying', 'hard': 'hard linking', ...
mit
M4573R/BuildingMachineLearningSystemsWithPython
ch10/chapter.py
20
4997
import numpy as np import mahotas as mh image = mh.imread('scene00.jpg') from matplotlib import pyplot as plt plt.imshow(image) plt.show() image = mh.colors.rgb2grey(image, dtype=np.uint8) plt.imshow(image) # Display the image plt.gray() thresh = mh.thresholding.otsu(image) print('Otsu threshold is {}.'.format(thresh)...
mit
Snifer/BurpSuite-Plugins
Sqlmap/tamper/lowercase.py
7
1044
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.data import kb from lib.core.enums import PRIORITY __priority__ = PRIORITY.NORMAL def dependencies(): pass def tamper(payload, **kwargs): "...
gpl-2.0
elioth010/lugama
activate/lib/python3.4/site-packages/pip/cmdoptions.py
239
14701
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parses general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this de...
gpl-2.0
slisson/intellij-community
python/lib/Lib/pickle.py
86
44800
"""Create portable serialized representations of Python objects. See module cPickle for a (much) faster implementation. See module copy_reg for a mechanism for registering custom picklers. See module pickletools source for extensive comments. Classes: Pickler Unpickler Functions: dump(object, file) ...
apache-2.0
surgebiswas/poker
PokerBots_2017/Johnny/numpy/f2py/capi_maps.py
46
31657
#!/usr/bin/env python """ Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2005/05/06 10:57:33 $ Pearu Peterson...
mit
vtemian/buffpy
buffpy/tests/test_api.py
1
2882
import json from unittest.mock import patch, MagicMock import httpretty import pytest from buffpy.api import API from buffpy.exceptions import BuffpyRestException MOCKED_RESPONSE = MagicMock(content=json.dumps({"status": "ok"})) def test_api_get_request(): """ Should call Buffer for a given GET request. """ ...
mit
chrys87/orca-beep
test/keystrokes/firefox/line_nav_lists_broken.py
2
2760
#!/usr/bin/python from macaroon.playback import * import utils sequence = MacroSequence() #sequence.append(WaitForDocLoad()) sequence.append(PauseAction(5000)) # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather than manually. sequence.append(KeyComboAction("<Con...
lgpl-2.1
roryyorke/python-control
examples/pvtol-lqr.py
3
6908
# pvtol_lqr.m - LQR design for vectored thrust aircraft # RMM, 14 Jan 03 # # This file works through an LQR based design problem, using the # planar vertical takeoff and landing (PVTOL) aircraft example from # Astrom and Murray, Chapter 5. It is intended to demonstrate the # basic functionality of the python-control p...
bsd-3-clause
astrellon/Rouge
python/htmlOutput.py
1
9869
import luaDocs; import re; import xml.etree.ElementTree as ET import string; class HtmlOutput: header = """ <head> <title>$title</title> <link rel='stylesheet' type='text/css' href='../css/styles.css'/> </head> """; class_body = """ <div class='class_bod...
mit
Narcolapser/automatic-fiesta
WebFiesta.py
1
3484
try: import usocket as socket except: import socket from machine import Pin import time import gc CONTENT = b"""HTTP/1.0 200 OK Content-Type: text/html <html> <head> <title>{0}</title> </head> <body> {1} </body> </html> """ class WebFiesta: def __init__(self,content=None,port=8080,host="0.0.0.0",blocking=True): ...
apache-2.0
gauribhoite/personfinder
env/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## 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...
apache-2.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/django_extensions/templatetags/highlighting.py
4
3266
""" 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...
agpl-3.0
jtorrents/networkx
networkx/__init__.py
21
1905
""" NetworkX ======== NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. https://networkx.lanl.gov/ Using ----- Just write in Python >>> import networkx as nx >>> G=nx.Graph() >>> G.add_edge(1,2) ...
bsd-3-clause
pawelidziak/smoveyProject
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
1843
1786
#!/usr/bin/env python # 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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
mit
omula/easybuild-easyblocks
easybuild/easyblocks/i/ipp.py
4
3046
## # Copyright 2009-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
eddieruano/SentinelGreen
StartMaid.py
1
1435
# -*- coding: utf-8 -*- # @Author: Eddie Ruano # @Date: 2017-06-16 12:57:01 # @Last Modified by: Eddie Ruano # @Last Modified time: 2017-06-16 13:43:23 import os, os.path import logging import sys import time from pathlib import Path def main(): LogLevel = logging.DEBUG ## Change this later LogLoca...
apache-2.0
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/functools.py
68
28681
"""functools.py - Tools for working with functions and callable objects """ # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. # Written by Nick Coghlan <ncoghlan at gmail.com>, # Raymond Hettinger <python at rcn.com>, # and Łukasz Langa <lukasz...
lgpl-3.0
apache/infrastructure-puppet
modules/mboxer/files/tools/archive.py
3
8860
#!/usr/bin/env python3 # -*- 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, ...
apache-2.0
emonty/ansible-modules-core
network/nxos/nxos_snmp_traps.py
20
15396
#!/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
fengyuanjs/catawampus
tr/vendor/bup/lib/bup/hashsplit.py
8
5668
import math from bup import _helpers from bup.helpers import * BLOB_MAX = 8192*4 # 8192 is the "typical" blob size for bupsplit BLOB_READ_SIZE = 1024*1024 MAX_PER_TREE = 256 progress_callback = None fanout = 16 GIT_MODE_FILE = 0100644 GIT_MODE_TREE = 040000 GIT_MODE_SYMLINK = 0120000 assert(GIT_MODE_TREE != 40000) ...
apache-2.0
libcrosswind/libcrosswind
platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/encodings/koi8_u.py
593
14018
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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_table) def decode(self,input,errors='stri...
gpl-3.0
espadrine/opera
chromium/src/third_party/python_26/Lib/random.py
53
31938
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
bsd-3-clause
geometalab/drf-utm-zone-info
tests/viewset_test.py
1
2145
import pytest from django.contrib.gis.geos import Polygon from rest_framework import status from rest_framework.reverse import reverse from rest_framework.test import APIClient import utm_zone_info def test_posting_valid_data_returns_utm_zones(mocker, api_client, utm_zone_post_url, payload): utm_zone_mock = mock...
isc
anielsen001/scipy
scipy/cluster/hierarchy.py
2
96514
""" ======================================================== Hierarchical clustering (:mod:`scipy.cluster.hierarchy`) ======================================================== .. currentmodule:: scipy.cluster.hierarchy These functions cut hierarchical clusterings into flat clusterings or find the roots of the forest f...
bsd-3-clause
YanTangZhai/tf
tensorflow/python/ops/clip_ops.py
10
9155
# Copyright 2015 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 required by applicable law or a...
apache-2.0
IoThinks/selfdrivingcar
exemple code/domotique/Loop_SerialArduino.py
2
3639
#!/usr/bin/env python # -*- coding: latin-1 -*- #Execution Auto dans le fichier etc\rc.local import http.client, urllib.parse #import urllib.request #import urllib.parse import datetime import csv from time import time,sleep,strftime import RPi.GPIO as GPIO import os import signal import sys import serial ######...
apache-2.0
APMonitor/arduino
5_Moving_Horizon_Estimation/2nd_order_nonlinear/Python_GEKKO/tclab_mhe_2nd_order_semi-empirical.py
1
7987
import numpy as np import time import matplotlib.pyplot as plt import random # get gekko package with: # pip install gekko from gekko import GEKKO # get tclab package with: # pip install tclab from tclab import TCLab # Connect to Arduino a = TCLab() # Final time tf = 10 # min # number of data poin...
apache-2.0
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/08_image_keras/flowersmodel/task.py
8
3939
# Copyright 2017 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 required by applicable law or a...
apache-2.0
bkendzior/scipy
scipy/special/tests/test_orthogonal.py
12
29053
from __future__ import division, print_function, absolute_import import numpy as np from numpy import array, sqrt from numpy.testing import (TestCase, assert_array_almost_equal, assert_almost_equal, assert_allclose, assert_raises, run_module_suite) from scipy._lib...
bsd-3-clause
pe-suke/ansible
lib/ansible/new_inventory/__init__.py
170
11156
# (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
golismero/golismero-devel
plugins/report/bson.py
8
2924
#!/usr/bin/env python # -*- coding: utf-8 -*- __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 redistribute it and/or modify it under the terms of...
gpl-2.0
MridulS/sympy
sympy/logic/tests/test_dimacs.py
17
3926
"""Various tests on satisfiability using dimacs cnf file syntax You can find lots of cnf files in ftp://dimacs.rutgers.edu/pub/challenge/satisfiability/benchmarks/cnf/ """ from sympy.logic.utilities.dimacs import load from sympy.logic.algorithms.dpll import dpll_satisfiable from sympy.utilities.pytest import skip de...
bsd-3-clause
Jumpscale/jumpscale_core8
lib/JumpScale/tools/cuisine/systemservices/kvm/Disks.py
1
1286
from JumpScale import j class Disks: """This class give you access to disk related actions from the kvm sal over cuisine""" def __init__(self, controller): self._controller = controller self._storage_controller = j.sal.kvm.StorageController(controller) def create(self, pool, name, size=...
apache-2.0
Neamar/django
django/core/management/commands/diffsettings.py
479
1565
from django.core.management.base import BaseCommand def module_to_dict(module, omittable=lambda k: k.startswith('_')): """Converts a module namespace to a Python dictionary.""" return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)} class Command(BaseCommand): help = """Displays diff...
bsd-3-clause
ryfeus/lambda-packs
Spacy/source2.7/spacy/tests/test_underscore.py
1
3181
# coding: utf-8 from __future__ import unicode_literals import pytest from mock import Mock from ..vocab import Vocab from ..tokens.doc import Doc from ..tokens.underscore import Underscore def test_create_doc_underscore(): doc = Mock() doc.doc = doc uscore = Underscore(Underscore.doc_extensions, doc) ...
mit
drjeep/django
tests/template_tests/filter_tests/test_date.py
207
2534
from datetime import datetime, time from django.template.defaultfilters import date from django.test import SimpleTestCase from django.utils import timezone from ..utils import setup from .timezone_utils import TimezoneTestCase class DateTests(TimezoneTestCase): @setup({'date01': '{{ d|date:"m" }}'}) def t...
bsd-3-clause
zakuro9715/lettuce
tests/integration/lib/Django-1.2.5/django/db/backends/postgresql_psycopg2/base.py
45
8198
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql.operations import DatabaseOperations as Postgresq...
gpl-3.0
vmindru/ansible
lib/ansible/utils/unicode.py
158
1166
# (c) 2012-2014, Toshio Kuratomi <a.badger@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
almarklein/bokeh
bokeh/models/mappers.py
34
1948
""" Models for mapping values from one range or space to another. """ from __future__ import absolute_import from ..plot_object import PlotObject from ..properties import Float, Color, Enum, Seq from ..enums import Palette from .. import palettes class ColorMapper(PlotObject): """ Base class for color mapper typ...
bsd-3-clause
DaanHoogland/cloudstack
test/integration/component/maint/test_high_availability.py
4
37662
#!/usr/bin/env python # 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 # "Li...
apache-2.0
DianaDespa/marian-train
scripts/embeddings/prepare_corpus.py
3
2335
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import sys import argparse import subprocess import json UNK = '<unk>' EOS = '</s>' def main(): args = parse_user_args() print("Loading vocabulary") ext = os.path.splitext(args.vocab)[1] if ext == ".json"...
mit
bfaludi/riwo
riwo/dialects/sqlalchemy.py
1
4178
from __future__ import absolute_import import daprot.mapper import sqlalchemy.engine.base import sqlalchemy.exc from sqlalchemy import * from .. import ( Reader as AbstractReader, Writer as AbstractWriter, exceptions ) class Reader(AbstractReader): # void def __init__(self, connection, schema, offs...
gpl-3.0
UrLab/incubator
incubator/urls.py
1
1688
from django.urls import include, path from django.contrib import admin import incubator.views import incubator.apiurls from incubator import settings import redir.views import events.views import incubator.views import space.views urlpatterns = [ path('', incubator.views.home, name='home'), path('spaceapi.js...
agpl-3.0
anish/buildbot
master/buildbot/test/unit/test_steps_maxq.py
1
2646
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
clinton-hall/nzbToMedia
libs/common/unidecode/x0cc.py
253
4749
data = ( 'jjyim', # 0x00 'jjyib', # 0x01 'jjyibs', # 0x02 'jjyis', # 0x03 'jjyiss', # 0x04 'jjying', # 0x05 'jjyij', # 0x06 'jjyic', # 0x07 'jjyik', # 0x08 'jjyit', # 0x09 'jjyip', # 0x0a 'jjyih', # 0x0b 'jji', # 0x0c 'jjig', # 0x0d 'jjigg', # 0x0e 'jjigs', # 0x0f 'jjin',...
gpl-3.0
jjmiranda/edx-platform
common/djangoapps/contentserver/admin.py
27
1455
""" Django admin page for CourseAssetCacheTtlConfig, which allows you to configure the TTL that gets used when sending cachability headers back with request course assets. """ from django.contrib import admin from config_models.admin import ConfigurationModelAdmin from .models import CourseAssetCacheTtlConfig, CdnUserA...
agpl-3.0
tonybaloney/st2
contrib/packs/tests/test_action_download.py
1
14697
#!/usr/bin/env python # 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 "Licens...
apache-2.0
kalahbrown/HueBigSQL
desktop/core/ext-py/Django-1.6.10/django/conf/locale/sr_Latn/formats.py
235
1981
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y.' TIME_FORMAT = 'H:i' DATE...
apache-2.0
fahhem/openhtf
test/phase_descriptor_test.py
2
3434
# Copyright 2016 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 required by applicable law or agre...
apache-2.0
serge-sans-paille/pythran
pythran/transformations/expand_globals.py
1
4931
""" ExpandGlobals replaces globals variables by function call. It also turn globals assignment in function definition. """ from pythran.analyses import LocalNameDeclarations from pythran.passmanager import Transformation from pythran.syntax import PythranSyntaxError from pythran.utils import path_to_attr from pythran...
bsd-3-clause
Debian/openjfx
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
2
7440
# Copyright (c) 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 of conditions and the...
gpl-2.0
hycis/Pynet
pynet/learning_method.py
1
2765
__author__ = "Zhenzhou Wu" __copyright__ = "Copyright 2012, Zhenzhou Wu" __credits__ = ["Zhenzhou Wu"] __license__ = "3-clause BSD" __email__ = "hyciswu@gmail.com" __maintainer__ = "Zhenzhou Wu" import theano import theano.tensor as T floatX = theano.config.floatX import numpy as np class LearningMethod(object): ...
apache-2.0
croxis/SpaceDrive
spacedrive/renderpipeline/toolkit/pathtracing_reference/get_brightness.py
1
1110
from __future__ import division, print_function def approx(roughness): alpha = roughness * roughness return 1.0 - 0.5 * roughness from panda3d.core import PNMImage, Vec3 import os for i in range(11): r = i / 10.0 fname = "batch_compare/Gold-R" + str(r) + ".png" img = PNMImage(fnam...
mit
3DRudder/3DRudderPython
sample_01.py
1
8564
##################################################################################### # # Sample 01 - This sample presents the basic Function of the SDK. # # Python 3.5.2 # # SDK 3dRudder # # Copyright (C) 2016-2017 3dRudder # ##################################################################################### imp...
mit
xxshutong/openerp-7.0
openerp/service/web_services.py
20
30750
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
gietal/Stocker
stocker/Robinhood.py
1
10781
import getpass import json import requests import urllib import sys class Robinhood: endpoints = { "login": "https://api.robinhood.com/api-token-auth/", "investment_profile": "https://api.robinhood.com/user/investment_profile/", "accounts":"https://api.robinhood.com/accounts/...
mit