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
SwagColoredKitteh/servo
python/servo/bootstrap.py
15
7857
# 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/. from __future__ import absolute_import, print_function from distutils.spawn import find_executable import json import o...
mpl-2.0
robnee/picsim
insdata.py
1
4659
''' This is the instruction data grabbed from the Instruction Set Summary table in the Pic data sheet for an enhanced midrange (14bit) processor such as the 16f1826 or 12f1822. This is used to initialize the decoder. fields: mnemonic arguments description cycles opcode format status bits affe...
gpl-3.0
praveenkumar/ansible
test/units/template/test_safe_eval.py
14
1768
# (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
jonathonwalz/ansible
test/units/plugins/cache/test_cache.py
91
4078
# (c) 2012-2015, 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
gaddman/ansible
lib/ansible/modules/network/avi/avi_pool.py
29
20387
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
SCOAP3/invenio
invenio/legacy/bibdocfile/plugins/bom_textdoc.py
13
6894
# This file is part of Invenio. # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any l...
gpl-2.0
dannyperry571/theapprentice
script.module.youtube.dl/lib/youtube_dl/extractor/thisav.py
32
2527
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import remove_end class ThisAVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?thisav\.com/video/(?P<id>[0-9]+)/.*' _TESTS = [{ # jwplayer 'url': 'http://www.thisav.com/video/...
gpl-2.0
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
680
3709
#!/usr/bin/env python # # Copyright 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...
apache-2.0
JinXinDeep/tensorflow
tensorflow/python/ops/numerics.py
11
2734
# Copyright 2015 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 by applicable law or a...
apache-2.0
Laharah/deluge-FileBotTool
filebottool/gtkui/config_ui_gtk3.py
1
9943
from __future__ import absolute_import __author__ = 'laharah' from gi.repository import Gtk import os import time import webbrowser from twisted.internet import defer from deluge.ui.client import client import deluge.component as component from filebottool.common import get_resource from filebottool.common import ...
gpl-3.0
jank3/django
django/core/files/images.py
429
2428
""" Utility functions for handling images. Requires Pillow as you might imagine. """ import struct import zlib from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def ...
bsd-3-clause
rmfitzpatrick/ansible
test/units/modules/packaging/os/test_apk.py
137
1157
from ansible.compat.tests import mock from ansible.compat.tests import unittest from ansible.modules.packaging.os import apk class TestApkQueryLatest(unittest.TestCase): def setUp(self): self.module_names = [ 'bash', 'g++', ] @mock.patch('ansible.modules.packaging.os...
gpl-3.0
kaedroho/django
django/db/migrations/operations/utils.py
2
3791
from collections import namedtuple from django.db.models.fields.related import RECURSIVE_RELATIONSHIP_CONSTANT def resolve_relation(model, app_label=None, model_name=None): """ Turn a model class or model reference string and return a model tuple. app_label and model_name are used to resolve the scope o...
bsd-3-clause
wdwvt1/qiime
scripts/merge_otu_tables.py
15
2246
#!/usr/bin/env python # File created on 30 Aug 2010 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Greg Caporaso", "Daniel McDonald"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporas...
gpl-2.0
tst-eclamar/earthenterprise
earth_enterprise/src/server/wsgi/search/plugin/example_search_handler.py
5
14884
#!/usr/bin/env python2.7 # # Copyright 2017 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 l...
apache-2.0
catapult-project/catapult
tracing/tracing/extras/symbolizer/symbolize_trace.py
4
63468
#!/usr/bin/env python # Copyright 2016 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. # pylint: disable=too-many-lines """ This script processes trace files and symbolizes stack frames generated by Chrome's native heap pr...
bsd-3-clause
petercable/mi-dataset
mi/dataset/parser/adcpt_acfgm_dcl_pd0.py
3
5943
#!/usr/bin/env python """ @package mi.dataset.parser.adcpt_acfgm_dcl_pd0 @file marine-integrations/mi/dataset/parser/adcpt_acfgm_dcl_pd0.py @author Jeff Roy @brief Particle and Parser classes for the adcpt_acfgm_dcl_pd0 drivers The particles are parsed by the common PD0 Parser and Abstract particle class in file adcp_...
bsd-2-clause
RayRuizhiLiao/ITK_4D
Utilities/Doxygen/mcdoc.py
1
5816
#!/usr/bin/env python import sys, os, re, glob try: import io except ImportError: import cStringIO as io def usage(): sys.stdout.write( """usage: mdoc.py set group file [files...] Add the tag "\\ingroup group" to all the doxygen comment with a \\class tag in it. usage: mdoc.py check group ...
apache-2.0
RohitDas/cubeproject
lib/django/contrib/gis/db/backends/spatialite/schema.py
518
6882
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.utils import DatabaseError class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sq...
bsd-3-clause
BlueBrain/ITK
Modules/ThirdParty/pygccxml/src/pygccxml/binary_parsers/undname.py
12
10352
# Copyright 2014 Insight Software Consortium. # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt """ provides low-level functionality, needed to undecorate\demangle compiler generated unique names and map them to the declaratio...
apache-2.0
rail/treeherder
tests/webapp/api/test_note_api.py
11
5277
import json from django.contrib.auth.models import User from django.core.urlresolvers import reverse from rest_framework.test import APIClient def test_note_list(webapp, sample_notes, jm): """ test retrieving a list of notes from the note-list endpoint """ job_id = jm.get_job_list(0, 1)[0]["id"] ...
mpl-2.0
grschafer/alacrity
alacrity/spritesheets/hero_icons_to_sheet.py
1
1432
import os from PIL import Image import dota_file_parser # data from dota2 files: resource/flash3/images/heroes print 'Expecting hero icons to be in "heroes" (e.g. "heroes/antimage.png")' print 'Expecting hero data to be in current folder (e.g. "npc_heroes.txt")' hero_data = dota_file_parser.parse('npc_heroes.txt') he...
mit
chaimleib/intervaltree
test/intervaltree_methods/restructure_test.py
1
17270
""" intervaltree: A mutable, self-balancing interval tree for Python 2 and 3. Queries may be by point, by range overlap, or by range envelopment. Test module: IntervalTree, Special methods Copyright 2013-2018 Chaim Leib Halbert Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file...
apache-2.0
science-is-the-new-black/bio_stuff
translate/translate.py
1
1635
"""Script for translating given sequence.""" from translate_dicts import translation_code import regex as re def translate_handler(sequence, start=False, Frame='all', code='translation_code', reverse=True) if reverse == True: return translate(sequence, start=start, Frame=Frame, code=code), ...
agpl-3.0
asfaltboy/GitSavvy
core/commands/init.py
1
5716
import os import sublime from sublime_plugin import WindowCommand from ..git_command import GitCommand from ...common import util NO_REPO_MESSAGE = ("It looks like you haven't initialized Git in this directory. " "Would you like to?") REPO_PATH_PROMPT = "Enter root path of new git repo:" CONFIRM...
mit
wifidog/wifidog-gateway
contrib/load-tester/common.py
13
1508
# -*- coding: utf-8 -*- import socket import fcntl import struct import argparse # http://stackoverflow.com/questions/159137/getting-mac-address def get_mac_address(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', ifname[:15])) retu...
gpl-2.0
anielsen001/scipy
scipy/weave/accelerate_tools.py
97
12946
#**************************************************************************# #* FILE ************** accelerate_tools.py ************************# #**************************************************************************# #* Author: Patrick Miller February 9 2002 *# #***********...
bsd-3-clause
V155/qutebrowser
qutebrowser/browser/webkit/rfc6266.py
5
9768
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
mikewiebe-ansible/ansible
test/units/modules/network/check_point/test_cp_mgmt_service_icmp.py
19
3878
# Ansible module to manage CheckPoint Firewall (c) 2019 # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dist...
gpl-3.0
JakeTobin/kenthackenoughF2015
Pi/flask/test_flaskr.py
157
2059
# -*- coding: utf-8 -*- """ Flaskr Tests ~~~~~~~~~~~~ Tests the Flaskr application. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import os import flaskr import tempfile @pytest.fixture def client(request): db_fd, flaskr.app.config['...
mit
philanthropy-u/edx-platform
lms/djangoapps/mobile_api/users/views.py
2
15245
""" Views for user API """ import json from django.shortcuts import redirect from django.utils import dateparse from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import UsageKey from rest_framework import generics, views from rest_framework.decorators import api_view from rest_framework.response import...
agpl-3.0
xzturn/tensorflow
tensorflow/python/layers/pooling_test.py
21
8576
# 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
google/material-design-icons
update/venv/lib/python3.9/site-packages/pip/_internal/utils/unpacking.py
6
9032
"""Utilities related archives. """ import logging import os import shutil import stat import tarfile import zipfile from typing import Iterable, List, Optional from zipfile import ZipInfo from pip._internal.exceptions import InstallationError from pip._internal.utils.filetypes import ( BZ2_EXTENSIONS, TAR_EXT...
apache-2.0
ferabra/edx-platform
lms/djangoapps/licenses/management/commands/import_serial_numbers.py
106
2288
import os.path from django.utils.html import escape from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.django import modulestore from licenses.models import CourseSoftware, UserLicense from opaque_keys.edx.locations import SlashSeparatedCourseKey class Command(BaseCommand): ...
agpl-3.0
ktonon/GameSoup
gamesoup/expressions/context.py
1
1688
import UserDict class TemplateContext(UserDict.UserDict): def update_with_bindings(self, queryset): ''' Given a queryset of bindings, update this template context with any bindings that match parameters. ''' from gamesoup.library.models import InterfaceTemplateParamete...
mit
freeflightsim/ffs-app-engine
ffs-cal.appspot.com/gdata/atom/http_core.py
8
18853
#!/usr/bin/env python # # 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...
gpl-2.0
sourcegraph/pydep
pydep/vcs.py
3
1048
import re repo_url_patterns = [ r'(?:git\+)?((?:https?|git)\://github.com/(?:[^/#]+)/(?:[^/#]+))(?:/.*)?', r'(?:git\+|hg\+)?((?:https?|git|hg)\://bitbucket.org/(?:[^/#]+)/(?:[^/#]+))(?:/.*)?', r'(?:git\+|hg\+)?((?:https?|git|hg)\://code.google.com/p/(?:[^/#]+))(?:/.*)?', ] def parse_repo_url(url): ""...
bsd-3-clause
vrenaville/OCB
addons/account_followup/report/account_followup_print.py
63
5695
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
lukeburden/django-allauth
allauth/socialaccount/providers/basecamp/provider.py
10
1174
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class BasecampAccount(ProviderAccount): def get_avatar_url(self): return None def to_str(self): dflt = super(BasecampAccount, self).to_str() ret...
mit
rkokkelk/CouchPotatoServer
libs/rtorrent/__init__.py
64
24837
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.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, ...
gpl-3.0
danilito19/django
django/core/checks/security/base.py
341
6313
from django.conf import settings from .. import Tags, Warning, register SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, " "SECURE_CONTENT_TYPE_NOSNIFF...
bsd-3-clause
hiroakis/ansible
v1/tests/TestVault.py
118
5121
#!/usr/bin/env python from unittest import TestCase import getpass import os import shutil import time import tempfile from binascii import unhexlify from binascii import hexlify from nose.plugins.skip import SkipTest from ansible import errors from ansible.utils.vault import VaultLib # Counter import fails for 2.0....
gpl-3.0
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/quopri.py
424
6969
#! /usr/bin/env python """Conversions to/from quoted-printable transport encoding as per RFC 1521.""" # (Dec 1991 version). __all__ = ["encode", "decode", "encodestring", "decodestring"] ESCAPE = '=' MAXLINESIZE = 76 HEX = '0123456789ABCDEF' EMPTYSTRING = '' try: from binascii import a2b_qp, b2a_qp except Impo...
agpl-3.0
jriegel/FreeCAD
src/Mod/Path/PathScripts/PathSelection.py
3
8502
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> * #* ...
lgpl-2.1
jeffknupp/sandman2
sandman2/service.py
1
9904
"""Automatically generated REST API services from SQLAlchemy ORM models or a database introspection.""" # Third-party imports from flask import request, make_response import flask from flask.views import MethodView from sqlalchemy import asc, desc # Application imports from sandman2.exception import NotFoundException...
apache-2.0
bliz937/kivy
kivy/core/camera/__init__.py
18
4533
''' Camera ====== Core class for acquiring the camera and converting its input into a :class:`~kivy.graphics.texture.Texture`. .. versionchanged:: 1.8.0 There is now 2 distinct Gstreamer implementation: one using Gi/Gst working for both Python 2+3 with Gstreamer 1.0, and one using PyGST working only for P...
mit
tumbl3w33d/ansible
lib/ansible/modules/network/check_point/cp_mgmt_threat_exception.py
20
6207
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
repotvsupertuga/tvsupertuga.repository
script.vodextende/salts_lib/directstream.py
1
11260
# -*- coding: utf-8 -*- """ VOD TVsupertuga Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Th...
gpl-2.0
nirmeshk/oh-mainline
mysite/profile/migrations/0016_asheesh_make_project_and_project_name_unique_in_projectexp.py
17
6100
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
nin042/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
124
8145
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
mitsuhiko/sentry
src/sentry/south_migrations/0247_migrate_file_blobs.py
7
50599
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import IntegrityError, models, transaction class Migration(DataMigration): def forwards(self, orm): from sentry.utils.query import RangeQuerySetWrapper ...
bsd-3-clause
juhnowski/FishingRod
production/pygsl-0.9.5/examples/bspline.py
1
1107
from pygsl import bspline, multifit, rng import pygsl._numobj as numx N = 200 ncoeffs = 8 nbreak = ncoeffs - 2 bspline = bspline.bspline def run(): r = rng.rng() bw = bspline(4, nbreak) # Data to be fitted x = 15. / (N-1) * numx.arange(N) y = numx.cos(x) * numx.exp(0.1 * x) sigma = .1 ...
mit
ytjiang/django
django/contrib/auth/management/__init__.py
91
6477
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps from django.contrib.auth import get_permission_codename from django.core import exceptions from django.core.management.base import CommandErr...
bsd-3-clause
shakamunyi/beam
sdks/python/apache_beam/metrics/metric_test.py
6
5205
# # 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 us...
apache-2.0
grapesmoker/regulations-parser
regparser/tree/depth/rules.py
7
6355
"""Namespace for constraints on paragraph depth discovery""" from regparser.tree.depth import markers def must_be(value): """A constraint that the given variable must matches the value.""" def inner(var): return var == value return inner def type_match(marker): """The type of the associated...
cc0-1.0
jankeromnes/depot_tools
testing_support/super_mox.py
3
5349
# 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. """Simplify unit tests based on pymox.""" import os import random import shutil import string import StringIO import subprocess import sys sys.path.app...
bsd-3-clause
kaplun/ops
modules/websubmit/lib/functions/Retrieve_Data.py
35
1426
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your ...
gpl-2.0
caphrim007/ansible
lib/ansible/plugins/inventory/script.py
6
8443
# Copyright (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright (c) 2017 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 DOCUMENTATION = ''' invento...
gpl-3.0
raymondnoonan/Mpropulator
MPropulator/readConfig.py
1
1536
import pandas as pd import os from MPropulator import validations as vd def readConfig(config): ''' Reads in the config file as a dataframe and validates the inputs and outputs of this file. args: config is the path to the config file csv output: pandas dataframe that is a parsed and prepped...
mit
PythonNut/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_client.py
442
44484
#!/usr/bin/env python # # Copyright 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...
mpl-2.0
cloudera/hue
desktop/core/ext-py/odfpy-1.4.1/tests/testxmlgen.py
4
5376
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009 Søren Roug, European Environment Agency # # This is free software. You may redistribute it under the terms # of the Apache license and the GNU General Public License Version # 2 or at your option any later version. # # This program is distributed in th...
apache-2.0
kontrafiktion/ansible
docsite/build-site.py
56
2986
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of the Ansible Documentation # # 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 th...
gpl-3.0
TeachAtTUM/edx-platform
openedx/core/djangoapps/oauth_dispatch/tests/test_dop_adapter.py
50
2439
""" Tests for DOP Adapter """ from datetime import timedelta import ddt from django.test import TestCase from django.utils.timezone import now from provider.oauth2 import models from provider import constants from student.tests.factories import UserFactory from ..adapters import DOPAdapter from .constants import DU...
agpl-3.0
librasungirl/openthread
tools/harness-automation/autothreadharness/__init__.py
36
1580
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
DefyVentures/edx-platform
lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py
114
9808
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PaidCourseRegistrationAnnotation' db.create_table('shoppingcart_paidcourseregistrationannota...
agpl-3.0
solvebio/xmltodict
tests/test_xmltodict.py
2
8864
import threading import xml.parsers.expat from xmltodict import parse, ParsingInterrupted try: import unittest2 as unittest except ImportError: import unittest try: from io import BytesIO as StringIO except ImportError: from xmltodict import StringIO def _encode(s): try: return bytes(s, ...
mit
embeddedarm/android_external_chromium_org
tools/telemetry/telemetry/value/value_backcompat.py
36
1984
# 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. """Backward compatibility for old results API. This module helps convert the old PageMeasurementResults API into the new style one. This exists as a bridging...
bsd-3-clause
wskplho/sl4a
python/gdata/src/gdata/urlfetch.py
276
9330
#!/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
slightstone/SickRage
lib/unidecode/x0c4.py
253
5024
data = ( 'sswals', # 0x00 'sswalt', # 0x01 'sswalp', # 0x02 'sswalh', # 0x03 'sswam', # 0x04 'sswab', # 0x05 'sswabs', # 0x06 'sswas', # 0x07 'sswass', # 0x08 'sswang', # 0x09 'sswaj', # 0x0a 'sswac', # 0x0b 'sswak', # 0x0c 'sswat', # 0x0d 'sswap', # 0x0e 'sswah', # 0x0f ...
gpl-3.0
frostynova/calico-docker
calico_containers/adapter/docker_restart.py
1
5239
# Copyright 2015 Metaswitch Networks # # 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
DanteOnline/free-art
venv/lib/python3.4/site-packages/django/contrib/postgres/aggregates/statistics.py
493
2033
from django.db.models import FloatField, IntegerField from django.db.models.aggregates import Aggregate __all__ = [ 'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept', 'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate', ] class StatAggregate(Aggregate): def __in...
gpl-3.0
slyphon/pants
tests/python/pants_test/base/test_build_environment.py
33
1581
# coding=utf-8 # Copyright 2015 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 os import uni...
apache-2.0
jlcarmic/producthunt_simulator
venv/lib/python2.7/site-packages/pip/locations.py
173
5632
"""Locations where we look for configs, install stuff, etc""" from __future__ import absolute_import import os import os.path import site import sys from distutils import sysconfig from distutils.command.install import install, SCHEME_KEYS # noqa from pip.compat import WINDOWS, expanduser from pip.utils import appd...
mit
angdraug/nova
nova/api/ec2/cloud.py
4
86495
# 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
openstack/horizon
openstack_dashboard/test/unit/api/rest/test_utils.py
4
8967
# Copyright 2014, Rackspace, US, 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 w...
apache-2.0
sparkslabs/kamaelia
Code/Python/Kamaelia/Kamaelia/Visualisation/ER/ERLaws.py
6
4531
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
apache-2.0
zurcoin/zurcoin
qa/rpc-tests/rest.py
45
15163
#!/usr/bin/env python3 # Copyright (c) 2014-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 REST interface # from test_framework.test_framework import BitcoinTestFramework from test_fram...
mit
yanheven/nova
nova/tests/unit/image/test_s3.py
69
11230
# Copyright 2011 Isaku Yamahata # 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 b...
apache-2.0
vnsofthe/odoo-dev
addons/gbsoft_weixin/WXBizMsgCrypt.py
6
10637
#!/usr/bin/env python #-*- encoding:utf-8 -*- """ 对公众平台发送给公众账号的消息加解密示例代码. @copyright: Copyright (c) 1998-2014 Tencent Inc. """ # ------------------------------------------------------------------------ import base64 import string import random import hashlib import time import struct from Crypto.Cipher import AES im...
agpl-3.0
kapilt/ansible
test/units/playbook/test_play.py
61
4064
# (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
xodus7/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/sample_stats_test.py
24
18846
# 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
MobinRanjbar/hue
desktop/core/ext-py/requests-2.6.0/requests/__init__.py
151
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
apache-2.0
unseenlaser/machinekit
src/emc/usr_intf/gscreen/mdi.py
36
13854
# Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com> # # Touchy 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. # # Touchy i...
lgpl-2.1
tseaver/google-cloud-python
tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client_config.py
4
4855
config = { "interfaces": { "google.cloud.tasks.v2beta2.CloudTasks": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [], }, "retry_params": { "default": { "initial_...
apache-2.0
AntonKhorev/spb-budget-xls
src/testRecord.py
1
23498
#!/usr/bin/env python3 import unittest import record,number class TestRecordBuilder(unittest.TestCase): def setUp(self): self.text1=[ "1. АДМИНИСТРАЦИЯ ГУБЕРНАТОРА САНКТ- 2 114 774,1", "ПЕТЕРБУРГА (801)", "1.1. Расходы на содержание главы Правительства 0102 0010008 2 026,0", "Санкт-Петербурга", "1....
bsd-2-clause
hahaps/openstack-project-generator
template/<project_name>/tests/unit/api/middleware/test_faults.py
1
11029
# Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
Ohjel/wood-process
base/hero.py
1
1239
import pygame from entity import Entity from animation import Animation HERO_INERTIA = 0.95 HERO_ACCELERATION = 0.1 HERO_HITBOX = pygame.Rect(0, 50, 64, 64) HERO_ANIMATION = (0, 0) class Hero(Entity): def __init__(self, nb, img): #Call the parent constructor Entity.__init__(self, HERO_HITBOX, Tru...
mit
martynovp/edx-platform
common/djangoapps/student/migrations/0002_text_to_varchar_and_indexes.py
188
9581
# 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): # Changing field 'UserProfile.name' db.alter_column('auth_userprofile', 'name', self.gf('django.db.models.fields....
agpl-3.0
chengduoZH/Paddle
python/paddle/fluid/tests/unittests/test_square_error_cost.py
2
2032
# Copyright (c) 2019 PaddlePaddle 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 app...
apache-2.0
adoosii/edx-platform
lms/envs/bok_choy.py
1
6517
""" Settings for Bok Choy tests that are used when running LMS. Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running the tests Note: it isn't possible to have a single settings file, because Django doesn't support both generating sta...
agpl-3.0
pwaller/pgi
examples/cairo/shapes.py
2
1555
#!/usr/bin/python ''' ZetCode PyCairo tutorial This code example draws another three shapes in PyCairo. author: Jan Bodnar website: zetcode.com last edited: August 2012 ''' import sys sys.path.insert(0, '../..') import pgi pgi.install_as_gi() from gi.repository import Gtk class cv(object): points = ( ...
lgpl-2.1
euphorie/Euphorie
src/euphorie/deployment/commands/xmlimport.py
1
7808
from AccessControl.SecurityManagement import getSecurityManager from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import setSecurityManager from euphorie.client import publish from euphorie.content.upload import SurveyImporter from euphorie.content.user import UserPro...
gpl-2.0
Radagast-red/golem
tests/golem/task/dummy/runner.py
2
8435
"""Test script for running a single instance of a dummy task. The task simply computes hashes of some random data and requires no external tools. The amount of data processed (ie hashed) and computational difficulty is configurable, see comments in DummyTaskParameters. """ import atexit import logging import os import ...
gpl-3.0
surgebiswas/poker
PokerBots_2017/Johnny/theano/sandbox/cuda/tests/test_memory.py
6
7415
from __future__ import print_function import copy import gc import numpy as np import theano from theano import tensor from theano.sandbox import cuda from theano import ifelse # Skip test if cuda_ndarray is not available. from nose.plugins.skip import SkipTest if cuda.cuda_available == False: raise SkipTest('Op...
mit
s40523117/2016fallcp_hw
plugin/liquid_tags/test_flickr.py
26
2545
from . import flickr try: from unittest.mock import patch except ImportError: from mock import patch import os import pytest import re PLUGIN_DIR = os.path.dirname(__file__) TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data') @pytest.mark.parametrize('input,expected', [ ('18873146680 la...
agpl-3.0
dustcloud/dustlink
views/web/dustWeb/viz/VizForm.py
2
9108
import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('VizForm') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) import VizjQuery class VizForm(VizjQuery.VizjQuery): #======================== header ==========================...
bsd-3-clause
nvoron23/avos
horizon/utils/filters.py
86
2017
# Copyright 2012 Nebula, 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 agree...
apache-2.0
barnabytprowe/great3-public
validation/plot_variable_submission.py
2
3710
#!/usr/bin/env python # Copyright (c) 2014, the GREAT3 executive committee (http://www.great3challenge.info/?q=contacts) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted # provided that the following conditions are met: # # 1. Redistributions of ...
bsd-3-clause
morreene/tradenews
venv/Lib/encodings/undefined.py
860
1299
""" Python 'undefined' Codec This codec will always raise a ValueError exception when being used. It is intended for use by the site.py file to switch off automatic string to Unicode coercion. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ impo...
bsd-3-clause
dilee/carbon-device-mgt-plugins
features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/httpServer.py
23
4485
#!/usr/bin/env python """ /** * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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...
apache-2.0