repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
timduru/platform-external-chromium_org
third_party/python_gflags/gflags2man.py
407
18864
#!/usr/bin/env python # Copyright (c) 2006, 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 l...
bsd-3-clause
ckishimo/napalm-junos
test/unit/TestJunOSDriver.py
4
5191
# -*- coding: utf-8 -*- # Copyright 2015 Spotify AB. All rights reserved. # # The contents of this file are 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/LICE...
apache-2.0
UCSD-AUVSI/Heimdall
Recognition/ColorClassifier/PythonColorClassifier/ColorClassifier/Python/main.py
1
3405
import cv2 import math import numpy as np import pickle import sys import os import platform def getColor(color, testCode): print "starting Get Color" try: PATH = "Recognition/ColorClassifier/PythonColorClassifier/ColorClassifier/Python/" color_db=pickle.load(open(PATH+"color_db.p","rb")) except : print "Exce...
gpl-3.0
catroot/rethinkdb
external/gtest_1.7.0/test/gtest_xml_output_unittest.py
1815
14580
#!/usr/bin/env python # # Copyright 2006, 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...
agpl-3.0
Antiun/bank-statement-reconcile
account_statement_base_import/__openerp__.py
14
3018
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joel Grand-Guillaume # Copyright 2011-2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
p0psicles/SickRage
lib/feedparser/__init__.py
41
2011
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistribut...
gpl-3.0
ewmoore/numpy
setup.py
1
7204
#!/usr/bin/env python """NumPy: array processing for numbers, strings, records, and objects. NumPy is a general-purpose array-processing package designed to efficiently manipulate large multi-dimensional arrays of arbitrary records without sacrificing too much speed for small multi-dimensional arrays. NumPy is built ...
bsd-3-clause
ovilab/lammps
tools/i-pi/ipi/tests/test_io.py
41
3225
"""Deals with testing the io system. Copyright (C) 2013, Joshua More and Michele Ceriotti This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any lat...
gpl-2.0
Elettronik/SickRage
lib/lockfile/linklockfile.py
45
2650
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class LinkLockFile(LockBase): """Lock access to a file using atomic property of link(2). >>> lock = LinkLockFile('somefile') >>> lock = LinkL...
gpl-3.0
abhishek-ch/hue
desktop/core/ext-py/Django-1.6.10/django/utils/itercompat.py
113
1099
""" Providing iterator functions that are not in all version of Python we support. Where possible, we try to use the system-native version and only fall back to these implementations if necessary. """ import collections import itertools import sys import warnings def is_iterable(x): "A implementation independent...
apache-2.0
MuhammadVT/davitpy
davitpy/pydarn/dmapio/rst/setup.py
7
1146
# Copyright (C) 2012 VT SuperDARN Lab # Full license can be found in LICENSE.txt # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any la...
gpl-3.0
tbjoern/adventofcode
One/script.py
1
1159
file = open("input.txt", "r") input = file.next() sequence = input.split(", ") class walker: def __init__(self): self.east = 0 self.south = 0 self.facing = 0 self.tiles = {} def turnL(self): if self.facing == 0: self.facing = 3 else: self.facing -= 1 def turnR(self): i...
mit
lepistone/stock-logistics-workflow
__unported__/stock_move_backdating/stock.py
4
4008
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 BREMSKERL-REIBBELAGWERKE EMMERLING GmbH & Co. KG # Author Marco Dieckhoff # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free so...
agpl-3.0
DonBeo/scikit-learn
sklearn/utils/tests/test_class_weight.py
14
6559
import numpy as np from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.uti...
bsd-3-clause
neilh10/micropython
tools/make-frozen.py
34
1275
#!/usr/bin/env python # # Create frozen modules structure for MicroPython. # # Usage: # # Have a directory with modules to be frozen (only modules, not packages # supported so far): # # frozen/foo.py # frozen/bar.py # # Run script, passing path to the directory above: # # ./make-frozen.py frozen > frozen.c # # Include ...
mit
CLVsol/odoo_addons
clv_seedling/batch_history/clv_seedling_batch_history.py
1
2387
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
schmunk42/compose
compose/config/interpolation.py
3
3229
from __future__ import absolute_import from __future__ import unicode_literals import logging from string import Template import six from .errors import ConfigurationError from compose.const import COMPOSEFILE_V2_0 as V2_0 log = logging.getLogger(__name__) class Interpolator(object): def __init__(self, temp...
apache-2.0
boneyao/sentry
src/sentry/migrations/0146_auto__add_field_auditlogentry_ip_address.py
36
29197
# -*- 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 field 'AuditLogEntry.ip_address' db.add_column('sentry_auditlogentry', 'ip_address', ...
bsd-3-clause
dfang/odoo
addons/account/models/company.py
9
7291
# -*- coding: utf-8 -*- from odoo import fields, models, api, _ from datetime import timedelta class ResCompany(models.Model): _inherit = "res.company" #TODO check all the options/fields are in the views (settings + company form view) fiscalyear_last_day = fields.Integer(default=31, required=True) f...
agpl-3.0
MFoster/breeze
django/contrib/gis/db/models/sql/query.py
209
5406
from django.db import connections from django.db.models.query import sql from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import aggregates as gis_aggregates from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField from django.contri...
bsd-3-clause
MattRijk/django-ecomsite
lib/python2.7/site-packages/django/core/management/commands/inspectdb.py
30
10340
from __future__ import unicode_literals import keyword import re from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict class Command(NoArgsCommand): help = "Intro...
cc0-1.0
rubencabrera/odoo
addons/sale_journal/sale_journal.py
276
4290
# -*- 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
what-studio/profiling
test/test_tracing.py
1
1802
# -*- coding: utf-8 -*- import sys import pytest from _utils import factorial, find_stats, foo from profiling.stats import RecordingStatistics from profiling.tracing import TracingProfiler def test_setprofile(): profiler = TracingProfiler() assert sys.getprofile() is None with profiler: assert s...
bsd-3-clause
Phil9l/cosmos
code/artificial_intelligence/src/naive_bayes/gaussian_naive_bayes.py
3
1370
# example using iris dataset # Part of Cosmos by OpenGenus import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.model_selection import train_test_split from sklearn.naive_bayes import GaussianNB from sklearn.metrics import classification_report, confusion_matrix dataset = pd.read_csv("ir...
gpl-3.0
itmoss/Libjingle
swtoolkit/lib/TestFramework.py
18
11615
#!/usr/bin/python2.4 # 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...
gpl-2.0
AstroHuntsman/POCS
pocs/focuser/birger.py
1
16549
import io import re import serial import time import glob from pocs.focuser.focuser import AbstractFocuser # Birger adaptor serial numbers should be 5 digits serial_number_pattern = re.compile('^\d{5}$') # Error codes should be 'ERR' followed by 1-2 digits error_pattern = re.compile('(?<=ERR)\d{1,2}') error_message...
mit
edmorley/django
tests/model_fields/test_booleanfield.py
62
4543
from django import forms from django.core.exceptions import ValidationError from django.db import IntegrityError, models, transaction from django.test import SimpleTestCase, TestCase from .models import BooleanModel, FksToBooleans, NullBooleanModel class BooleanFieldTests(TestCase): def _test_get_prep_value(self...
bsd-3-clause
NL66278/odoo
addons/website_gengo/__init__.py
316
1024
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
Dhivyap/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_net_info.py
12
11676
#!/usr/bin/python # # This is a 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. # # This Ansible library is distributed in the hope that i...
gpl-3.0
queria/my-tempest
tempest/api/compute/servers/test_list_server_filters.py
1
13183
# 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
SnappleCap/oh-mainline
vendor/packages/zope.interface/src/zope/interface/tests/test_verify.py
22
4553
############################################################################## # # Copyright (c) 2001, 2002 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. # TH...
agpl-3.0
Cactuslegs/audacity-of-nope
lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/xlc.py
330
1175
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_xlc(conf): cc=conf.find_program(['xlc_r','xlc'],var='CC') cc=conf.cmd_to_list(cc) conf.g...
gpl-2.0
dushu1203/chromium.src
components/cronet/tools/extract_from_jars.py
76
1385
#!/usr/bin/env python # # 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 fnmatch import optparse import os import sys REPOSITORY_ROOT = os.path.abspath(os.path.join( os.path.dirname(__file__), '...
bsd-3-clause
linuxmidhun/0install
zeroinstall/cmd/remove_feed.py
1
1066
""" The B{0install remove-feed} command-line interface. """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. syntax = "[INTERFACE] FEED" from zeroinstall import SafeException, _ from zeroinstall.injector import model, writer from zeroinstall.cmd import add_feed, U...
lgpl-2.1
lrocheWB/navitia
source/tyr/tyr/command/build_data.py
12
1883
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/mimetypes.py
83
20735
"""Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=True) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=True) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list ...
gpl-2.0
oscaro/django
django/contrib/flatpages/tests/test_forms.py
111
4042
from __future__ import unicode_literals from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.test import TestCase, override_settings from django.utils import translation @override_settings(SITE_ID=1) class FlatpageAd...
bsd-3-clause
lifeinoppo/littlefishlet-scode
RES/REF/python_sourcecode/ipython-master/IPython/lib/inputhookglut.py
29
6104
# coding: utf-8 """ GLUT Inputhook support functions """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file...
gpl-2.0
catapult-project/catapult-csm
telemetry/telemetry/internal/browser/browser_unittest.py
1
11913
# Copyright 2012 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 import os import re import shutil import tempfile import unittest from telemetry.core import exceptions from telemetry import decorators from...
bsd-3-clause
helixyte/TheLMA
thelma/repositories/rdb/mappers/experimentjob.py
1
1080
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Experiment job mapper. """ from sqlalchemy.orm import relationship from everest.repositories.rdb.utils import mapper from thelma.entities.experiment import ...
mit
pkimber/old_story
example/wsgi.py
2
1053
""" WSGI config for app project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` sett...
apache-2.0
ujuo/opencv
opencv-3.2.0/platforms/android/build-tests/test_ndk_build.py
6
5109
#!/usr/bin/env python import unittest import os, sys, subprocess, argparse, shutil, re TEMPLATE_ANDROID_MK = '''\ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) {cut} LOCAL_MODULE := mixed_sample LOCAL_SRC_FILES := {cpp1} LOCAL_LDLIBS += -llog -ldl include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) {cut} L...
gpl-3.0
unsiloai/syntaxnet-ops-hack
tensorflow/contrib/keras/api/keras/applications/xception/__init__.py
57
1148
# 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
SeanEstey/Bravo
app/notify/tasks.py
1
7873
'''app.notify.tasks''' import json, os, pytz from os import environ as env from datetime import datetime, date, time, timedelta from dateutil.parser import parse from bson import ObjectId as oid from flask import g, render_template from app import get_keys, celery #, smart_emit from app.lib.dt import to_local from app....
gpl-2.0
ramon-astudillo/lxmls-toolkit
lxmls/pos_tagging/all_train_pos_tag.py
2
3145
import sys import codecs from sequences.sequence import * from sequences.sequence_list import * import readers.pos_corpus as pcc import readers.brown_pos_corpus as bpc import sequences.extended_feature as exfc import sequences.structured_perceptron as spc import sequences.confusion_matrix as bcm MAX_SENT_SIZE = 1000 ...
mit
tashaxe/Red-DiscordBot
lib/youtube_dl/extractor/sportbox.py
24
2253
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import js_to_json class SportBoxEmbedIE(InfoExtractor): _VALID_URL = r'https?://news\.sportbox\.ru/vdl/player(?:/[^/]+/|\?.*?\bn?id=)(?P<id>\d+)' _TESTS = [{ 'url': 'http://news.sportbox....
gpl-3.0
eunchong/build
third_party/twisted_10_2/twisted/words/im/pbsupport.py
55
9661
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """L{twisted.words} support for Instance Messenger.""" from __future__ import nested_scopes from twisted.internet import defer from twisted.internet import error from twisted.python import log from twisted.python.failure import Failur...
bsd-3-clause
vilorious/pyload
module/web/pyload_app.py
33
15873
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This prog...
gpl-3.0
tuxofil/Gps2Udp
misc/server/gps2udp.py
1
5891
#!/usr/bin/env python """ Receive Geo location data from the Gps2Udp Android application via UDP/IP and forward them to the stdout line by line. There is some requirements to a valid incoming packet: - it must be of form: TIMESTAMP LATITUDE LONGITUDE ACCURACY [other fields]; - TIMESTAMP is a Unix timestamp (seconds s...
bsd-2-clause
evewspace/eve-wspace
evewspace/Alerts/tasks.py
5
1651
# Eve W-Space # Copyright 2014 Andrew Austin and contributors # # 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 requi...
apache-2.0
Puppet-Finland/trac
files/spam-filter/tracspamfilter/captcha/keycaptcha.py
1
4322
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Dirk Stöcker <trac@dstoecker.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software...
bsd-2-clause
tombstone/models
research/domain_adaptation/domain_separation/grl_ops.py
16
1124
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
dbmi-pitt/EvidenceType-Calculator
source/evidence_type_calculator/languages/de.py
4
10534
# -*- coding: utf-8 -*- { '!langcode!': 'de', '!langname!': 'Deutsch (DE)', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "feld1=\'newvalue\'". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden',...
apache-2.0
anthonybishopric/pyboxfs
fs/errors.py
2
10848
""" Defines the Exception classes thrown by PyFilesystem objects. Exceptions relating to the underlying filesystem are translated in to one of the following Exceptions. Exceptions that relate to a path store that path in `self.path`. All Exception classes are derived from `FSError` which can be used as a catch-all exc...
bsd-3-clause
nmearl/pyqtgraph
pyqtgraph/widgets/ColorMapWidget.py
34
9933
from ..Qt import QtGui, QtCore from .. import parametertree as ptree import numpy as np from ..pgcollections import OrderedDict from .. import functions as fn __all__ = ['ColorMapWidget'] class ColorMapWidget(ptree.ParameterTree): """ This class provides a widget allowing the user to customize color mapping ...
mit
thiagopena/PySIGNFe
pysignfe/nfse/bhiss/v10/SubstituicaoNfse.py
1
1459
# -*- coding: utf-8 -*- from pysignfe.xml_sped import * class InfSubstituicaoNfse(XMLNFe): def __init__(self): super(InfSubstituicaoNfse, self).__init__() self.Id = TagCaracter(nome=u'InfSubstituicaoNfse', propriedade=u'Id', raiz=u'/') self.NfseSubstituidora = TagInteiro(nome=u'NfseSubstit...
lgpl-2.1
xyguo/scikit-learn
sklearn/decomposition/nmf.py
6
46993
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck # Mathieu Blondel <mathieu@mblondel.org> # Tom Dupre la Tour # Author: Chih-Jen Lin, National Taiwan University (original projected gradient # NMF implementation) # ...
bsd-3-clause
thopiekar/Cura
plugins/VersionUpgrade/VersionUpgrade21to22/MachineInstance.py
3
7993
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import configparser #To read config files. import io #To write config files to strings as if they were files. import os.path #To get the path to write new user profiles to. from typing import Dict, List, Optional, Set, Tupl...
lgpl-3.0
bobisme/odoo
addons/delivery/partner.py
383
1404
# -*- 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
ckane/crits
crits/config/database_example.py
17
1635
# This is an example file. You should copy this to "database.py" and # make your changes there. # Modifying this example file will not change the settings that CRITs uses. # MongoDB connection information MONGO_HOST = 'localhost' # server to connect to MONGO_PORT = 27017 # port MongoD is running on MO...
mit
shsingh/ansible
lib/ansible/module_utils/network/eos/config/lldp_interfaces/lldp_interfaces.py
19
7085
# -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The eos_lldp_interfaces class It is in this file where the current configuration (as dict) is compared to the provided configuration (as dict) and the command set necessary...
gpl-3.0
panyam/libgraph
libgraph/graphs.py
1
2606
class Edge(object): def __init__(self, source, target, data = None): self._source, self._target, self.data = source, target, data def __repr__(self): return "Edge<%s <-> %s>" % (repr(self.source), repr(self.target)) @property def source(self): return self._source @property de...
apache-2.0
dydek/django
tests/gis_tests/geoapp/test_serializers.py
245
3731
from __future__ import unicode_literals import json from django.contrib.gis.geos import LinearRing, Point, Polygon from django.core import serializers from django.test import TestCase, mock, skipUnlessDBFeature from django.utils import six from .models import City, MultiFields, PennsylvaniaCity @skipUnlessDBFeatur...
bsd-3-clause
shanemcd/ansible
lib/ansible/utils/module_docs_fragments/infinibox.py
210
1564
# # (c) 2016, Gregory Shulov <gregory.shulov@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 l...
gpl-3.0
Hardslog/android_kernel_asus_ze551kl
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
gameduell/duell
bin/win/python2.7.9/Lib/distutils/command/bdist_msi.py
164
35191
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005, 2006 Martin von Löwis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst """ Implements the bdist_msi command. """ import sys, os from sysconfig import get_python_version from distutils.core import Command from...
bsd-2-clause
googleapis/googleapis-gen
google/cloud/billing/v1/billing-v1-py/google/cloud/billing_v1/types/__init__.py
1
1795
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
ononeor12/python-social-auth
social/backends/behance.py
70
1581
""" Behance OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/behance.html """ from social.backends.oauth import BaseOAuth2 class BehanceOAuth2(BaseOAuth2): """Behance OAuth authentication backend""" name = 'behance' AUTHORIZATION_URL = 'https://www.behance.net/v2/oauth/authenticate'...
bsd-3-clause
hlzz/dotfiles
graphics/VTK-7.0.0/Rendering/Volume/Testing/Python/volRCClipPlanes.py
2
3843
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Simple volume rendering example. reader = vtk.vtkSLCReader() reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/sphere.slc") reader.Update() # Create transfer functions f...
bsd-3-clause
minhphung171093/GreenERP_V7
openerp/addons/mail/tests/test_mail_features.py
22
49719
# -*- 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
pavlovml/tensorflow
tensorflow/python/training/queue_runner_test.py
5
6835
"""Tests for QueueRunner.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import tensorflow.python.platform import tensorflow as tf class QueueRunnerTest(tf.test.TestCase): def testBasic(self): with self.test_session() as sess: ...
apache-2.0
bplancher/odoo
addons/event/models/event_mail.py
6
5812
# -*- coding: utf-8 -*- from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, tools _INTERVALS = { 'hours': lambda interval: relativedelta(hours=interval), 'days': lambda interval: relativedelta(days=interval), 'weeks': lambda interval: r...
agpl-3.0
openstack/nova
nova/tests/functional/db/test_compute_node.py
3
11359
# 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 # d...
apache-2.0
Serag8/Bachelor
google_appengine/google/appengine/ext/key_range/__init__.py
13
28453
#!/usr/bin/env python # # Copyright 2007 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 o...
mit
wuxue/altanalyze
mpmath/calculus/quadrature.py
17
38274
import math from ..libmp.backend import xrange class QuadratureRule(object): """ Quadrature rules are implemented using this class, in order to simplify the code and provide a common infrastructure for tasks such as error estimation and node caching. You can implement a custom quadrature rule by ...
apache-2.0
morissette/devopsdays-hackathon-2016
venv/lib/python2.7/site-packages/botocore/vendored/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...
gpl-3.0
hanshuoziyan/llvm-pred
scripts/freqavg.py
4
2663
#!/usr/bin/python3 # 通过Value-To-Edge 和 Edge 来比较差异. 使用算数平均. # using equation: # $\frac {pred - real} {min(pred, real)}$ import argparse import re def perror(*args, **keys): from sys import stderr print(file=stderr, *args, **keys) exit(-1) def calc_average(v2e_map, e_map): print("### following predic...
gpl-3.0
KyleAMoore/KanjiNani
Android/.buildozer/android/platform/build/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a/kivy/examples/canvas/canvas_stress.py
21
2146
''' Canvas stress ============= This example tests the performance of our Graphics engine by drawing large numbers of small squares. You should see a black canvas with buttons and a label at the bottom. Pressing the buttons adds small colored squares to the canvas. ''' from kivy.uix.button import Button from kivy.ui...
gpl-3.0
cmelange/ansible
lib/ansible/executor/module_common.py
22
38218
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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...
gpl-3.0
danielneis/osf.io
framework/mongo/handlers.py
22
2745
# -*- coding: utf-8 -*- import logging import pymongo from flask import g from werkzeug.local import LocalProxy from website import settings logger = logging.getLogger(__name__) def get_mongo_client(): """Create MongoDB client and authenticate database. """ client = pymongo.MongoClient(settings.DB_HO...
apache-2.0
Just-D/chromium-1
tools/telemetry/third_party/gsutilz/third_party/boto/boto/sqs/messageattributes.py
159
2487
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2014 Amazon.com, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, i...
bsd-3-clause
angelapper/edx-platform
common/djangoapps/util/tests/test_milestones_helpers.py
3
5370
""" Tests for the milestones helpers library, which is the integration point for the edx_milestones API """ import ddt from django.conf import settings from milestones.exceptions import InvalidCourseKeyException, InvalidUserException from mock import patch from milestones import api as milestones_api from milestones....
agpl-3.0
nalaswad/nalaswad-closure
closure/bin/build/jscompiler_test.py
27
3602
#!/usr/bin/env python # # Copyright 2013 The Closure Library 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 ...
apache-2.0
akarol/cfme_tests
cfme/tests/cloud_infra_common/test_html5_vm_console.py
1
8156
# -*- coding: utf-8 -*- """Test for HTML5 Remote Consoles of VMware/RHEV/RHOSP Providers.""" import pytest import imghdr import time import re from cfme.cloud.provider.openstack import OpenStackProvider from cfme.common.provider import CloudInfraProvider from cfme.infrastructure.provider.virtualcenter import VMwarePro...
gpl-2.0
mitar/django
django/contrib/admin/templatetags/log.py
99
2119
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
bsd-3-clause
guymers/containers_by_bazel
scripts/debian/extract_dependencies.py
2
1179
import re import sys with open(sys.argv[1], "r") as f: i = 0 for line in f: line = line.strip() if not line: continue if i == 1: match = re.search(r'name = "(.+)",$', line) name = match.group(1) if match else None if not name: raise Exception("Failed ...
apache-2.0
adsabs/citation_helper_service
citation_helper_service/citation_helper.py
1
1894
''' Created on Nov 1, 2014 @author: ehenneken ''' from __future__ import absolute_import # general module imports import sys import os import operator from itertools import groupby from flask import current_app from .utils import get_data from .utils import get_meta_data __all__ = ['get_suggestions'] def get_sugge...
mit
2014c2g3/0623exam
static/Brython3.1.0-20150301-090019/Lib/gc.py
743
3548
"""This module provides access to the garbage collector for reference cycles. enable() -- Enable automatic garbage collection. disable() -- Disable automatic garbage collection. isenabled() -- Returns true if automatic collection is enabled. collect() -- Do a full collection right now. get_count() -- Return the curren...
gpl-3.0
spaceof7/QGIS
python/plugins/processing/algs/grass7/ext/i_pansharpen.py
5
2139
# -*- coding: utf-8 -*- """ *************************************************************************** i_pansharpen.py --------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *******************************...
gpl-2.0
TheTimmy/spack
var/spack/repos/builtin/packages/miniamr/package.py
2
2528
############################################################################## # 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
linuxdaemon/CloudBot
plugins/minecraft_status.py
7
1373
import json import requests from cloudbot import hook @hook.command(autohelp=False) def mcstatus(reply): """- gets the status of various Mojang (Minecraft) servers""" try: request = requests.get("http://status.mojang.com/check") request.raise_for_status() except (requests.exceptions.HTT...
gpl-3.0
MaDKaTZe/phantomjs
src/breakpad/src/tools/gyp/pylib/gyp/MSVSNew.py
138
11514
#!/usr/bin/python2.4 # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """New implementation of Visual Studio project generation for SCons.""" import common import os import random # hashlib is supplied as of P...
bsd-3-clause
ran0101/namebench
nb_third_party/jinja2/exceptions.py
398
4530
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ class TemplateError(Exception): """Baseclass for all template errors.""" def __init__(self, message=None): i...
apache-2.0
yamt/neutron
quantum/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
2
5741
# Copyright (c) 2013 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
yzl0083/orange
Orange/OrangeWidgets/Classify/OWCN2.py
6
13020
""" <name>CN2</name> <description>Rule-based (CN2) learner/classifier.</description> <icon>icons/CN2.svg</icon> <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact> <priority>300</priority> """ from OWWidget import * import OWGUI, orange, orngCN2, sys from orngWrap import PreprocessedLearner NAME = "CN2"...
gpl-3.0
fenimore/freeebot
freeebot.py
1
5664
#!/usr/bin/env python """Twitter Bot for posting craigslist postings of Free Stuff Currently set up for New York. Example usage: python tweetstuffs.py Attributes: - NO_IMAGE -- link for when there is no image found - FILE -- path to tmp file - PATH -- current directory - C_KEY, C_SECRET, A_TOKEN,...
mit
disqus/django-mailviews
mailviews/tests/utils.py
5
2314
# flake8: noqa """ Backport of `django.test.utils.override_settings` from Django 1.3 and above. """ from functools import wraps from django.conf import settings, UserSettingsHolder class override_settings(object): """ Acts as either a decorator, or a context manager. If it's a decorator it takes a functi...
apache-2.0
alhowaidi/cvmfsNDN
python/parser.py
6
4026
import math class Counter: def __init__(self, name, number, description): self.name = name self.description = description try: self.values = [int(number)] except ValueError: self.values = [0] def sum(self): counter = 0.0 for n in self.val...
bsd-3-clause
michelts/lettuce
tests/integration/lib/Django-1.2.5/django/core/cache/backends/locmem.py
46
4062
"Thread-safe in-memory cache backend." import time try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache from django.utils.synch import RWLock class CacheClass(BaseCache): def __init__(self, _, params): BaseCache.__init__(self, param...
gpl-3.0
mrpiracyPT/repository.mrpiracy
plugin.video.mrpiracy/resources/lib/js2py/legecy_translators/translator.py
96
5676
from flow import translate_flow from constants import remove_constants, recover_constants from objects import remove_objects, remove_arrays, translate_object, translate_array, set_func_translator from functions import remove_functions, reset_inline_count from jsparser import inject_before_lval, indent, dbg TOP_GLOBAL ...
gpl-2.0