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
dnech/DIS2
app/1.1.0/resources/www_configurator/vendor/ionicons-2.0.1/builder/scripts/generate_font.py
348
5381
# Font generation script from FontCustom # https://github.com/FontCustom/fontcustom/ # http://fontcustom.com/ import fontforge import os import md5 import subprocess import tempfile import json import copy SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) INPUT_SVG_DIR = os.path.join(SCRIPT_PATH, '..', '..', '...
mit
tangrams/vbo-convert
vbo_to_obj.py
2
2205
from __future__ import division # required for float results when dividing ints import os, sys from glob import glob from os.path import isfile, join from itertools import islice INPUT=sys.argv[1] # zoom=int(sys.argv[3]) def convert(filename): # todo: get zoom from filename zoom=15# current zoom level - sets x & y...
mit
leeon/annotated-django
django/contrib/messages/tests/urls.py
6
2465
from django.conf.urls import url from django.contrib import messages from django.core.urlresolvers import reverse from django import forms from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext, Template from django.template.response import TemplateResponse from django.vie...
bsd-3-clause
iradul/phantomjs-clone
src/breakpad/src/tools/gyp/test/variables/gyptest-commands-ignore-env.py
138
1626
#!/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. """ Test that environment variables are ignored when --ignore-environment is specified. """ import os import TestGyp os.environ['GYP_DEFI...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/Jinja2/examples/rwbench/rwbench.py
75
3346
# -*- coding: utf-8 -*- """ RealWorldish Benchmark ~~~~~~~~~~~~~~~~~~~~~~ A more real-world benchmark of Jinja2. Like the other benchmark in the Jinja2 repository this has no real-world usefulnes (despite the name). Just go away and ignore it. NOW! :copyright: (c) 2009 by the Jinja Team. ...
agpl-3.0
chenc10/Spark-PAF
dist/ec2/lib/boto-2.34.0/boto/manage/__init__.py
271
1108
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
apache-2.0
varunnaganathan/django
django/contrib/gis/gdal/error.py
535
1996
""" This module houses the GDAL & SRS Exception objects, and the check_err() routine which checks the status code returned by GDAL/OGR methods. """ # #### GDAL & SRS Exceptions #### class GDALException(Exception): pass # Legacy name OGRException = GDALException class SRSException(Exception): pass cla...
bsd-3-clause
ssgeejr/mitropm
browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/property_parser.py
37
4241
# 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 re import codecs class MalformedLocaleFileError(Exception): pass def parse_file(path): return parse(rea...
gpl-3.0
ivanberry/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-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 required by applicable la...
apache-2.0
kiyoto/statsmodels
statsmodels/iolib/tests/test_summary.py
31
1535
'''examples to check summary, not converted to tests yet ''' from __future__ import print_function if __name__ == '__main__': from statsmodels.regression.tests.test_regression import TestOLS #def mytest(): aregression = TestOLS() TestOLS.setupClass() results = aregression.res1 r_summary = s...
bsd-3-clause
vim-IDE/python-mode
pymode/libs2/rope/refactor/wildcards.py
22
5833
from rope.base import ast, evaluate, builtins, pyobjects from rope.refactor import patchedast, occurrences class Wildcard(object): def get_name(self): """Return the name of this wildcard""" def matches(self, suspect, arg): """Return `True` if `suspect` matches this wildcard""" class Suspec...
lgpl-3.0
rhinstaller/pykickstart
tests/commands/keyboard.py
3
3784
# # Paul W. Frields <pfrields@redhat.com> # # Copyright 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be ...
gpl-2.0
arunchaganty/obviousli
third-party/stanza/stanza/util/postgres.py
3
2280
""" Utilities to use when interfacing with Postgres. - These utilities support the workflow wherein you store annoated sentences in a database. """ __author__ = 'arunchaganty' import os import stanza import requests import logging def unescape_sql(inp): """ :param inp: an input string to be unescaped :re...
apache-2.0
camptocamp/ngo-addons-backport
addons/mail/tests/test_mail_gateway.py
10
34792
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
apache/airflow
tests/providers/amazon/aws/operators/test_sagemaker_transform.py
3
3951
# # 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...
apache-2.0
motion2015/a3
cms/lib/xblock/test/test_authoring_mixin.py
48
5161
""" Tests for the Studio authoring XBlock mixin. """ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.partitions.partitions import Group, UserPartition class AuthoringMixinTestCase(ModuleStoreTestCase): ...
agpl-3.0
tudennis/LeetCode---kamyu104-11-24-2015
Python/russian-doll-envelopes.py
2
1377
# Time: O(nlogn + nlogk) = O(nlogn), k is the length of the result. # Space: O(1) # You have a number of envelopes with widths and heights given # as a pair of integers (w, h). One envelope can fit into another # if and only if both the width and height of one envelope is greater # than the width and height of the ot...
mit
robbiet480/python-social-auth
social/backends/jawbone.py
70
2794
""" Jawbone OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/jawbone.html """ from social.utils import handle_http_errors from social.backends.oauth import BaseOAuth2 from social.exceptions import AuthCanceled, AuthUnknownError class JawboneOAuth2(BaseOAuth2): name = 'jawbone' AUTHORIZA...
bsd-3-clause
glwu/python-for-android
python3-alpha/python3-src/Lib/test/test_descr.py
46
148012
import builtins import sys import types import math import unittest from copy import deepcopy from test import support class OperatorsTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) self.binops = { 'add': '+', ...
apache-2.0
pzdeb/SimpleCommander
src/simple_commander/game/check_collision_test.py
1
2494
import asyncio import datetime import math import time import unittest from SimpleCommander.src.simple_commander.game.hero import Hero from SimpleCommander.src.simple_commander.game.invader import Invader class Controller(): game_field = {'height': 1000, 'width': 1000} collisions = {} @asyncio.coroutine...
mit
tumf/xen-3.3.1
tools/python/logging/logging-0.4.9.2/test/log_test3.py
42
3360
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
gpl-2.0
martonw/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
115
25274
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
ShawnPengxy/Flask-madeBlog
site-packages/werkzeug/_internal.py
148
13713
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
mit
saurabhbajaj207/CarpeDiem
venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
mit
heynemann/whos-on-server
setup.py
1
1506
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of whoson. # https://github.com/heynemann/whos-on-server # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT-license # Copyright (c) 2015, Bernardo Heynemann <heynemann@gmail.com> from setuptools import setup, find_packages from...
mit
vtslab/sensafety-midterm
ilp/Libxml2_Library/Downloads/libxml2-2.9.1/python/tests/reader2.py
32
5345
#!/usr/bin/python -u # # this tests the DTD validation with the XmlTextReader interface # import sys import glob import string import libxml2 try: import StringIO str_io = StringIO.StringIO except: import io str_io = io.StringIO # Memory debug specific libxml2.debugMemory(1) err="" expect="""../../tes...
apache-2.0
skitzycat/beedraw
beeeventstack.py
1
16265
# Beedraw/Hive network capable client and server allowing collaboration on a single image # Copyright (C) 2009 Thomas Becker # # 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; eith...
gpl-2.0
f4nt/djpandora
djpandora/migrations/0012_auto__add_field_song_album_art.py
1
6939
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Song.album_art' db.add_column('djpandora_song', 'album_art', self.gf('django.db.models.fie...
bsd-3-clause
MartijnBraam/CouchPotatoServer
couchpotato/core/media/_base/media/index.py
5
5476
from string import ascii_letters from hashlib import md5 from CodernityDB.tree_index import MultiTreeBasedIndex, TreeBasedIndex from couchpotato.core.helpers.encoding import toUnicode, simplifyString class MediaIndex(MultiTreeBasedIndex): _version = 3 custom_header = """from CodernityDB.tree_index import Mu...
gpl-3.0
vovanbo/django-oscar
tests/functional/customer/alert_tests.py
39
2902
from django_webtest import WebTest from django.core.urlresolvers import reverse from django.core import mail from oscar.apps.customer.models import ProductAlert from oscar.test.factories import create_product, create_stockrecord from oscar.test.factories import UserFactory class TestAUser(WebTest): def test_can...
bsd-3-clause
sacnayak/ssnayak-viz
lib/werkzeug/useragents.py
257
5418
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta...
apache-2.0
andreparrish/python-for-android
python3-alpha/python3-src/Lib/test/test_sysconfig.py
47
13554
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest import sys import os import subprocess import shutil from copy import copy, deepcopy from test.support import (run_unittest, TESTFN, unlink, get_attribute, ...
apache-2.0
orvi2014/kitsune
kitsune/questions/tests/test_forms.py
17
3740
from django.contrib.auth.models import AnonymousUser from nose.tools import eq_ from kitsune.questions.forms import NewQuestionForm, WatchQuestionForm from kitsune.questions.tests import TestCaseBase from kitsune.users.tests import user class WatchQuestionFormTests(TestCaseBase): """Tests for WatchQuestionForm....
bsd-3-clause
boddumanohar/Holmes-Totem
src/main/scala/org/holmesprocessing/totem/services/zipmeta/holmeslibrary/files.py
2
3314
import mmap # import tempfile # import shutil # import os class LargeFileReader (object): """ FOr mapping file to virtual memory. File-like (read-only) object trimmed for low memory footprint. Reading and finding does not advance the offset. Usage: # open file = LargeFileReader("/f...
apache-2.0
qedsoftware/commcare-hq
corehq/form_processor/utils/general.py
1
2578
import threading from django.conf import settings from corehq.toggles import NEW_EXPORTS, TF_DOES_NOT_USE_SQLITE_BACKEND _thread_local = threading.local() def get_local_domain_sql_backend_override(domain): try: return _thread_local.use_sql_backend[domain] except (AttributeError, KeyError): ...
bsd-3-clause
meabsence/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/client_online_test.py
87
3314
#!/usr/bin/python # # Copyright (C) 2008 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 ...
apache-2.0
Dandandan/wikiprogramming
jsrepl/build/extern/python/closured/lib/python2.7/mailbox.py
74
78102
#! /usr/bin/env python """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import sys im...
mit
krafczyk/spack
var/spack/repos/builtin/packages/perl-devel-globaldestruction/package.py
5
1639
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
YNedderhoff/aspect-classifier
modules/perceptron.py
2
2250
class classifier(object): # initialize classifier setting all weights to 0.5: def __init__(self, tag, feat_vec, lmi_dict, top_x): self.tag = tag self.top_x = top_x self.lmi_dict = lmi_dict self.feat_vec = feat_vec self.weight_vector = [0.0 for ind in range(len(feat_vec))...
mit
Demolisty24/AlexaFood-Backend
venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
samdoran/ansible
lib/ansible/plugins/inventory/host_list.py
14
2818
# Copyright 2017 RedHat, 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 i...
gpl-3.0
CWSL/cwsl-mas
cwsl/vt_modules/mv_output.py
4
1316
""" Authors: Tim Bedin Copyright 2015 CSIRO, Australian Government Bureau of Meteorology 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
quattor/aquilon
tests/broker/test_update_cluster_systemlist.py
1
6721
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2016,2017 Contributor # # 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 co...
apache-2.0
albertjan/pypyjs
website/js/pypy.js-0.2.0/lib/modules/timeit.py
8
12671
#! /usr/bin/env python """Tool for measuring execution time of small code snippets. This module avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the Algorithms chapter in the Python Cookbook, published by O'Reilly. Library usage: see the Timer class. Command line ...
mit
microcom/odoo
addons/project_issue/project_issue.py
12
30631
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import calendar from datetime import datetime,date from dateutil import relativedelta import json import time from openerp import api from openerp import SUPERUSER_ID from openerp import tools from openerp.osv import fie...
agpl-3.0
etherkit/OpenBeacon2
client/linux-x86/venv/lib/python3.8/site-packages/cmd2/command_definition.py
3
2466
# coding=utf-8 """ Supports the definition of commands in separate classes to be composed into cmd2.Cmd """ from typing import Optional, Type from .constants import COMMAND_FUNC_PREFIX from .exceptions import CommandSetRegistrationError # Allows IDEs to resolve types without impacting imports at runtime, breaking cir...
gpl-3.0
slayerjain/servo
tests/wpt/update/fetchlogs.py
222
3183
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import cStringIO import gzip import json import os import requests import urlparse treeherder_base = "h...
mpl-2.0
Trult/youtube-dl
youtube_dl/extractor/sztvhu.py
148
1679
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor class SztvHuIE(InfoExtractor): _VALID_URL = r'http://(?:(?:www\.)?sztv\.hu|www\.tvszombathely\.hu)/(?:[^/]+)/.+-(?P<id>[0-9]+)' _TEST = { 'url': 'http://sztv.hu/hirek/cserkeszek-nepszerusitettek-a-kornye...
unlicense
ppries/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test_utils.py
11
2081
# 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
leb2dg/osf.io
addons/onedrive/models.py
4
9726
# -*- coding: utf-8 -*- import os import urllib import logging from django.db import models from addons.base import exceptions from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings, BaseStorageAddon) from addons.onedrive import settings from addons.onedrive.clien...
apache-2.0
ensemblr/llvm-project-boilerplate
include/llvm/projects/libcxx/utils/google-benchmark/tools/gbench/report.py
50
5098
"""report.py - Utilities for reporting statistics about benchmark results """ import os class BenchmarkColor(object): def __init__(self, name, code): self.name = name self.code = code def __repr__(self): return '%s%r' % (self.__class__.__name__, (self.name, sel...
mit
likaiguo/flask-admin
examples/layout_bootstrap3/app.py
43
6109
import os import os.path as op from flask import Flask from flask_sqlalchemy import SQLAlchemy import flask_admin as admin from flask_admin.contrib.sqla import ModelView # Create application app = Flask(__name__) # Create dummy secrey key so we can use sessions app.config['SECRET_KEY'] = '123456790' # Create in-me...
bsd-3-clause
bmotlaghFLT/FLT_PhantomJS
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader.py
124
4953
# Copyright (c) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
jturney/psi4
psi4/driver/inputparser.py
6
28874
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
baojie/pydatalog
pyDatalog/examples/console.py
1
1673
""" pyDatalog Copyright (C) 2012 Pierre Carbonnelle This library 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 2 of the License, or (at your option) any later version. This lib...
lgpl-2.1
alexjc/pylearn2
pylearn2/sandbox/cuda_convnet/convnet_compile.py
44
6654
import errno import logging import os import shutil import stat import sys from theano import config from theano.gof.cmodule import get_lib_extension from theano.gof.compilelock import get_lock, release_lock from theano.sandbox import cuda from theano.sandbox.cuda import nvcc_compiler from .shared_code import this_di...
bsd-3-clause
ayshrimali/Appium-UIAutomation
automation/mobile/uicomponents.py
1
2002
#!/usr/bin/env python # 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
jabeerahmed/testrepo
term1/Lessons/LaneDetection/finding_lane_lines_color_region.py
1
2342
import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np # Read in the image and print out some stats # Note: in the previous example we were reading a .jpg # Here we read a .png and convert to 0,255 bytescale image = mpimg.imread('../images/test.jpg') # Grab the x and y size and make a co...
gpl-2.0
axinging/chromium-crosswalk
tools/auto_bisect/source_control_test.py
45
3231
# 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. """Unit tests for the source_control module.""" import unittest import mock import source_control class SourceControlTest(unittest.TestCase): @mock.pa...
bsd-3-clause
rabipanda/tensorflow
tensorflow/contrib/lite/schema/upgrade_schema.py
19
12877
# ============================================================================== # 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 ...
apache-2.0
yati-sagade/incubator-airflow
tests/contrib/operators/test_pubsub_operator.py
5
6123
# -*- 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
Datera/cinder
cinder/tests/unit/volume/drivers/disco/test_create_snapshot.py
3
5947
# (c) Copyright 2015 Industrial Technology Research Institute. # # 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 re...
apache-2.0
44px/redash
redash/permissions.py
7
2344
import functools from flask_login import current_user from flask_restful import abort from funcy import flatten view_only = True not_view_only = False ACCESS_TYPE_VIEW = 'view' ACCESS_TYPE_MODIFY = 'modify' ACCESS_TYPE_DELETE = 'delete' ACCESS_TYPES = (ACCESS_TYPE_VIEW, ACCESS_TYPE_MODIFY, ACCESS_TYPE_DELETE) def...
bsd-2-clause
willcodefortea/wagtail
wagtail/wagtailimages/wagtail_hooks.py
4
3778
from django.conf import settings from django.conf.urls import include, url from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.utils.html import format_html, format_html_join from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore import hoo...
bsd-3-clause
khkaminska/bokeh
bokeh/validation/decorators.py
41
2911
''' Provide decorators help with define Bokeh validation checks. ''' from __future__ import absolute_import from functools import partial from six import string_types def _validator(code_or_name, validator_type): if validator_type == "error": from .errors import codes from .errors import EXT ...
bsd-3-clause
nanolearning/edx-platform
lms/djangoapps/open_ended_grading/utils.py
40
7381
import logging from xmodule.modulestore import search from xmodule.modulestore.django import modulestore, ModuleI18nService from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem from xmodule.open_ended_grading_classes.controller_query_service import ControllerQueryService from xmodule.open_ended_g...
agpl-3.0
implus/jieba
test/test.py
62
4973
#encoding=utf-8 import sys sys.path.append("../") import jieba def cuttest(test_sent): result = jieba.cut(test_sent) print(" / ".join(result)) if __name__ == "__main__": cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。") cuttest("我不喜欢日本和服。") cuttest("雷猴回归人间。") cuttest("工信处女干事每月经过下属科室都要亲口交代24口...
mit
wenjoy/homePage
node_modules/geetest/node_modules/request/node_modules/karma/node_modules/glob/node_modules/inflight/node_modules/tap/node_modules/yamlish/yamlish-py/test/test_input.py
157
1764
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import test try: import unittest2 as unittest except ImportError: import unittest import yamlish test_data_list = [ { "name": "Input test", "in": r"""--- bill-to: address: city: "Royal Oak" ...
mit
xingh/jaikuengine
common/decorator.py
33
1652
# Copyright 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 writing, ...
apache-2.0
minghuascode/pyj
examples/gwtcanvas/__main__.py
7
1088
#!/usr/bin/env python # -*- coding: utf-8 -*- TARGETS = [ 'GWTCanvasDemo.py', 'SVGCanvasDemo.py', ] PACKAGE = { 'title': 'GWT Canvas', 'desc': 'Port of GWTCanvas Example', } def setup(targets): '''Setup example for translation, MUST call util.setup(targets).''' util.setup(targets) def tr...
apache-2.0
pyconca/2017-web
pyconca2017/tests/test_views.py
1
1467
from test_plus.test import TestCase from datetime import date from pyconca2017.pycon_schedule.models import Schedule class WebPagesTests(TestCase): def test_homepage(self): response = self.client.get(self.reverse('home')) self.assertEqual(response.status_code, 200) def test_about(self): ...
mit
matrixise/epcon
p3/management/commands/users_with_unassigned_tickets.py
4
3569
# -*- coding: utf-8 -*- """ Print information of the users who got unassigned tickets.""" from django.core.management.base import BaseCommand, CommandError from django.core import urlresolvers from django.conf import settings from conference import models from conference import utils from p3 import models as p3_model...
bsd-2-clause
krkhan/azure-linux-extensions
VMEncryption/main/ConfigUtil.py
8
3221
#!/usr/bin/env python # # VMEncryption extension # # Copyright 2015 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
apache-2.0
pytorn/hackr
hackr/Graphs.py
1
2839
import matplotlib.pyplot as plt # Matplotlib module has been used for plotting # Class plot1 has been made to plot given coordinates in different graph styles # For each graph style a function has been defined # For saving the figure a function has been defined , You have to provide the full path # For example in Ubunt...
apache-2.0
PW-Sat2/PWSat2OBC
integration_tests/tests/test_experiment_detumbling.py
1
2259
import logging from datetime import timedelta, datetime import telecommand from obc.experiments import ExperimentType from response_frames.common import ExperimentSuccessFrame from system import auto_power_on, runlevel from tests.base import RestartPerTest from utils import TestEvent class TestExperimentD...
agpl-3.0
jwlawson/tensorflow
tensorflow/python/keras/_impl/keras/layers/normalization.py
28
5754
# 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
datsfosure/ansible
lib/ansible/playbook/playbook_include.py
37
5458
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
mickem/json-protobuf
json_protobuf/generator.py
1
14445
# Copyright 2014 Michael Medin # # 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 w...
apache-2.0
francisc0garcia/autonomous_bicycle
test/convert_csv_files.py
1
1323
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri May 26 10:24:07 2017 @author: pach0 """ import os from fnmatch import fnmatch import pandas as pd root = '/home/pach0/Documents/autonomous_bicycle/code/' pattern = "*.csv" filenames = [] files = [] for path, subdirs, files in os.walk(root): for n...
apache-2.0
HumanExposure/factotum
dashboard/migrations/0171_product_uber_puc_view.py
1
1753
# Generated by Django 2.2.14 on 2020-11-04 16:14 from django.db import migrations import django_db_views.migration_functions import django_db_views.operations class Migration(migrations.Migration): dependencies = [("dashboard", "0170_product_fields_verbose_name")] operations = [ django_db_views.ope...
gpl-3.0
Clyde-fare/scikit-learn
sklearn/metrics/scorer.py
211
13141
""" The :mod:`sklearn.metrics.scorer` submodule implements a flexible interface for model selection and evaluation using arbitrary score functions. A scorer object is a callable that can be passed to :class:`sklearn.grid_search.GridSearchCV` or :func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame...
bsd-3-clause
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/ruamel_yaml/scalarint.py
5
3069
# coding: utf-8 from __future__ import print_function, absolute_import, division, unicode_literals if False: # MYPY from typing import Text, Any, Dict, List # NOQA __all__ = ["ScalarInt", "BinaryInt", "OctalInt", "HexInt", "HexCapsInt"] from .compat import no_limit_int # NOQA class ScalarInt(no_limit_int):...
apache-2.0
amimoto-ami/amimoto-amazon-alexa
amimoto_alexa/dispatchers.py
1
6974
#!/usr/bin/env python # -*- coding: utf-8 -*- """ for amimoto_alexa """ from helpers import * from debugger import * import yaml import random def dispatch_question(intent, session): """Dispatch questions and return answer. """ session_attributes = build_session_attributes(session) should_end_sessi...
mit
mostlygeek/splice
tests/base.py
3
2317
import os import csv from splice.environment import Environment from splice.webapp import create_webapp from flask.ext.testing import TestCase db_uri = os.environ.get('TEST_DB_URI') or 'postgres://localhost/splice_test' env = Environment.instance(test=True, test_db_uri=db_uri) class BaseTestCase(TestCase): def ...
mpl-2.0
superna9999/pyfdt
samples/python-generate.py
2
2194
#!/usr/bin/env python from pyfdt.pyfdt import * phandle = 1 root = FdtNode("/") chosen = FdtNode("chosen") aliases = FdtNode("aliases") memory = FdtNode("memory") cpus = FdtNode("cpus") clocks = FdtNode("clocks") soc = FdtNode("soc") soc_intc = FdtNode("interrupt-controller") soc_uart = FdtNode("uart@0xF000E000") ro...
apache-2.0
about-dev/sf_application_form
vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
mit
prutseltje/ansible
lib/ansible/modules/network/onyx/onyx_mlag_ipl.py
118
6779
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
dtroyer/python-openstacksdk
openstack/identity/v3/group.py
1
1542
# 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 # distributed under t...
apache-2.0
mecury421/gtest
test/gtest_color_test.py
3259
4911
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
espadrine/opera
chromium/src/third_party/scons-2.0.1/engine/SCons/Tool/mingw.py
61
5886
"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) 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 T...
bsd-3-clause
MartijnBraam/CouchPotatoServer
couchpotato/core/media/_base/providers/torrent/ilovetorrents.py
5
7153
import re import traceback from bs4 import BeautifulSoup from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentProvider lo...
gpl-3.0
Galexrt/zulip
zerver/tests/test_user_groups.py
2
2288
# -*- coding: utf-8 -*- from typing import Any, List, Optional, Text import django import mock from zerver.lib.test_classes import ZulipTestCase from zerver.lib.user_groups import ( check_add_user_to_user_group, check_remove_user_from_user_group, create_user_group, get_user_groups, user_groups_in_...
apache-2.0
Tejeshwarabm/Westwood
src/point-to-point/bindings/modulegen__gcc_ILP32.py
38
407808
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
mambelli/osg-bosco-marco
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/fr.py
10
7460
apiAttachAvailable = u'API disponible' apiAttachNotAvailable = u'Indisponible' apiAttachPendingAuthorization = u'Autorisation en attente' apiAttachRefused = u'Refus\xe9' apiAttachSuccess = u'Connexion r\xe9ussie' apiAttachUnknown = u'Inconnu' budDeletedFriend = u'Supprim\xe9 de la liste d\u2019amis' budFriend = ...
apache-2.0
linuxium/ubuntu-yakkety
scripts/gdb/linux/proc.py
265
5905
# # gdb helper commands and functions for Linux kernel debugging # # Kernel proc information reader # # Copyright (c) 2016 Linaro Ltd # # Authors: # Kieran Bingham <kieran.bingham@linaro.org> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import constants from linux impor...
gpl-2.0
alu042/edx-platform
lms/djangoapps/commerce/api/v1/tests/test_models.py
127
1169
""" Tests for models. """ import ddt from django.test import TestCase from commerce.api.v1.models import Course from course_modes.models import CourseMode @ddt.ddt class CourseTests(TestCase): """ Tests for Course model. """ def setUp(self): super(CourseTests, self).setUp() self.course = Cour...
agpl-3.0
daler/Pharmacogenomics_Prediction_Pipeline_P3
doc/custom_dot.py
4
3743
#!/usr/bin/env python """ This script is used to create color-coded sub-DAGs for the documentation. It is intended to be run from the "doc" directory, and can be triggered by running the Makefile target "dags". The "Snakefile" is run with each set of targets defined by the config.yaml file to create a DAG just for th...
cc0-1.0
eadgarchen/tensorflow
tensorflow/python/keras/_impl/keras/applications/vgg16_test.py
34
1854
# 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
Goldmund-Wyldebeast-Wunderliebe/django-diazo
django_diazo/migrations/0006_auto__del_field_theme_rules.py
1
1188
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Theme.rules' db.delete_column(u'django_diazo_theme', 'rules') def backwards(self, or...
gpl-2.0
TRox1972/youtube-dl
youtube_dl/extractor/tmz.py
65
2138
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TMZIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tmz\.com/videos/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'http://www.tmz.com/videos/0_okj015ty/', 'md5': '4d22a51ef205b6c06395d8394f72d560', ...
unlicense