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
commtrack/commtrack-core
apps/buildmanager/models.py
3
24577
import os, sys import logging import traceback from django.conf import settings from datetime import datetime import time # make things easier so people don't have to install pygments try: from pygments import highlight from pygments.lexers import HtmlLexer from pygments.formatters import HtmlFormatter ...
bsd-3-clause
mozilla/addons-server
src/olympia/amo/tests/test_helpers.py
1
15332
# -*- coding: utf-8 -*- import mimetypes import os from datetime import datetime, timedelta from unittest.mock import Mock, patch from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import NoReverseMatch from django.test.client import RequestFactory from dja...
bsd-3-clause
jcupitt/sorl-thumbnail
sorl/thumbnail/kvstores/cached_db_kvstore.py
10
2035
from django.core.cache import cache, InvalidCacheBackendError from sorl.thumbnail.compat import get_cache from sorl.thumbnail.kvstores.base import KVStoreBase from sorl.thumbnail.conf import settings from sorl.thumbnail.models import KVStore as KVStoreModel class EMPTY_VALUE(object): pass class KVStore(KVStoreB...
bsd-3-clause
pearsonlab/nipype
nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py
12
1315
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from .....testing import assert_equal from ..featuredetection import GenerateTestImage def test_GenerateTestImage_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(nohas...
bsd-3-clause
chiefspace/udemy-rest-api
udemy_rest_api_section5/env/lib/python3.4/site-packages/pip/__init__.py
7
11392
#!/usr/bin/env python import os import optparse import sys import re import errno # Debian virtual environment (venv) support. When inside a venv, we have to # add all the devendorized wheels to sys.path from inside the venv, otherwise # the devendorized packages won't be found. Only do this in a venv so it # doesn...
gpl-2.0
tastynoodle/django
django/contrib/gis/db/backends/spatialite/base.py
119
3209
import sys from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import (Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper) from django.contrib.gis.db.backends.spatialite.client import...
bsd-3-clause
niavlys/kivy
kivy/core/audio/audio_ffpyplayer.py
39
5984
''' FFmpeg based audio player ========================= To use, you need to install ffpyplyaer and have a compiled ffmpeg shared library. https://github.com/matham/ffpyplayer The docs there describe how to set this up. But briefly, first you need to compile ffmpeg using the shared flags while disabling the stati...
mit
GoogleCloudPlatform/bigquery-utils
tools/cloud_functions/gcs_event_based_ingest/tests/conftest.py
1
20146
# Copyright 2021 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 agreed to in writing, ...
apache-2.0
JioEducation/edx-platform
common/test/acceptance/pages/lms/track_selection.py
110
1942
"""Track selection page""" from bok_choy.page_object import PageObject from . import BASE_URL from .dashboard import DashboardPage from .pay_and_verify import PaymentAndVerificationFlow class TrackSelectionPage(PageObject): """Interact with the track selection page. This page can be accessed at `/course_mode...
agpl-3.0
AntouanK/rethinkdb
external/v8_3.30.33.16/build/gyp/test/variables/commands/gyptest-commands-repeated.py
330
1313
#!/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. """ Test variable expansion of '<!()' syntax commands where they are evaluated more then once.. """ import TestGyp test = TestGyp.TestGyp(...
agpl-3.0
rc/sfepy
examples/homogenization/nonlinear_hyperelastic_mM.py
2
6215
import numpy as nm import six from sfepy import data_dir from sfepy.base.base import Struct, output from sfepy.terms.terms_hyperelastic_ul import HyperElasticULFamilyData from sfepy.homogenization.micmac import get_homog_coefs_nonlinear import sfepy.linalg as la from sfepy.discrete.evaluate import Evaluator hyperelas...
bsd-3-clause
pombreda/django-hotclub
libs/external_libs/gdata.py-1.0.13/src/gdata/spreadsheet/service.py
10
15970
#!/usr/bin/python # # Copyright (C) 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 ...
mit
randynobx/ansible
lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py
70
6582
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright IBM Corp. 2016 # Author(s): Andreas Nafpliotis <nafpliot@de.ibm.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 Found...
gpl-3.0
535521469/crawler_sth
scrapyd/app.py
1
1586
from twisted.application.service import Application from twisted.application.internet import TimerService, TCPServer from twisted.web import server from twisted.python import log from scrapy.utils.misc import load_object from .interfaces import IEggStorage, IPoller, ISpiderScheduler, IEnvironment from .launcher impor...
bsd-3-clause
DirtyUnicorns/android_kernel_samsung_trlte
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
icodemachine/Stem
test/unit/doctest.py
9
3334
""" Tests examples from our documentation. """ from __future__ import absolute_import import doctest import os import unittest import stem.descriptor.router_status_entry import stem.util.connection import stem.util.str_tools import stem.util.system import stem.version import test.util try: # added in python 3.3 ...
lgpl-3.0
shakamunyi/tensorflow
tensorflow/contrib/learn/python/learn/tests/stability_test.py
4
4977
# 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
reidwooten99/botbot-web
botbot/apps/plugins/runner.py
2
11330
# pylint: disable=W0212 import json import logging from datetime import datetime from django.utils.timezone import utc import re import redis import botbot_plugins.plugins from botbot_plugins.base import PrivateMessage from django.core.cache import cache from django.conf import settings from django.utils.importlib imp...
mit
aurelijusb/arangodb
3rdParty/V8-4.3.61/.ycm_extra_conf.py
31
5867
# Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Autocompletion config for YouCompleteMe in V8. # # USAGE: # # 1. Install YCM [https://github.com/Valloric/YouCompleteMe] # (Googlers should ch...
apache-2.0
tcharding/kubernetes
cluster/juju/layers/kubernetes-master/lib/charms/kubernetes/common.py
359
2002
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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
solintegra/addons
hw_posbox_upgrade/__init__.py
1894
1075
# -*- 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...
agpl-3.0
ehashman/oh-mainline
vendor/packages/scrapy/scrapy/tests/test_utils_sitemap.py
25
4450
import unittest from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots class SitemapTest(unittest.TestCase): def test_sitemap(self): s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>http://www.example.com/</loc>...
agpl-3.0
hezuoguang/ZGVL
WLServer/site-packages/requests/packages/chardet/euctwfreq.py
3133
34872
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
apache-2.0
eric-haibin-lin/mxnet
python/mxnet/ndarray/numpy/_op.py
2
252233
# pylint: disable=C0302 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
apache-2.0
deepmind/lab2d
dmlab2d/lib/game_scripts/levels/clean_up/play.py
1
3449
# Copyright 2020 The DMLab2D Authors. # # 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...
apache-2.0
ganeshkoilada/libforensics
unittests/tests/dec/raw.py
13
4098
# Copyright 2010 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 ver...
gpl-3.0
chetaldrich/MLOCR
naiveBayesProbs.py
1
243497
def getSavedProbs(): return {0: 0.09871452420701168, 1: 0.11242070116861436, 2: 0.09931552587646077, 3: 0.10223706176961603, 4: 0.09736227045075126, 5: 0.09021702838063439, 6: 0.09863105175292154, 7: 0.10445742904841403, 8: 0.0974457429048414, 9: 0.09919866444073455}, {0: {(7, 3): 0.00016926556668285482, (20, 25): 0.0...
mit
kracwarlock/neon
neon/models/autoencoder.py
9
2835
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
fractal-mind/portfolio
node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit
nvoron23/hue
apps/search/src/search/decorators.py
4
2234
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
beiko-lab/gengis
bin/Lib/site-packages/ndg/httpsclient/https.py
66
4598
"""ndg_httpsclient HTTPS module containing PyOpenSSL implementation of httplib.HTTPSConnection PyOpenSSL utility to make a httplib-like interface suitable for use with urllib2 """ __author__ = "P J Kershaw (STFC)" __date__ = "09/12/11" __copyright__ = "(C) 2012 Science and Technology Facilities Council" __license__ =...
gpl-3.0
jk1/intellij-community
python/lib/Lib/site-packages/django/core/serializers/xml_serializer.py
293
11885
""" XML serializer. """ from django.conf import settings from django.core.serializers import base from django.db import models, DEFAULT_DB_ALIAS from django.utils.xmlutils import SimplerXMLGenerator from django.utils.encoding import smart_unicode from xml.dom import pulldom class Serializer(base.Serializer): """ ...
apache-2.0
brownharryb/erpnext
erpnext/utilities/user_progress_utils.py
7
6851
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext import json from frappe import _ from frappe.utils import flt from erpnext.setup.doctype.setup_progress.setup_progress import up...
gpl-3.0
lizardsystem/flooding
flooding_lib/tasks/calculaterisespeed_132.py
3
9870
#!c:/python25/python.exe # -*- coding: utf-8 -*- #*********************************************************************** # This file is part of the nens library. # # the nens library is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by ...
gpl-3.0
prantlf/node-gyp
gyp/pylib/gyp/MSVSToolFile.py
2736
1804
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
mit
ray-project/ray
release/tune_tests/scalability_tests/workloads/test_network_overhead.py
1
1297
"""Networking overhead (200 trials on 200 nodes) In this run, we will start 100 trials and run them on 100 different nodes. This test will thus measure the overhead that comes with network communication and specifically log synchronization. Cluster: cluster_100x2.yaml Test owner: krfricke Acceptance criteria: Shoul...
apache-2.0
arahuja/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
lifanov/cobbler
cobbler/item_package.py
15
2384
""" Copyright 2006-2009, MadHatter Kelsey Hightower <kelsey.hightower@gmail.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; either version 2 of the License, or (at your option) any later version...
gpl-2.0
nephila/django-filer
runtests.py
4
2515
#!/usr/bin/env python import argparse import os import sys import warnings from filer.test_utils.cli import configure from filer.test_utils.tmpdir import temp_dir from filer.test_utils.cli import configure from filer.test_utils.tmpdir import temp_dir def main(verbosity=1, failfast=False, test_labels=None, migrate=Fa...
bsd-3-clause
cdiener/pyart
asciinator.py
1
1723
#!/usr/bin/env python # asciinator.py # # Copyright 2014 Christian Diener <ch.diener@gmail.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; either version 2 of the License, or # ...
gpl-3.0
isaac-s/cloudify-plugins-common
cloudify/decorators.py
2
15492
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
jstoxrocky/statsmodels
statsmodels/tsa/interp/tests/test_denton.py
35
1245
import numpy as np from statsmodels.tsa.interp import dentonm def test_denton_quarterly(): # Data and results taken from IMF paper indicator = np.array([98.2, 100.8, 102.2, 100.8, 99.0, 101.6, 102.7, 101.5, 100.5, 103.0, 103.5, 101.5]) benchmark = np.array([4000.,4161.4]) x_im...
bsd-3-clause
leoliujie/odoo
addons/account_test/report/account_test_report.py
194
3819
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
bmazin/ARCONS-pipeline
astrometry/guide-centroid/manage.py
1
5233
from FitsAnalysis import convert,StarCalibration from catalog import queryVizier,queryFitsImage import os import warnings from radec import radec from functions import * #ignore the warning caused by astropy warnings.filterwarnings("ignore") #This specifies the center of fits images retrieved from the data base #Tho...
gpl-2.0
tommo/gii
lib/3rdparty/common/yaml/cyaml.py
537
3290
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
mit
brittanystoroz/kitsune
kitsune/landings/views.py
18
1425
from django.shortcuts import render from mobility.decorators import mobile_template from kitsune.products.models import Product from kitsune.sumo.decorators import ssl_required from kitsune.sumo.views import redirect_to from kitsune.wiki.decorators import check_simple_wiki_locale @check_simple_wiki_locale def home(...
bsd-3-clause
demaranderson/othello-py
othello_gui.py
3
6937
# othello_gui: a GUI based interface to get the user's move # Copyright (C) 2006 Nimar S. Arora # # 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,...
gpl-2.0
MikeAmy/django
django/core/management/commands/makemessages.py
19
24495
from __future__ import unicode_literals import fnmatch import glob import io import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.files.temp import NamedTemporaryFile from django.core.management.base import ...
bsd-3-clause
ericzundel/pants
src/python/pants/backend/graph_info/tasks/dependees.py
4
3226
# 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 json from col...
apache-2.0
mjrulesamrat/xbmcbackup
resources/lib/relativedelta.py
11
17115
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime import calendar __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "F...
mit
Stavitsky/nova
nova/tests/unit/virt/xenapi/client/test_objects.py
80
3981
# Copyright (c) 2014 Rackspace Hosting # 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 req...
apache-2.0
ricardogsilva/QGIS
tests/src/python/test_qgis_local_server.py
45
6464
# -*- coding: utf-8 -*- """QGIS Unit tests for qgis_local_server.py Python test module From build dir: ctest -R PyQgsLocalServer -V Set the following env variables when manually running tests: QGIS_TEST_SUITE to run specific tests (define in __main__) QGIS_TEST_VERBOSE to output individual test summary QGIS_TEST...
gpl-2.0
asuradaimao/linux
tools/perf/scripts/python/check-perf-trace.py
1997
2539
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
ChanChiChoi/scikit-learn
sklearn/linear_model/ransac.py
191
14261
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
bsd-3-clause
JulienMcJay/eclock
windows/Python27/Lib/site-packages/requests-2.2.1-py2.7.egg/requests/packages/urllib3/connectionpool.py
223
25767
# urllib3/connectionpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import errno import logging from socket import error as SocketError, timeout as SocketT...
gpl-2.0
kenglishhi/gae-django-sandbox
django/contrib/gis/geos/tests/test_geos_mutation.py
68
5446
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest import django.utils.copycompat as copy from django.contrib.gis.geos import * from django.contrib.gis.geos.error import GEOSIndex...
apache-2.0
katchengli/tech-interview-prep
interview_cake/ic3.py
1
1451
#constraint: list_of_ints will always have at least 3 integers #can have negative numbers def highest_product_three_ints(list_of_ints): biggest_int = max(list_of_ints) list_of_ints.remove(biggest_int) max_int1 = max(list_of_ints) list_of_ints.remove(max_int1) max_int2 = max(list_of_ints) list_...
apache-2.0
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/requests/packages/chardet/langthaimodel.py
2930
11275
######################## 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...
mit
alexryndin/ambari
ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEYARN/package/scripts/yarn_client.py
3
1123
""" 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 this ...
apache-2.0
mitocw/latex2edx
latex2edx/test/test_custom_html.py
1
2044
import os import unittest from lxml import etree from io import StringIO from latex2edx.main import latex2edx from latex2edx.test.util import make_temp_directory class MakeTeX(object): def __init__(self, tex): buf = """\\documentclass[12pt]{article}\n\\usepackage{edXpsl}\n\n\\begin{document}""" b...
agpl-3.0
jaberg/nengo
examples/question.py
2
2681
D=16 subdim=4 N=100 seed=7 import nef.nef_theano as nef import nef.convolution import hrr import math import random random.seed(seed) vocab=hrr.Vocabulary(D,max_similarity=0.1) net=nef.Network('Question Answering') #Create the network object net.make('A',1,D,mode='direct') #Make some pseudo populations (so they ...
mit
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/chardet/universaldetector.py
244
12485
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
MattCrystal/yolo-computing-machine
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
Twistbioscience/incubator-airflow
airflow/contrib/operators/emr_terminate_job_flow_operator.py
16
1879
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
jendap/tensorflow
tensorflow/python/ops/tensor_array_grad.py
32
9133
# 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
ville-k/tensorflow
tensorflow/contrib/layers/python/layers/feature_column_test.py
22
45974
# 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
faridani/pyDoc
Unidecode/unidecode/x012.py
252
4318
data = ( 'ha', # 0x00 'hu', # 0x01 'hi', # 0x02 'haa', # 0x03 'hee', # 0x04 'he', # 0x05 'ho', # 0x06 '[?]', # 0x07 'la', # 0x08 'lu', # 0x09 'li', # 0x0a 'laa', # 0x0b 'lee', # 0x0c 'le', # 0x0d 'lo', # 0x0e 'lwa', # 0x0f 'hha', # 0x10 'hhu', # 0x11 'hhi', # 0x1...
mit
cloudera/hue
desktop/core/ext-py/Babel-2.5.1/tests/test_localedata.py
2
3832
# -*- 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...
apache-2.0
jxta/cc
vendor/Twisted-10.0.0/twisted/cred/util.py
4
1284
# -*- test-case-name: twisted.test.test_newcred -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Outdated, deprecated functionality related to challenge-based authentication. Seek a solution to your problem elsewhere. This module is deprecated. """ # System Imports import ra...
apache-2.0
Bismarrck/tensorflow
tensorflow/contrib/constrained_optimization/python/candidates.py
26
13286
# Copyright 2018 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
hemidactylus/flaskbiblio
config.py
1
1074
import os # directories and so on basedir = os.path.abspath(os.path.dirname(__file__)) DB_DIRECTORY=os.path.join(basedir,'app/database') DB_NAME='biblio.db' # stuff for Flask WTF_CSRF_ENABLED = True from sensible_config import SECRET_KEY # formats, etc DATETIME_STR_FORMAT = '%Y-%m-%d %H:%M:%S' SHORT_DATETIME_STR_FO...
gpl-3.0
xflows/textflows
workflows/management/commands/auto_import_packages.py
4
6445
from datetime import datetime import os import sys from django.core.management.base import BaseCommand, CommandError from workflows import module_importer from workflows.management.commands import export_package_old as export_package from workflows.management.commands import import_package_old as import_package ...
mit
xen0l/ansible
lib/ansible/modules/storage/infinidat/infini_pool.py
43
6070
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Gregory Shulov (gregory.shulov@gmail.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_version': '...
gpl-3.0
evaschalde/odoo
addons/hr_holidays/hr_holidays.py
159
33482
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
agpl-3.0
UXE/local-edx
common/lib/xmodule/xmodule/randomize_module.py
54
3690
import logging import random from xmodule.x_module import XModule, STUDENT_VIEW from xmodule.seq_module import SequenceDescriptor from lxml import etree from xblock.fields import Scope, Integer from xblock.fragment import Fragment log = logging.getLogger('edx.' + __name__) class RandomizeFields(object): choic...
agpl-3.0
danilito19/django
tests/model_meta/test_legacy.py
199
7556
import warnings from django import test from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import CharField, related from django.utils.deprecation import RemovedInDjango110Warning from .models import BasePerson, Person from ...
bsd-3-clause
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/francetv.py
1
15999
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( clean_html, determine_ext, ExtractorError, int_or_none, parse_duration, try_get, url_or_none, ) from .dailymotion import Dailymotion...
gpl-3.0
kevinlondon/glances
glances/core/glances_snmp.py
12
4873
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances 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 Lic...
lgpl-3.0
fureszpeter/a2billing
CallBack/callback-daemon-py/build/lib/callback_daemon/manager.py
14
19498
#!/usr/bin/env python # vim: set expandtab shiftwidth=4: """ Python Interface for Asterisk Manager This module provides a Python API for interfacing with the asterisk manager. import asterisk.manager import sys def handle_shutdown(event, manager): print "Recieved shutdown event" manager.close()...
agpl-3.0
louiskun/flaskGIT
venv/lib/python2.7/site-packages/wheel/test/test_ranking.py
565
1496
import unittest from wheel.pep425tags import get_supported from wheel.install import WheelFile WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl" def make_wheel(name, ver, pyver, abi, arch): name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi, arch=arch) return WheelFile(name...
mit
hifly/Pentaho-reports-for-OpenERP
openerp_addon/pentaho_reports/java_oe.py
13
5128
# -*- encoding: utf-8 -*- from datetime import datetime TYPE_STRING = 'str' TYPE_BOOLEAN = 'bool' TYPE_INTEGER = 'int' TYPE_NUMBER = 'num' TYPE_DATE = 'date' TYPE_TIME = 'dtm' OPENERP_DATA_TYPES = [(TYPE_STRING, 'String'), (TYPE_BOOLEAN, 'Boolean'), (TYPE_INTEGER, 'Integer...
gpl-2.0
mharrys/sudoku
sudoku.py
1
7848
import fileinput from dlx import DLX from numpy import array, unique from optparse import OptionParser class SudokuError(Exception): """Raised when any error related to Sudoku is found during construction and validation such as unexpected values or contradictions. """ def __init__(self, value): ...
gpl-3.0
Plain-Andy-legacy/android_external_chromium_org
tools/telemetry/telemetry/value/list_of_scalar_values_unittest.py
29
5972
# Copyright 2013 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 os import unittest from telemetry import value from telemetry.page import page_set from telemetry.value import list_of_scalar_values from telemetry.va...
bsd-3-clause
defcello/Children-of-Eden-Synth-Server
src/data/webpages/rolandfantomxr/PRA.py
4
7924
#################################################################################################### # Copyright 2013 John Crawford # # This file is part of PatchCorral. # # PatchCorral is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
gpl-3.0
behzadnouri/scipy
benchmarks/benchmarks/go_benchmark_functions/go_funcs_I.py
10
1175
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from numpy import sin, sum from .go_benchmark import Benchmark class Infinity(Benchmark): r""" Infinity objective function. This class defines the Infinity [1]_ global optimization problem. This is a multimodal...
bsd-3-clause
Bekt/tweetement
src/service.py
1
3578
import logging import string import tweepy from credentials import (consumer_key, consumer_secret) from models import Stopword from collections import Counter class Service(object): # Map uppercase to lowercase, and deletes any punctuation. trans = {ord(string.ascii_uppercase[i]): ord(string.ascii_lowercase...
mit
tersmitten/ansible
lib/ansible/modules/cloud/azure/azure_rm_mysqlconfiguration.py
13
7982
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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', ...
gpl-3.0
ptitjano/bokeh
examples/compat/mpl_contour.py
7
1028
# demo inspired by: http://matplotlib.org/examples/pylab_examples/contour_demo.html from bokeh import mpl from bokeh.plotting import output_file, show import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt import numpy as np matplotlib.rcParams['xtick.direction'] = 'out' matplotlib.rcParams...
bsd-3-clause
StefanRijnhart/OpenUpgrade
addons/l10n_cn/__init__.py
102
1055
# -*- 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
srm912/servo
tests/wpt/css-tests/tools/manifest/update.py
230
3336
#!/usr/bin/env python import argparse import imp import os import sys import manifest import vcs from log import get_logger from tree import GitTree, NoVCSTree here = os.path.dirname(__file__) localpaths = imp.load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, "localpaths.py"))) def update(tests...
mpl-2.0
mgamer/gyp
test/lib/TestWin.py
90
3168
# Copyright (c) 2014 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. """ TestWin.py: a collection of helpers for testing on Windows. """ import errno import os import re import sys import subprocess class Registry(object): def ...
bsd-3-clause
dengit/shadowsocks
shadowsocks/lru_cache.py
11
4274
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
mit
echodaemon/Malfunction
malfunction/disassembler.py
3
2079
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # disassembler.py # # Authors: James Brahm, Matthew Rogers, Morgan Wagner, Jeramy Lochner, # Donte Brock # ----------------------------------------------------------------------- # Copyright 2015 Dynetics, Inc. # # This fi...
lgpl-2.1
mcanthony/rethinkdb
external/v8_3.30.33.16/build/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py
350
1226
#!/usr/bin/env python # 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. """ Verify that a hard_dependency that is not exported is not pulled in as a dependency for a target if the target does not explicitly speci...
agpl-3.0
mahmutf/dupeguru
qt/problem_dialog.py
3
2842
# Created By: Virgil Dupras # Created On: 2010-04-12 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-...
gpl-3.0
cryptickp/heat
heat/tests/ceilometer/test_gnocchi_alarm.py
4
14472
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
akashlevy/Yaklient
yaklient/objects/message.py
3
1985
# -*- coding: utf-8 -*- """Abstract class for a post on Yik Yak""" from abc import abstractmethod from yaklient import helper class Message(object): """An abstract class for a postable object on Yik Yak (Comment or Yak)""" def __init__(self, raw, user): """Initialize message from raw JSON dict and u...
mit
nbessi/pyhiccup
pyhiccup/page.py
1
3037
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 # Original concept by James Reeves # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
agpl-3.0
docusign/docusign-python-client
docusign_esign/models/external_file.py
1
7550
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
mit
ravibhure/ansible
lib/ansible/modules/windows/win_tempfile.py
47
2164
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017 Dag Wieers <dag@wieers.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 # ...
gpl-3.0