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 |
|---|---|---|---|---|---|
analogue/mythbox | resources/lib/twisted/twisted/test/stdio_test_halfclose.py | 56 | 1899 | # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_readConnectionLost -*-
# Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTestCase.test_readConnectionLost}
to test that IH... | gpl-2.0 |
rsoumyassdi/nuxeo-drive | nuxeo-drive-client/nxdrive/client/remote_file_system_client.py | 1 | 11005 | """API to access a remote file system for synchronization."""
import unicodedata
from collections import namedtuple
from datetime import datetime
import os
from nxdrive.logging_config import get_logger
from nxdrive.client.common import NotFound
from nxdrive.client.base_automation_client import BaseAutomationClient
fro... | lgpl-2.1 |
rebstar6/servo | components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py | 241 | 1893 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface DuplicateQualifiers1 {
getter getter byte foo(unsigned long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... | mpl-2.0 |
nicko96/Chrome-Infra | infra/tools/buildbot/__main__.py | 2 | 2757 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import sys
import time
import requests
def get_builders(json_base):
return requests.get(
'https://%s/json/bu... | bsd-3-clause |
CivicTechTO/open-cabinet | venv/lib/python2.7/site-packages/django/conf/locale/fi/formats.py | 504 | 1390 | # -*- 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 = 'j. E Y'
TIME_FORMAT = 'G.i'
DATET... | mit |
js0701/chromium-crosswalk | chrome/common/extensions/docs/server2/compiled_file_system_test.py | 79 | 9522 | #!/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.
import functools
import os
from compiled_file_system import Cache, CompiledFileSystem
from copy import deepcopy
from environment impor... | bsd-3-clause |
bobrock/eden | modules/s3db/tour.py | 11 | 19770 | # -*- coding: utf-8 -*-
""" Sahana Eden Guided Tour Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 w... | mit |
unsiloai/syntaxnet-ops-hack | tensorflow/tools/test/check_futures_test.py | 9 | 3763 | # 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 |
stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/utils/memcached.py | 3 | 3908 | # -*- coding: utf-8 -*-
'''
Utilities for working with memcache
:depends: - python-memcached
This library sets up a connection object for memcache, using the configuration
passed into the get_conn() function. Normally, this is __opts__. Optionally,
a profile or specific host and port may be passed in. If neither pro... | apache-2.0 |
rohlandm/servo | components/script/dom/bindings/codegen/parser/tests/test_const.py | 134 | 3000 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestConsts {
const byte zero = 0;
const byte b = -1;
const octet o = 2;
const short s = -3;
const unsigned short us = 0x4;
const long l = -0X5;
const unsigned long... | mpl-2.0 |
idovear/odoo | addons/l10n_be_invoice_bba/__init__.py | 438 | 1101 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
wjsl/jaredcumulo | test/system/auto/simple/range.py | 2 | 1088 | # 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 |
Revanth47/addons-server | src/olympia/translations/forms.py | 7 | 2548 | from django.forms import ValidationError
from django.conf import settings
from django.db import models
from django.forms.util import ErrorList
from django.utils.translation.trans_real import to_language
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from django.utils.html imp... | bsd-3-clause |
unicri/edx-platform | lms/djangoapps/course_wiki/plugins/markdownedx/mdx_circuit.py | 158 | 2645 | #!/usr/bin/env python
'''
Image Circuit Extension for Python-Markdown
======================================
Any single line beginning with circuit-schematic: and followed by data (which should be json data, but this
is not enforced at this level) will be displayed as a circuit schematic. This is simply an input elem... | agpl-3.0 |
justnems/ansible-demo-examples | Windows Example/library/win_file.py | 9 | 2578 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, 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... | mit |
Signbank/BSL-signbank | signbank/dictionary/migrations/0025_auto__add_field_gloss_final_loc.py | 2 | 8132 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Gloss.final_loc'
db.add_column('dictionary_gloss', 'final_loc',
self.g... | bsd-3-clause |
platinummonkey/Vizwall-Website | vizwall/news/management/commands/addNews.py | 1 | 1123 | from django.core.management.base import NoArgsCommand
from vizwall.news.models import News
import datetime
class Command(NoArgsCommand):
args = '<No arguments for this command>'
help = 'Sends reminders to proctors about an event they have been assigned to that day'
def handle_noargs(self, **options):
while ... | gpl-3.0 |
jjz/v2ex | html5lib/tests/test_parser2.py | 73 | 1243 | import support
from html5lib import html5parser
from html5lib.constants import namespaces
from html5lib.treebuilders import dom
import unittest
# tests that aren't autogenerated from text files
class MoreParserTests(unittest.TestCase):
def test_assertDoctypeCloneable(self):
parser = html5parser.HTMLParser(tree... | bsd-3-clause |
SravanthiSinha/edx-platform | common/test/acceptance/fixtures/library.py | 147 | 2994 | """
Fixture to create a Content Library
"""
from opaque_keys.edx.keys import CourseKey
from . import STUDIO_BASE_URL
from .base import XBlockContainerFixture, FixtureError
class LibraryFixture(XBlockContainerFixture):
"""
Fixture for ensuring that a library exists.
WARNING: This fixture is NOT idempote... | agpl-3.0 |
srikantbmandal/ansible | lib/ansible/modules/system/mount.py | 60 | 21299 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Red Hat, inc
# Written by Seth Vidal
# based on the mount modules from salt and puppet
#
# 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 ... | gpl-3.0 |
TripleDogDare/RadioWCSpy | env/lib/python2.7/site-packages/pip/locations.py | 117 | 7778 | """Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import getpass
import os
import os.path
import site
import sys
import tempfile
from distutils import sysconfig
from distutils.command.install import install, SCHEME_KEYS
from pip.compat import get_path_uid, WINDOWS
f... | mit |
shastah/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/up2date_client/rhnreg_constants.py | 10 | 19573 | # -*- coding: utf-8 -*-
#
# String constants for the RHN Register TUI/GUI.
# Copyright (c) 2000--2015 Red Hat, Inc.
#
# Author:
# James Slagle <jslagle@redhat.com>
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
COPYRIGHT_TEXT = _(u"Copyright © 2006--2010 Red Hat... | gpl-2.0 |
anilmuthineni/tensorflow | tensorflow/tools/test/check_futures_test.py | 105 | 3723 | # 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 |
thaim/ansible | lib/ansible/inventory/group.py | 28 | 9962 | # (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... | mit |
mpasternak/michaldtz-fix-552 | examples/programming_guide/hello_world.py | 30 | 2206 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | bsd-3-clause |
sgzsh269/django | tests/string_lookup/models.py | 281 | 1533 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... | bsd-3-clause |
listamilton/supermilton.repository | script.areswizard/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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... | gpl-2.0 |
pombredanne/cubes | cubes/sql/functions.py | 6 | 7004 | # -*- encoding=utf -*-
# TODO: Remove this module or rewrite using expressions (or named expressions
# called `formulas`) once implemented. There is no need for complexity of
# this type.
from collections import namedtuple
from ..errors import InternalError, NoSuchAttributeError, ModelError
try:
import sqlalche... | mit |
valentin-krasontovitsch/ansible | lib/ansible/modules/cloud/google/gcp_compute_instance.py | 1 | 61114 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
mensler/ansible | lib/ansible/modules/database/mysql/mysql_replication.py | 43 | 13039 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql replication
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU... | gpl-3.0 |
purejoy/baziapp | baziapp/blazers/settings.py | 1 | 5490 | # Django settings for blazers project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', ... | gpl-2.0 |
saurabh6790/med_app_rels | patches/february_2013/fix_outstanding.py | 21 | 1168 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
from webnotes.utils import flt
records = webnotes.conn.sql("""
select against_voucher_type, against_voucher,
sum(ifnull(debit, 0)) - sum(ifnull(credi... | agpl-3.0 |
msreis/SigNetSim | signetsim/tests/test_system_math.py | 2 | 2490 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... | agpl-3.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/orca/scripts/apps/Instantbird/chat.py | 3 | 7112 | # Orca
#
# Copyright 2010 Joanmarie Diggs.
#
# 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 i... | gpl-3.0 |
JingPG2014/pmtk3 | matlabTools/metaTools/googlecode_upload.py | 304 | 8912 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | mit |
kiwicopple/MyMDb | venv/Lib/site-packages/tests/test_cpp_domain.py | 22 | 4877 | # -*- coding: utf-8 -*-
"""
test_cpp_domain
~~~~~~~~~~~~~~~
Tests the C++ Domain
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from util import raises
from sphinx.domains.cpp import DefinitionParser, DefinitionError
def parse(name,... | mit |
meabsence/python-for-android | python3-alpha/python3-src/Tools/freeze/winmakemakefile.py | 89 | 4977 | import sys, os
# Template used then the program is a GUI program
WINMAINTEMPLATE = """
#include <windows.h>
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmd... | apache-2.0 |
lnls-sirius/dev-packages | siriuspy/siriuspy/simul/simulator.py | 1 | 4266 | """Base Simulator."""
import random as _random
from abc import ABC, abstractmethod
import numpy as _np
from . import DBASE_DEFAULT as _DBASE_DEF
class Simulator(ABC):
"""Simulator.
Independent and markovian PVs simulator,
dbase_default : epics database used as default if no other dbase
... | gpl-3.0 |
vivianli32/TravelConnect | flask/lib/python3.4/site-packages/flask/testsuite/testing.py | 561 | 7411 | # -*- coding: utf-8 -*-
"""
flask.testsuite.testing
~~~~~~~~~~~~~~~~~~~~~~~
Test client and more.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
from flask._compat import text_type
c... | mit |
aristanetworks/neutron | neutron/tests/unit/api/test_extensions.py | 11 | 33104 | # Copyright (c) 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
MinFu/youtube-dl | youtube_dl/extractor/bpb.py | 145 | 1364 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class BpbIE(InfoExtractor):
IE_DESC = 'Bundeszentrale für politische Bildung'
_VALID_URL = r'http://www\.bpb\.de/mediathek/(?P<id>[0-9]+)/'
_TEST = {
'url': 'http://www.bpb.de/mediathek/297/joachim-gauck-zu... | unlicense |
yang-guangliang/android_guard | androguard/decompiler/dad/tests/dataflow_test.py | 1 | 14367 | """Tests for def_use."""
import sys
sys.path.append('.')
import collections
import mock
import unittest
from androguard.decompiler.dad import dataflow
from androguard.decompiler.dad import graph
from androguard.decompiler.dad import node
from androguard.decompiler.dad import instruction
from androguard.decompiler.dad... | apache-2.0 |
songmonit/CTTMSONLINE | addons/product/__init__.py | 443 | 1120 | # -*- 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 |
CeltonMcGrath/TACTIC | src/pyasm/web/html_wdg.py | 5 | 46313 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
klarkc/devedeng | src/copy_files_verbose.py | 4 | 1139 | #!/usr/bin/env python3
# Copyright 2014 (C) Raster Software Vigo (Sergio Costas)
#
# This file is part of DeVeDe-NG
#
# DeVeDe-NG 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 Licens... | gpl-3.0 |
modulexcite/blink | LayoutTests/html5lib/generate-test-wrappers.py | 56 | 5226 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
Davidjohnwilson/sympy | sympy/polys/tests/test_dispersion.py | 117 | 3181 | from sympy.core import Symbol, S, oo
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.polys import poly
from sympy.polys.dispersion import dispersion, dispersionset
def test_dispersion():
x = Symbol("x")
a = Symbol("a")
fp = poly(S(0), x)
assert sorted(dispersionset(fp)) == [0]
... | bsd-3-clause |
jecp/mean | node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
RebeccaWPerry/vispy | examples/basics/visuals/box.py | 17 | 2124 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Simple demonstration of Box visual.
"""
from vispy import app, gloo, visuals
from vispy.geometry import create_box
from vispy.visuals.transforms import MatrixTransform
... | bsd-3-clause |
daisymax/nvda | source/appModules/loudtalks.py | 3 | 1227 | #appModules/loudtalks.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2010 Peter Vagner <peter.v@datagate.sk>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
import oleacc
from... | gpl-2.0 |
tanmaythakur/django | tests/auth_tests/test_tokens.py | 297 | 2551 | import unittest
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.test import TestCase
from django.utils.six import PY3
class TokenGeneratorTest(TestCase):
def test_make... | bsd-3-clause |
devasia1000/anti_adblock | libmproxy/controller.py | 2 | 3637 | from __future__ import absolute_import
import Queue, threading
class DummyReply:
"""
A reply object that does nothing. Useful when we need an object to seem
like it has a channel, and during testing.
"""
def __init__(self):
self.acked = False
def __call__(self, msg=False):
... | mit |
pinkavaj/gnuradio | grc/core/Connection.py | 14 | 5933 | """
Copyright 2008-2015 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any l... | gpl-3.0 |
htzy/bigfour | lms/djangoapps/courseware/masquerade.py | 44 | 4365 | '''
---------------------------------------- Masquerade ----------------------------------------
Allow course staff to see a student or staff view of courseware.
Which kind of view has been selected is stored in the session state.
'''
import logging
from django.conf import settings
from django.contrib.auth.decorators... | agpl-3.0 |
battlecat/Spirit | spirit/user/forms.py | 2 | 2366 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.template import defaultfilters
from django.conf import settings
from ..core.uti... | mit |
radlab/sparrow | deploy/third_party/boto-2.1.1/boto/route53/connection.py | 8 | 12631 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# w... | apache-2.0 |
prds21/barrial-movie | servers/zinwa.py | 43 | 1641 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para zinwa
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import ... | gpl-3.0 |
Gitlab11/odoo | addons/crm_partner_assign/wizard/__init__.py | 389 | 1038 | # -*- 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 |
yozel/alskdjBlog | apps/usersystem/forms.py | 1 | 8338 | # -*- coding: utf-8 -*-
import uuid
from django.contrib.auth.models import User
from django import forms
from django.contrib.auth.forms import PasswordResetForm
from django.db import IntegrityError
from django.conf import settings
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.forms i... | gpl-3.0 |
rhgrant10/Groupy | groupy/api/messages.py | 1 | 15912 | import time
from . import base
from .attachments import Attachment
from groupy import utils
from groupy import pagers
class Messages(base.Manager):
"""A message manager for a particular group.
:param session: the request session
:type session: :class:`~groupy.session.Session`
:param str group_id: th... | apache-2.0 |
eadgarchen/tensorflow | tensorflow/python/client/device_lib.py | 149 | 1308 | # 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 |
piiswrong/nnvm | python/setup.py | 3 | 1809 | import os
import sys
from setuptools import find_packages
from distutils.core import setup
def config_cython():
# temporary disable cython for now
# as NNVM uses local DLL build
return []
try:
from Cython.Build import cythonize
from distutils.extension import Extension
if sys.ve... | apache-2.0 |
aoakeson/home-assistant | homeassistant/bootstrap.py | 2 | 13201 | """Provides methods to bootstrap a home assistant instance."""
import logging
import logging.handlers
import os
import shutil
import sys
from collections import defaultdict
from threading import RLock
import homeassistant.components as core_components
import homeassistant.components.group as group
import homeassistan... | mit |
ocampocj/cloud-custodian | tools/c7n_kube/tests/test_labels.py | 5 | 2795 | # Copyright 2019 Capital One Services, LLC
#
# 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... | apache-2.0 |
rajendrakrp/GeoMicroFormat | django/utils/simplejson/encoder.py | 430 | 15620 | """Implementation of JSONEncoder
"""
import re
c_encode_basestring_ascii = None
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
... | bsd-3-clause |
xiandiancloud/ji | common/djangoapps/config_models/models.py | 74 | 1912 | """
Django Model baseclass for database-backed configuration.
"""
from django.db import models
from django.contrib.auth.models import User
from django.core.cache import get_cache, InvalidCacheBackendError
try:
cache = get_cache('configuration') # pylint: disable=invalid-name
except InvalidCacheBackendError:
f... | agpl-3.0 |
secmff/obnam | obnamlib/fmt_6/clientlist_tests.py | 4 | 4100 | # Copyright 2010-2014 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | gpl-3.0 |
nikitph/bluddy-app-engine | lib/markupsafe/__init__.py | 701 | 10338 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import string
from collections import Mapping
from markupsafe._compat import text_type, string_types, int_types, \
u... | apache-2.0 |
Bachaco-ve/odoo | addons/crm/wizard/crm_phonecall_to_phonecall.py | 337 | 4535 | # -*- 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 |
lj1985730/vehicleCRM | crm/vehiclewin.py | 1 | 22084 | # coding=utf-8
import wx
import datetime
import wx.adv
import wx.xrc
from wx.lib import intctrl
from crm import service, textvalidator, platenumvalidator, auth
# Class VehicleWin
class VehicleWin(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"编辑车辆信息", pos=w... | apache-2.0 |
bobobox/ansible | lib/ansible/plugins/lookup/template.py | 60 | 2935 | # (c) 2012, 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) any lat... | gpl-3.0 |
paulmadore/Eric-IDE | 6-6.0.9/eric/Helpviewer/HelpClearPrivateDataDialog.py | 1 | 2276 | # -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a dialog to select which private data to clear.
"""
from __future__ import unicode_literals
from PyQt5.QtWidgets import QDialog
from .Ui_HelpClearPrivateDataDialog import Ui_HelpClearPrivateDat... | gpl-3.0 |
sysadminmatmoz/ingadhoc | inter_company_move/wizard/inter_company_move_wizard.py | 8 | 1170 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp.osv import osv
from openerp import fi... | agpl-3.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/pip/wheel.py | 22 | 32030 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | mit |
ibmsoe/tensorflow | tensorflow/contrib/saved_model/__init__.py | 109 | 1411 | # 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 |
jamesob/bitcoin | test/functional/p2p_dos_header_tree.py | 27 | 3833 | #!/usr/bin/env python3
# Copyright (c) 2019-2020 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 that we reject low difficulty headers to prevent our block tree from filling up with useless bloat... | mit |
DeadSix27/python_cross_compile_script | tools/check_versions.py | 1 | 14457 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# noqa: E121
import ast
import ftplib
import json
import os
import re
import subprocess
import sys
import traceback
from distutils.version import LooseVersion
from pathlib import Path
from urllib.parse import urlparse
import requests
from bs4 import BeautifulSoup
from co... | mpl-2.0 |
Jaden-J/shpescape | ft_auth/views.py | 18 | 3592 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
rohe/saml2test2 | test/test_ec_compare.py | 2 | 2785 | from saml2test.check.ec_compare import Result
from saml2test.check.ec_compare import EntityCategoryTestResult
from saml2test.check.ec_compare import verify_rs_compliance
from saml2test.check.ec_compare import verify_coco_compliance
from saml2.entity_category import refeds
from saml2.entity_category import edugain
__au... | bsd-2-clause |
cxxgtxy/tensorflow | tensorflow/contrib/session_bundle/session_bundle_test.py | 133 | 7571 | # 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 |
NEricN/RobotCSimulator | Python/App/Lib/sndhdr.py | 257 | 5973 | """Routines to help recognizing sound files.
Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.
The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- nu... | apache-2.0 |
PennartLoettring/Poettrix | rootfs/usr/lib/python3.4/distutils/dep_util.py | 207 | 3491 | """distutils.dep_util
Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""
import os
from distutils.errors import DistutilsFileError
def newer (source, target):
"""Return true if 'source' exists and is more... | gpl-2.0 |
shakamunyi/sahara | sahara/plugins/cdh/v5_9_0/deploy.py | 1 | 5506 | # Copyright (c) 2016 Mirantis 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 writ... | apache-2.0 |
liangwang/m5 | src/arch/x86/X86NativeTrace.py | 19 | 1771 | # Copyright (c) 2009 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
sebfung/yellowpillowcase | vendor/cache/gems/pygments.rb-0.6.3/vendor/pygments-main/external/moin-parser.py | 42 | 3600 | # -*- coding: utf-8 -*-
"""
The Pygments MoinMoin Parser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a MoinMoin parser plugin that renders source code to HTML via
Pygments; you need Pygments 0.7 or newer for this parser to work.
To use it, set the options below to match your setup and put this file in
... | mit |
sarakha63/persomov | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/spike.py | 40 | 1167 | from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
class SpikeIE(MTVServicesInfoExtractor):
_VALID_URL = r'''(?x)https?://
(www\.spike\.com/(video-clips|episodes)/.+|
m\.spike\.com/videos/video.rbml\?id=(?P<mobile_id>[^&]+))
'''
_TEST = {
... | gpl-3.0 |
JioCloud/nova_test_latest | nova/tests/unit/fake_instance.py | 27 | 4888 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
bkolli/swift | test/functional/test_object.py | 16 | 47739 | #!/usr/bin/python
# Copyright (c) 2010-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 appl... | apache-2.0 |
mtougeron/python-openstacksdk | openstack/tests/functional/telemetry/v2/test_alarm_change.py | 3 | 1424 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
timchen86/ntulifeguardapp | gdata-2.0.18/samples/apps/marketplace_sample/gdata/apps/organization/service.py | 133 | 11041 | #!/usr/bin/python
#
# Copyright (C) 2008 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
debrouwere/python-literate | literate/core/parser.py | 1 | 6763 | # encoding: utf-8
import sys
import utils
from cStringIO import StringIO
import markdown as md
import re
def br(string):
# in Markdown, ending a line with more than one space
# signifies a (single) line break
return re.sub('\n{1}', ' \n', string)
def pad(string, padding):
pattern = re.compile(r'^'... | mit |
msmbuilder/msmbuilder-legacy | MSMBuilder/metrics/positions.py | 2 | 4231 | from __future__ import print_function, absolute_import, division
from mdtraj.utils.six import PY2
import logging
logger = logging.getLogger(__name__)
import mdtraj as md
import numpy as np
try:
import lprmsd
except:
RuntimeError(
"Unable to import lprmsd. See msmbuilder/Extras/lprmsd for directions on ... | gpl-2.0 |
blrm/openshift-tools | ansible/roles/lib_openshift_3.2/build/src/oadm_project.py | 13 | 3076 | # pylint: skip-file
# pylint: disable=too-many-instance-attributes
class OadmProject(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'namespace'
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
config,
verbose=False):... | apache-2.0 |
JPRasquin/Ubuntu14.04 | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
fluxw42/youtube-dl | youtube_dl/extractor/usatoday.py | 70 | 1925 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
get_element_by_attribute,
parse_duration,
update_url_query,
ExtractorError,
)
from ..compat import compat_str
class USATodayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?usatoday... | unlicense |
indera/redi-dropper-client | app/redidropper/utils.py | 1 | 8944 | """
Goal: Store helper functions not tied to a specific module
@authors:
Andrei Sura <sura.andrei@gmail.com>
Ruchi Vivek Desai <ruchivdesai@gmail.com>
Sanath Pasumarthy <sanath@ufl.edu>
"""
import os
import ast
import json
from datetime import datetime, timedelta
from itsdangerous ... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/unittest/test/testmock/testpatch.py | 77 | 53730 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support import SomeClass, is_instance
from unittest.mock import... | gpl-2.0 |
09zwcbupt/undergrad_thesis | pox/log/color.py | 26 | 5403 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | gpl-3.0 |
wylwang/vnpy | archive/demo/ltsdemo/demoUi.py | 46 | 47157 | # encoding: UTF-8
"""
该文件中包含的是交易平台的上层UI部分,
通过图形界面调用中间层的主动函数,并监控相关数据更新。
Monitor主要负责监控数据,有部分包含主动功能。
Widget主要用于调用主动功能,有部分包含数据监控。
"""
from __future__ import division
import time
import sys
import shelve
from collections import OrderedDict
import sip
from PyQt4 import QtCore, QtGui
from eventEngine import *
#######... | mit |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/msilib/text.py | 175 | 9018 | import msilib,os;dirname=os.path.dirname(__file__)
ActionText = [
('InstallValidate', 'Validating install', None),
('InstallFiles', 'Copying new files', 'File: [1], Directory: [9], Size: [6]'),
('InstallAdminPackage', 'Copying network install files', 'File: [1], Directory: [9], Size: [6]'),
('FileCost', 'Computing s... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.