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 |
|---|---|---|---|---|---|
vadimtk/chrome4sdp | gpu/command_buffer/build_gles2_cmd_buffer.py | 1 | 348239 | #!/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.
"""code generator for GLES2 command buffers."""
import itertools
import os
import os.path
import sys
import re
import platform
fro... | bsd-3-clause |
draugiskisprendimai/odoo | addons/point_of_sale/report/pos_receipt.py | 380 | 3100 | # -*- 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 |
pompiduskus/scikit-learn | examples/semi_supervised/plot_label_propagation_versus_svm_iris.py | 286 | 2378 | """
=====================================================================
Decision boundary of label propagation versus SVM on the Iris dataset
=====================================================================
Comparison for decision boundary generated on iris dataset
between Label Propagation and SVM.
This demon... | bsd-3-clause |
guorendong/iridium-browser-ubuntu | third_party/tlslite/tlslite/utils/p256.py | 54 | 4364 | # Author: Google
# See the LICENSE file for legal information regarding use of this file.
import os
p = (
115792089210356248762697446949407573530086143415290314195533631308867097853951)
order = (
115792089210356248762697446949407573529996955224135760342422259061068512044369)
p256B = 0x5ac635d8aa3a93e7b3ebbd55... | bsd-3-clause |
sunil07t/e-mission-server | bin/historical/before_bic2cal/reset_uuids.py | 3 | 3026 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import attrdict as ad
import uuid
import emission.core.get_da... | bsd-3-clause |
frogsicle/naivlix1 | genome2simplesttrain.py | 1 | 7164 | import intervaltree
import sys
import getopt
import random
class Yformatr:
allowed_types = ['%', 'b']
def __init__(self):
self.out_type = None
def format(self, numseq, percent_coding, cds_or_not):
if self.out_type is None:
raise ValueError("out_type must be set prior to outpu... | gpl-3.0 |
resmo/ansible | lib/ansible/modules/network/ingate/ig_unit_information.py | 52 | 3988 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ingate Systems AB
# 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 = {
'status': ['preview'],
... | gpl-3.0 |
ingadhoc/odoo | openerp/tools/win32.py | 457 | 1993 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
dexterx17/nodoSocket | clients/Python-2.7.6/Lib/email/test/test_email_renamed.py | 53 | 121318 | # Copyright (C) 2001-2007 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
from cStringIO import StringIO
import email
from email.charset import Charset
from email.header import Header, ... | mit |
MrLeeh/jsonwatchqt | jsonwatchqt/settings.py | 1 | 1115 | # -*- coding: utf-8 -*-
# @Author: Stefan Lehmann
# @Date: 2016
# @Last Modified by: MrLeeh
# @Last Modified time: 2016
from collections import namedtuple
from qtpy.QtCore import QSettings
class Setting:
def __init__(self, name, type_=None, default=None):
self.name = name
self.type = type_
... | mit |
TransientObject/labMTComparison | labMT-simple/labMTsimple/chrome-print.py | 1 | 1112 | import subprocess
def asrun(ascript):
"Run the given AppleScript and return the standard output and error."
osa = subprocess.Popen(['osascript', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
return osa.communicate(ascript)[0]
def asquote(astr):
"Return... | apache-2.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/django/conf/locale/eo/formats.py | 504 | 2335 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a ... | mit |
hayd/SimpleCV | scripts/install/win/OpenKinect/freenect-examples/demo_cv_sync_multi.py | 15 | 1054 | #!/usr/bin/env python
"""This goes through each kinect on your system, grabs one frame and
displays it. Uncomment the commented line to shut down after each frame
if your system can't handle it (will get very low FPS but it should work).
This will keep trying indeces until it finds one that doesn't work, then it
... | bsd-3-clause |
remh/dd-agent | utils/profile.py | 34 | 3216 | # stdlib
import cProfile # noqa, it seems that import-names thinks it's not stdlib
from cStringIO import StringIO
import logging
import pstats # noqa, same here
log = logging.getLogger('collector')
class AgentProfiler(object):
PSTATS_LIMIT = 20
DUMP_TO_FILE = True
STATS_DUMP_FILE = './collector-stats.d... | bsd-3-clause |
bradmontgomery/alfred-percent-change | workflow-build.py | 1 | 9742 |
#!/usr/bin/python
# encoding: utf-8
#
# Copyright (c) 2013 deanishe@deanishe.net.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
"""workflow-build [options] <workflow-dir>
Build Alfred Workflows.
Compile contents of <workflow-dir> to a ZIP file (with extension
`.alfredworkflow`)... | mit |
ddrmanxbxfr/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/dl.py | 107 | 4915 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"dl-in-p": "<p><dl><dt>text<dd>text</dl></p>",
"header-in-dt": "<dl><dt><header>text</header><dd>text</dl>",
"footer-in-dt": "<dl><dt><foot... | mpl-2.0 |
chudaol/edx-platform | lms/djangoapps/instructor_task/api.py | 28 | 18655 | """
API for submitting background tasks by an instructor for a course.
Also includes methods for getting information about tasks that have
already been submitted, filtered either by running state or input
arguments.
"""
import hashlib
from celery.states import READY_STATES
from xmodule.modulestore.django import mod... | agpl-3.0 |
mszewczy/odoo | addons/l10n_be_hr_payroll_account/__openerp__.py | 298 | 1626 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
thaumos/ansible-modules-extras | cloud/cloudstack/cs_configuration.py | 44 | 8490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
aopp/android_kernel_nvidia_shieldtablet | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
XiaosongWei/chromium-crosswalk | chrome/common/extensions/docs/server2/api_data_source_test.py | 78 | 5664 | #!/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.
import unittest
from api_data_source import APIDataSource
from extensions_paths import CHROME_EXTENSIONS
from servlet import Reque... | bsd-3-clause |
wrobelda/urlwatch | lib/urlwatch/ical2txt.py | 1 | 2719 | # -*- coding: utf-8 -*-
#
# This file is part of urlwatch (https://thp.io/2008/urlwatch/).
# Copyright (c) 2008-2015 Thomas Perl <thp.io/about>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... | bsd-3-clause |
aospan/linux-stable-netup-universal-dvb-1.4 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
Lujeni/ansible | test/units/modules/network/f5/test_bigip_dns_zone.py | 22 | 3736 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py | 8 | 1333 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
bdh1011/cupeye | venv/lib/python2.7/site-packages/jinja2/testsuite/filters.py | 394 | 19169 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.filters
~~~~~~~~~~~~~~~~~~~~~~~~
Tests for the jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
fro... | bsd-3-clause |
mano3m/CouchPotatoServer | couchpotato/core/providers/info/couchpotatoapi/main.py | 3 | 3575 | from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.info.base import MovieProvider
from couchpotato.environment import Env
import time
log = CPLog(__name__)
class CouchPotatoApi(Mov... | gpl-3.0 |
steveandroulakis/mytardis | tardis/tardis_portal/templatetags/uploadify_tags.py | 5 | 1152 | from django import template
from django.conf import settings
register = template.Library()
# -----------------------------------------------------------------------------
# multi_file_upload
# -----------------------------------------------------------------------------
@register.inclusion_tag('tardis_portal/uploa... | bsd-3-clause |
eviljeff/olympia | src/olympia/translations/tests/test_models.py | 3 | 34591 | # -*- coding: utf-8 -*-
import re
import django
from django.conf import settings
from django.db import connections, reset_queries
from django.test import TransactionTestCase
from django.test.utils import override_settings
from django.utils import translation
from django.utils.functional import lazy
import jinja2
imp... | bsd-3-clause |
gautam1858/tensorflow | tensorflow/contrib/checkpoint/python/containers.py | 3 | 3045 | """Checkpointable data structures."""
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | apache-2.0 |
ibmsoe/tensorflow | tensorflow/python/tools/strip_unused.py | 180 | 3786 | # 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 |
libcrosswind/libcrosswind | platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/test/crashers/loosing_mro_ref.py | 151 | 1079 | """
There is a way to put keys of any type in a type's dictionary.
I think this allows various kinds of crashes, but so far I have only
found a convoluted attack of _PyType_Lookup(), which uses the mro of the
type without holding a strong reference to it. Probably works with
super.__getattribute__() too, which uses th... | gpl-3.0 |
aiyappaganesh/OP | httplib2/socks.py | 811 | 18459 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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 notice, this
... | gpl-2.0 |
gylian/sickrage | sickbeard/notifiers/pytivo.py | 13 | 3585 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | gpl-3.0 |
rmcgibbo/mdtraj | mdtraj/formats/prmtop.py | 10 | 9196 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: TJ Lane
# Contributors: Robert McGibbon, Jason Swails
#
# MDTr... | lgpl-2.1 |
CenterForOpenScience/osf.io | api/preprints/permissions.py | 11 | 5469 | # -*- coding: utf-8 -*-
from rest_framework import permissions
from rest_framework import exceptions
from api.base.utils import get_user_auth, assert_resource_type
from api.nodes.permissions import (
AdminOrPublic as NodeAdminOrPublic,
)
from osf.models import Preprint, OSFUser, PreprintContributor, Identifier
fro... | apache-2.0 |
nheijmans/MalZoo | malzoo/core/suppliers/monitor.py | 2 | 1704 | #!/usr/bin/python
"""
File is part of Malzoo
The monitor function checks every 60 seconds for new samples in the directory.
It keeps track of the previous folder state so malware samples are not processed twice.
It adds the samples to the Queue that is shared with the workers.
"""
#Parent
from malzoo.common.abstract i... | gpl-2.0 |
scalable-networks/ext | gnuradio-3.7.0.1/gr-filter/python/filter/qa_pfb_decimator.py | 8 | 4243 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... | gpl-2.0 |
hephaestus9/Ironworks | lib/jinja2/_markupsafe/tests.py | 156 | 2626 | import gc
import unittest
from jinja2._markupsafe import Markup, escape, escape_silent
class MarkupTestCase(unittest.TestCase):
def test_markup_operations(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="application/x-some-script">alert("foo");</script>'
sa... | mit |
erjohnso/ansible | lib/ansible/modules/network/f5/bigip_iapp_template.py | 10 | 15475 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUM... | gpl-3.0 |
azuer88/webhome | webhome/settings.py | 1 | 2825 | """
Django settings for webhome project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ... | gpl-3.0 |
NEricN/RobotCSimulator | Python/App/Lib/test/test_cmath.py | 34 | 18665 | from test.test_support import run_unittest
from test.test_math import parse_testfile, test_file
import unittest
import cmath, math
from cmath import phase, polar, rect, pi
INF = float('inf')
NAN = float('nan')
complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]]
complex_infinities = [complex(x, y... | apache-2.0 |
anilveeramalli/cloudify-azure-plugin | azurecloudify/utils.py | 1 | 15027 | import random
import string
from cloudify import ctx
from cloudify.state import ctx_parameters as inputs
import constants
from cloudify.exceptions import NonRecoverableError,RecoverableError
import requests
from lockfile import LockFile
import os
def random_suffix_generator(size=5, chars=string.ascii_lowercase + stri... | apache-2.0 |
RudolfCardinal/pythonlib | cardinal_pythonlib/psychiatry/drugs.py | 1 | 53553 | #!/usr/bin/env python
# cardinal_pythonlib/psychiatry/drugs.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version... | apache-2.0 |
MisanthropicBit/bibpy | tests/test_crossrefs.py | 1 | 5079 | # -*- coding: utf-8 -*-
"""Test inheritance and uninheritance of crossreferences."""
import bibpy
import bibpy.entry
import pytest
@pytest.fixture
def test_entries():
entry1 = bibpy.entry.Entry(
'inbook',
'key1',
**{
'crossref': 'key2',
'title': 'Title',
... | mit |
syhost/android_kernel_pantech_ef62l | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
sharkykh/SickRage | sickbeard/providers/newznab.py | 1 | 15947 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# Rewrite: Dustyn Gibson (miigotu) <miigotu@gmail.com>
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | gpl-3.0 |
kevinmel2000/sl4a | python/src/Lib/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py | 73 | 7687 | """Suite Legacy suite: Operations formerly handled by the Finder, but now automatically delegated to other applications
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'fleg'
class Legacy_suite_E... | apache-2.0 |
NavyaJayaram/MyRepository | YouTubeUsingAJS/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
hrishioa/Navo | Raspi-Code/Lib/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 853 | 5751 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | gpl-2.0 |
darjeeling/django | tests/utils_tests/test_autoreload.py | 44 | 9458 | import gettext
import os
import shutil
import tempfile
from importlib import import_module
from unittest import mock
import _thread
from django import conf
from django.contrib import admin
from django.test import SimpleTestCase, override_settings
from django.test.utils import extend_sys_path
from django.utils import ... | bsd-3-clause |
dwillmer/blaze | blaze/expr/collections.py | 1 | 15808 | from __future__ import absolute_import, division, print_function
from toolz import (
isdistinct, frequencies, concat as tconcat, unique, get, first,
)
import datashape
from datashape import DataShape, Option, Record, Unit, dshape, var, Fixed, Var
from datashape.predicates import isscalar, iscollection, isrecord
f... | bsd-3-clause |
makinacorpus/django-admin-watchdog | admin_watchdog/handlers.py | 1 | 2410 | import logging
from pprint import pformat
from django.utils.encoding import force_str
def build_request_repr(request):
"""
FROM Django 1.8
Builds and returns the request's representation string. The request's
attributes may be overridden by pre-processed values.
"""
# Since this is called as... | gpl-3.0 |
75651/kbengine_cloud | kbe/src/lib/python/Lib/urllib/request.py | 63 | 92653 | """An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... | lgpl-3.0 |
krzotr/kismon | kismon/gui.py | 1 | 19221 | #!/usr/bin/env python3
"""
Copyright (c) 2010, Patrick Salecker
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 li... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/lib/third_party/dateutil/relativedelta.py | 25 | 18411 | # -*- coding: utf-8 -*-
import datetime
import calendar
from six import integer_types
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __c... | mit |
hellsgate1001/bookit | docs/env/Lib/site-packages/django/contrib/flatpages/models.py | 119 | 1487 | from __future__ import unicode_literals
from django.db import models
from django.contrib.sites.models import Site
from django.core.urlresolvers import get_script_prefix
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import iri_to_uri, python_2_unicode_compatible
@python_2_unicode_c... | mit |
vasyarv/edx-platform | lms/djangoapps/certificates/migrations/0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_.py | 188 | 7955 | # 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 'GeneratedCertificate.graded_certificate_id'
db.add_column('certificates_generatedcertificate', 'g... | agpl-3.0 |
miguelparaiso/PracticaOdoo | addons/sale_analytic_plans/__openerp__.py | 262 | 1634 | # -*- 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 |
kpkhxlgy0/SublimeText3 | Packages/Python PEP8 Autoformat/libs/py33/lib2to3/pygram.py | 170 | 1114 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Export the Python grammar and symbols."""
# Python imports
import os
# Local imports
from .pgen2 import token
from .pgen2 import driver
from . import pytree
# The grammar file
_GRAMMAR_FILE = os.path.join(os.path.... | mit |
reignofmiracle/RM_Torrent | TorrentPython/TorrentPython/PeerProvider.py | 1 | 2401 | import pykka
from TorrentPython.DHTExplorer import *
from TorrentPython.MetaInfo import MetaInfo
from TorrentPython.TrackerService import TrackerService
class PeerProviderActor(pykka.ThreadingActor):
def __init__(self, client_id: bytes, metainfo: MetaInfo, routing_table: dict):
super(PeerProviderActor, ... | mit |
simbs/edx-platform | lms/djangoapps/lms_xblock/field_data.py | 188 | 1403 | """
:class:`~xblock.field_data.FieldData` subclasses used by the LMS
"""
from xblock.field_data import ReadOnlyFieldData, SplitFieldData
from xblock.fields import Scope
class LmsFieldData(SplitFieldData):
"""
A :class:`~xblock.field_data.FieldData` that
reads all UserScope.ONE and UserScope.ALL fields fr... | agpl-3.0 |
emilroz/openmicroscopy | components/tools/OmeroPy/src/flim-omero.py | 5 | 31427 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
components/tools/OmeroPy/scripts/omero/analysis_scripts/FLIM.py
-----------------------------------------------------------------------------
Copyright (C) 2006-2010 University of Dundee. All rights reserved.
This program is free software; you can redistribute i... | gpl-2.0 |
SachinJanani/zeppelin | dev/travis/save-logs.py | 144 | 1836 | #!/usr/bin/python
# -*- 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 t... | apache-2.0 |
spark-test/spark | python/pyspark/ml/tuning.py | 2 | 35436 | #
# 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 |
gaddman/ansible | test/units/modules/network/eos/test_eos_command.py | 68 | 4231 | # (c) 2016 Red Hat 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 is dis... | gpl-3.0 |
vaygr/ansible | lib/ansible/modules/network/cloudengine/ce_ospf_vrf.py | 43 | 68757 | #!/usr/bin/python
#
# 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 is distribut... | gpl-3.0 |
meabsence/python-for-android | python3-alpha/python3-src/Lib/ctypes/test/test_unicode.py | 65 | 1911 | import unittest
import ctypes
try:
ctypes.c_wchar
except AttributeError:
pass
else:
import _ctypes_test
class UnicodeTestCase(unittest.TestCase):
def test_wcslen(self):
dll = ctypes.CDLL(_ctypes_test.__file__)
wcslen = dll.my_wcslen
wcslen.argtypes = [ctypes... | apache-2.0 |
brandond/ansible | lib/ansible/plugins/lookup/__init__.py | 89 | 4408 | # (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 |
gwpy/gwpy | examples/signal/gw150914.py | 3 | 5642 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2016-2020)
#
# This file is part of GWpy.
#
# GWpy 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,... | gpl-3.0 |
BrechtBa/webopt | django/customauth/forms.py | 1 | 1527 |
from django import forms
from django.utils.translation import ugettext, ugettext_lazy as _
from django.contrib.auth import password_validation
from .models import User
class UserCreationForm(forms.ModelForm):
"""
A form that creates a user, with no privileges, from the given email address
and password.
"""
er... | gpl-3.0 |
ptitoliv/cineapp | migrations/versions/b037baf33cfa_favoritetypes_add_a_weight_for_each_.py | 1 | 1039 | """FavoriteTypes add a weight for each category for optimized sort
Revision ID: b037baf33cfa
Revises: 31a42956fb9e
Create Date: 2017-08-30 18:00:31.438844
"""
# revision identifiers, used by Alembic.
revision = 'b037baf33cfa'
down_revision = '31a42956fb9e'
from alembic import op
import sqlalchemy as sa
import cinea... | mit |
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/idlelib/ReplaceDialog.py | 38 | 5134 | from Tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
def replace(text):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_replacedialog"):
engine._replacedialog = ReplaceDialog(root, engine)
dialog = engine._rep... | mit |
jamesthechamp/zamboni | mkt/api/serializers.py | 11 | 4247 | from django.conf import settings
import commonware.log
from rest_framework import serializers
from rest_framework.reverse import reverse
from tower import ugettext as _
log = commonware.log.getLogger('z.mkt.api.forms')
class PotatoCaptchaSerializer(serializers.Serializer):
"""
Serializer class to inherit f... | bsd-3-clause |
Ichimonji10/robottelo | robottelo/cli/contenthost.py | 1 | 2915 | # -*- encoding: utf-8 -*-
"""
Usage::
hammer content-host [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
available-incremental-updates Given a set of systems and errata, lists the
... | gpl-3.0 |
jdemaeyer/scrapy | scrapy/settings/deprecated.py | 160 | 1383 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
DEPRECATED_SETTINGS = [
('TRACK_REFS', 'no longer needed (trackref is always enabled)'),
('RESPONSE_CLASSES', 'no longer supported'),
('DEFAULT_RESPONSE_ENCODING', 'no longer supported'),
('BOT_VERSION', 'no longer used (user agent ... | bsd-3-clause |
ezequielpereira/Time-Line | libs/wx/lib/agw/ribbon/toolbar.py | 2 | 23597 | """
A ribbon tool bar is similar to a traditional toolbar which has no labels.
Description
===========
It contains one or more tool groups, each of which contains one or more tools.
Each tool is represented by a (generally small, i.e. 16x15) bitmap.
Events Processing
=================
This class processes the fol... | gpl-3.0 |
jarrahwu/tornado | demos/appengine/blog.py | 114 | 5385 | #!/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 |
skipmodea1/plugin.video.xbmctorrent | resources/site-packages/xbmctorrent/ga.py | 5 | 2698 | from xbmctorrent import plugin
from functools import wraps
import xbmc
TRACKING_ID = "UA-40799149-3"
def make_visitor():
from pyga.requests import Visitor
visitor = Visitor()
visitor.user_agent = get_user_agent()
visitor.locale = xbmc.getLanguage()
return visitor
def get_ga():
from pyga.re... | gpl-3.0 |
MahjongRepository/mahjong | mahjong/hand_calculating/yaku_list/sanankou.py | 1 | 1479 | # -*- coding: utf-8 -*-
from mahjong.hand_calculating.yaku import Yaku
from mahjong.utils import is_chi, is_pon_or_kan
class Sanankou(Yaku):
"""
Three closed pon sets, the other sets need not to be closed
"""
def __init__(self, yaku_id=None):
super(Sanankou, self).__init__(yaku_id)
def s... | mit |
pgonda/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/non_callable_wsh.py | 499 | 1649 | # Copyright 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... | mpl-2.0 |
collex100/odoo | addons/project_timesheet/report/task_report.py | 336 | 4030 | # -*- 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 |
acourtney2015/boto | boto/ec2/instancestatus.py | 181 | 6854 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Cython-0.22.1/docs/sphinxext/ipython_console_highlighting.py | 31 | 2772 | from pygments.lexer import Lexer, do_insertions
from pygments.lexers.agile import PythonConsoleLexer, PythonLexer, \
PythonTracebackLexer
from pygments.token import Comment, Generic
from sphinx import highlighting
import re
line_re = re.compile('.*?\n')
class IPythonConsoleLexer(Lexer):
"""
For IPython co... | mit |
wisechengyi/pants | src/python/pants/invalidation/build_invalidator.py | 2 | 8944 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import errno
import hashlib
import os
from abc import ABC, abstractmethod
from collections import namedtuple
from pants.base.hash_utils import hash_all
from pants.build_graph.target impor... | apache-2.0 |
mkottre/pyquiz | pyquiz.py | 1 | 1652 | import random, sys
quiz_file = open(sys.argv[1], 'r') # Opens the quiz file, supplied by the command line argument, as read-only
quiz = quiz_file.readlines() # Creates a list with each element being either a question or an answer
questions = [] # Creates an empty questions list
answers = [] # Creates an empty answers ... | bsd-2-clause |
schmidtc/pysal | pysal/contrib/network/lincs.py | 15 | 13081 | #!/usr/bin/env python
"""
A library for computing local indicators of network-constrained clusters
Author:
Myunghwa Hwang mhwang4@gmail.com
"""
import unittest
import numpy as np
import scipy.stats as stats
import geodanet.network as pynet
import pysal, copy
import time
def unconditional_sim(event, base, s):
"... | bsd-3-clause |
loads/molotov | molotov/tests/test_slave.py | 1 | 2043 | import os
import pytest
from unittest import mock
import tempfile
import subprocess
from shutil import copytree, copyfile
from molotov import __version__
from molotov.slave import main
from molotov.tests.support import TestLoop, dedicatedloop, set_args
_REPO = "https://github.com/loads/molotov"
NO_INTERNET = os.envi... | apache-2.0 |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/site-packages/pip/commands/wheel.py | 170 | 7528 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import warnings
from pip.basecommand import RequirementCommand
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import RequirementSet
from pip.utils import import_or_raise
from pip.utils.build import Bui... | gpl-3.0 |
ehirt/odoo | openerp/addons/test_new_api/tests/test_onchange.py | 37 | 11810 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestOnChange(common.TransactionCase):
def setUp(self):
super(TestOnChange, self).setUp()
self.Discussion = self.env['test_new_api.discussion']
self.Message = self.env['test_new_api.message']
self.EmailMessage = self.en... | agpl-3.0 |
xerpi/3ds-arm9-linux | lib/libsndfile/src/src/create_symbols_file.py | 3 | 4753 | #!/usr/bin/python
# Copyright (C) 2003,2004 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# 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 ... | gpl-2.0 |
vponomaryov/manila | manila/db/migrations/alembic/versions/ef0c02b4366_add_share_type_projects.py | 7 | 2518 | # 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 |
Mega-DatA-Lab/mxnet | example/gluon/tree_lstm/scripts/preprocess-sick.py | 61 | 4765 | # 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 u... | apache-2.0 |
ModdedPA/android_external_chromium_org | chrome/test/mini_installer/test_installer.py | 23 | 6167 | # 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.
"""This script tests the installer with test cases specified in the config file.
For each test case, it checks that the machine states after the execution o... | bsd-3-clause |
citrontyan/googletest | scripts/common.py | 1180 | 2919 | # Copyright 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 foll... | bsd-3-clause |
datawire/ambassador | python/ambassador/ir/irambassador.py | 1 | 20745 | from typing import Any, ClassVar, Dict, List, Optional, TYPE_CHECKING
from ..constants import Constants
from ..config import Config
from .irresource import IRResource
from .iripallowdeny import IRIPAllowDeny
from .irbasemapping import IRBaseMapping
from .irhttpmapping import IRHTTPMapping
from .irtls import IRAmbass... | apache-2.0 |
wellesleywatson/INFO3180-lab4-old | lib/werkzeug/wrappers.py | 298 | 76131 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | apache-2.0 |
gooddata/openstack-nova | releasenotes/source/conf.py | 3 | 8539 | # Nova Release Notes documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 5 11:50:32 2015.
#
# 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.
#
# All configuratio... | apache-2.0 |
ywcui1990/nupic | scripts/profiling/profile_opf_memory.py | 15 | 2054 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
ximion/dak-dep11 | dak/dakdb/update46.py | 6 | 2441 | #!/usr/bin/env python
# coding=utf8
"""
Add columns and tables for Packages/Sources work
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2011 Mark Hymers <mhy@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.