repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
eestay/edx-platform
lms/djangoapps/certificates/management/commands/gen_cert_report.py
91
4512
""" Generate a report of certificate statuses """ from django.core.management.base import BaseCommand, CommandError from certificates.models import GeneratedCertificate from django.contrib.auth.models import User from optparse import make_option from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import ...
agpl-3.0
yrizk/django-blog
blogvenv/lib/python3.4/site-packages/django/contrib/sessions/backends/cache.py
61
2497
from django.conf import settings from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.cache import caches from django.utils.six.moves import range KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
apache-2.0
wanghaven/readthedocs.org
readthedocs/builds/filters.py
33
1312
from django.utils.translation import ugettext_lazy as _ import django_filters from readthedocs.builds import constants from readthedocs.builds.models import Build, Version ANY_REPO = ( ('', _('Any')), ) BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES class VersionSlugFilter(django_filters.FilterSet): cla...
mit
willworth/thermos
thermos/Lib/site-packages/setuptools/command/sdist.py
130
6821
from distutils import log import distutils.command.sdist as orig import os import sys import io import contextlib import six from .py36compat import sdist_add_defaults import pkg_resources _default_revctrl = list def walk_revctrl(dirname=''): """Find all files under revision control""" for ep in pkg_resou...
mit
mcking49/apache-flask
Python/Lib/encodings/unicode_escape.py
852
1184
""" Python 'unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is inte...
mit
JavaRabbit/CS496_capstone
appengine/flexible/sendgrid/main_test.py
8
1447
# Copyright 2016 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
gregdek/ansible
lib/ansible/modules/remote_management/ucs/ucs_san_connectivity.py
64
9965
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
bravominski/PennApps2015-HeartMates
venv/lib/python2.7/site-packages/flask/helpers.py
776
33793
# -*- coding: utf-8 -*- """ flask.helpers ~~~~~~~~~~~~~ Implements various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import pkgutil import posixpath import mimetypes from time import time from zlib import adler32 from th...
apache-2.0
rajalokan/nova
nova/notifications/objects/exception.py
3
1991
# 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 # d...
apache-2.0
Cinntax/home-assistant
homeassistant/components/brunt/cover.py
2
5307
"""Support for Brunt Blind Engine covers.""" import logging import voluptuous as vol from homeassistant.const import ATTR_ATTRIBUTION, CONF_PASSWORD, CONF_USERNAME from homeassistant.components.cover import ( ATTR_POSITION, CoverDevice, PLATFORM_SCHEMA, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SE...
apache-2.0
silentfuzzle/calibre
src/html5lib/constants.py
16
89683
from __future__ import absolute_import, division, unicode_literals import string import gettext _ = gettext.gettext EOF = None E = { "null-character": _("Null character in input stream, replaced with U+FFFD."), "invalid-codepoint": _("Invalid codepoint in stream."), "incorrectly-placed-so...
gpl-3.0
skipisz/linux
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
BjoernT/python-openstackclient
openstackclient/tests/fakes.py
1
5201
# Copyright 2013 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 agreed to...
apache-2.0
piotrpawlaczek/suds-jurko
suds/xsd/__init__.py
18
2609
# 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 b...
lgpl-3.0
ahmadshahwan/cohorte-runtime
python/src/lib/python/unidecode/x08d.py
252
4636
data = ( 'Wei ', # 0x00 'Bai ', # 0x01 'Chen ', # 0x02 'Zhuan ', # 0x03 'Zhi ', # 0x04 'Zhui ', # 0x05 'Biao ', # 0x06 'Yun ', # 0x07 'Zeng ', # 0x08 'Tan ', # 0x09 'Zan ', # 0x0a 'Yan ', # 0x0b '[?] ', # 0x0c 'Shan ', # 0x0d 'Wan ', # 0x0e 'Ying ', # 0x0f 'Jin ', # 0x...
apache-2.0
mkmelin/bedrock
tests/pages/partnerships.py
11
1341
# 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 selenium.webdriver.common.by import By from pages.base import BasePage class PartnershipsPage(BasePage): UR...
mpl-2.0
scottlawsonbc/audio-reactive-led-strip
python/visualization.py
2
12877
from __future__ import print_function from __future__ import division import time import numpy as np from scipy.ndimage.filters import gaussian_filter1d import config import microphone import dsp import led _time_prev = time.time() * 1000.0 """The previous time that the frames_per_second() function was called""" _fps...
mit
bstell/TachyFont
run_time/src/gae_server/third_party/fonttools/Lib/fontTools/ttLib/tables/_p_o_s_t.py
8
8856
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools import ttLib from fontTools.ttLib.standardGlyphOrder import standardGlyphOrder from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval, readHex from . import DefaultTable import sys...
apache-2.0
Ravenm/2143-OOP-NASH
python3env/Lib/site-packages/PIL/ImageStat.py
88
3847
# # The Python Imaging Library. # $Id$ # # global image statistics # # History: # 1996-04-05 fl Created # 1997-05-21 fl Added mask; added rms, var, stddev attributes # 1997-08-05 fl Added median # 1998-07-05 hk Fixed integer overflow error # # Notes: # This class shows how to implement delayed evaluation of att...
cc0-1.0
PetePriority/home-assistant
homeassistant/components/abode/camera.py
4
2867
""" This component provides HA camera support for Abode Security System. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.abode/ """ import logging from datetime import timedelta import requests from homeassistant.components.abode import AbodeDevi...
apache-2.0
thorwhalen/ut
ppi/binary_pairs_kv.py
1
8713
__author__ = 'thor' import copy from itertools import combinations class EdgeStats(object): def __init__(self): self._count = CountVal(0.0) self.a = KeyVal() self.ab = KeyVal() def count_data(self, item_iterator): self.__init__() for nodes in item_iterator: ...
mit
skosukhin/spack
lib/spack/external/jinja2/defaults.py
130
1323
# -*- coding: utf-8 -*- """ jinja2.defaults ~~~~~~~~~~~~~~~ Jinja default filters and tags. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import range_type from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner # defaults for ...
lgpl-2.1
leigh123linux/Cinnamon
files/usr/share/cinnamon/cinnamon-desktop-editor/cinnamon-desktop-editor.py
3
17290
#!/usr/bin/python3 import sys import os import gettext import glob from optparse import OptionParser import shutil import subprocess from setproctitle import setproctitle import gi gi.require_version("Gtk", "3.0") gi.require_version("CMenu", "3.0") from gi.repository import GLib, Gtk, Gio, CMenu sys.path.insert(0, '...
gpl-2.0
nicholasserra/sentry
tests/sentry/api/endpoints/test_team_stats.py
10
1170
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.app import tsdb from sentry.testutils import APITestCase class TeamStatsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) team = self.create_team(name='foo') project_1 =...
bsd-3-clause
addition-it-solutions/project-all
addons/hr_timesheet_invoice/report/account_analytic_profit.py
8
5744
# -*- 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
jamesgk/robofab
Lib/robofab/interface/all/dialogs_legacy.py
8
18412
""" Dialogs. Cross-platform and cross-application compatible. Some of them anyway. (Not all dialogs work on PCs outside of FontLab. Some dialogs are for FontLab only. Sorry.) Mac and FontLab implementation written by the RoboFab development team. PC implementation by Eigi Eigendorf and is (C)2002 Eigi Eigendorf. ""...
bsd-3-clause
bioinformatics-ua/catalogue
emif/searchengine/models.py
2
1201
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # 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 vers...
gpl-3.0
tylerjereddy/scipy
scipy/integrate/_ivp/base.py
12
9550
import numpy as np def check_arguments(fun, y0, support_complex): """Helper function for checking arguments common to all solvers.""" y0 = np.asarray(y0) if np.issubdtype(y0.dtype, np.complexfloating): if not support_complex: raise ValueError("`y0` is complex, but the chosen solver doe...
bsd-3-clause
algiopensource/server-tools
users_ldap_push/models/res_company_ldap.py
16
2645
# -*- coding: utf-8 -*- ############################################################################## # # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
Rosy-S/twilio-python
twilio/rest/resources/notifications.py
51
1258
from .util import normalize_dates from . import InstanceResource, ListResource class Notification(InstanceResource): def delete(self): """ Delete this notification """ return self.delete_instance() class Notifications(ListResource): name = "Notifications" instance = Not...
mit
purplecode/node-gyp
gyp/pylib/gyp/generator/xcode.py
1363
58344
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
mit
danlrobertson/servo
tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
238
1454
from wptserve.handlers import HTTPException import urllib def main(request, response): if request.method != "GET": raise HTTPException(400, message="Method was not GET") if not "id" in request.GET: raise HTTPException(400, message="No id") id = request.GET['id'] if "read" in request....
mpl-2.0
zzzombat/lucid-python-django
django/core/handlers/base.py
55
11479
import sys from django import http from django.core import signals from django.utils.encoding import force_unicode from django.utils.importlib import import_module from django.utils.log import getLogger logger = getLogger('django.request') class BaseHandler(object): # Changes that are always applied to a respon...
bsd-3-clause
lordzuko/appengine-mapreduce
python/test/mapreduce/api/map_job/datastore_input_reader_base_test.py
15
9111
#!/usr/bin/env python """Datastore Input Reader Base Test for the map_job API.""" import unittest from google.appengine.api import datastore_types from google.appengine.api import namespace_manager from google.appengine.datastore import datastore_stub_util from google.appengine.ext import testbed from testlib import t...
apache-2.0
medspx/QGIS
tests/src/python/test_qgslayoutgridsettings.py
22
5022
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutGridSettings. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version....
gpl-2.0
kirca/odoo
addons/base_import/__openerp__.py
62
1229
{ 'name': 'Base import', 'description': """ New extensible file import for OpenERP ====================================== Re-implement openerp's file import system: * Server side, the previous system forces most of the logic into the client which duplicates the effort (between clients), makes the import s...
agpl-3.0
XXLRay/libreshot
build/lib.linux-x86_64-2.7/libreshot/uploads/youtube/gdata/client.py
9
47380
#!/usr/bin/env python # # Copyright (C) 2008, 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 appli...
gpl-3.0
Fahmedullah/parallel-ssh
psshlib/askpass_client.py
66
3467
#!/usr/bin/env python # -*- Mode: python -*- # Copyright (c) 2009-2012, Andrew McNabb """Implementation of SSH_ASKPASS to get a password to ssh from pssh. The password is read from the socket specified by the environment variable PSSH_ASKPASS_SOCKET. The other end of this socket is pssh. The ssh man page discusses...
bsd-3-clause
tersmitten/ansible
lib/ansible/modules/network/fortios/fortios_user_radius.py
20
28212
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
sungyism/sungyism
gmetad-python/Gmetad/gmetad_daemon.py
16
3379
#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, 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: #* #* - Redistributi...
bsd-3-clause
steven-cutting/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/parse/api.py
9
6878
# Natural Language Toolkit: Parser API # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Steven Bird <sb@csse.unimelb.edu.au> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT # import itertools from nltk.internals import depre...
gpl-3.0
pombredanne/mopidy-webhooks
mopidy_webhooks/reporters/status.py
2
2051
# future imports from __future__ import absolute_import from __future__ import unicode_literals # stdlib imports import logging import time # third-party imports import pykka # local imports from ..utils import send_webhook logger = logging.getLogger(__name__) class StatusReporter(pykka.ThreadingActor): """P...
apache-2.0
7anner/grpc
test/http2_test/test_rst_during_data.py
26
2707
# Copyright 2016, 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
hargup/sympy
sympy/polys/domains/pythonrationalfield.py
117
2234
"""Implementation of :class:`PythonRationalField` class. """ from __future__ import print_function, division from sympy.polys.domains.rationalfield import RationalField from sympy.polys.domains.groundtypes import PythonInteger, PythonRational, SymPyRational from sympy.polys.polyerrors import CoercionFailed from symp...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/django/contrib/localflavor/mk/mk_choices.py
91
2580
# -*- coding: utf-8 -*- """ Macedonian municipalities per the reorganization from 2004. """ from django.utils.translation import ugettext_lazy as _ MK_MUNICIPALITIES = ( ('AD', _(u'Aerodrom')), ('AR', _(u'Aračinovo')), ('BR', _(u'Berovo')), ('TL', _(u'Bitola')), ('BG', _(u'Bogdanci')), ('VJ', _...
agpl-3.0
varunarya10/nova_test_latest
nova/tests/unit/test_configdrive2.py
44
4722
# Copyright 2012 Michael Still and Canonical 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 # # ...
apache-2.0
pbs/django-cms
cms/plugins/file/south_migrations/0001_initial.py
11
1086
from south.db import db from django.db import models from cms.plugins.file.models import * class Migration: depends_on = ( ("cms", "0001_initial"), ) def forwards(self, orm): # Adding model 'File' db.create_table('file_file', ( ('cmsplugin_ptr', models.On...
bsd-3-clause
movmov/cc
vendor/boto/boto/pyami/installers/ubuntu/trac.py
47
6271
# Copyright (c) 2008 Chris Moyer http://coredumped.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, modify, m...
apache-2.0
kernc/networkx
networkx/linalg/tests/test_graphmatrix.py
40
4292
from nose import SkipTest import networkx as nx from networkx.generators.degree_seq import havel_hakimi_graph class TestGraphMatrix(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod def setupClass(cls): global numpy global assert_equal g...
bsd-3-clause
sayanriju/marchfluxmenu
onadd.py
1
1232
# /usr/bin/env python ## Filename : onadd.py import os from main import * import cPickle as pickle ''' Executed when a .desktop file is added, generally on installtion of a new package ''' itemdata = 'itemlist.data' new_file_list = GetLatestFiles('') for filename in new_file_list: if fnmatch.fnmatch(filename,'*.de...
gpl-3.0
VirusOnline/VoragineCore
dep/libmpq/bindings/python/mpq.py
501
10430
"""wrapper for libmpq""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope th...
gpl-3.0
MarkWh1te/xueqiu_predict
python3_env/lib/python3.4/site-packages/sqlalchemy/orm/loading.py
7
23341
# orm/loading.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 """private module containing functions used to convert database rows into object inst...
mit
obsh/tornado
tornado/template.py
15
35334
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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
Srisai85/scipy
scipy/signal/_arraytools.py
91
5145
""" Functions for acting on a axis of an array. """ from __future__ import division, print_function, absolute_import import numpy as np def axis_slice(a, start=None, stop=None, step=None, axis=-1): """Take a slice along axis 'axis' from 'a'. Parameters ---------- a : numpy.ndarray The array ...
bsd-3-clause
adityacs/ansible
lib/ansible/modules/storage/netapp/netapp_e_lun_mapping.py
48
12304
#!/usr/bin/python # (c) 2016, NetApp, 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....
gpl-3.0
osamak/student-portal
niqati/south_migrations/0003_convert_to_episode.py
2
13829
# -*- 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 models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
agpl-3.0
vongazman/libcloud
libcloud/compute/drivers/elasticstack.py
2
16303
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
TEAM-Gummy/platform_external_chromium_org
ui/ozone/generate_ozone_platform_list.py
28
2740
#!/usr/bin/env python # 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. """Code generator for Ozone platform list. This script takes as arguments a list of platform names and generates a C++ source file con...
bsd-3-clause
mistydemeo/gyp
test/msvs/list_excluded/gyptest-all.py
347
1292
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that msvs_list_excluded_files=0 doesn't list files that would normally be in _excluded_files, and that if that flag is not set,...
bsd-3-clause
gppezzi/easybuild-framework
easybuild/tools/package/package_naming_scheme/easybuild_pns.py
2
2335
## # Copyright 2015-2019 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
m0ppers/arangodb
3rdParty/V8/V8-5.0.71.39/build/gyp/pylib/gyp/generator/cmake.py
1355
44604
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
apache-2.0
Alwnikrotikz/pyglet
experimental/input/dinput.py
28
15854
#!/usr/bin/python # $Id:$ import ctypes import pyglet from pyglet import com from pyglet.window.win32 import _kernel32 lib = ctypes.oledll.dinput8 LPVOID = ctypes.c_void_p WORD = ctypes.c_uint16 DWORD = ctypes.c_uint32 LPDWORD = ctypes.POINTER(DWORD) BOOL = ctypes.c_int WCHAR = ctypes.c_wchar UINT ...
bsd-3-clause
peg4d/peg4d-java
libnez/libnez.py
2
2876
class ParsingObject: def __init__(self, pos): self.oid = 0 self.start_pos = pos self.end_pos = pos self.tag = '#empty' self.value = None self.parent = None self.child = None class ParsingLog: def __init__(self): self.next = None self.index...
bsd-2-clause
BadWolfAlfa/MyaKernel-Note-4
ToolChain/share/gdb/python/gdb/types.py
126
5421
# Type utilities. # Copyright (C) 2010-2014 Free Software Foundation, Inc. # 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 versi...
gpl-2.0
jiangwei1221/django-virtualenv-demo
env/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py
109
5305
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. from django.utils import unittest from django.utils.unittest import skipUnless from .. import HAS_GEOS if HAS_GEOS: from .. import * fr...
unlicense
gminds/rapidnewsng
django/contrib/gis/db/models/fields.py
101
11200
from django.db.models.fields import Field from django.db.models.sql.expressions import SQLEvaluator from django.utils.translation import ugettext_lazy as _ from django.contrib.gis import forms from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.geometry.backend import Geometry, Geometry...
bsd-3-clause
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/boto/boto/mturk/connection.py
112
42336
# Copyright (c) 2006,2007 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...
bsd-3-clause
ademuk/django-oscar
src/oscar/apps/checkout/utils.py
37
7910
class CheckoutSessionData(object): """ Responsible for marshalling all the checkout session data Multi-stage checkouts often require several forms to be submitted and their data persisted until the final order is placed. This class helps store and organise checkout form data until it is required to...
bsd-3-clause
itoed/anaconda
tests/glade/viewport/check_viewport.py
2
2833
#!/usr/bin/python # # Copyright (C) 2014 Red Hat, Inc. # # This program 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.1 of the License, or # (at your option) any later version. # # T...
gpl-2.0
Kitware/tonic-data-generator
python/tonic/cinema/spec-b-converter.py
1
5917
r""" brew install libtiff libjpeg webp little-cms2 sudo easy_install pip sudo pip install Pillow """ import sys, os, json, math, gzip, shutil import numpy as np from PIL import ImImagePlugin from PIL import Image from vtk import * from tonic.paraview import data_converter def extractFloatArrays(directory, ranges): ...
bsd-3-clause
SpotlightKid/mididings
mididings/live/livedings.py
2
10056
# -*- coding: utf-8 -*- # # mididings # # Copyright (C) 2008-2014 Dominic Sacré <dominic.sacre@gmx.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (...
gpl-2.0
sharma1nitish/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/closepatch.py
145
1889
# Copyright (C) 2010 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 th...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_thread.py
27
8274
import os import unittest import random from test import test_support thread = test_support.import_module('thread') import time import sys import weakref from test import lock_tests NUMTASKS = 10 NUMTRIPS = 3 _print_mutex = thread.allocate_lock() def verbose_print(arg): """Helper function for printing out debu...
gpl-2.0
myd7349/Ongoing-Study
c#/Console/PInvoke/MarshalCppClassV1/MarshalCppClass/dump_dll_exports.py
1
2848
# coding: utf-8 import sys import cppmangle import plumbum def main(): if len(sys.argv) != 2: print('DLL path missing.') return dll_path = sys.argv[1] print('DLL path:', dll_path) mangled_symbols = [] try: dependencies = plumbum.local['Dependencies.exe'] dll_exp...
lgpl-3.0
invalidstatement/grit-i18n
grit/tool/diff_structures.py
62
3923
#!/usr/bin/env python # 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. '''The 'grit sdiff' tool. ''' import os import getopt import tempfile from grit.node import structure from grit.tool import inter...
bsd-2-clause
misisnik/ExternalInterface
ENV/Lib/encodings/cp1250.py
272
13686
""" Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.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_table) def decode(self,in...
mit
assj/CloudNetworkAllocator
cloud-network-allocator/genetic_algorithm/ga.py
1
7471
# coding=utf-8 """ Implementação de um algoritmo genético para a alocar os nós de uma requisição """ import random import copy import utils.quality_evaluator as evaluator def randomly_allocate_virtual_node(physical_node_list, virtual_node, virtual_node_list): memory_capacity = virtual_node['memoryCapacity'] ...
gpl-3.0
grischa/django-filer
filer/utils/loader.py
38
1668
#-*- coding: utf-8 -*- """ This function is snatched from https://github.com/ojii/django-load/blob/3058ab9d9d4875589638cc45e84b59e7e1d7c9c3/django_load/core.py#L49 local changes: * added check for basestring to allow values that are already an object or method. """ from django.utils.importlib import import_module ...
bsd-3-clause
olivierdalang/QGIS
python/plugins/processing/algs/grass7/ext/v_net_visibility.py
45
1240
# -*- coding: utf-8 -*- """ *************************************************************************** v_net_visibility.py --------------------- Date : December 2015 Copyright : (C) 2015 by Médéric Ribreux Email : medspx at medspx dot fr ******************...
gpl-2.0
janusnic/wagtail
wagtail/wagtailcore/migrations/0002_initial_data.py
27
2325
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import VERSION as DJANGO_VERSION from django.db import migrations def initial_data(apps, schema_editor): ContentType = apps.get_model('contenttypes.ContentType') Group = apps.get_model('auth.Group') Page = apps.get_model('wagtail...
bsd-3-clause
FedoraScientific/salome-paravis
test/VisuPrs/GaussPoints/A2.py
1
2021
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # 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.1 of the License, or (at your option) any later version. # # This library ...
lgpl-2.1
saneyuki/servo
tests/wpt/web-platform-tests/tools/third_party/html5lib/setup.py
25
4533
from __future__ import print_function import ast import codecs import sys from os.path import join, dirname from setuptools import setup, find_packages, __version__ as setuptools_version from pkg_resources import parse_version import pkg_resources try: import _markerlib.markers except ImportError: _markerli...
mpl-2.0
SimonBiggs/electronfactor-server
electroninserts.py
1
14607
# Copyright (C) 2016 Simon Biggs # 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 version. # This program is distributed in...
agpl-3.0
greatmazinger/or-tools
examples/python/organize_day.py
34
3011
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ...
apache-2.0
axt/angr
angr/engines/vex/expressions/__init__.py
5
1147
def translate_expr(expr, state): expr_name = 'SimIRExpr_' + type(expr).__name__.split('IRExpr')[-1].split('.')[-1] g = globals() if expr_name not in g and o.BYPASS_UNSUPPORTED_IREXPR not in state.options: raise UnsupportedIRExprError("Unsupported expression type %s" % (type(expr))) elif expr_na...
bsd-2-clause
alphagov/backdrop
backdrop/transformers/tasks/user_satisfaction.py
1
1410
from .util import encode_id def calculate_rating(datum): # See # https://github.com/alphagov/spotlight/blob/ca291ffcc86a5397003be340ec263a2466b72cfe/app/common/collections/user-satisfaction.js # noqa if not datum['total:sum']: return None min_score = 1 max_score = 5 score = 0 for ...
mit
andreif/django
tests/project_template/test_settings.py
274
1083
import unittest from django.test import TestCase from django.utils import six @unittest.skipIf(six.PY2, 'Python 2 cannot import the project template because ' 'django/conf/project_template doesn\'t have an __init__.py file.') class TestStartProjectSettings(TestCase): def test_middleware_classes_headers(...
bsd-3-clause
spotify/cobbler
scripts/demo_connect.py
19
1527
#!/usr/bin/python """ Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at yo...
gpl-2.0
magic0704/neutron
neutron/db/migration/alembic_migrations/versions/aae5706a396_nuage_provider_networks.py
15
1349
# Copyright 2014 OpenStack Foundation # # 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
seize-the-dave/XlsxWriter
xlsxwriter/test/comparison/test_chart_gradient05.py
8
1722
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
barnsnake351/neutron
neutron/agent/l3/router_info.py
3
30239
# Copyright (c) 2014 Openstack Foundation # # 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 ...
apache-2.0
mprinc/KnAllEdge
src/services/puzzles/flow/go/python/demo-0.py
1
1501
# __package__ = "use-cases" import uuid # from colabo.flow.go import ColaboFlowGo, go_pb2 from colabo.flow.go import ColaboFlowGo from random import randint from time import sleep colaboFlowGo = ColaboFlowGo() print("colaboFlowGo = %s" % (colaboFlowGo)) # gets the name of function inspectig stack def gTFN(): ...
mit
cristian69/KernotekV3
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3127
1902
######################## 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...
gpl-3.0
terbolous/SickRage
lib/singledispatch_helpers.py
46
5228
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from abc import ABCMeta from collections import MutableMapping import sys try: from collections import UserDict except ...
gpl-3.0
lukecwik/incubator-beam
sdks/python/apache_beam/io/parquetio_it_test.py
2
4943
# # 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
kadashu/satori
satori-rules/plugin/libs/bson/max_key.py
55
1320
# Copyright 2010-2015 MongoDB, 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 writin...
apache-2.0
bdelzell/creditcoin-org-creditcoin
contrib/devtools/test-security-check.py
38
2651
#!/usr/bin/python2 # 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 script for security-check.py ''' from __future__ import division,print_function import subprocess imp...
mit
gregdek/ansible
test/units/config/manager/test_find_ini_config_file.py
27
10659
# -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type import os import os.path import stat import pytest from a...
gpl-3.0
EmuxEvans/mbed
workspace_tools/host_tests/serial_nc_tx_auto.py
37
1962
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
bbc/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/PythonInterpreter/MultiProcessPygamePythonInterpreter.py
6
1249
#!/usr/bin/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, Ver...
apache-2.0