repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
sodafree/backend
build/lib.linux-i686-2.7/django/contrib/comments/forms.py
92
8086
import time from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.comments.models import Comment from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import...
bsd-3-clause
UK992/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py
5
16753
import json import os import sys import traceback from six.moves.urllib.parse import parse_qs, quote, unquote, urljoin from six import iteritems from .constants import content_types from .pipes import Pipeline, template from .ranges import RangeParser from .request import Authentication from .response import Multipar...
mpl-2.0
vest-thermostat/server
vest/location/models.py
1
2568
import logging logger = logging.getLogger(__name__) from django.contrib.gis.db import models from django.contrib.gis.measure import D from django.db.models.signals import post_save from django.dispatch import receiver class UserLocation(models.Model): """ """ owner = models.ForeignKey('users.VestUser', re...
gpl-3.0
ltilve/chromium
tools/findit/common/utils.py
74
2051
# Copyright (c) 2011 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 re import sys from http_client_local import HttpClientLocal GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$') def GetOSName(platform_name=s...
bsd-3-clause
saurvs/servo
tests/wpt/web-platform-tests/mixed-content/generic/tools/spec_validator.py
202
5824
#!/usr/bin/env python import json, sys from common_paths import * def assert_non_empty_string(obj, field): assert field in obj, 'Missing field "%s"' % field assert isinstance(obj[field], basestring), \ 'Field "%s" must be a string' % field assert len(obj[field]) > 0, 'Field "%s" must not be empty'...
mpl-2.0
dermoth/gramps
gramps/gen/plug/report/__init__.py
13
1231
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001 David R. Hampton # Copyright (C) 2001-2006 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
haraldschilly/smc
src/smc_pyutil/smc_pyutil/jupyter_notebook.py
3
8202
#!/usr/bin/python ###################################################################### # This is a daemon-ization script for the IPython notebook, for running # it under a specific URL behind a given proxy server. It is probably # only of use directly in https://cloud.sagemath.com. # # This is written in Python, bu...
gpl-3.0
Azure/azure-sdk-for-python
sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_get_bounding_boxes_async.py
1
7460
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
mit
yanheven/nova
nova/api/openstack/compute/plugins/v3/cells.py
7
12055
# Copyright 2011-2012 OpenStack Foundation # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/lic...
apache-2.0
frreiss/tensorflow-fred
tensorflow/python/data/kernel_tests/map_test.py
6
53053
# 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
FreeBSDonHyper-V/azure-freebsd-automation
remote-scripts/E2E-SIEGE-TEST.py
8
2963
#!/usr/bin/python import re import time import imp import sys import argparse import os import linecache from azuremodules import * parser = argparse.ArgumentParser() parser.add_argument('-u', '--user', help='specifies user to login', required=True, type= str ) parser.add_argument('-p', '--password', help='specifies...
apache-2.0
sotdjin/glibglab
venv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/reflection.py
21
15627
# mysql/reflection.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re from ... import log, util from ... import types as sqltypes from .enum...
mit
MarkWh1te/xueqiu_predict
p3_env/lib/python3.5/site-packages/bpython/curtsiesfrontend/preprocess.py
2
1468
"""Tools for preparing code to be run in the REPL (removing blank lines, etc)""" from bpython.lazyre import LazyReCompile # TODO specifically catch IndentationErrors instead of any syntax errors indent_empty_lines_re = LazyReCompile(r'\s*') tabs_to_spaces_re = LazyReCompile(r'^\t+') def indent_empty_lines(s, comp...
mit
ankurankan/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
datastax/python-driver
tests/integration/standard/test_client_warnings.py
1
4506
# Copyright DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
apache-2.0
40223150/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/version.py
607
1334
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
gpl-3.0
tntnatbry/tensorflow
tensorflow/contrib/slim/python/slim/evaluation_test.py
27
9175
# 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
flyfei/python-for-android
python-build/python-libs/gdata/samples/blogger/app/blogapp.py
128
4959
# Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
sgml/popcorn_maker
vendor-local/lib/python/noseprogressive/result.py
3
8070
from __future__ import with_statement from blessings import Terminal from nose.plugins.skip import SkipTest from nose.result import TextTestResult from nose.util import isclass from noseprogressive.bar import ProgressBar, NullProgressBar from noseprogressive.tracebacks import format_traceback, extract_relevant_tb fro...
bsd-3-clause
gnychis/gnuradio-3.5.0-dmr
gr-uhd/examples/usrp_wfm_rcv_pll.py
3
14235
#!/usr/bin/env python # # Copyright 2005-2007,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at you...
gpl-3.0
citrix-openstack/build-ryu
ryu/lib/xflow/netflow.py
60
4009
# Copyright (C) 2013 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
gmferrigno/pyafipws
wsaa.py
1
19707
#!/usr/bin/python # -*- coding: latin-1 -*- # 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, or (at your option) any later # version. # # This program is distributed in the hope...
gpl-3.0
davidbuzz/ardupilot
Tools/LogAnalyzer/tests/TestOptFlow.py
32
14968
from LogAnalyzer import Test,TestResult import DataflashLog from math import sqrt import numpy as np import matplotlib.pyplot as plt class TestFlow(Test): '''test optical flow sensor scale factor calibration''' # # Use the following procedure to log the calibration data. is assumed that the optical flow ...
gpl-3.0
luca76/QGIS
python/plugins/processing/ui/ui_DlgAutofill.py
6
3498
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'python/plugins/processing/ui/DlgAutofill.ui' # # Created: Wed Oct 2 20:49:45 2013 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCor...
gpl-2.0
pbchou/trafficserver
tests/gold_tests/tls_hooks/tls_hooks16.test.py
4
3037
''' Test single immediate client hello hook ''' # 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 ...
apache-2.0
public-ink/public-ink
server/appengine/lib/numpy/distutils/fcompiler/ibm.py
45
3409
from __future__ import division, absolute_import, print_function import os import re import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command, find_executable from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFCompi...
gpl-3.0
Effi-01/Testing
plugin.video.live.streamspro/playtvfr.py
37
9027
import struct import urllib2,urllib import re import json import math CRYPT_XXTEA_DELTA= 0x9E3779B9 headers = [('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),( 'Connection','Keep-Alive')] class Crypt_XXTEA: _key=None def setKey(self,key): if isinstance(key, b...
gpl-2.0
themadhatterz/cpapi
app/checkpoint.py
1
6936
import ast import base64 import itertools from functools import lru_cache import cpapilib from flask import session from app import app OBJECTS_DICTIONARY = None @lru_cache(maxsize=5000) def uid_name(uid_obj): for obj in OBJECTS_DICTIONARY: if uid_obj == obj['uid']: return obj['name'] ...
mit
turbhrus/pixhg
mk/VRBRAIN/Tools/genmsg/src/genmsg/srvs.py
51
3095
# Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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 ...
gpl-3.0
cloudera/hue
desktop/core/ext-py/django-extensions-1.8.0/django_extensions/management/commands/export_emails.py
2
5148
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import sys import six from csv import writer # noqa from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.core.management.base import BaseCommand, CommandError from django_extensions.mana...
apache-2.0
SKA-ScienceDataProcessor/integration-prototype
sip/science_pipeline_workflows/ical_dask/pipelines/imaging_modeling.py
1
7070
# -*- coding: utf-8 -*- """Dask workflow for generating model data for the SIP example ICAL workflow. This is code based on the test ICAL pipeline notebook from ARL. """ import logging import pickle import os import sys import json import numpy from astropy import units as u from astropy.coordinates import SkyCoord ...
bsd-3-clause
muntasirsyed/intellij-community
python/helpers/pydev/pydevd_plugins/jinja2_debug.py
33
14866
import traceback from pydevd_breakpoints import LineBreakpoint, get_exception_name from pydevd_constants import GetThreadId, STATE_SUSPEND, DictContains, DictIterItems, DictKeys from pydevd_comm import CMD_SET_BREAK, CMD_STEP_OVER, CMD_ADD_EXCEPTION_BREAK import pydevd_vars from pydevd_file_utils import GetFileNameAndB...
apache-2.0
factorlibre/stock-logistics-warehouse
stock_inventory_hierarchical_location/tests/fill_inventory_test.py
2
8546
# -*- coding: utf-8 -*- # # # Authors: Laetitia Gangloff # Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) # All Rights Reserved # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # consequences res...
agpl-3.0
polossk/jieba
test/test_tokenize.py
65
5534
#encoding=utf-8 from __future__ import print_function,unicode_literals import sys sys.path.append("../") import jieba g_mode="default" def cuttest(test_sent): global g_mode result = jieba.tokenize(test_sent,mode=g_mode) for tk in result: print("word %s\t\t start: %d \t\t end:%d" % (tk[0],tk[1],tk[...
mit
peterfpeterson/mantid
Framework/PythonInterface/test/python/plugins/algorithms/PDConvertRealSpaceTest.py
3
1521
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
rmboggs/django
tests/validation/test_unique.py
337
7108
from __future__ import unicode_literals import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import ( CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrors...
bsd-3-clause
j5shi/Thruster
pylibs/test/test_xml_etree.py
2
56942
# xml.etree test. This file contains enough tests to make sure that # all included components work as they should. # Large parts are extracted from the upstream test suite. # IMPORTANT: the same doctests are run from "test_xml_etree_c" in # order to ensure consistency between the C implementation and the # Pyth...
gpl-2.0
snowball-one/django-oscar-support
tests/unit/test_utils.py
1
2018
import mock from django.test import TestCase from oscar_support import defaults from oscar_support.models import Ticket, TicketStatus from oscar_support.utils import TicketNumberGenerator, TicketStatusGenerator class TestTheTicketNumberGenerator(TestCase): @mock.patch('oscar_support.models.Ticket.objects.count...
bsd-3-clause
zace-yuan/viewfinder
backend/base/test/counters_test.py
13
4162
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """ Tests for the viewfinder counters module. """ __author__ = 'matt@emailscrubbed.com (Matt Tracy)' import time from viewfinder.backend.base import counters import unittest class CountersTest(unittest.TestCase): """Test for the various counter types, the Cou...
apache-2.0
twobob/buildroot-kindle
output/build/host-python-2.7.2/Lib/test/re_tests.py
188
31856
#!/usr/bin/env python # -*- mode: python -*- # Re test suite and benchmark suite v1.5 # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just speed. The # first element of each tuple is the regex ...
gpl-2.0
kalkehcoisa/django-optimus
optimus/sitemaps/tests/https.py
219
2550
from __future__ import unicode_literals from datetime import date from django.test.utils import override_settings from .base import SitemapTestsBase class HTTPSSitemapTests(SitemapTestsBase): protocol = 'https' urls = 'django.contrib.sitemaps.tests.urls.https' def test_secure_sitemap_index(self): ...
unlicense
reinout/django
tests/template_tests/filter_tests/test_join.py
93
2936
from django.template.defaultfilters import join from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class JoinTests(SimpleTestCase): @setup({'join01': '{{ a|join:", " }}'}) def test_join01(self): output = self.engine.render_to_string('join01...
bsd-3-clause
Tesora/tesora-horizon
openstack_dashboard/dashboards/identity/roles/views.py
63
3427
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
earonesty/bitcoin
test/functional/proxy_test.py
5
8427
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind with different proxy configuration. Test plan: - Start bitcoind's with different proxy c...
mit
Jeff-Tian/mybnb
Python27/Lib/lib2to3/fixes/fix_execfile.py
60
2050
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for execfile. This converts usages of the execfile function into calls to the built-in exec() function. """ from .. import fixer_base from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot...
apache-2.0
nghia-huynh/gem5-stable
src/mem/slicc/ast/StateDeclAST.py
43
3217
# Copyright (c) 2011 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions...
bsd-3-clause
jbradberry/dxr
dxr/plugins/clang/tests/test_direct.py
2
5097
from dxr.plugins.clang.tests import CSingleFileTestCase, MINIMAL_MAIN class TypeAndMethodTests(CSingleFileTestCase): source = """ class MemberFunction { public: void member_function(int a); // Don't assume the qualname void MEMBER_FUNCTION(int a); ...
mit
bmordue/nb
src/connectors/DbConnector.py
1
1433
class DbConnector: def __init__(self): pass def add_comment_count(self, comments_url, count): raise NotImplementedError def add_story(self, nb_hash, added, comments_url, story_url): raise NotImplementedError def close_connection(self): raise NotImplementedError de...
mit
sinhrks/numpy
numpy/distutils/fcompiler/sun.py
167
1690
from __future__ import division, absolute_import, print_function from numpy.distutils.ccompiler import simple_version_match from numpy.distutils.fcompiler import FCompiler compilers = ['SunFCompiler'] class SunFCompiler(FCompiler): compiler_type = 'sun' description = 'Sun or Forte Fortran 95 Compiler' #...
bsd-3-clause
currychou/1
static/Brython3.1.1-20150328-091302/Lib/linecache.py
785
3864
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
gpl-3.0
jessepeterson/commandment
commandment/alembic/versions/71818e983100_create_application_sources_table.py
1
1168
"""Create application_sources table Revision ID: 71818e983100 Revises: da52b64b865f Create Date: 2017-05-18 22:29:40.036227 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '71818e983100' down_revision = None branch_labels = None depends_on = None def upgrade(...
mit
jose36/plugin.video.Jmdl2
servers/modovideo.py
42
4261
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para modovideo # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re, urlparse, urllib, urllib2 import os from ...
apache-2.0
renanrodm/namebench
libnamebench/config_test.py
173
2083
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
gonboy/sl4a
python/src/Lib/test/test_symtable.py
53
7068
""" Test the API of the symtable module. """ import symtable import unittest import warnings from test import test_support TEST_CODE = """ import sys glob = 42 class Mine: instance_var = 24 def a_method(p1, p2): pass def spam(a, b, *var, **kw): global bar bar = 47 x = 23 glob d...
apache-2.0
beswarm/django-allauth
allauth/account/urls.py
13
1336
from django.conf.urls import url from django.views.generic import RedirectView from . import views urlpatterns = [ url(r"^signup/$", views.signup, name="account_signup"), url(r"^login/$", views.login, name="account_login"), url(r"^logout/$", views.logout, name="account_logout"), url(r"^password/chang...
mit
KohlsTechnology/ansible
lib/ansible/module_utils/digital_ocean.py
104
5769
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
MQQiang/kbengine
kbe/res/scripts/common/Lib/tempfile.py
74
21519
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
lgpl-3.0
icyflame/batman
pywikibot/userinterfaces/gui.py
1
21774
# -*- coding: utf-8 -*- """ A window with a unicode textfield where the user can edit. Useful for editing the contents of an article. """ from __future__ import absolute_import, unicode_literals # # (C) Rob W.W. Hooft, 2003 # (C) Daniel Herding, 2004 # Wikiwichtel # (C) Pywikibot team, 2008-2014 # # Distributed ...
mit
cloudcache/zstack-utility
apibinding/apibinding/api_actions.py
1
108915
from apibinding import inventory from apibinding import api from zstacklib.utils import jsonobject class SilentAction(inventory.APISilentMsg): def __init__(self): super(SilentAction, self).__init__() self.sessionUuid = None self.out = None def run(self): if not self.sessionUuid:...
apache-2.0
nightjean/Deep-Learning
tensorflow/contrib/learn/python/learn/metric_spec.py
23
16230
# 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
suitnecniv/dota2
logistic_regression/preprocess.py
4
1990
from pymongo import MongoClient from progressbar import ProgressBar, Bar, Percentage, FormatLabel, ETA import numpy as np np.set_printoptions(threshold=np.nan) client = MongoClient() db = client.dotabot matches = db.matches # We're going to create a training matrix, X, where each # row is a different match and each ...
mit
playm2mboy/edx-platform
openedx/core/djangoapps/content/course_structures/migrations/0002_auto__add_field_coursestructure_discussion_id_map_json.py
64
1536
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'CourseStructure.discussion_id_map_json' db.add_column('co...
agpl-3.0
kaapstorm/trc_me
src/trc_me/core/models.py
1
16613
# -*- coding: utf-8 -*- # This file is part of trc.me. # # trc.me 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. # # trc.me is distrib...
agpl-3.0
demomint/prop
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
dcamposliz/youtube-dl
youtube_dl/extractor/rutv.py
106
7702
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none ) class RUTVIE(InfoExtractor): IE_DESC = 'RUTV.RU' _VALID_URL = r'''(?x) https?://player\.(?:rutv\.ru|vgtrk\.com)/ (?P<path>flas...
unlicense
Bolton-and-Menk-GIS/photos-to-map
PhotosToMap/photomapper/gpsimage/PIL/ImageWin.py
40
6366
# # The Python Imaging Library. # $Id$ # # a Windows DIB display interface # # History: # 1996-05-20 fl Created # 1996-09-20 fl Fixed subregion exposure # 1997-09-21 fl Added draw primitive (for tzPrint) # 2003-05-21 fl Added experimental Window/ImageWindow classes # 2003-09-05 fl Added fromstring/tostring me...
gpl-3.0
papados/ordersys
Lib/site-packages/pip/_vendor/requests/packages/charade/constants.py
3008
1335
######################## 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...
unlicense
jmesteve/medical
openerp/addons_extra/yowsup/Common/debugger.py
22
2095
''' Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, m...
agpl-3.0
yuyunliuhen/automatic-text-categorization
test/gensim_tutorial/topics_and_transformations.py
1
1703
import os from gensim import corpora, models, similarities from pprint import pprint # pretty-printer import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',level=logging.INFO) if (os.path.exists("/tmp/deerwester.dict")): dictionary = corpora.Dictionary.load('/tmp/deerwester.dict') ...
mit
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py
214
3568
from __future__ import unicode_literals import logging import os import re from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE from ctypes.util import find_library from django.contrib.gis.gdal.error import OGRException from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger('django.contrib...
mit
Technorip/Myntra
Django Backend/myntra/env/lib/python2.7/site-packages/django/core/management/commands/compilemessages.py
315
5174
from __future__ import unicode_literals import codecs import glob import os from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import find_command, popen_wrapper from django.utils._os import npath, upath def has_bom(fn): with open(fn, 'rb') as f: sample =...
gpl-2.0
Thingee/cinder
cinder/exception.py
2
19676
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
dimroc/tensorflow-mnist-tutorial
lib/python3.6/site-packages/tensorflow/python/layers/base.py
14
11669
# 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
DirtyUnicorns/android_external_chromium_org
native_client_sdk/src/build_tools/sdk_tools/sdk_update_common.py
168
3249
# Copyright (c) 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. """Utility functions for sdk_update.py and sdk_update_main.py.""" import errno import logging import os import shutil import subprocess import sys impor...
bsd-3-clause
mahendra-r/edx-platform
lms/djangoapps/lti_provider/tests/test_outcomes.py
32
18771
""" Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py """ import unittest from django.test import TestCase from lxml import etree from mock import patch, MagicMock, ANY import requests_oauthlib import requests from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator from stud...
agpl-3.0
jalexvig/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/routing_function_op_test.py
102
2327
# 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
Belxjander/Kirito
Python-3.5.0-main/Lib/encodings/cp866.py
272
34396
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
gpl-3.0
aneeshusa/servo
components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py
276
1371
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface IdentifierConflictAcrossMembers1 { const byte thing1 = 1; readonly attribute long thing1; }; """) results = parser.finish() except: threw = True...
mpl-2.0
joone/chromium-crosswalk
tools/telemetry/telemetry/timeline/tracing_category_filter_unittest.py
10
6210
# 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 unittest from telemetry.timeline import tracing_category_filter class TracingCategoryFilterTests(unittest.TestCase): def CheckCategoryFilters(sel...
bsd-3-clause
ppiotr/Invenio
modules/miscutil/lib/inveniocfg_upgrader_unit_tests.py
6
5504
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 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 ## Licens...
gpl-2.0
peerster/CouchPotatoServer
libs/caper/matcher.py
81
4952
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
sergiohgz/incubator-airflow
tests/sensors/test_timedelta_sensor.py
15
1750
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
mariadb-corporation/maxscale-system-test
maxscale-system-test/maxinfo.py
2
1267
#!/usr/bin/python3 import http.client import os import json import subprocess import threading # Needs to be declared here to allow Python 3 modules to be used def prepare_test(testname = "replication"): subprocess.call(os.getcwd() + "/non_native_setup " + str(testname), shell=True) prepare_test("maxinfo.py") #...
gpl-2.0
thurt/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_unicode_file.py
58
8556
# Test some Unicode file name semantics # We dont test many operations on files other than # that their names can be used with Unicode characters. import os, glob, time, shutil import unicodedata import unittest from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE from test.test_support import TESTF...
apache-2.0
r0e/servo
tests/wpt/harness/setup.py
196
2713
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import glob import os import sys import textwrap from setuptools import setup, find_packages here = os.path.split(__fi...
mpl-2.0
rdhyee/waterbutler
docs/conf.py
3
2074
# Ensure we get the local copy of tornado instead of what's on the standard path import os import sys from waterbutler.version import __version__ sys.path.insert(0, os.path.abspath("..")) master_doc = "index" project = "WaterButler" copyright = "2018, Center For Open Science" version = release = __version__ ext...
apache-2.0
eunchong/build
third_party/sqlalchemy_0_7_1/sqlalchemy/dialects/mssql/information_schema.py
22
4455
# mssql/information_schema.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # TODO: should be using the sys. catalog with SQL Server, not information ...
bsd-3-clause
abo-abo/edx-platform
common/lib/capa/capa/safe_exec/tests/test_lazymod.py
102
1626
"""Test lazymod.py""" import sys import unittest from capa.safe_exec.lazymod import LazyModule class ModuleIsolation(object): """ Manage changes to sys.modules so that we can roll back imported modules. Create this object, it will snapshot the currently imported modules. When you call `clean_up()`,...
agpl-3.0
eeshangarg/zulip
scripts/setup/inline_email_css.py
3
4148
#!/usr/bin/env python3 import os from typing import Set from cssutils import profile from cssutils.profiles import Profiles, macros, properties from premailer import Premailer ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../") EMAIL_TEMPLATES_PATH = os.path.join(ZULIP_PATH, "templates", "...
apache-2.0
rachanarp/patchfield_sample
PatchfieldPd/jni/libpd/python/pygame_test.py
11
1461
from pylibpd import * import array import pygame import numpy BUFFERSIZE = 4096 SAMPLERATE = 44100 BLOCKSIZE = 64 pygame.mixer.init(frequency=SAMPLERATE) m = PdManager(1, 2, SAMPLERATE, 1) patch = libpd_open_patch('bloopy.pd', '.') print "$0: ", patch # this is basically a dummy since we are not actually going to r...
apache-2.0
LtHummus/SpyPartyDraft
test.py
1
3025
from draft.upload_draft_to_manager import Uploader from room import Room from draft.draft import Draft import json def get_map_by_name(name, pool): return [x for x in pool if x.slug == name][0] if __name__ == '__main__': from draft.map import Map from draft.drafttype import DraftType # (self, room_id...
mit
majora2007/plexpy
lib/unidecode/x054.py
251
4583
data = ( 'Mie ', # 0x00 'Xu ', # 0x01 'Mang ', # 0x02 'Chi ', # 0x03 'Ge ', # 0x04 'Xuan ', # 0x05 'Yao ', # 0x06 'Zi ', # 0x07 'He ', # 0x08 'Ji ', # 0x09 'Diao ', # 0x0a 'Cun ', # 0x0b 'Tong ', # 0x0c 'Ming ', # 0x0d 'Hou ', # 0x0e 'Li ', # 0x0f 'Tu ', # 0x10 'Xiang ...
gpl-3.0
frederick623/HTI
wat_py/monthly_report.py
1
4845
import sqlite3 import csv import re import win32com.client import os def question_marks(st): question_marks = '?' for i in range(0, len(st.split(','))-1): question_marks = question_marks + ",?" return question_marks def csv_to_arr(csv_file, start=0, has_header=True, delimiter=','): arr = [] with open(csv_file,...
apache-2.0
eht16/suds-improvements
tests/axis2.py
64
4781
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
LedgerHQ/blue-loader-python
ledgerblue/Dongle.py
1
1416
""" ******************************************************************************* * Ledger Blue * (c) 2016 Ledger * * 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-2.0
alexlo03/ansible
lib/ansible/modules/storage/netapp/na_ontap_lun_map.py
9
8496
#!/usr/bin/python """ this is lun mapping module (c) 2018, NetApp, Inc # 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
rschnapka/bank-payment
account_banking_nl_triodos/__openerp__.py
1
2042
############################################################################## # # Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>) # and Therp BV (<http://therp.nl>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
trunglq7/horizon
openstack_dashboard/dashboards/admin/networks/subnets/tables.py
10
2757
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC 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 #...
apache-2.0
mattt416/neutron
neutron/db/migration/alembic_migrations/versions/liberty/expand/52c5312f6baf_address_scopes.py
40
1206
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
calico/basenji
bin/archive/basenji_average.py
1
2676
#!/usr/bin/env python # Copyright 2017 Calico 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