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 |
|---|---|---|---|---|---|
koehlermichael/olympia | apps/amo/tests/test_readonly.py | 15 | 2098 | from django.conf import settings
from django.db import models
from django.utils import importlib
import MySQLdb as mysql
from nose.tools import assert_raises, eq_
from pyquery import PyQuery as pq
import amo.tests
from addons.models import Addon
def pubdir(ob):
for name in dir(ob):
if not name.startswit... | bsd-3-clause |
eclipse-ease-addons/engines | jython/org.jython/Lib/encodings/koi8_u.py | 593 | 14018 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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,input,errors='stri... | epl-1.0 |
vliulan/pydelicious | tools/dlcs_feeds.py | 23 | 3051 | #!/usr/bin/env python
try:
from hashlib import md5
except ImportError:
from md5 import md5
from itertools import chain
import locale
import optparse
import os
from pprint import pprint, pformat
import re
import sys
import pydelicious
#ENCODING = locale.getpreferredencoding()
__usage__ = """%prog [options] [comman... | bsd-2-clause |
postlund/home-assistant | homeassistant/components/netgear_lte/binary_sensor.py | 7 | 1376 | """Support for Netgear LTE binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.exceptions import PlatformNotReady
from . import CONF_MONITORED_CONDITIONS, DATA_KEY, LTEEntity
from .sensor_types import BINARY_SENSOR_CLASSES
_LOGGER = loggi... | apache-2.0 |
ArcherSys/ArcherSys | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 1 | 9950 | <<<<<<< HEAD
<<<<<<< HEAD
#!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
cl... | mit |
jphilipsen05/zulip | zerver/migrations/0053_emailchangestatus.py | 19 | 1109 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-23 05:37
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('zerver', '0052_auto_fix_re... | apache-2.0 |
ecosoft-odoo/odoo | addons/portal/wizard/share_wizard.py | 224 | 10392 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
redhat-openstack/django | tests/reserved_names/tests.py | 59 | 1693 | from __future__ import absolute_import
import datetime
from django.test import TestCase
from .models import Thing
class ReservedNameTests(TestCase):
def generate(self):
day1 = datetime.date(2005, 1, 1)
t = Thing.objects.create(when='a', join='b', like='c', drop='d',
alter='e', havin... | bsd-3-clause |
Dhivyap/ansible | lib/ansible/modules/windows/win_reboot.py | 28 | 4324 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = r'''
---
module: win_reb... | gpl-3.0 |
Stratio/stratio-cassandra | pylib/cqlshlib/test/basecase.py | 45 | 2555 | # 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 |
msmbuilder/mdentropy | mdentropy/cli/main.py | 1 | 1372 | from __future__ import print_function, absolute_import, division
import sys
import argparse
from .. import __version__
from . import dmutinf
from . import dtent
def main():
help = ('MDEntropy is a python library that allows users to perform '
'information-theoretic analyses on molecular dynamics (MD... | mit |
Naoya-Horiguchi/linux | tools/perf/scripts/python/export-to-postgresql.py | 368 | 39760 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
hrubi/fabric | tests/test_decorators.py | 35 | 6800 | from __future__ import with_statement
import random
import sys
from nose.tools import eq_, ok_, assert_true, assert_false, assert_equal
import fudge
from fudge import Fake, with_fakes, patched_context
from fabric import decorators, tasks
from fabric.state import env
import fabric # for patching fabric.state.xxx
from... | bsd-2-clause |
luyishisi/tensorflow | 4.Object_Detection/object_detection/builders/box_predictor_builder_test.py | 21 | 15071 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | bsd-2-clause |
GladeRom/android_external_chromium_org | third_party/protobuf/python/google/protobuf/internal/wire_format.py | 561 | 8431 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
donkawechico/arguman.org | web/profiles/migrations/0002_notification.py | 7 | 1286 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Noti... | mit |
fedora-infra/bodhi | bodhi/server/services/errors.py | 2 | 3793 | # Copyright © 2011-2017 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# 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 lat... | gpl-2.0 |
etos/django | tests/template_tests/filter_tests/test_slice.py | 428 | 1317 | from django.template.defaultfilters import slice_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SliceTests(SimpleTestCase):
@setup({'slice01': '{{ a|slice:"1:3" }} {{ b|slice:"1:3" }}'})
def test_slice01(self):
output = sel... | bsd-3-clause |
ryanbackman/zulip | zerver/webhooks/freshdesk/view.py | 17 | 5886 | """Webhooks for external integrations."""
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.models import get_client, UserProfile
from zerver.lib.actions import check_send_message
from zerver.lib.response import json... | apache-2.0 |
Cinntax/home-assistant | tests/auth/test_init.py | 4 | 31542 | """Tests for the Home Assistant auth module."""
from datetime import timedelta
from unittest.mock import Mock, patch
import jwt
import pytest
import voluptuous as vol
from homeassistant import auth, data_entry_flow
from homeassistant.auth import models as auth_models, auth_store, const as auth_const
from homeassistan... | apache-2.0 |
ask/celery | celery/tests/utilities/test_local.py | 2 | 7546 | from __future__ import absolute_import
from __future__ import with_statement
import sys
from nose import SkipTest
from celery.local import Proxy, PromiseProxy, maybe_evaluate, try_import
from celery.tests.utils import Case
class test_try_import(Case):
def test_imports(self):
self.assertTrue(try_impor... | bsd-3-clause |
wkhtmltopdf/qtwebkit | Source/WebCore/inspector/generate_protocol_externs.py | 117 | 9058 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | gpl-2.0 |
sloanyang/aquantic | Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py | 124 | 3269 | # 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 the ... | gpl-2.0 |
ResearchComputing/oide-slurm-assist | sandstone_slurm/config_utils.py | 2 | 1487 | import copy
import json
from jsonschema import Draft4Validator
from sandstone import settings
class ConfigLoader:
@staticmethod
def getFormConfig():
base_schema = settings.BASE_CONFIG
Draft4Validator.check_schema(base_schema)
form_config = settings.FORM_CONFIG
full_config = ... | mit |
michal-stuglik/django-mips | mips/example/examples2.py | 2 | 5789 | __author__ = 'AniaF'
import os
import django
# set the DJANGO_SETTINGS_MODULE environment variable to "mips.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mips.settings")
# setup
django.setup()
# import proper classes to play with
# from mips.models import Mip, Subspecies, SampleSubspecies, Samples, Pa... | mit |
thorkd1t/lurkbot | query.py | 1 | 1330 | import sqlite3
import time
import joinlist
# the tables look like this:
# db name 'imaqtpie.db' (each channel in joinlist has its own .db)
# Table name chat (each db has one table named 'chat')
#___________________________________________________________________
# usr | mesg | id | flags | channel | ... | mit |
punalpatel/st2 | contrib/runners/action_chain_runner/tests/unit/test_actionchain.py | 4 | 40041 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
NicoVarg99/daf-recipes | ckan/ckan/ckan/ckan/tests/helpers.py | 1 | 16313 | # encoding: utf-8
'''This is a collection of helper functions for use in tests.
We want to avoid sharing test helper functions between test modules as
much as possible, and we definitely don't want to share test fixtures between
test modules, or to introduce a complex hierarchy of test class subclasses,
etc.
We want... | gpl-3.0 |
mancoast/CPythonPyc_test | fail/332_test_pep352.py | 93 | 7146 | import unittest
import builtins
import warnings
from test.support import run_unittest
import os
from platform import system as platform_system
class ExceptionClassTests(unittest.TestCase):
"""Tests for anything relating to exception objects themselves (e.g.,
inheritance hierarchy)"""
def test_builtins_n... | gpl-3.0 |
40223236/40223236-50 | static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementInclude.py | 784 | 5146 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | gpl-3.0 |
teeple/pns_server | work/install/Python-2.7.4/Tools/bgen/bgen/bgenObjectDefinition.py | 44 | 17822 | from bgenOutput import *
from bgenGeneratorGroup import GeneratorGroup
class ObjectDefinition(GeneratorGroup):
"Spit out code that together defines a new Python object type"
basechain = "NULL"
tp_flags = "Py_TPFLAGS_DEFAULT"
basetype = None
argref = "" # set to "*" if arg to <type>_New should be... | gpl-2.0 |
jeasoft/odoo | marcos_addons/marcos_ipf_module/__openerp__.py | 2 | 1035 | # -*- coding: utf-8 -*-
{
'name': "marcos_ipf_module",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long description of module's purpose
""",
'author': "Your Company",
... | agpl-3.0 |
jlspyaozhongkai/Uter | third_party_build/Python-2.7.9/lib/python2.7/lib2to3/fixes/fix_isinstance.py | 326 | 1609 | # Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed. This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.
eg. isinstance(x, (int,... | gpl-3.0 |
jank3/django | tests/admin_widgets/models.py | 227 | 4760 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class MyFileField(models.FileField):
pass
@python_2_unicode_compatible
class Member(models.Model):
name = models.CharField(max_lengt... | bsd-3-clause |
umeboshi2/vignewton | vignewton/resources.py | 1 | 1855 | from pyramid.security import Allow, Everyone, Authenticated
from fanstatic import Library, Resource
from js.lightbox import lightbox
from haberdashery.resources import jqueryui, fc_css, deform_css
#from trumpet.resources import jqueryui
from trumpet.resources import StaticResources as TrumpetResources
library = Li... | unlicense |
mikeboers/PyAV | tests/test_codec_context.py | 1 | 10799 | from fractions import Fraction
from unittest import SkipTest
import os
from av import AudioResampler, Codec, Packet
from av.codec.codec import UnknownCodecError
import av
from .common import TestCase, fate_suite
def iter_frames(container, stream):
for packet in container.demux(stream):
for frame in pack... | bsd-3-clause |
mguijarr/mxcube3 | mxcube3/remote_access.py | 2 | 2948 | import logging
from flask import request, session
from mxcube3 import socketio
from collections import deque
from mxcube3 import app as mxcube
MASTER = None
MASTER_ROOM = None
PENDING_EVENTS = deque()
DISCONNECT_HANDLED = True
OBSERVERS = {}
def set_master(master_sid):
global MASTER
MASTER = master_sid
de... | gpl-2.0 |
Elettronik/SickRage | lib/pgi/signals.py | 19 | 3336 | # Copyright 2013 Christoph Reiter
#
# 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.
from ctypes import byref
... | gpl-3.0 |
savanu/servo | components/script/dom/bindings/codegen/pythonpath.py | 131 | 1404 | # 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/.
"""
Run a python script, adding extra directories to the python path.
"""
def main(args):
def usage():
pri... | mpl-2.0 |
cjmathy/ann_bmi203 | ann/rap1.py | 1 | 6499 | import numpy as np
import re
import random
def prepare_data():
"""This method prepares input positive and negative datasets as bitvectors for the Rap1 binding problem. Output: three lists of bitvectors, one containing positive samples, negative samples that are similar to positive samples, and negative examples t... | apache-2.0 |
m87/pyEM | stepwise.py | 1 | 3019 | from thirdparty import log_mvnpdf, log_mvnpdf_diag
import numpy as np
from online import *
from scipy.misc import logsumexp
from gaussEM import GaussEM
class Stepwise(OnlineEM):
def __init__(self, param):
super().__init__(param)
self.param = float(param['alpha'])
self.skip = int(param['skip... | mit |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_types.py | 164 | 1797 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
import type... | apache-2.0 |
tawsifkhan/scikit-learn | sklearn/pipeline.py | 162 | 21103 | """
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# Licence: BSD
from collections import defaultdict... | bsd-3-clause |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/build/gyp/test/variables/filelist/gyptest-filelist-golden.py | 228 | 1584 | #!/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.
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format=... | apache-2.0 |
ramadhane/odoo | addons/portal_project/project.py | 285 | 1809 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
bguillot/OpenUpgrade | addons/hr_payroll/report/report_payslip.py | 377 | 1982 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
orestkreminskyi/taf | unittests/test_staticcross.py | 2 | 2599 | # Copyright (c) 2011 - 2017, Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
vane/pywinauto | pywinauto/timings.py | 15 | 12142 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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 you... | lgpl-2.1 |
szhem/spark | python/docs/conf.py | 98 | 10607 | # -*- coding: utf-8 -*-
#
# pyspark documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 28 15:17:47 2014.
#
# 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.
#
# A... | apache-2.0 |
mm1ke/portage | pym/portage/package/ebuild/_config/LicenseManager.py | 7 | 7408 | # Copyright 2010-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = (
'LicenseManager',
)
from portage import os
from portage.dep import ExtendedAtomDict, use_reduce
from portage.exception import InvalidDependString
from portage.localization import _
from portage.util... | gpl-2.0 |
katyushacccp/ISN_projet_final | alpha 1.4/modules/recherche.py | 3 | 2873 | # Fonction très utile. Tu lui envoie le numéro d'une face et elle te renvoie une liste sous la forme :
# [faceAuDessus[numéroFaceDessus,coin adjacent à la face principal en partant de la gauche,arrete adjacente,coin adjacent droit],
# numéroFaceDroite[...],numéroFaceGauche[...],nméroFaceOppose]
def posRel(face):
i... | cc0-1.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/plat-irix5/panel.py | 132 | 7862 | # Module 'panel'
#
# Support for the Panel library.
# Uses built-in module 'pnl'.
# Applications should use 'panel.function' instead of 'pnl.function';
# most 'pnl' functions are transparently exported by 'panel',
# but dopanel() is overridden and you have to use this version
# if you want to use callbacks.
from warnin... | mit |
Scemoon/lpts | site-packages/pychart/afm/AvantGarde_DemiOblique.py | 12 | 1506 | # AFM font AvantGarde-DemiOblique (path: /usr/share/fonts/afms/adobe/pagdo8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["AvantGarde-DemiOblique"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 50... | gpl-2.0 |
joariasl/odoo | addons/survey_crm/__openerp__.py | 312 | 1593 | # -*- 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 |
MichaeLeroy/Escher.jl | assets/bower_components/katex/metrics/extract_tfms.py | 20 | 2698 | #!/usr/bin/env python
import collections
import json
import parse_tfm
import subprocess
import sys
def find_font_path(font_name):
try:
font_path = subprocess.check_output(['kpsewhich', font_name])
except OSError:
raise RuntimeError("Couldn't find kpsewhich program, make sure you" +
... | mit |
agry/NGECore2 | scripts/mobiles/endor/hanadak_ancient.py | 2 | 1711 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
cherrygirl/micronaet7 | menuitem_account/__init__.py | 18 | 1114 | # -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... | agpl-3.0 |
lpsinger/astropy | astropy/io/ascii/tests/test_qdp.py | 5 | 9090 | import numpy as np
import pytest
from astropy.io import ascii
from astropy.io.ascii.qdp import _read_table_qdp, _write_table_qdp
from astropy.io.ascii.qdp import _get_lines_from_file
from astropy.table import Table, Column, MaskedColumn
from astropy.utils.exceptions import AstropyUserWarning
def test_get_tables_from_... | bsd-3-clause |
lama7/blogtool | doc/source/conf.py | 1 | 7957 | # -*- coding: utf-8 -*-
#
# blogtool documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 21 11:36:34 2013.
#
# 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.
#
# Al... | mit |
google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Demo/metaclasses/Synch.py | 6 | 8194 | """Synchronization metaclass.
This metaclass makes it possible to declare synchronized methods.
"""
import thread
# First we need to define a reentrant lock.
# This is generally useful and should probably be in a standard Python
# library module. For now, we in-line it.
class Lock:
"""Reentran... | apache-2.0 |
kamyu104/django | tests/sessions_tests/tests.py | 116 | 30900 | import base64
import os
import shutil
import string
import sys
import tempfile
import unittest
from datetime import timedelta
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessions.backends.cached_db import \
SessionStore as Cac... | bsd-3-clause |
smmosquera/serge | sandbox/shadow.py | 2 | 2074 | """Test of making a shadow"""
import pygame
import Numeric
import os
import time
import serge.visual
import serge.engine
import serge.blocks.utils
import serge.blocks.visualblocks
serge.visual.Register.setPath(os.path.join('..', 'test', 'images'))
serge.visual.Register.registerItem('green', 'greenship.png')
serge.vi... | lgpl-3.0 |
securestate/king-phisher-plugins | client/uri_spoof_generator.py | 3 | 3621 | import os
import king_phisher.client.gui_utilities as gui_utilities
import king_phisher.client.mailer as mailer
import king_phisher.client.plugins as plugins
def _expand_path(output_file, *joins, pathmod=os.path):
output_file = pathmod.expandvars(output_file)
output_file = pathmod.expanduser(output_file)
output_fi... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | script.module.universalscrapers/lib/universalscrapers/modules/js2py/constructors/jsdate.py | 64 | 10612 | from ..base import *
from .time_helpers import *
TZ_OFFSET = (time.altzone//3600)
ABS_OFFSET = abs(TZ_OFFSET)
TZ_NAME = time.tzname[1]
ISO_FORMAT = '%s-%s-%sT%s:%s:%s.%sZ'
@Js
def Date(year, month, date, hours, minutes, seconds, ms):
return now().to_string()
Date.Class = 'Date'
def now():
return PyJsDate(int... | gpl-2.0 |
shangwuhencc/scikit-learn | doc/tutorial/machine_learning_map/pyparsing.py | 258 | 137838 | # module pyparsing.py
#
# Copyright (c) 2003-2008 Paul T. McGuire
#
# 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 u... | bsd-3-clause |
gunan/tensorflow | tensorflow/python/kernel_tests/rnn_test.py | 1 | 32669 | # 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 |
deepsrijit1105/edx-platform | lms/djangoapps/commerce/models.py | 14 | 1394 | """
Commerce-related models.
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
from config_models.models import ConfigurationModel
class CommerceConfiguration(ConfigurationModel):
""" Commerce configuration """
class Meta(object):
app_label = "commerce"
AP... | agpl-3.0 |
redhat-openstack/trove | trove/tests/unittests/secgroups/test_security_group.py | 2 | 6416 | # Copyright 2012 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 l... | apache-2.0 |
thaumos/ansible | test/units/modules/network/voss/test_voss_command.py | 38 | 4637 | # (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 |
archf/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_net_facts.py | 18 | 3802 | #!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
juneJuly/MFFA | sp_stream.py | 20 | 2074 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
/*
* Android media framework fuzzer
* Copyright (c) 2015, Intel Corporation.
* Author: Alexandru Blanda (ioan-alexandru.blanda@intel.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General P... | gpl-2.0 |
smartboyathome/Wonderland-Engine | Doorknob/DBWrapper.py | 1 | 11354 | '''
Copyright (c) 2012 Alexander Abbott
This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth
referred to as Cheshire).
Cheshire 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 Sof... | agpl-3.0 |
yangming85/lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/pt/forms.py | 309 | 1561 | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | gpl-3.0 |
Ju2ender/amonone | amonone/core/defaults.py | 5 | 1044 | import sys
try:
import json
except ImportError:
import simplejson as json
try:
config_file = file('/etc/amonone.conf').read()
config = json.loads(config_file)
except Exception, e:
print "There was an error in your configuration file (/etc/amonone.conf)"
raise e
# Amon Defaults
MONGO = config.... | mit |
hale36/SRTV | lib/unidecode/x066.py | 252 | 4677 | data = (
'Yun ', # 0x00
'Bei ', # 0x01
'Ang ', # 0x02
'Ze ', # 0x03
'Ban ', # 0x04
'Jie ', # 0x05
'Kun ', # 0x06
'Sheng ', # 0x07
'Hu ', # 0x08
'Fang ', # 0x09
'Hao ', # 0x0a
'Gui ', # 0x0b
'Chang ', # 0x0c
'Xuan ', # 0x0d
'Ming ', # 0x0e
'Hun ', # 0x0f
'Fen ', # 0x10
... | gpl-3.0 |
nateberman/Python_Koans | python3/libs/colorama/ansi.py | 527 | 1039 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... | mit |
rostj/pedantica | engine/android-port/app/src/main/jni/SDL2_ttf-2.0.14/external/freetype-2.4.12/src/tools/docmaker/sources.py | 106 | 10770 | # Sources (c) 2002-2004, 2006-2009, 2012
# David Turner <david@freetype.org>
#
#
# this file contains definitions of classes needed to decompose
# C sources files into a series of multi-line "blocks". There are
# two kinds of blocks:
#
# - normal blocks, which contain source code or ordinary comments
#
# - docu... | gpl-3.0 |
frankrousseau/weboob | weboob/capabilities/shop.py | 1 | 3939 | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Oleg Plakhotniuk
#
# This file is part of weboob.
#
# weboob 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 o... | agpl-3.0 |
digitalocean/netbox | netbox/extras/migrations/0013_objectchange.py | 2 | 1959 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-06-22 18:13
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dep... | apache-2.0 |
carlTLR/gyp | pylib/gyp/generator/make.py | 10 | 90525 | # 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | bsd-3-clause |
norayr/unisubs | apps/auth/tests.py | 4 | 7877 | # -*- coding: utf-8 -*-
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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
#... | agpl-3.0 |
OpenConceptLab/oclapi | ocl/concepts/search_indexes.py | 2 | 2578 | from django.contrib.contenttypes.models import ContentType
from haystack import indexes
from concepts.models import ConceptVersion
from oclapi.search_backends import SortOrFilterField, FilterField
from oclapi.search_indexes import OCLSearchIndex
from sources.models import SourceVersion, Source
__author__ = 'misternand... | mpl-2.0 |
gigglearrows/anniesbot | alembic/versions/3841cd597e_added_a_table_for_duel_stats.py | 1 | 1033 | """Added a table for duel stats
Revision ID: 3841cd597e
Revises: d5f1b8bd68
Create Date: 2015-12-02 00:12:07.548855
"""
# revision identifiers, used by Alembic.
revision = '3841cd597e'
down_revision = 'd5f1b8bd68'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():... | mit |
ewindisch/nova | nova/tests/virt/libvirt/test_image_utils.py | 15 | 9555 | # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
syaiful6/django | django/contrib/postgres/forms/ranges.py | 393 | 3005 | from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
from django import forms
from django.core import exceptions
from django.forms.widgets import MultiWidget
from django.utils.translation import ugettext_lazy as _
__all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField... | bsd-3-clause |
marscher/PyEMMA | pyemma/_ext/variational/estimators/tests/benchmark_moments.py | 1 | 5907 | from __future__ import absolute_import
from __future__ import print_function
__author__ = 'noe'
import time
import numpy as np
from .. import moments
def genS(N):
""" Generates sparsities given N (number of cols) """
S = [10, 90, 100, 500, 900, 1000, 2000, 5000, 7500, 9000, 10000, 20000, 50000, 75000, 90000] ... | lgpl-3.0 |
Mazecreator/tensorflow | tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py | 63 | 5870 | # 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 |
manasapte/pants | src/python/pants/bin/exiter.py | 13 | 4940 | # 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 datetime
impo... | apache-2.0 |
Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86 | usr/pkg/lib/python2.7/encodings/cp1251.py | 593 | 13617 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.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 |
cube2matrix/Krypton | test/networkx/algorithms/graphical.py | 30 | 12990 | # -*- coding: utf-8 -*-
"""Test sequences for graphiness.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from collections import defaultdict
import heapq
import networkx as nx
_... | gpl-2.0 |
scottdangelo/RemoveVolumeMangerLocks | cinder/scheduler/filters/affinity_filter.py | 25 | 3997 | # Copyright 2014, eBay Inc.
# Copyright 2014, 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
#
# Un... | apache-2.0 |
09zwcbupt/undergrad_thesis | ext/poxdesk/qx/tool/pylib/ecmascript/frontend/Comment_2.py | 1 | 27369 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2006-2012 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/li... | gpl-3.0 |
beni55/django | tests/forms_tests/tests/test_input_formats.py | 313 | 38501 | from datetime import date, datetime, time
from django import forms
from django.test import SimpleTestCase, override_settings
from django.utils.translation import activate, deactivate
@override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True)
class LocalizedTimeTests(SimpleTestCase):
def se... | bsd-3-clause |
brchiu/tensorflow | tensorflow/contrib/keras/api/keras/applications/mobilenet/__init__.py | 39 | 1111 | # 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 |
andim27/magiccamp | build/lib/django/contrib/gis/gdal/__init__.py | 397 | 2173 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-... | bsd-3-clause |
JioCloud/python-glanceclient | glanceclient/openstack/common/apiclient/base.py | 3 | 16202 | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Grid Dynamics
# Copyright 2013 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... | apache-2.0 |
TPopovich/mongo-connector | mongo_connector/oplog_manager.py | 1 | 31232 | # Copyright 2013-2014 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 |
CenturylinkTechnology/ansible-modules-extras | monitoring/sensu_check.py | 17 | 13614 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
#
# 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 Licen... | gpl-3.0 |
simongoffin/website_version | addons/mail/tests/__init__.py | 121 | 1318 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
rahuldan/sympy | sympy/plotting/pygletplot/plot_mode_base.py | 96 | 11337 | from __future__ import print_function, division
from pyglet.gl import *
from plot_mode import PlotMode
from threading import Thread, Event, RLock
from color_scheme import ColorScheme
from sympy.core import S
from sympy.core.compatibility import is_sequence
from time import sleep
import warnings
class PlotModeBase(Pl... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.