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
ypwalter/fxos-certsuite
mcts/webapi_tests/runner.py
6
5731
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import importlib import inspect import os import sys import json from fnmatch im...
mpl-2.0
papouso/odoo
addons/account_anglo_saxon/purchase.py
427
2043
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/encodings/latin_1.py
853
1264
""" Python 'latin-1' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
lgpl-3.0
krasin/distcc
include_server/statistics.py
26
5225
#! /usr/bin/python2.4 # # Copyright 2007 Google 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 License, or (at your option) any later version. # # This program...
gpl-2.0
EDUlib/edx-platform
lms/djangoapps/course_api/api.py
1
9596
""" Course API """ import logging import search from django.conf import settings from django.contrib.auth.models import AnonymousUser, User # lint-amnesty, pylint: disable=imported-auth-user from django.urls import reverse from edx_django_utils.monitoring import function_trace from edx_when.api import get_dates_for_c...
agpl-3.0
kxliugang/edx-platform
lms/djangoapps/shoppingcart/admin.py
102
5401
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
agpl-3.0
Gagaro/django
tests/raw_query/tests.py
119
12624
from __future__ import unicode_literals from datetime import date from django.db.models.query_utils import InvalidQuery from django.test import TestCase, skipUnlessDBFeature from .models import Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, Reviewer class RawQueryTests(TestCase): @classmethod def setUp...
bsd-3-clause
Vitallium/qtwebkit
Tools/QueueStatusServer/model/queuepropertymixin.py
143
1888
# 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
mmardini/django
django/utils/tzinfo.py
97
3923
"Implementation of tzinfo classes for use with datetime.datetime." from __future__ import unicode_literals from datetime import timedelta, tzinfo import time import warnings from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING ...
bsd-3-clause
bobbyluig/Eclipse
src/agility/maestro.py
1
14308
import logging import os import re import time import serial from serial import SerialTimeoutException import struct from threading import Lock from serial.tools import list_ports logger = logging.getLogger('universe') class Maestro: """ Implementation of the controller for Pololu Mini Maestro Controller. ...
mit
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/databrowse/plugins/fieldchoices.py
252
3856
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.text import capfirst from django.utils.encoding import smart_str, force_unico...
bsd-3-clause
hlzz/dotfiles
graphics/VTK-7.0.0/Examples/VisualizationAlgorithms/Python/officeTubes.py
1
12926
#!/usr/bin/env python # This example demonstrates the use of streamlines generated from seeds, # combined with a tube filter to create several streamtubes. import vtk from vtk.util.misc import vtkGetDataRoot from vtk.util.colors import * VTK_DATA_ROOT = vtkGetDataRoot() # We read a data file the is a CFD a...
bsd-3-clause
tangfeixiong/nova
nova/api/metadata/password.py
66
2255
# Copyright 2012 Nebula, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
pplatek/odoo
openerp/addons/base/res/res_lang.py
196
12383
# -*- 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
retorquere/zotero-better-bibtex
util/rebalance.py
1
4472
#!/usr/bin/env python3 import os import sys import json from munch import Munch import re from ortools.algorithms import pywrapknapsack_solver ref, output = sys.argv[1:] if not ref.startswith('refs/heads/'): print(ref, 'is not a branch') sys.exit(0) branch = ref.split('/')[-1] print('rebalance', branch, '=>', ou...
mit
cysnake4713/odoo
addons/l10n_ve/__openerp__.py
119
3056
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved ############################################################################## # Modu...
agpl-3.0
andela-angene/coursebuilder-core
coursebuilder/modules/gen_sample_data/gen_sample_data.py
3
14095
# 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 ...
apache-2.0
dennis-sheil/commandergenius
project/jni/python/src/Lib/unittest.py
55
31107
#!/usr/bin/env python ''' Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's Smalltalk testing framework. This module contains the core framework classes that form the basis of specific test cases and suites (TestCase, TestSuite etc.), and also a text-based utility class for running the tests ...
lgpl-2.1
upfluence/thrift
test/py/TestEof.py
99
4327
#!/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 # "L...
apache-2.0
cloudbase/maas
src/maas/tests/test_maas.py
1
3335
# Copyright 2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Test the maas package.""" from __future__ import ( absolute_import, print_function, unicode_literals, ) str = None __metaclass__ = type __all__ = [] from imp...
agpl-3.0
awslabs/chalice
chalice/app.py
1
57505
"""Chalice app and routing code.""" # pylint: disable=too-many-lines,ungrouped-imports import re import sys import os import logging import json import traceback import decimal import base64 import copy from collections import defaultdict __version__ = '1.15.1' _PARAMS = re.compile(r'{\w+}') # Implementation note: ...
apache-2.0
sameerparekh/pants
tests/python/pants_test/base/test_source_root.py
1
11740
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import uni...
apache-2.0
open-power/op-test-framework
common/OpTestUtil.py
1
89212
#!/usr/bin/env python2 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/common/OpTestUtil.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2015 # [+] International Business Machines Corp. # # # Licensed under the Apache License, Versio...
apache-2.0
mbedmicro/mbed
drivers/tests/TESTS/host_tests/usb_device_hid.py
13
24283
""" mbed SDK Copyright (c) 2019 ARM Limited SPDX-License-Identifier: Apache-2.0 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 ap...
apache-2.0
XiaodunServerGroup/ddyedx
lms/djangoapps/bulk_email/tasks.py
12
33434
""" This module contains celery task functions for handling the sending of bulk email to a course. """ import re import random import json from time import sleep from dogapi import dog_stats_api from smtplib import SMTPServerDisconnected, SMTPDataError, SMTPConnectError, SMTPException from boto.ses.exceptions import (...
agpl-3.0
ashutrix03/inteygrate_flaskapp-master
google/protobuf/unittest_mset_wire_format_pb2.py
43
3837
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_mset_wire_format.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.pr...
gpl-3.0
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/encodings/cp855.py
272
33850
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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'): ...
lgpl-3.0
discosultan/quake-console
Samples/Sandbox/Lib/encodings/cp1252.py
594
13767
""" Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.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,in...
mit
ofilipowicz/owndb
owndb/settings.py
1
3421
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) SECRET_KEY = 'lv^ce%zv9ppcl(v-mix+-&x2q#1mtq3@qxl==_bvyqy-k9soru' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['127.0.0.1', 'localhost'] CRISPY_TEMPLATE_PACK = 'bootstrap3' INSTALL...
mit
PrashantJalan/Mail-Cat
dict_create.py
3
1060
import os from collections import Counter from collections import OrderedDict import nltk from nltk.tokenize import * from nltk.probability import * def main(): ran = range(3) d_file = open('dictionary2').readlines() dict_key = [] dict_occ = [] for line in d_file: tmp = line.strip() tmp = tmp.split() ...
apache-2.0
fauferoth/assignment
.mywaflib/waflib/extras/c_dumbpreproc.py
5
1647
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Dumb C/C++ preprocessor for finding dependencies It will look at all include files it can find after removing the comments, so the following will always add the dependency on both "a.h" and "b.h":: #include "a.h" #ifdef B #include "b.h" ...
bsd-3-clause
tadashi-aikawa/gemini
tests/addons/reqs2reqs/test_add.py
1
3227
#!/usr/bin/env python # -*- coding:utf-8 -*- from jumeaux.addons.reqs2reqs.add import Executor from jumeaux.models import Reqs2ReqsAddOnPayload class TestExec: def test(self): payload: Reqs2ReqsAddOnPayload = Reqs2ReqsAddOnPayload.from_dict( { "requests": [ ...
mit
zhufenggood/shadowsocks
shadowsocks/asyncdns.py
655
17416
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 r...
apache-2.0
afourmy/pyNMS
pyNMS/views/geographical_view.py
2
7551
# Copyright (C) 2017 Antoine Fourmy <antoine dot fourmy at gmail dot 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 Foundation. # # This program is distributed in the hope that it will be useful, # ...
gpl-3.0
KellyChan/Python
python/pygame/tetris/lib/shape.py
3
8684
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import pygame from pygame.locals import * import util class Tile: def __init__(self, color, image = None): self.color = color self.image = image class Shape(object): SHAPE_WIDTH = 4 SHAPE_HEIGHT = 4 SHAPES = ( ...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/atexit.py
336
1705
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] import sys _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in rev...
gpl-2.0
chafique-delli/OpenUpgrade
addons/l10n_fr_rib/__init__.py
433
1046
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
badele/home-assistant
homeassistant/components/isy994.py
1
7195
""" homeassistant.components.isy994 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Connects to an ISY-994 controller and loads relevant components to control its devices. Also contains the base classes for ISY Sensors, Lights, and Switches. For configuration details please visit the documentation for this component at https://home-a...
mit
DougFirErickson/qgisSpaceSyntaxToolkit
esstoolkit/external/pyqtgraph/graphicsItems/GraphicsWidgetAnchor.py
54
4080
from ..Qt import QtGui, QtCore from ..Point import Point class GraphicsWidgetAnchor(object): """ Class used to allow GraphicsWidgets to anchor to a specific position on their parent. The item will be automatically repositioned if the parent is resized. This is used, for example, to anchor a LegendIte...
gpl-3.0
thjashin/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_linear_operator_test.py
22
4097
# 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
os2webscanner/os2webscanner
django-os2webscanner/os2webscanner/migrations/0040_auto_20180711_1457.py
1
1657
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-07-11 12:57 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion import re class Migration(migrations.Migration): dependencies = [ ('os2webscanner', '00...
mpl-2.0
ksrajkumar/openerp-6.1
openerp/addons/base_report_designer/base_report_designer.py
9
3544
# -*- 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
aviciimaxwell/odoo
addons/l10n_cr/__openerp__.py
178
3140
# -*- encoding: utf-8 -*- ############################################################################## # # __openerp__.py # l10n_cr_account # First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv...
agpl-3.0
Edraak/edraak-platform
lms/djangoapps/courseware/tests/test_date_summary.py
1
39412
# -*- coding: utf-8 -*- """Tests for course home page date summary blocks.""" from datetime import datetime, timedelta from unittest import expectedFailure import ddt import waffle from django.contrib.messages.middleware import MessageMiddleware from django.urls import reverse from django.test import RequestFactory fr...
agpl-3.0
twalthr/flink
flink-python/pyflink/table/examples/batch/word_count.py
7
2909
################################################################################ # 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...
apache-2.0
yanheven/nova
nova/api/openstack/compute/image_metadata.py
17
4909
# Copyright 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 requ...
apache-2.0
pyblish/pyblish-mindbender
mindbender/vendor/jsonschema/_format.py
7
6861
import datetime import re import socket from .compat import str_types from .exceptions import FormatError class FormatChecker(object): """ A ``format`` property checker. JSON Schema does not mandate that the ``format`` property actually do any validation. If validation is desired however, instances ...
mit
T3chn3/HFP
webapp/cgi-bin/yate.py
22
1409
from string import Template def start_response(resp="text/html"): return('Content-type: ' + resp + '\n\n') def include_header(the_title): with open('templates/header.html') as headf: head_text = headf.read() header = Template(head_text) return(header.substitute(title=the_title)) def include_...
mit
metatoaster/mtj.eve.tracker
setup.py
1
1094
from setuptools import setup, find_packages import os version = '0.1' setup(name='mtj.eve.tracker', version=version, description="EVE Online Tracker", long_description=open("README.rst").read() + "\n" + open(os.path.join("docs", "HISTORY.rst")).read(), # Get more strings...
gpl-3.0
mavit/ansible
lib/ansible/modules/remote_management/cobbler/cobbler_system.py
30
10729
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ver...
gpl-3.0
xserty/piDS
Desktop/packages/rmutil/UnixDriveDetector.py
2
2004
import threading, sys, os, time, platform, getpass import wx if platform.system() == "Linux": from wx.lib.pubsub import setupkwargs from wx.lib.pubsub import pub as Publisher else: from wx.lib.pubsub import pub as Publisher if platform.system() == "Linux": if 'fedora' in platform.dist(): user =...
apache-2.0
funson/rt-xen
tools/python/xen/xend/uuid.py
48
2410
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
certik/hermes2d
doc/exts/math_dollar.py
29
1813
import re def process_dollars(app, docname, source): r""" Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or ...
gpl-2.0
TheNite/namebench
nb_third_party/dns/rdtypes/ANY/SOA.py
246
5180
# Copyright (C) 2003-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
commaai/panda
tests/gmlan_harness_test.py
1
1841
#!/usr/bin/env python3 import os import sys import time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) from panda import Panda # noqa: E402 WHITE_GMLAN_BUS = 3 OTHER_GMLAN_BUS = 1 def set_gmlan(p): if p.is_white(): p.set_gmlan(2) else: p.set_obd(True) def set_speed_kb...
mit
venthur/wyrm
test/test_variance.py
2
1975
from __future__ import division import unittest import numpy as np from wyrm.types import Data from wyrm.processing import variance from wyrm.processing import swapaxes class TestVariance(unittest.TestCase): def setUp(self): ones = np.ones((10, 5)) # epo with 0, 1, 2 data = np.array([0...
mit
jerem/django-rcsfield
rcsfield/backends/base.py
4
2535
""" Base-backends for django-rcsfield. Used to hold common functionality of all backends. Every backend module implementd a very simple API. Three functions are exported: * fetch(key, revision): knows how to fetch a specific revision of the entity referenced by ``key`` * commit(key, data): knows how to com...
bsd-3-clause
ygenc/onlineLDA
onlineldavb_new/build/scipy/build/lib.macosx-10.6-intel-2.7/scipy/sparse/sparsetools/csc.py
4
19953
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.1+capsulehack # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # This file is compatible with both classic and new-style classes. from sys import version_info if versio...
gpl-3.0
benjaminjkraft/django
django/conf/locale/ka/formats.py
504
2180
# -*- 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 = 'l, j F, Y' TIME_FORMAT = 'h:i a' ...
bsd-3-clause
LeoZ123/Machine-Learning-Practice
Neural_Network/NeuralNetwork.py
1
3201
''' Created on Mar 28, 2017 @author: Leo Zhong ''' import numpy as np # for metrics calculation #define functions def tanh(x): return np.tanh(x) def tanh_deriv(x): #derivative for tanh return 1.0 - np.tanh(x)*np.tanh(x) def logistic(x): return 1/(1 + np.exp(-x)) def logistic_derivative(x): #deriv...
mit
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/lib2to3/fixes/fix_filter.py
326
2107
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This...
mit
ShinyROM/android_external_chromium_org
third_party/protobuf/python/google/protobuf/internal/test_util.py
210
27885
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
olologin/scikit-learn
sklearn/gaussian_process/tests/test_kernels.py
24
11602
"""Testing for kernels for Gaussian processes.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Licence: BSD 3 clause from collections import Hashable from sklearn.externals.funcsigs import signature import numpy as np from sklearn.gaussian_process.kernels import _approx_fprime from sklearn.metrics...
bsd-3-clause
meln1k/marathon
tests/system/test_marathon_universe.py
2
3834
"""Marathon acceptance tests for DC/OS.""" import common import pytest import retrying import shakedown from datetime import timedelta from dcos import packagemanager, cosmos PACKAGE_NAME = 'marathon' SERVICE_NAME = 'marathon-user' DCOS_SERVICE_URL = shakedown.dcos_service_url(PACKAGE_NAME) WAIT_TIME_IN_SECS = 300 ...
apache-2.0
jhawkesworth/ansible
lib/ansible/modules/network/sros/sros_config.py
24
11717
#!/usr/bin/python # # Copyright: 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': ['preview'],...
gpl-3.0
theheros/kbengine
kbe/res/scripts/common/Lib/encodings/mac_arabic.py
37
37165
""" Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.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='st...
lgpl-3.0
gdrouart/MrMoose
example_6z.py
1
6743
""" Example to generate a .fit, .mod and .dat file to feed in MrMoose for demonstration. The model consists of one single power-laws and two black bodies, with 15 data points. All is a mixture of unresolved and blended/spatially identified components, with the black bodies being at different redshifts (z=2 and z=4)...
gpl-3.0
sangwonl/audi
audi/external/babel/messages/catalog.py
32
31061
# -*- coding: utf-8 -*- """ babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ Data structures for message catalogs. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import re import time from cgi import parse_header from datetime import datetime, time as time_...
mit
kou/zulip
zerver/webhooks/opsgenie/view.py
2
2877
from typing import Any, Dict from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zerver.models import Us...
apache-2.0
Southpaw-TACTIC/Team
src/python/Tools/Scripts/xxci.py
12
2914
#! /usr/bin/env python # xxci # # check in files for which rcsdiff returns nonzero exit status import sys import os from stat import * import fnmatch EXECMAGIC = '\001\140\000\010' MAXSIZE = 200*1024 # Files this big must be binaries and are skipped. def getargs(): args = sys.argv[1:] if a...
epl-1.0
Turbo87/unp
unp.py
1
14021
import os import re import sys import tempfile import mimetypes import subprocess import click FILENAME = object() OUTPUT_FOLDER = object() unpackers = [] def register_unpacker(cls): unpackers.append(cls) return cls def fnmatch(pattern, filename): filename = os.path.basename(os.path.normcase(filename...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_mmap.py
68
27117
from test.support import (TESTFN, run_unittest, import_module, unlink, requires, _2G, _4G, gc_collect, cpython_only) import unittest import os import re import itertools import socket import sys import weakref # Skip test if we can't import mmap. mmap = import_module('mmap') PAGESIZE = mmap....
gpl-2.0
arbn/pysaml2
src/saml2/attribute_converter.py
1
15064
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) s2010-2011 Umeå University # # 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/LICENS...
bsd-2-clause
francois-berder/PyLetMeCreate
letmecreate/core/led.py
1
4150
#!/usr/bin/env python3 """Python binding of LED wrapper of LetMeCreate library.""" import ctypes _LIB = ctypes.CDLL('libletmecreate_core.so') LED_0 = 0x01 LED_1 = 0x02 LED_2 = 0x04 LED_3 = 0x08 LED_4 = 0x10 LED_5 = 0x20 LED_6 = 0x40 LED_HEARTBEAT = LED_7 = 0x80 ALL_LEDS = 0xFF LED_CNT = 8 ON_OFF_MODE = 0 TIMER_MOD...
bsd-3-clause
hfp/tensorflow-xsmm
tensorflow/contrib/solvers/python/kernel_tests/util_test.py
25
4551
# 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
CloudVLab/professional-services
tools/kunskap/config.py
2
1957
# Copyright 2019 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 law or agreed to in writing, ...
apache-2.0
admetricks/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/networktransaction.py
190
2926
# 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 ...
bsd-3-clause
ulrich3110/mfc
deb-binarys/builds/mfc1_1.0-5/mfc1-1.0/debian/tmp/usr/share/mfc/mfc1/unity.py
8
9734
#!/usr/bin/python # -*- coding: utf-8 -*- # With the MindfulClock you turn your device into a Bell of Mindfulness. # Concept, Design: Marcurs Möller # <marcus.moeller@outlook.com> # <http://apps.microsoft.com/windows/de-de/app/ # mindfulclock/58063160-9cc6-4dee-9d92-...
gpl-3.0
rtiwariops/rain
nodejs/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
1569
23354
#!/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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
apache-2.0
tanglei528/glance
glance/tests/functional/test_api.py
2
11437
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
rebost/django
tests/regressiontests/localflavor/cz/tests.py
14
2844
from __future__ import unicode_literals from django.contrib.localflavor.cz.forms import (CZPostalCodeField, CZRegionSelect, CZBirthNumberField, CZICNumberField) from django.core.exceptions import ValidationError from django.test import SimpleTestCase class CZLocalFlavorTests(SimpleTestCase): def test_CZRegi...
bsd-3-clause
gevero/deap
examples/ga/onemax_multidemic.py
12
3208
# This file is part of DEAP. # # DEAP 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 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
lgpl-3.0
kanagasabapathi/python-for-android
python3-alpha/python3-src/Lib/test/test_strlit.py
48
5040
r"""Test correct treatment of various string literals by the parser. There are four types of string literals: 'abc' -- normal str r'abc' -- raw str b'xyz' -- normal bytes br'xyz' -- raw bytes The difference between normal and raw strings is of course that in a raw string, \ escapes (while still u...
apache-2.0
jasonzio/azure-linux-extensions
OSPatching/test/handler.py
8
17930
#!/usr/bin/python # # OSPatching extension # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
eaplatanios/tensorflow
tensorflow/python/ops/variable_scope.py
2
98348
# 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
bmaluenda/switch
switch_mod/operations/unitcommit/fuel_use.py
1
16280
# Copyright 2015 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ This module describes fuel use with considerations of unit commitment and incremental heat rates using piecewise linear expressions. If you want to use this module directly in a ...
apache-2.0
iuliat/nova
nova/tests/functional/libvirt/test_numa_servers.py
45
6782
# Copyright (C) 2015 Red Hat, 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...
apache-2.0
dparlevliet/zelenka-report-storage
server-local/twisted/python/test/test_versions.py
33
10680
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.versions}. """ from __future__ import division, absolute_import import sys import operator from io import BytesIO from twisted.python.versions import getVersionString, IncomparableVersions from twisted.python.vers...
lgpl-3.0
OpenFacetracker/facetracker-core
lib/youtube-dl/youtube_dl/extractor/unistra.py
146
2119
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import qualities class UnistraIE(InfoExtractor): _VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)' _TESTS = [ { 'url': 'http://utv.unistra.fr/video.php?id_v...
gpl-2.0
JioCloud/nova
nova/api/openstack/compute/plugins/v3/extended_availability_zone.py
36
2533
# Copyright 2013 Netease, LLC. # 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
rossgoodwin/drgonzo
en/wordnet/wordnet.py
11
41682
# Module wordnet.py # # Original author: Oliver Steele <steele@osteele.com> # Project Page: http://sourceforge.net/projects/pywordnet # # Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under # the Artistic License # <http://www.opensource.org/licenses/artistic-license.html> """An OO interface to the WordN...
mit
chafique-delli/OpenUpgrade
addons/crm_project_issue/project_issue.py
380
2373
from openerp.osv import osv, fields class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ _name = "crm.lead2projectissue.wizard" _inherit = 'crm.partner.binding' _columns = { "lead_id": fields.many2one("crm....
agpl-3.0
onpon4/naev
utils/econsim/datreader/readers.py
20
3932
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=80: import os try: from lxml import etree as ET except ImportError: try: import xml.etree.cElementTree as ET except ImportError: try: import xml.etree.ElementTree as ET except ImportError: print "Failed to ...
gpl-3.0
robinandeer/chanjo
chanjo/cli/init.py
1
2340
# -*- coding: utf-8 -*- import codecs from distutils.spawn import find_executable import logging import click from path import Path import ruamel.yaml from chanjo.store.api import ChanjoDB from chanjo.init.bootstrap import pull, BED_NAME, DB_NAME from chanjo.init.demo import setup_demo, DEMO_BED_NAME LOG = logging.g...
mit
rlefevre1/hpp-rbprm-corba
script/scenarios/demos/siggraph_asia/spiderman/spiderman_backJump_interp.py
2
3619
#/usr/bin/env python # author: Mylene Campana (mcampana@laas.fr) # Script which goes with hpp-rbprm-corba package. from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.problem_solver import ProblemSolver from hpp.gepetto import Viewe...
lgpl-3.0
stjokro/Project-1
project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
912
3325
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
bsd-3-clause
laurent-george/weboob
modules/liberation/pages/article.py
10
2024
# -*- coding: utf-8 -*- # Copyright(C) 2013 Florent Fourcot # # This file is part of weboob. # # weboob 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 op...
agpl-3.0
artlucas/django-notification-twilio
django-notification-twilio.py
1
2277
# -*- coding: utf-8 -*- from django.conf import settings from django.utils.translation import ugettext from notification import backends MOBILE_NUMBER_SETTING_KEY = "NOTIFICATION_TWILIO_USER_MOBILE_NUMBER" TWILIO_ACCOUNT_SETTING_KEY = "TWILIO_ACCOUNT_SID" TWILIO_AUTH_SETTING_KEY = "TWILIO_AUTH_TOKEN" TWILIO_FROM_SETT...
bsd-3-clause
RMKD/networkx
doc/source/conf.py
22
7150
# -*- coding: utf-8 -*- # # Sphinx documentation build configuration file, created by # sphinx-quickstart.py on Sat Mar 8 21:47:50 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickl...
bsd-3-clause
pypa/pip
tests/unit/test_index.py
4
28915
import logging import pytest from pip._vendor.packaging.specifiers import SpecifierSet from pip._internal.index.collector import LinkCollector from pip._internal.index.package_finder import ( CandidateEvaluator, CandidatePreferences, FormatControl, LinkEvaluator, PackageFinder, _check_link_req...
mit