repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
jameinel/juju
acceptancetests/assess_cloud.py
1
5335
#!/usr/bin/env python from argparse import ArgumentParser import logging from textwrap import dedent import yaml from deploy_stack import ( BootstrapManager, ) from jujupy import ( get_juju_home, ModelClient, FakeBackend, FakeControllerState, ) from jujupy.wait_condition import ( Condit...
agpl-3.0
Baumelbi/IntroPython2016
students/sheree/session_01/homework/LPTHW-EXC-06.py
3
1112
#exersize 6 - strings and text # here we set the placeholder in the var which is string and the placeholder is a num x = "There are %d types of people." % 10 binary = "binary" do_not = "don't" # here we set a var with two of our other vars and replace two placeholders with those vars y = "Those who know %s and those w...
unlicense
solashirai/edx-platform
openedx/core/djangoapps/content/course_structures/models.py
50
3140
""" Django ORM model specifications for the Course Structures sub-application """ import json import logging from collections import OrderedDict from model_utils.models import TimeStampedModel from util.models import CompressedTextField from xmodule_django.models import CourseKeyField, UsageKey logger = logging.get...
agpl-3.0
github-account-because-they-want-it/scrapy
tests/test_utils_signal.py
121
2741
from testfixtures import LogCapture from twisted.trial import unittest from twisted.python.failure import Failure from twisted.internet import defer, reactor from pydispatch import dispatcher from scrapy.utils.signal import send_catch_log, send_catch_log_deferred class SendCatchLogTest(unittest.TestCase): @defe...
bsd-3-clause
rnixx/python-for-android
pythonforandroid/recipes/icu/__init__.py
4
4654
import sh import os from os.path import join, isdir, exists from multiprocessing import cpu_count from pythonforandroid.recipe import Recipe from pythonforandroid.toolchain import shprint from pythonforandroid.util import current_directory, ensure_dir class ICURecipe(Recipe): name = 'icu4c' version = '57.1' ...
mit
fillycheezstake/MissionPlanner
Lib/site-packages/numpy/lib/function_base.py
53
108301
__docformat__ = "restructuredtext en" __all__ = ['select', 'piecewise', 'trim_zeros', 'copy', 'iterable', 'percentile', 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax', 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'av...
gpl-3.0
HtcLegacy/android_kernel_htc_pico
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
sunflyer/shadowsocks
shadowsocks/daemon.py
694
5602
#!/usr/bin/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 requi...
apache-2.0
molkoback/trackma
trackma/tracker/kodi.py
2
5404
# This file is part of Trackma. # # 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 program is distributed in the...
gpl-3.0
Jgarcia-IAS/SITE
addons/product/pricelist.py
8
25268
# -*- 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
alilotfi/django
tests/decorators/tests.py
58
14120
from functools import update_wrapper, wraps from unittest import TestCase from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test, ) from django.http import HttpRequest, HttpResponse, HttpResponseNotA...
bsd-3-clause
1mentat/fbgroupviz
fbpostdump.py
3
3139
import settings import time import codecs import argparse import dokuwiki as wiki import json, urllib2 def feed2wiki(cj,doc): for post in doc['data']: postdoc = unicode('') postdoc += wiki.headingthreadmode postdoc += wiki.heading2 try: postdoc += post['from']['name'] ...
mit
blueboxgroup/neutron
neutron/agent/l3_agent.py
1
2004
# Copyright (c) 2015 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 # # Unle...
apache-2.0
rudaoshi/neuralmachines
neural_machine/tasks/language/sequence_tagging/sequence_tagging_keras.py
3
6220
__author__ = 'Sun' from keras.models import Sequential, Graph from keras.layers.core import Dense, Dropout, Activation, TimeDistributedDense, Reshape, RepeatVector, Merge from keras.layers.embeddings import Embedding from keras.layers.recurrent import LSTM, GRU from keras.layers.wrappers import Bidirectional, TimeDist...
gpl-3.0
matiasb/django
django/contrib/gis/gdal/prototypes/srs.py
471
3513
from ctypes import POINTER, c_char_p, c_int, c_void_p from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import ( const_string_output, double_output, int_output, srs_output, string_output, void_output, ) # Shortcut generation for routines with known...
bsd-3-clause
Yannig/ansible
lib/ansible/modules/network/vyos/vyos_interface.py
2
13837
#!/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
a358003542/expython
expython/web/useragent.py
1
78946
#!/usr/bin/env python # -*- coding: utf-8 -*- # 将 RewriteEngine 模式打开RewriteEngine OnRewriteBase /# Rewrite 规则 判断用户浏览器类型,如果是手机就跳转到手机网站RewriteCond %{HTTP_USER_AGENT} # # "(baidu.Transcoder|mini|android|blackberry|googlebot-mobile|iemobile|Mobile|ipad|iphone|ipod|opera mobile|palmos|webos|ucweb|Windows Phone|Symbi...
mit
gangadharkadam/letzfrappe
frappe/desk/doctype/todo/todo.py
4
2484
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json from frappe.model.document import Document from frappe.utils import get_fullname class ToDo(Document): def validate(self): if self.is_new(): s...
mit
kwikteam/phy
phy/utils/tests/test_config.py
1
3568
# -*- coding: utf-8 -*- """Test config.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import logging from textwrap import dedent from pytest import fixture from traitlets import Float from ...
bsd-3-clause
dahlstrom-g/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_xrange.py
326
2699
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes xrange(...) into range(...).""" # Local imports from .. import fixer_base from ..fixer_util import Name, Call, consuming_calls from .. import patcomp class FixXrange(fixer_base.BaseFix): BM_...
apache-2.0
adambornak/AutoskloCarManagementSystem
node_modules/protractor/node_modules/jasmine/node_modules/jasmine-core/setup.py
191
1983
from setuptools import setup, find_packages, os import json with open('package.json') as packageFile: version = json.load(packageFile)['version'] setup( name="jasmine-core", version=version, url="http://pivotal.github.io/jasmine/", author="Pivotal Labs", author_email="jasmine-js@googlegroups.com...
mit
andreabduque/GAFE
main.py
1
1148
from functions.FE import FE from fitness import Classifier from sklearn.preprocessing import MinMaxScaler import numpy as np import pandas as pd import ga def testIris(): iris = pd.read_csv("data/iris.data", sep=",") irisAtts = iris.drop("class", 1) target = iris["class"] #Scale to [0,1] before expan...
mit
HKUST-SING/tensorflow
tensorflow/contrib/learn/python/learn/datasets/synthetic.py
120
6827
# 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
Zhongqilong/kbengine
kbe/src/lib/python/Lib/test/test_importlib/extension/test_finder.py
81
1317
from .. import abc from .. import util as test_util from . import util machinery = test_util.import_importlib('importlib.machinery') import unittest import warnings # XXX find_spec tests class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" def find_module(self, fullname): ...
lgpl-3.0
enthought/shiboken
tests/samplebinding/conversion_operator_test.py
6
1772
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under the terms...
gpl-2.0
michelts/lettuce
tests/integration/lib/Django-1.2.5/django/utils/http.py
43
4346
import re import sys import urllib from email.Utils import formatdate from django.utils.encoding import smart_str, force_unicode from django.utils.functional import allow_lazy ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"') def urlquote(url, safe='/'): """ A version of Python's urllib.quote() function t...
gpl-3.0
orenault/TestLink-API-Python-client
src/testlink/testlinkhelper.py
2
5714
#! /usr/bin/python # -*- coding: UTF-8 -*- # Copyright 2012-2017 Luiko Czub, TestLink-API-Python-client developers # # 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.ap...
apache-2.0
rtucker-mozilla/mozilla_inventory
adapters/KeyValueTree.py
1
6057
#!/usr/bin/python from django.core.management import setup_environ import settings setup_environ(settings) from systems.models import System, KeyValue from truth.models import Truth, KeyValue as TruthKeyValue import re from MacroExpansion import MacroExpansion class KeyValueTree: def __init__(self,search_string):...
bsd-3-clause
washingtonpost/datawrapper
test/api.test.py
3
4574
# # test script for Datawrapper API # import requests import os import json from random import randint import yaml config = yaml.load(open('../config.yaml').read()) domain = 'http://' + config['domain'] if 'DATAWRAPPER_DOMAIN' in os.environ: domain = os.environ['DATAWRAPPER_DOMAIN'] endpoint = domain + '/api/...
mit
sunzuolei/youtube-dl
youtube_dl/extractor/jove.py
177
3068
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate ) class JoveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)' _CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={vide...
unlicense
bearstech/ansible
contrib/inventory/nagios_livestatus.py
74
6768
#!/usr/bin/env python # (c) 2015, Yannig Perre <yannig.perre@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 ...
gpl-3.0
GitHublong/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/backends/postgis/operations.py
108
24998
import re from decimal import Decimal from django.conf import settings from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter from django.contrib.gi...
apache-2.0
zhanghenry/stocks
django/contrib/admin/sites.py
77
22052
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import NoRe...
bsd-3-clause
igordejanovic/textX
textx/exceptions.py
1
1547
class TextXError(Exception): def __init__(self, message, line=None, col=None, err_type=None, filename=None): super(TextXError, self).__init__(message.encode('utf-8')) self.line = line self.col = col self.err_type = err_type self.filename = filename se...
mit
kirca/OpenUpgrade
addons/google_spreadsheet/__openerp__.py
312
1710
# -*- 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
cgstudiomap/cgstudiomap
main/parts/odoo/openerp/report/custom.py
338
25091
# -*- 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...
agpl-3.0
sunny94/temp
sympy/matrices/expressions/tests/test_indexing.py
25
2185
from sympy import (symbols, MatrixSymbol, Symbol, MatPow, BlockMatrix, Identity, ZeroMatrix, ImmutableMatrix, eye, Sum) from sympy.utilities.pytest import raises k, l, m, n = symbols('k l m n', integer=True) i, j = symbols('i j', integer=True) W = MatrixSymbol('W', k, l) X = MatrixSymbol('X', l, m) Y = Matrix...
bsd-3-clause
ozburo/youtube-dl
youtube_dl/extractor/channel9.py
12
10284
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, ExtractorError, int_or_none, parse_iso8601, qualities, unescapeHTML, ) class Channel9IE(InfoExtractor): IE_DESC = 'Channel 9' IE_NAME = 'channel9' _VALID_URL = r'...
unlicense
alsrgv/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py
25
21071
# 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
Shiroy/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/helpconfig.py
180
5120
""" version info, help messages, tracing configuration. """ import py import pytest import os, sys def pytest_addoption(parser): group = parser.getgroup('debugconfig') group.addoption('--version', action="store_true", help="display pytest lib version and import information.") group._addoption(...
mpl-2.0
metatoaster/mtj.eve.tracker
mtj/eve/tracker/tests/test_sql.py
1
26464
from unittest import TestCase, TestSuite, makeSuite import zope.component from mtj.eve.tracker.backend import sql from mtj.eve.tracker.interfaces import ITrackerBackend from mtj.evedb.tests.base import init_test_db from .base import setUp, tearDown FUEL_NORMAL = 1 FUEL_REINFORCE = 4 STATE_UNANCHORED = 0 STATE_ANCH...
gpl-3.0
wong2/sentry
tests/sentry/web/frontend/test_release_webhook.py
20
2421
from __future__ import absolute_import import hashlib import hmac from django.core.urlresolvers import reverse from exam import fixture from mock import patch from sentry.models import ProjectOption from sentry.testutils import TestCase class ReleaseWebhookTest(TestCase): def setUp(self): super(Release...
bsd-3-clause
googleads/google-ads-python
examples/recommendations/apply_recommendation.py
1
2954
#!/usr/bin/env python # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
cemagg/sucem-fem
sandbox/pec_labels/dolfin_utils_meshconvert.py
1
47536
## Copyright (C) 2011 Stellenbosch University ## ## This file is part of SUCEM. ## ## SUCEM 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 v...
gpl-3.0
rmmh/kubernetes-contrib
diurnal/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
1138
3876
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
hradec/gaffer
python/GafferDispatchUI/DispatcherUI.py
4
12613
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2012-2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
bsd-3-clause
Intel-Corporation/tensorflow
tensorflow/python/debug/lib/debug_graphs_test.py
82
4301
# 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
freedomtan/workload-automation
wlauto/workloads/telemetry/__init__.py
2
11987
# Copyright 2015 ARM Limited # # 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 writin...
apache-2.0
closeio/mongoengine
mongoengine/common.py
1
2087
_class_registry_cache = {} def _import_class(cls_name): """Cache mechanism for imports. Due to complications of circular imports mongoengine needs to do lots of inline imports in functions. This is inefficient as classes are imported repeated throughout the mongoengine code. This is compounded ...
mit
neurodata/ndgrutedb
MR-OCP/upload/ocp_mri_upload.py
2
3809
#!/usr/bin/env python # Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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
ifermon/weatherPi
util/mk_dirs.py
2
7819
#!/usr/bin/python3 """\ The program groups files into directories based on a date field that is part of the file name. File names are assumed to have a format of nn-yyyymmddnnnnnnn.ccc where n is any integer, yyyy is the four digit year, mm is a two digit month, dd is a two digit day, and c ...
gpl-2.0
Grirrane/odoo
addons/sale_stock/__init__.py
8
1044
# -*- 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
rcarrillocruz/ansible
test/units/modules/network/ios/test_ios_command.py
62
4060
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
matuu/sgk
sgk/sgk/settings.py
1
5215
# -*- coding: utf-8 -*- # Django settings for sgk project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Matías Varela', 'matu.varela@gmail.com'), ) MANAGERS = ADMINS # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowe...
apache-2.0
NetMasterFlex/nmfrepo
python3/koans/about_dice_project.py
110
1852
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import random class DiceSet: def __init__(self): self._values = None @property def values(self): return self._values def roll(self, n): # Needs implementing! # Tip: random.randint(min, max) can b...
mit
eaas-framework/virtualbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py
11
5124
## @file # This file is used to define class objects of INF file [UserExtension] section. # It will consumed by InfParser. # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD Li...
gpl-2.0
40223142/CDA0629
static/Brython3.1.0-20150301-090019/Lib/abc.py
765
8057
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" from _weakrefset import WeakSet def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or der...
gpl-3.0
cdrooom/odoo
addons/point_of_sale/wizard/pos_open_statement.py
7
4153
# -*- 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
Swiftea/Crawler
crawler/crawler_domain.py
2
3007
#!/usr/bin/env python3 from time import time from os import path from crawler.swiftea_bot import data, module, links from crawler.crawler_base import Crawler from crawler.swiftea_bot.file_manager import FileManager from crawler.index.inverted_index_nosql import InvertedIndex from crawler.database.database_swiftea im...
gpl-3.0
liamgh/liamgreenhughes-sl4a-tf101
python/src/Demo/pdist/cvslib.py
47
10175
"""Utilities for CVS administration.""" import string import os import time import md5 import fnmatch if not hasattr(time, 'timezone'): time.timezone = 0 class File: """Represent a file's status. Instance variables: file -- the filename (no slashes), None if uninitialized lseen -- true if the ...
apache-2.0
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/scipy/misc/tests/test_pilutil.py
12
6980
from __future__ import division, print_function, absolute_import import os.path import tempfile import shutil import numpy as np import warnings import glob from numpy.testing import (assert_equal, dec, decorate_methods, TestCase, run_module_suite, assert_allclose, ...
mit
thiphariel/navitia
source/jormungandr/tests/traveler_profile_test.py
3
3180
# 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
thurt/arangodb
3rdParty/V8-4.3.61/build/gyp/test/mac/gyptest-loadable-module.py
146
1279
#!/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. """ Tests that a loadable_module target is built correctly. """ import TestGyp import os import struct import sys if sys.platform == 'dar...
apache-2.0
charbeljc/OCB
addons/mail/mail_group_menu.py
334
2631
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
5amfung/simpleflake
simpleflake/simpleflake.py
1
2047
import time import random import collections #: Epoch for simpleflake timestamps, starts at the year 2000 SIMPLEFLAKE_EPOCH = 946702800 #field lengths in bits SIMPLEFLAKE_TIMESTAMP_LENGTH = 41 SIMPLEFLAKE_RANDOM_LENGTH = 23 #left shift amounts SIMPLEFLAKE_RANDOM_SHIFT = 0 SIMPLEFLAKE_TIMESTAMP_SHIFT = 23 simpleflak...
mit
webeng/DeepLearningTutorials
code/py_bing_search.py
1
3533
import urllib2 import requests import pdb import time class PyBingException(Exception): pass class PyBingSearch(object): # QUERY_URL = 'https://api.datamarket.azure.com/Bing/Search/v1/Composite' \ # + '?Sources={}&Query={}&$top={}&$skip={}&$format={}' QUERY_URL = 'https://api.datamarket.azure.com...
bsd-3-clause
PatrickChrist/scikit-learn
sklearn/cluster/mean_shift_.py
96
15434
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
bsd-3-clause
lingkong7/vertx-web
vertx-web/src/test/sockjs-protocol/venv/lib/python2.7/site-packages/ws4py/framing.py
14
8986
# -*- coding: utf-8 -*- import array import os import struct from ws4py.exc import FrameTooLargeException, ProtocolException # Frame opcodes defined in the spec. OPCODE_CONTINUATION = 0x0 OPCODE_TEXT = 0x1 OPCODE_BINARY = 0x2 OPCODE_CLOSE = 0x8 OPCODE_PING = 0x9 OPCODE_PONG = 0xa __all__ = ['Frame'] class Frame(obj...
apache-2.0
tomkralidis/QGIS
python/user.py
12
3333
# -*- coding: utf-8 -*- """ *************************************************************************** user.py --------------------- Date : January 2015 Copyright : (C) 2015 by Nathan Woodrow Email : woodrow dot nathan at gmail dot com ********************...
gpl-2.0
rtindru/django
django/conf/locale/lv/formats.py
504
1906
# -*- 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 = r'Y. \g\a\d\a j. F' TIME_FORMAT = ...
bsd-3-clause
BaySchoolCS2/Golem
golemUtils.py
1
2656
def breakUp(data): punctuation = '-,.:;[]&*!()=+<>?"' words = data.replace("\n\n", " ").replace("\n", " ").lower() #Makes the input text all lowercase and divides it into individual words for char in punctuation: words = words.replace(char, "") #Removes all of the puncuation listed above words ...
mit
spacelis/node-gyp
gyp/pylib/gyp/generator/ninja.py
372
89149
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common impo...
mit
vasyarv/edx-platform
lms/djangoapps/class_dashboard/urls.py
163
1470
""" Class Dashboard API endpoint urls. """ from django.conf.urls import patterns, url from django.conf import settings COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN urlpatterns = patterns( '', # Json request data for metrics for entire course url(r'^{}/all_sequential_open_distrib$'.format(settings.COURS...
agpl-3.0
lbjay/cds-invenio
modules/bibupload/lib/batchuploader.py
4
6139
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either versio...
gpl-2.0
GeoMop/GeoMop
src/gm_base/model_data/validation/checks.py
1
4726
"""Basic rules for data validation .. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz> """ # pylint: disable=unused-argument from ..data_node import DataNode from ..notifications import Notification def check_scalar(node, input_type): """Checks scalar node value.""" if node.implementation != DataNode.Implem...
gpl-3.0
mistio/libcloud
libcloud/test/conftest.py
6
1649
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
Nikea/VisTrails
vistrails/packages/CLTools/wizard.py
2
48925
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
bsd-3-clause
seann1/portfolio5
.meteor/dev_bundle/python/Lib/lib-tk/test/widget_tests.py
24
19643
# Common tests for test_tkinter/test_widgets.py and test_ttk/test_widgets.py import unittest import sys import Tkinter as tkinter from ttk import Scale from test_ttk.support import (AbstractTkTest, tcl_version, requires_tcl, get_tk_patchlevel, pixels_conv, tcl_obj_eq) import test.test_sup...
gpl-2.0
netgroup/dreamer-ryu
ryu/tests/unit/ofproto/test_parser_v10.py
10
170126
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 # # Unless required by appli...
apache-2.0
TomBaxter/waterbutler
tests/tasks/test_move.py
3
6692
import sys import copy import time import asyncio import hashlib from unittest import mock import celery import pytest from waterbutler import tasks # noqa from waterbutler.core import remote_logging from waterbutler.core import utils as core_utils from waterbutler.core.path import WaterButlerPath import tests.util...
apache-2.0
divya-csekar/flask-microblog-server
flask/Lib/site-packages/migrate/tests/changeset/test_changeset.py
66
36587
#!/usr/bin/env python # -*- coding: utf-8 -*- import sqlalchemy import warnings from sqlalchemy import * from migrate import changeset, exceptions from migrate.changeset import * from migrate.changeset import constraint from migrate.changeset.schema import ColumnDelta from migrate.tests import fixture from migrate.te...
bsd-3-clause
Timeship/OnlineJudge-1
contest/serializers.py
6
4353
# coding=utf-8 import json from rest_framework import serializers from django.utils import timezone import datetime from account.models import User from account.serializers import UserSerializer from .models import Contest, ContestProblem class CreateContestSerializer(serializers.Serializer): title = serializers....
mit
sdague/home-assistant
tests/components/homeassistant/triggers/test_time.py
3
12283
"""The tests for the time automation.""" from datetime import timedelta import pytest import homeassistant.components.automation as automation from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF from homeassistant.setup import async_setup_component import homeassistant.util.dt as dt_util from tests.asyn...
apache-2.0
dstrockis/outlook-autocategories
shared/config.py
1
2987
# from models import GlobalConfig # from google.appengine.ext import ndb import os def get(name): # Holds default config values not overridden in datastore try: azure_storage_account_key = os.environ['AZURE_STORAGE_ACCOUNT_KEY'] except KeyError: azure_storage_account_key = None tr...
apache-2.0
chokribr/PIST
modules/bibauthorid/lib/bibauthorid_personid_maintenance.py
13
4727
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
gpl-2.0
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pip/_vendor/urllib3/_collections.py
95
10204
from __future__ import absolute_import from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): ...
apache-2.0
leosac/leosac
python/leosacpy/cli/cli_config.py
2
1918
import logging from configparser import ConfigParser from typing import Optional from pathlib import Path import os from click import UsageError class CLIConfig: def __init__(self, config_content): assert isinstance(config_content, str) self.host = '' self.username = '' self.pa...
agpl-3.0
kerwinxu/barcodeManager
zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/hplink.py
1
2465
"""SCons.Tool.hplink Tool-specific initialization for the HP linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The ...
bsd-2-clause
dustinlarimer/collab-pad
src/node_modules/npm/node_modules/node-gyp/gyp/test/win/gyptest-cl-function-level-linking.py
332
1595
#!/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. """ Make sure function-level linking setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = Te...
apache-2.0
kursitet/edx-platform
lms/djangoapps/shoppingcart/processors/helpers.py
169
1025
""" Helper methods for credit card processing modules. These methods should be shared among all processor implementations, but should NOT be imported by modules outside this package. """ from django.conf import settings from microsite_configuration import microsite def get_processor_config(): """ Return a dic...
agpl-3.0
superdesk/Live-Blog
distribution/libraries/Babel-1.0dev-py3.2/babel/messages/pofile.py
4
17312
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software # 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://babel.edgewall.org/wiki/License. # # This software consists...
agpl-3.0
rghe/ansible
test/units/modules/network/nxos/test_nxos_vxlan_vtep.py
57
2521
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
aibor/marmoset
marmoset/installimage/installimage_config.py
1
2437
import os import re class InstallimageConfig: CFG_DIR = '/srv/tftp/installimage/' @classmethod def all(cls): '''Return all currently defined installimage configs.''' entries = [] for entry_file in os.listdir(InstallimageConfig.CFG_DIR): if re.match('([0-9A-Za-z]{2}_){5}...
agpl-3.0
sam-tsai/django
django/contrib/auth/middleware.py
258
5718
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
bsd-3-clause
sauliusl/scipy
scipy/sparse/compressed.py
22
43386
"""Base class for sparse matrix formats using compressed storage.""" from __future__ import division, print_function, absolute_import __all__ = [] from warnings import warn import operator import numpy as np from scipy._lib.six import xrange, zip as izip from .base import spmatrix, isspmatrix, SparseEfficiencyWarni...
bsd-3-clause
juanalfonsopr/odoo
addons/hr_payroll/hr_payroll.py
144
49776
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/CallTipWindow.py
96
5924
"""A CallTip window class for Tkinter/IDLE. After ToolTip.py, which uses ideas gleaned from PySol Used by the CallTips IDLE extension. """ from Tkinter import * HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>" HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>") CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide...
apache-2.0
pytroll/satpy
satpy/_compat.py
1
1188
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2020 Satpy developers # # This file is part of satpy. # # satpy 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...
gpl-3.0
ktan2020/jenkins-1.507
ips/proto.py
27
2196
# The MIT License # # Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi # # 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 ...
mit
virtool/virtool
virtool/analyses/api.py
2
5083
""" Provides request handlers for managing and viewing analyses. """ import os import aiojobs.aiohttp import virtool.analyses.format import virtool.analyses.utils import virtool.api.json import virtool.api.response import virtool.bio import virtool.analyses.db import virtool.samples.db import virtool.errors import vi...
mit