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 |
|---|---|---|---|---|---|
rhinstaller/anaconda | tests/unit_tests/pyanaconda_tests/modules/storage/test_platform.py | 2 | 16392 | #
# Copyright (C) 2020 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | gpl-2.0 |
Just-D/chromium-1 | third_party/cython/src/Cython/Compiler/Naming.py | 93 | 5553 | #
# C naming conventions
#
#
# Prefixes for generating C names.
# Collected here to facilitate ensuring uniqueness.
#
pyrex_prefix = "__pyx_"
codewriter_temp_prefix = pyrex_prefix + "t_"
temp_prefix = u"__cyt_"
builtin_prefix = pyrex_prefix + "builtin_"
arg_prefix = pyrex_prefix + "arg_"
f... | bsd-3-clause |
CasualGaming/studlan | apps/userprofile/migrations/0007_auto_20161202_1519.py | 2 | 1064 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-02 15:19
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 = [
('userprofile', '0006_auto_2... | mit |
jcshen007/cloudstack | test/integration/smoke/test_outofbandmanagement.py | 2 | 23154 | # 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 |
postfix/https-ids | scripts/cdf_generator.py | 2 | 5301 | #!/usr/bin/python3.4
# Author: Olivier van der Toorn <o.i.vandertoorn@student.utwente.nl>
# Description: Generates a cdf from flow data
import fnmatch
import os
import re
import subprocess
import sys
import traceback
class CDF():
def __init__(self):
self.threshold = 5
self.data = {}
self.fa_pag... | bsd-3-clause |
tophatmonocle/django-tastypie | tests/core/tests/resources.py | 1 | 136271 | import base64
import copy
import datetime
from decimal import Decimal
import django
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import FieldError, MultipleObjectsReturned
from django.core import mail
from django.core.urlres... | bsd-3-clause |
cosmiclattes/TPBviz | torrent/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | 765 | 26958 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | gpl-3.0 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/sqlalchemy/sql/selectable.py | 22 | 111382 | # sql/selectable.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The :class:`.FromClause` class of SQL expression elements, representing
SQL tab... | mit |
xfouloux/Flexget | tests/test_rtorrent.py | 11 | 13943 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
import mock
import os
import xmlrpclib
from flexget.plugins.plugin_rtorrent import RTorrent
torrent_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'private.torrent')
torrent_url = 'file:///%s' % torrent_... | mit |
randpdevs/chopper | genQues/APIv1/submitRanking.py | 1 | 1343 | from ..models import *
from login.models import UserModel,UserStat
from time import time
from login.APIv1 import userStatAPI
def submitRank(data):
currentEpoch = int(time())
try:
quesObj = QuesSet_v2.objects.get(questionID = data['questionID'])
except:
return '404'
print currentEpoch, q... | mit |
olasitarska/django | django/contrib/staticfiles/storage.py | 63 | 14802 | from __future__ import unicode_literals
from collections import OrderedDict
import hashlib
import os
import posixpath
import re
import json
from django.conf import settings
from django.core.cache import (caches, InvalidCacheBackendError,
cache as default_cache)
from django.core.exception... | bsd-3-clause |
moreati/django | tests/utils_tests/test_http.py | 220 | 8102 | from __future__ import unicode_literals
import sys
import unittest
from datetime import datetime
from django.utils import http, six
from django.utils.datastructures import MultiValueDict
class TestUtilsHttp(unittest.TestCase):
def test_same_origin_true(self):
# Identical
self.assertTrue(http.sa... | bsd-3-clause |
fabiobatalha/ratchet | ratchet/controller.py | 1 | 7000 | # coding: utf-8
import urlparse
import pymongo
LIMIT = 20
def get_next_endpoint(endpoint, total, limit, offset, fltr=None):
offset += limit
if offset >= total:
return None
fltrs = ''
if fltr:
fltrs += '&%s' % '&'.join(set(['='.join([key, value]) for key, value in fltr.items()]))
... | bsd-2-clause |
Vimos/scikit-learn | sklearn/manifold/isomap.py | 39 | 7519 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
xawksow/GroestlCoin | qa/rpc-tests/mempool_resurrect_test.py | 150 | 3478 | #!/usr/bin/env python2
# Copyright (c) 2014 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 resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework impo... | mit |
chalesguo/labelImg-python-ExVOC | libs/labelFile.py | 1 | 2827 | # Copyright (c) 2016 Tzutalin
# Create by TzuTaLin <tzu.ta.lin@gmail.com>
try:
from PyQt5.QtGui import QImage
except ImportError:
from PyQt4.QtGui import QImage
from base64 import b64encode, b64decode
from libs.pascal_voc_io import PascalVocWriter
from libs.pascal_voc_io import XML_EXT
import os.path
import s... | mit |
sitsbeyou/Misago | misago/threads/views/generic/forum/actions.py | 8 | 14262 | from django.contrib import messages
from django.db.transaction import atomic
from django.shortcuts import render
from django.utils import timezone
from django.utils.translation import ugettext_lazy, ugettext as _, ungettext
from misago.forums.lists import get_forum_path
from misago.threads import moderation
from misa... | gpl-2.0 |
ralf1070/freeopcua | tests/gmock/gtest/scripts/fuse_gtest_files.py | 4 | 8797 | #!/usr/bin/env python
#
# 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... | lgpl-3.0 |
sjfloat/youtube-dl | youtube_dl/extractor/sexykarma.py | 90 | 4429 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
parse_duration,
int_or_none,
)
class SexyKarmaIE(InfoExtractor):
IE_DESC = 'Sexy Karma and Watch Indian Porn'
_VALID_URL = r'https?://(?:www\.)?(?:sexykarma\... | unlicense |
amir-qayyum-khan/edx-platform | common/djangoapps/student/migrations/0007_registrationcookieconfiguration.py | 10 | 1348 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('student'... | agpl-3.0 |
peterkuma/tjrapid | eventapp/models.py | 1 | 8066 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Peter Kuma
from os import urandom
import datetime
from django.db.models import *
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from django.core.validators import validate_comma_separated_integer_list
ACCOMMNIGHTS_CHOICES = ... | mit |
vitorespindola/home-assistant | homeassistant/components/zwave.py | 4 | 3729 | """
homeassistant.components.zwave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Connects Home Assistant to a Z-Wave network.
"""
from pprint import pprint
from homeassistant import bootstrap
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP,
EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_... | mit |
nicky-ji/edx-nicky | cms/djangoapps/contentstore/tests/test_contentstore.py | 3 | 75645 | # -*- coding: utf-8 -*-
# pylint: disable=E1101
# pylint: disable=W0212
import copy
import mock
import shutil
from datetime import timedelta
from fs.osfs import OSFS
from json import loads
from path import path
from tempdir import mkdtemp_clean
from textwrap import dedent
from uuid import uuid4
from django.conf impo... | agpl-3.0 |
QLGu/django-oscar | tests/unit/core/compat_tests.py | 30 | 2385 | # -*- coding: utf-8 -*-
import datetime
from django.utils import six
from django.utils.six.moves import cStringIO
from django.test import TestCase
from oscar.core.compat import UnicodeCSVWriter, existing_user_fields
class TestExistingUserFields(TestCase):
def test_order(self):
fields = existing_user_fie... | bsd-3-clause |
jmerkow/VTK | ThirdParty/Twisted/twisted/tap/ftp.py | 67 | 2002 | # -*- test-case-name: twisted.test.test_ftp_options -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I am the support module for making a ftp server with twistd.
"""
from twisted.application import internet
from twisted.cred import portal, checkers, strcred
from twisted.protocols impor... | bsd-3-clause |
2ndQuadrant/ansible | lib/ansible/modules/network/netvisor/pn_igmp_snooping.py | 52 | 6474 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... | gpl-3.0 |
neocogent/electrum | electrum/wallet.py | 1 | 83727 | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 t... | mit |
ishanic/scikit-learn | examples/mixture/plot_gmm_selection.py | 248 | 3223 | """
=================================
Gaussian Mixture Model Selection
=================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in th... | bsd-3-clause |
daavery/audacity | lib-src/lv2/sratom/waflib/TaskGen.py | 177 | 11938 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Task,Utils,Logs,Errors,ConfigSet,Node
feats=Utils.defaultdict(set)
class task_gen(object):
mappings={}
prec=Utils.defaultdict(list)
def... | gpl-2.0 |
tailorian/Sick-Beard | sickbeard/showUpdater.py | 9 | 4731 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 |
RackSec/ansible | lib/ansible/modules/cloud/amazon/ec2_eni.py | 16 | 22689 | #!/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 |
Klozz/TheXperienceProject_Motorola_Kernel_msm8226_falcon | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
haripradhan/MissionPlanner | Lib/unittest/case.py | 42 | 43140 | """Test case implementation"""
import collections
import sys
import functools
import difflib
import pprint
import re
import warnings
from . import result
from .util import (
strclass, safe_repr, unorderable_list_difference,
_count_diff_all_purpose, _count_diff_hashable
)
__unittest = True
... | gpl-3.0 |
wileeam/airflow | airflow/models/slamiss.py | 4 | 1718 | #
# 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... | apache-2.0 |
shikhardb/scikit-learn | sklearn/manifold/spectral_embedding_.py | 9 | 19648 | """Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import lobpcg
from ..base import BaseEstimator
from ..ext... | bsd-3-clause |
zorna/zorna | zorna/faq/views.py | 1 | 12051 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template.defaultfilters import slugify
from django.http import Http40... | bsd-3-clause |
joeyoung658/A-Level_2016-18 | 0. General/C1_Activity_1.1.py | 4 | 1306 | """
Assembly Code:
LDA ONE # load value of one to acc
STA COUNT # store value of acc in count
OUT # output value of acc
# -- start of loop --
LOOPTOP LDA COUNT # load value of count to acc
ADD ONE # add value of one to ... | gpl-3.0 |
bvernoux/micropython | tests/bytecode/mp-tests/ptex.py | 22 | 9009 | import sys
import os
import os.path
import datetime
import argparse
from xml.etree.ElementTree import Element, SubElement, tostring
from log import Log
from texparser import TexParser
from latexparser import LatexParser
from gettexfile import file_has_suffix
from gettexfile import get_tex_file
from xiwi.common.misc i... | mit |
puentesarrin/selene | test/test_forms.py | 1 | 2192 | # -*- coding: utf-8 *-*
import tornado.locale
import unittest
from selene import forms
class TestRegisterForm(unittest.TestCase):
def setUp(self):
tornado.locale.LOCALE_NAMES['zh_HK'] = {
'name_en': 'Chinese (Hong Kong)',
'name': '\u4e2d\u6587(\u7e41\u9ad4)'
}
tor... | gpl-3.0 |
arcivanov/pybuilder | src/main/python/pybuilder/plugins/ronn_manpage_plugin.py | 3 | 3036 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... | apache-2.0 |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/idlelib/configHandler.py | 48 | 28730 | """Provides access to stored IDLE configuration information.
Refer to the comments at the beginning of config-main.def for a description of
the available configuration files and the design implemented to update user
configuration information. In particular, user configuration choices which
duplicate the defaults will... | apache-2.0 |
zhukaixy/kbengine | kbe/res/scripts/common/Lib/ctypes/test/test_struct_fields.py | 264 | 1503 | import unittest
from ctypes import *
class StructFieldsTestCase(unittest.TestCase):
# Structure/Union classes must get 'finalized' sooner or
# later, when one of these things happen:
#
# 1. _fields_ is set.
# 2. An instance is created.
# 3. The type is used as field of another Structure/Union.
... | lgpl-3.0 |
tic-ull/defensatfc-proto | tfc_webapps/packages/suds-timestamp/suds/sax/element.py | 1 | 33540 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | agpl-3.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/unidecode/x063.py | 252 | 4656 | data = (
'Bo ', # 0x00
'Chi ', # 0x01
'Gua ', # 0x02
'Zhi ', # 0x03
'Kuo ', # 0x04
'Duo ', # 0x05
'Duo ', # 0x06
'Zhi ', # 0x07
'Qie ', # 0x08
'An ', # 0x09
'Nong ', # 0x0a
'Zhen ', # 0x0b
'Ge ', # 0x0c
'Jiao ', # 0x0d
'Ku ', # 0x0e
'Dong ', # 0x0f
'Ru ', # 0x10
'Tiao ... | bsd-3-clause |
ajaali/django | tests/template_tests/filter_tests/test_truncatewords.py | 215 | 1705 | from django.template.defaultfilters import truncatewords
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class TruncatewordsTests(SimpleTestCase):
@setup({'truncatewords01':
'{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:"... | bsd-3-clause |
fibbo/DIRAC | Core/DISET/private/SSLSocketFactory.py | 5 | 1487 | # $HeadURL$
__RCSID__ = "$Id$"
import types
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.DISET.private.Transports.SSL.FakeSocket import FakeSocket
from DIRAC.Core.DISET.private.Transports.SSL.SocketInfoFactory import gSocketInfoFactory
from DIRAC.Core.DISET.private.Transports.SSLTransport import checkSanity
class ... | gpl-3.0 |
cryptobanana/ansible | lib/ansible/modules/network/dellos6/dellos6_command.py | 6 | 7096 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell 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
ANSIBLE_METADATA = {'metadata_versio... | gpl-3.0 |
BayanGroup/sentry | src/sentry/migrations/0023_auto__add_field_event_time_spent.py | 36 | 10519 | # 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 'Event.time_spent'
db.add_column('sentry_message', 'time_spent', self.gf('django.db.models.fields.F... | bsd-3-clause |
Phuehvk/gyp | test/msvs/filters/gyptest-filters-2010.py | 101 | 1517 | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that extra filters are pruned correctly for Visual Studio 2010
and later.
"""
import TestGyp
test = TestGyp.TestGyp(formats=... | bsd-3-clause |
tayfun/django | tests/user_commands/management/commands/hal.py | 372 | 1024 | from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Useless command."
def add_arguments(self, parser):
parser.add_argument('args', metavar='app_label', nargs='*',
help='Specify the app label(s) to works on.')
parser.add_argument('-... | bsd-3-clause |
hirokiky/oauthlib | tests/oauth2/rfc6749/clients/test_base.py | 10 | 10495 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from ....unittest import TestCase
import datetime
from oauthlib import common
from oauthlib.oauth2.rfc6749 import utils
from oauthlib.oauth2 import Client
from oauthlib.oauth2 import InsecureTransportError
from oauthlib.oauth2.rfc6749.cli... | bsd-3-clause |
iDTLabssl/kitsune | kitsune/products/models.py | 8 | 7544 | import io
import os
from django.conf import settings
from django.db import models
from PIL import Image
from uuid import uuid4
from kitsune.sumo.models import ModelBase
from kitsune.sumo.urlresolvers import reverse
HOT_TOPIC_SLUG = 'hot'
class Product(ModelBase):
title = models.CharField(max_length=255, db_in... | bsd-3-clause |
heran7/edx-platform | common/lib/capa/capa/tests/test_html_render.py | 7 | 9118 | import unittest
from lxml import etree
import os
import textwrap
import mock
from .response_xml_factory import StringResponseXMLFactory, CustomResponseXMLFactory
from . import test_system, new_loncapa_problem
class CapaHtmlRenderTest(unittest.TestCase):
def setUp(self):
super(CapaHtmlRenderTest, self).... | agpl-3.0 |
ybellavance/python-for-android | python3-alpha/python3-src/Lib/test/test_strlit.py | 48 | 5040 | r"""Test correct treatment of various string literals by the parser.
There are four types of string literals:
'abc' -- normal str
r'abc' -- raw str
b'xyz' -- normal bytes
br'xyz' -- raw bytes
The difference between normal and raw strings is of course that in a
raw string, \ escapes (while still u... | apache-2.0 |
mbauskar/alec_frappe5_erpnext | erpnext/accounts/doctype/account/test_account.py | 31 | 2669 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def _make_test_records(verbose):
from frappe.test_runner import make_test_objects
accounts = [
# [account_name, parent_account, is_g... | agpl-3.0 |
mus1711/nitro_kernel | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
firmlyjin/brython | www/src/Lib/unittest/test/testmock/testcallable.py | 739 | 4234 | # 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 unittest
from unittest.test.testmock.support import is_instance, X, SomeClass
from unittest.mock import (
Mock, MagicMock, NonCallableMagicMock,
NonCallableM... | bsd-3-clause |
iradul/phantomjs-clone | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py | 113 | 18377 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
ajm/seance | seance/system.py | 1 | 3045 | import sys
import os
import tempfile
import multiprocessing
import logging
from seance.tools import ExternalProgram
class System(object) :
__tmpdir__ = None
def __init__(self) :
self.log = logging.getLogger('seance')
@staticmethod
def tempdir(tmpdir=None) :
if tmpdir != None :
... | gpl-3.0 |
coolhacks/docker-hacks | dockerfiles/sentry/sentry.conf.py | 27 | 2467 | import os.path
import os
CONF_ROOT = os.path.dirname(__file__)
database_name = os.environ.get('SENTRY_NAME', 'sentry')
database_user = os.environ.get('SENTRY_USER', 'sentry')
database_password = os.environ.get('SENTRY_PASS', 'sentry')
database_host = os.environ.get('SENTRY_HOST', '127.0.0.1')
database_port = os.envir... | mit |
silkyar/570_Big_Little | build/ARM/python/m5/internal/param_DummyChecker.py | 1 | 3876 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import d... | bsd-3-clause |
gyyu/cmu-debate | node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 960 | 45344 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
pbs/django-cms | cms/plugins/file/south_migrations/0004_table_rename.py | 8 | 12191 |
from south.db import db
from django.db import models
from cms.plugins.file.models import *
class Migration:
depends_on = (
("cms", "0019_public_table_renames"),
)
def forwards(self, orm):
db.rename_table("file_file", "cmsplugin_file")
db.rename_table("file_publicfile", "cm... | bsd-3-clause |
tdyas/pants | src/python/pants/java/nailgun_executor.py | 1 | 14633 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import hashlib
import logging
import os
import re
import selectors
import threading
import time
from contextlib import closing
from pants.base.build_environment import get_buildroot
from ... | apache-2.0 |
rutsky/letsencrypt | letsencrypt/validator.py | 44 | 2825 | """Validators to determine the current webserver configuration"""
import logging
import socket
import requests
import zope.interface
from acme import crypto_util
from acme import errors as acme_errors
from letsencrypt import interfaces
logger = logging.getLogger(__name__)
class Validator(object):
# pylint: dis... | apache-2.0 |
rghe/ansible | test/units/module_utils/basic/test_platform_distribution.py | 53 | 4947 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
... | gpl-3.0 |
mblachford/conductor | src/util/mob.py | 1 | 1761 | import os
import sys
import logging
import inspect
import psphere.managedobjects as vcsa_objects
log = logging.getLogger(__name__)
def get_esx_env(cursor):
''' define the physical map of our vCenter '''
try:
log.info("Attempting to poll all ESXi objects")
data = vcsa_objects.HostSystem.all(cur... | gpl-2.0 |
flyingfish007/tempest | tempest/api/compute/servers/test_servers.py | 3 | 5596 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
jessedhillon/batteries | batteries/model/serializable.py | 1 | 3050 | import collections
import numbers
from sqlalchemy.orm import object_session
from sqlalchemy.orm.util import has_identity
class Serializer(object):
datetime_format = '%s'
date_format = '%Y-%m%d'
def serialize_datetime(dt, opts):
v = dt.strftime(opts.get('datetime_format', '%s'))
try:
return in... | bsd-3-clause |
BT-csanchez/hr | __unported__/hr_employee_phone_extension/__init__.py | 9 | 1036 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 |
citisolo/wabt | test/gen-spec-js.py | 1 | 15863 | #!/usr/bin/env python
#
# Copyright 2016 WebAssembly Community Group participants
#
# 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 |
Distrotech/intellij-community | python/lib/Lib/site-packages/django/contrib/comments/templatetags/comments.py | 309 | 11845 | from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_unicode
register = template.Library()
class BaseCommentNode(template.N... | apache-2.0 |
pathumego/nototools | third_party/spiro/curves/fromcubic.py | 15 | 7031 | # Convert piecewise cubic into piecewise clothoid representation.
from math import *
import clothoid
import pcorn
import tocubic
import offset
def read_bz(f):
result = []
for l in f.xreadlines():
s = l.split()
if len(s) > 0:
cmd = s[-1]
#print s[:-1], cmd
... | apache-2.0 |
suiyuan2009/tensorflow | tensorflow/python/framework/op_def_library.py | 36 | 31119 | # 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 |
KarimAllah/nova | nova/network/manager.py | 2 | 77898 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | apache-2.0 |
synconics/odoo | addons/website_mail/models/mail_thread.py | 338 | 1454 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
ssato/sos-analyzer | sos_analyzer/scanner/rpm_Va.py | 1 | 1444 | #
# Copyright (C) 2013 - 2015 Red Hat, Inc.
# Author: Satoru SATOH <ssato redhat.com>
# License: GPLv3+
#
"""rpm -Va output format (verify options in rpm(8)):
....L.... c /etc/pam.d/smartcard-auth
....L.... c /etc/pam.d/system-auth
S.5....T. /usr/lib/python2.6/site-packages/jinja2_cli/render.py
S.5....T. /usr/l... | gpl-3.0 |
wfxiang08/changes | tests/changes/jobs/test_sync_repo.py | 2 | 5506 | from __future__ import absolute_import
import mock
from datetime import datetime
from changes.config import db
from changes.jobs.sync_repo import sync_repo, NUM_RECENT_COMMITS
from changes.models import Repository, RepositoryBackend
from changes.testutils import TestCase
from changes.vcs.base import Vcs, RevisionRes... | apache-2.0 |
Gui13/CouchPotatoServer | libs/requests/models.py | 14 | 26621 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | gpl-3.0 |
unsiloai/syntaxnet-ops-hack | tensorflow/contrib/learn/python/learn/dataframe/transforms/unary_transforms.py | 87 | 3863 | # 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 |
ShineFan/odoo | addons/l10n_at/__openerp__.py | 430 | 1785 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
dsajkl/reqiop | common/djangoapps/edxmako/shortcuts.py | 9 | 5022 | # Copyright (c) 2008 Mikeal Rogers
#
# 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... | agpl-3.0 |
sensysnetworks/uClinux | user/python/Lib/dis.py | 6 | 7361 | """Disassembler of Python byte code into mnemonics."""
import sys
import string
import types
def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argument, disassemble the last traceback.
"""
if not x:
distb()
return
if type(x) is types.InstanceType:
x = x.__class__
if hasattr(x... | gpl-2.0 |
OmnesRes/onco_lnc | lncrna/processing.py | 1 | 2437 | ##this script will parse the mitranscriptome counts file for primary tumors and save results in separate files
##WARNING, I believe this script requires 6GB of RAM
##you will have to move the resulting files to their correct locations in tcga_data
f=open('mitranscriptome.expr.counts.tsv')
f.readline()
transcripts=[]
f... | mit |
akarki15/mozillians | vendor-local/lib/python/unidecode/x011.py | 252 | 4135 | data = (
'g', # 0x00
'gg', # 0x01
'n', # 0x02
'd', # 0x03
'dd', # 0x04
'r', # 0x05
'm', # 0x06
'b', # 0x07
'bb', # 0x08
's', # 0x09
'ss', # 0x0a
'', # 0x0b
'j', # 0x0c
'jj', # 0x0d
'c', # 0x0e
'k', # 0x0f
't', # 0x10
'p', # 0x11
'h', # 0x12
'ng', # 0x13
'nn', ... | bsd-3-clause |
geo-poland/frappe | frappe/model/db_schema.py | 15 | 12290 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Syncs a database table to the `DocType` (metadata)
.. note:: This module is only used internally
"""
import os
import frappe
from frappe import _
from frappe.utils import... | mit |
mozilla/verbatim | vendor/lib/python/django/contrib/admin/models.py | 89 | 2674 | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.contrib.admin.util import quote
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.utils.safestring import mark... | gpl-2.0 |
daviddupont69/CouchPotatoServer | couchpotato/core/providers/torrent/bithdtv/__init__.py | 7 | 1709 | from .main import BiTHDTV
def start():
return BiTHDTV()
config = [{
'name': 'bithdtv',
'groups': [
{
'tab': 'searcher',
'list': 'torrent_providers',
'name': 'BiT-HDTV',
'description': 'See <a href="http://bit-hdtv.com">BiT-HDTV</a>',
'wiz... | gpl-3.0 |
michaellaier/pymor | src/pymordemos/elliptic_oned.py | 1 | 2920 | #!/usr/bin/env python
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
"""Proof of concept for solving the Poisson equation in 1D using linear finite elements and ... | bsd-2-clause |
dezynetechnologies/odoo | addons/mrp_repair/mrp_repair.py | 148 | 36935 | # -*- 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 |
soldag/home-assistant | homeassistant/components/niko_home_control/light.py | 15 | 3802 | """Support for Niko Home Control."""
from datetime import timedelta
import logging
import nikohomecontrol
import voluptuous as vol
# Import the device class from the component that you want to support
from homeassistant.components.light import ATTR_BRIGHTNESS, PLATFORM_SCHEMA, LightEntity
from homeassistant.const imp... | apache-2.0 |
iamsarin/geonode | docs/tutorials/users/conf.py | 35 | 7974 | # -*- coding: utf-8 -*-
#
# GeoNode Users Workshop documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 17 15:21:27 2012.
#
# 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
# autogenerate... | gpl-3.0 |
nikhilprathapani/python-for-android | python-modules/twisted/twisted/words/im/ircsupport.py | 49 | 9263 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
IRC support for Instance Messenger.
"""
import string
from twisted.words.protocols import irc
from twisted.words.im.locals import ONLINE
from twisted.internet import defer, reactor, protocol
from twisted.internet.defer import succe... | apache-2.0 |
nongxiaoming/rt-thread | bsp/ck802/rtconfig.py | 17 | 1957 | import os
# toolchains options
ARCH ='c-sky'
CPU ='ck802'
CROSS_TOOL ='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'F:\c-sky\CSKY\MinGW\csky-abiv2-elf-toolchain\bin'
# EXEC_PATH = r'/home/tanek/c-sky/CK802... | apache-2.0 |
mlaidouni/Artistfunds | venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/__about__.py | 441 | 1073 | # Copyright 2014 Donald Stufft
#
# 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, so... | mit |
Humsie/pi-domotica-server | server/looprgb.py | 1 | 2444 | #!/usr/bin/python
from Adafruit_PWM_Servo_Driver import PWM
import time
import sys
import getopt
# ===========================================================================
# Example Code
# ===========================================================================
# Initialise the PWM device using the default add... | apache-2.0 |
jasvir99/LibreHatti | src/librehatti/programmeletter/admin.py | 5 | 1675 | from django.contrib import admin
from librehatti.programmeletter.models import TeamName
from librehatti.programmeletter.models import StaffInTeam
from librehatti.programmeletter.models import LetterData
from librehatti.programmeletter.forms import StaffInTeamForm
from librehatti.programmeletter.forms import TeamNameF... | gpl-2.0 |
richardnpaul/FWL-Website | lib/python2.7/site-packages/django/contrib/contenttypes/generic.py | 70 | 20534 | """
Classes allowing "generic" relations through ContentType and object-id fields.
"""
from __future__ import unicode_literals
from collections import defaultdict
from functools import partial
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import signals
f... | gpl-3.0 |
vikatory/kbengine | kbe/src/lib/python/Lib/multiprocessing/connection.py | 69 | 30570 | #
# A higher level module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ]
import io
import os
import sys
import socket
import struct
import time
imp... | lgpl-3.0 |
Qalthos/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_list.py | 38 | 3743 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.