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 |
|---|---|---|---|---|---|
moondrop-entertainment/django-nonrel-drawp | django/core/management/base.py | 248 | 16452 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
import os
import sys
from optparse import make_option, OptionParser
import django
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import ... | bsd-3-clause |
paddyvishnubhatt/daranalysis | lib/jinja2/constants.py | 220 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | apache-2.0 |
frejanordsiek/hdf5storage | tests/test_dict_like_storage_methods.py | 1 | 7762 | # Copyright (c) 2013-2021, Freja Nordsiek
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions ... | bsd-2-clause |
tedelhourani/ansible | lib/ansible/module_utils/facts/system/chroot.py | 40 | 1029 | # Copyright (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)
__metaclass__ = type
import os
from ansible.module_utils.facts.collector import BaseFactCollector
def is_chroot():
... | gpl-3.0 |
greenify/zodiacy | bin/import_to_sql.py | 1 | 1369 | #!/usr/bin/env python3
# encoding: utf-8
import argparse
import os
import sqlite3
import json
"""import_to_sql.py: Imports the Horoscope database into a SQLite"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
parser = argparse.ArgumentParser(description="Awesome SQLite importer")... | mit |
Neamar/django | tests/utils_tests/test_baseconv.py | 326 | 1787 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... | bsd-3-clause |
lovedaybrooke/gender-decoder | db_repository/versions/005_migration.py | 1 | 1581 | from sqlalchemy import *
from migrate import *
import datetime
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
job_ad = Table('job_ad', pre_meta,
Column('hash', VARCHAR, primary_key=True, nullable=False),
Column('date', TIMESTAMP),
Column('jobAdText', TEXT),
Column('m... | mit |
CodePath-Parse/MiAR | Firebase/functions/node_modules/firebase-admin/node_modules/grpc/third_party/boringssl/util/generate_build_files.py | 10 | 24976 | # Copyright (c) 2015, Google Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | apache-2.0 |
doismellburning/edx-platform | common/djangoapps/student/migrations/0006_expand_meta_field.py | 188 | 9246 | # 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):
# Changing field 'UserProfile.meta'
db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.... | agpl-3.0 |
majora2007/plexpy | lib/unidecode/x006.py | 252 | 3961 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
',', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'[?]', ... | gpl-3.0 |
Serag8/Bachelor | google_appengine/lib/oauth2client/oauth2client/util.py | 20 | 5617 | #!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | mit |
Daniel-CA/odoo | addons/report_webkit/__init__.py | 382 | 1593 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
Mattze96/youtube-dl | youtube_dl/extractor/mixcloud.py | 91 | 4042 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
HEADRequest,
str_to_int,
)
class MixcloudIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:www\.)?mixcloud\.com/([^/]+)/([^/]+)... | unlicense |
agiliq/fundraiser | customadmin/tests.py | 2 | 1215 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.core.urlr... | bsd-3-clause |
purplewall1206/shadowsocks | tests/test_udp_src.py | 1009 | 2482 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | apache-2.0 |
ianblenke/awsebcli | ebcli/bundled/botocore/vendored/requests/packages/charade/escprober.py | 206 | 3273 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
... | apache-2.0 |
shawnbow/git-repo | subcmds/grep.py | 89 | 7931 | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 la... | apache-2.0 |
ovaskevich/convnet-nu-discovery | python_util/data.py | 180 | 7803 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
edx-solutions/edx-platform | lms/djangoapps/courseware/tests/test_rules.py | 4 | 1680 | """
Tests for permissions defined in courseware.rules
"""
import ddt
import six
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from course_modes.tests.factories import CourseModeFactory
from student.models import CourseEnrollment
from student.tests.factories import UserFactory
@... | agpl-3.0 |
henriquegemignani/randovania | randovania/game_connection/connection_base.py | 1 | 1872 | from enum import Enum
from typing import Optional, Callable, Awaitable, List, NamedTuple, Dict, Tuple
from randovania.game_description.resources.item_resource_info import ItemResourceInfo
from randovania.game_description.resources.pickup_entry import PickupEntry
class GameConnectionStatus(Enum):
Disconnected = "... | gpl-3.0 |
bxshi/gem5 | src/mem/slicc/ast/OodAST.py | 90 | 1802 | #
# Copyright (c) 2011 Mark D. Hill and David A. Wood
# 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 condit... | bsd-3-clause |
marcusrehm/serenata-de-amor | rosie/rosie/chamber_of_deputies/classifiers/monthly_subquota_limit_classifier.py | 2 | 6711 | import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin
class MonthlySubquotaLimitClassifier(TransformerMixin):
"""
Monthly Subquota Limit classifier.
Dataset
-------
issue_date : datetime column
Date when the expense was made.
month : int column
The ... | mit |
gmcastil/numpy | numpy/tests/test_reloading.py | 68 | 1038 | from __future__ import division, absolute_import, print_function
import sys
from numpy.testing import assert_raises, assert_, run_module_suite
if sys.version_info[:2] >= (3, 4):
from importlib import reload
else:
from imp import reload
def test_numpy_reloading():
# gh-7844. Also check that relevant glob... | bsd-3-clause |
jbhamilton/Which-CSS | codebase/tinycss/tests/test_decoding.py | 6 | 3375 | # coding: utf8
"""
Tests for decoding bytes to Unicode
-----------------------------------
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import pytest
from tinycss.decoding import decode
def params(css, encoding, use_... | apache-2.0 |
janocat/odoo | 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 |
EdLogan18/logan-repository | plugin.video.logan/mechanize/_request.py | 133 | 1561 | """Integration with Python standard library module urllib2: Request class.
Copyright 2004-2006 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import logging
... | gpl-2.0 |
jacshfr/mozilla-bedrock | vendor-local/lib/python/south/management/commands/startmigration.py | 129 | 2113 | """
Now-obsolete startmigration command.
"""
from __future__ import print_function
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--m... | mpl-2.0 |
hostmaster/ansible-modules-core | system/group.py | 81 | 13394 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@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 Lice... | gpl-3.0 |
Cinntax/home-assistant | homeassistant/components/geniushub/sensor.py | 1 | 3755 | """Support for Genius Hub sensor devices."""
from datetime import timedelta
from typing import Any, Awaitable, Dict
from homeassistant.const import DEVICE_CLASS_BATTERY
from homeassistant.util.dt import utc_from_timestamp, utcnow
from . import DOMAIN, GeniusEntity
GH_HAS_BATTERY = ["Room Thermostat", "Genius Valve",... | apache-2.0 |
valorbit/valorbit | share/seeds/generate-seeds.py | 128 | 4187 | #!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory ... | mit |
knabar/openmicroscopy | components/tools/OmeroPy/src/omero/install/bzip2_tool.py | 15 | 1301 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Function for enabling/disabling the bzip2.dll which
comes with PyTables.
Copyright 2009 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import sys
def bzip2_tool(disable=False):
"""... | gpl-2.0 |
thorgate/django-esteid | esteid/authentication/views.py | 1 | 3854 | import logging
from typing import Type, TYPE_CHECKING
from django.http import HttpRequest, JsonResponse
from esteid.exceptions import ActionInProgress
from esteid.mixins import DjangoRestCompatibilityMixin, SessionViewMixin
from .authenticator import Authenticator
from .types import AuthenticationResult
try:
f... | bsd-3-clause |
shabab12/edx-platform | common/test/acceptance/pages/lms/index.py | 11 | 1751 | # -*- coding: utf-8 -*-
"""
LMS index (home) page.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
BANNER_SELECTOR = 'section.home header div.outer-wrapper div.title .heading-group h1'
INTRO_VIDEO_SELECTOR = 'div.play-intro'
VIDEO_MODAL_SELECTOR = 'section#video-modal.modal.home-page-video-modal... | agpl-3.0 |
Poojawa/tgstation-fork | tools/midi2piano/midi/midi.py | 102 | 65440 | #! /usr/bin/python3
# unsupported 20091104 ...
# ['set_sequence_number', dtime, sequence]
# ['raw_data', dtime, raw]
r'''
This module offers functions: concatenate_scores(), grep(),
merge_scores(), mix_scores(), midi2opus(), midi2score(), opus2midi(),
opus2score(), play_score(), score2midi(), score2opus(), sco... | agpl-3.0 |
5GExchange/escape | mininet/mininet/cli_vnf.py | 2 | 5976 | """
Extends Mininet CLI with sum-commands for interactive with VNFs.
Example session:
mininet> vnf info
mininet> ee status
mininet> ee help
mininet> ee
mininet:ee> status
mininet:ee> help
mininet:ee>
mininet>
"""
from os import kill
from time import sleep
from cmd import Cmd
import sys
import curses
from mininet.lo... | apache-2.0 |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/debian/headphones/apps/headphones/lib/unidecode/x0a3.py | 253 | 4521 | data = (
'nzup', # 0x00
'nzurx', # 0x01
'nzur', # 0x02
'nzyt', # 0x03
'nzyx', # 0x04
'nzy', # 0x05
'nzyp', # 0x06
'nzyrx', # 0x07
'nzyr', # 0x08
'sit', # 0x09
'six', # 0x0a
'si', # 0x0b
'sip', # 0x0c
'siex', # 0x0d
'sie', # 0x0e
'siep', # 0x0f
'sat', # 0x10
'sax', #... | gpl-2.0 |
jswoboda/SimISR | beamtools/setupGUI.py | 2 | 13468 | #!/usr/bin/env python
"""
This GUI can be used to create set up files for the SimISR. The user can set up
the parameters and set up the beam pattern. The user can also bring in an older setup
file, change the settings and then save out a new version.
@author: Greg Starr
"""
#from Tkinter import *
import Tkint... | mit |
teeple/pns_server | work/install/Python-2.7.4/Lib/test/test_uuid.py | 84 | 20782 | from unittest import TestCase
from test import test_support
import uuid
def importable(name):
try:
__import__(name)
return True
except:
return False
class TestUUID(TestCase):
last_node = None
source2node = {}
def test_UUID(self):
equal = self.assertEqual
as... | gpl-2.0 |
zhuguihua/linux | tools/perf/scripts/python/export-to-postgresql.py | 238 | 25591 | # 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 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/tools/metrics/histograms/find_unmapped_histograms.py | 56 | 7483 | # 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.
"""Scans the Chromium source for histograms that are absent from histograms.xml.
This is a heuristic scan, so a clean run of this script does not guarantee ... | apache-2.0 |
cpennington/edx-platform | openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py | 1 | 23912 | """
Test the various password reset flows
"""
import json
import re
import unicodedata
import unittest
import ddt
from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, make_password
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tokens... | agpl-3.0 |
lpsinger/healpy | healpy/test/test_pixelfunc.py | 5 | 8263 | from ..pixelfunc import *
from .._query_disc import boundaries
from .._pixelfunc import ringinfo, pix2ring, isnsideok
import numpy as np
import unittest
class TestPixelFunc(unittest.TestCase):
def setUp(self):
# data fixture
self.theta0 = [1.52911759, 0.78550497, 1.57079633, 0.05103658, 3.09055608... | gpl-2.0 |
rcharp/toyota-flask | venv/lib/python2.7/site-packages/markupsafe/tests.py | 674 | 6107 | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="appl... | apache-2.0 |
vertigo235/Sick-Beard-XEM | lib/hachoir_parser/misc/pifv.py | 90 | 8492 | """
EFI Platform Initialization Firmware Volume parser.
Author: Alexandre Boeglin
Creation date: 08 jul 2007
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt24, UInt32, UInt64, Enum,
CString, String, PaddingBytes, RawBytes, NullBytes)
from lib.hachoir... | gpl-3.0 |
danielkza/dnf | dnf/yum/packages.py | 15 | 3808 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-2.0 |
kristjankorjus/Replicating-DeepMind | src/ale/ale.py | 6 | 4582 | """
ALE class launches the ALE game and manages the communication with it
"""
import os
import numpy as np
from preprocessor import Preprocessor
import traceback
import random
class ALE:
actions = [np.uint8(0), np.uint8(1), np.uint8(3), np.uint8(4), np.uint8(11), np.uint8(12)]
current_points = 0
next_scre... | gpl-3.0 |
jitendra29/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/base.py | 293 | 1831 | import base64
import logging
import os
import unittest
import urllib
import urllib2
import urlparse
import wptserve
logging.basicConfig()
here = os.path.split(__file__)[0]
doc_root = os.path.join(here, "docroot")
class Request(urllib2.Request):
def __init__(self, *args, **kwargs):
urllib2.Request.__init... | mpl-2.0 |
jshufelt/volatility | volatility/plugins/mac/bash.py | 12 | 6355 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
yongtang/tensorflow | tensorflow/python/keras/saving/saved_model/json_utils.py | 6 | 4656 | # Copyright 2020 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 |
mozilla/firefox-flicks | vendor-local/lib/python/billiard/forking.py | 1 | 20104 | #
# Module for starting a process object using os.fork() or CreateProcess()
#
# multiprocessing/forking.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
import os
import sys
import signal
import warnings
from ._ext import Connection, ... | bsd-3-clause |
M4sse/chromium.src | third_party/cython/src/Cython/Compiler/Interpreter.py | 99 | 2063 | """
This module deals with interpreting the parse tree as Python
would have done, in the compiler.
For now this only covers parse tree to value conversion of
compile-time values.
"""
from Nodes import *
from ExprNodes import *
from Errors import CompileError
class EmptyScope(object):
def lookup(self, name):
... | bsd-3-clause |
silly-wacky-3-town-toon/SOURCE-COD | Panda3D-1.10.0/python/Lib/urllib.py | 37 | 58056 | """Open an arbitrary URL.
See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html
See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/Protocols... | apache-2.0 |
chrisjaquet/FreeCAD | src/Mod/Ship/shipUtils/Locale.py | 38 | 2210 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2016 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
tarzan0820/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 |
sergmelikyan/murano | murano/utils.py | 1 | 2779 | # Copyright (c) 2013 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... | apache-2.0 |
alexryndin/ambari | ambari-client/python-client/src/examples/main.py | 4 | 4761 | #
# 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 ... | apache-2.0 |
bastianh/zulip | zerver/lib/logging_util.py | 124 | 1529 | from __future__ import absolute_import
import logging
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
... | apache-2.0 |
BlackBox-Kernel/blackbox_sprout_lp | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
elimence/edx-platform | lms/djangoapps/certificates/migrations/0002_auto__add_field_generatedcertificate_download_url.py | 188 | 6807 | # -*- 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 'GeneratedCertificate.download_url'
db.add_column('certificates_generatedcertificate', 'downl... | agpl-3.0 |
diorcety/intellij-community | python/lib/Lib/site-packages/django/conf/locale/pl/formats.py | 78 | 1286 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# 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 = 'H:i:s'
DATETIME_FORMAT = 'j E Y H:i:s'
YEAR_MONTH_F... | apache-2.0 |
pyprism/Diary | hiren/settings.py | 1 | 4794 | """
Django settings for hiren project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
impo... | mit |
parinporecha/backend_gtgonline | GTG/gtk/__init__.py | 1 | 1400 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | gpl-3.0 |
seanrivera/rust | src/etc/debugger_pretty_printers_common.py | 16 | 12327 | # Copyright 2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... | apache-2.0 |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/hr_recruitment/report/__init__.py | 442 | 1107 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
ilayn/scipy | scipy/sparse/csr.py | 12 | 11609 | """Compressed Sparse Row matrix format"""
__docformat__ = "restructuredtext en"
__all__ = ['csr_matrix', 'isspmatrix_csr']
import numpy as np
from .base import spmatrix
from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks,
get_csr_submatrix)
from .sputils import upcast, get_i... | bsd-3-clause |
chirilo/mozillians | vendor-local/lib/python/celery/tests/test_events/test_events_state.py | 14 | 10736 | from __future__ import absolute_import
from time import time
from itertools import count
from celery import states
from celery.events import Event
from celery.events.state import State, Worker, Task, HEARTBEAT_EXPIRE
from celery.utils import uuid
from celery.tests.utils import Case
class replay(object):
def _... | bsd-3-clause |
Slezhuk/ansible | lib/ansible/modules/remote_management/ipmi/ipmi_power.py | 69 | 3949 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
omegamoon/rockchip-rk3188-mk908 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
asser/django | tests/gis_tests/gis_migrations/test_operations.py | 284 | 7957 | from __future__ import unicode_literals
from django.contrib.gis.db.models import fields
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.test ... | bsd-3-clause |
thebohemian/openembedded | lib/oe/packagedata.py | 27 | 2978 | import os
import bb.data
import codecs
def packaged(pkg, d):
return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
def read_pkgdatafile(fn):
pkgdata = {}
def decode(str):
c = codecs.getdecoder("string_escape")
return c(str)[0]
if os.access(fn, os.R_OK):
import r... | mit |
elena/django | tests/admin_changelist/test_date_hierarchy.py | 24 | 3483 | from datetime import datetime
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.auth.models import User
from django.test import RequestFactory, TestCase
from django.utils.timezone import make_aware
from .admin import EventAdmin, site as custom_site
from .models import Event
clas... | bsd-3-clause |
MQQiang/kbengine | kbe/src/lib/python/Lib/distutils/util.py | 81 | 20665 | """distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
import os
import re
import importlib.util
import sys
import string
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from ... | lgpl-3.0 |
beni55/djangolint | project/lint/views.py | 2 | 2264 | from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
from django.utils import simplejson as json
from django.views.decorators.http import require_POST
from .forms import ReportForm
from .models import Report, STAGES
from .tasks import process_report
def index(request):
repo... | isc |
lovelylain/pyctp | example/pyctp2/trader/trade_command.py | 7 | 7748 | #-*- coding:utf-8 -*-
"""
与底层无关的交易命令
"""
import logging
from ..common.base import Nope
from .position import POSITION_APPROVE_STATUS
LOWEST_PRIORITY = 9000000
class Command(object):
def __init__(self,priority=LOWEST_PRIORITY):
self._priority = priority
@property
def priority(self):
... | mit |
jeffjirsa/cassandra | pylib/cqlshlib/tracing.py | 11 | 3475 | # 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 |
gsobczyk/hamster | waflib/Tools/qt5.py | 35 | 23825 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2018 (ita)
"""
This tool helps with finding Qt5 tools and libraries,
and also provides syntactic sugar for using Qt5 tools.
The following snippet illustrates the tool usage::
def options(opt):
opt.load('compiler_cxx qt5')
def configure(conf):
conf.lo... | gpl-3.0 |
pombreda/pydbgr | trepan/debugger.py | 2 | 14215 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2010, 2013 Rocky Bernstein <rocky@gnu.org>
#
# 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... | gpl-3.0 |
cisco-openstack/neutron | neutron/plugins/cisco/network_plugin.py | 32 | 6921 | # Copyright 2012 Cisco Systems, 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 requir... | apache-2.0 |
luogangyi/bcec-nova | nova/tests/compute/test_compute_xen.py | 16 | 2602 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
bgaultier/laboitepro | laboite/apps/weather/migrations/0001_initial.py | 1 | 1855 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-21 20:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('boites', '__first__'),
]
operati... | agpl-3.0 |
aronasorman/content-curation | contentcuration/contentcuration/production_settings.py | 2 | 1440 | import os
from .settings import *
STORAGE_ROOT = "/contentworkshop_content/storage/"
DB_ROOT = "/contentworkshop_content/databases/"
STATIC_ROOT = "/contentworkshop_static/"
MEDIA_ROOT = STORAGE_ROOT
SITE_ID = int(os.getenv("SITE_ID"))
SESSION_ENGINE = "django.contrib.sessions.backends.db"
if os.getenv("USE_DATADO... | mit |
ehirt/odoo | addons/mass_mailing/models/mail_thread.py | 66 | 5189 | # -*- 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 o... | agpl-3.0 |
SoftwareKing/zstack-dashboard | zstack_dashboard/static/templates/console/utils/websocket.py | 9 | 34617 | #!/usr/bin/env python
'''
Python WebSocket library with support for "wss://" encryption.
Copyright 2011 Joel Martin
Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
Supports following protocol versions:
- http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75
- http://tools.ietf.org/html/draft-... | apache-2.0 |
bealdav/OCB | addons/mail/wizard/__init__.py | 438 | 1075 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
albertomurillo/ansible | lib/ansible/modules/network/cloudengine/ce_netstream_template.py | 27 | 15739 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
agentfog/qiime | qiime/sort.py | 15 | 7369 | #!/usr/bin/env python
# File created on 15 Feb 2011
from __future__ import division
import re
from operator import itemgetter
from numpy import array
from skbio.parse.sequences import parse_fasta
from qiime.parse import parse_mapping_file
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project... | gpl-2.0 |
dfc/beets | test/test_fetchart.py | 25 | 2004 | # This file is part of beets.
# Copyright 2015, Thomas Scholtes.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | mit |
lebrice/SimpleParsing | test/test_decoding.py | 1 | 3455 | import json
import logging
import textwrap
from collections import OrderedDict
from dataclasses import dataclass, fields
from pathlib import Path
from test.conftest import silent
from test.testutils import *
from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Type, Union
import pytest
import yaml
from ... | mit |
andykimpe/chromium-test-npapi | base/android/jni_generator/jni_generator.py | 1 | 53217 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests."""... | bsd-3-clause |
VirtueSecurity/aws-extender | BappModules/docutils/parsers/rst/languages/cs.py | 128 | 4857 | # $Id: cs.py 7119 2011-09-02 13:00:23Z milde $
# Author: Marek Blaha <mb@dat.cz>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each lan... | mit |
MaDKaTZe/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py | 115 | 26224 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
jilir/shadowsocks | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
oberlin/django | django/test/client.py | 29 | 26734 | from __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import ... | bsd-3-clause |
KevinGoodsell/sympy | sympy/physics/secondquant.py | 4 | 14763 | """
Second quantization operators and states for bosons.
This follow the formulation of Fetter and Welecka, "Quantum Theory
of Many-Particle Systems."
"""
from sympy import (
Basic, Function, var, Mul, sympify, Integer, Add, sqrt,
Number, Matrix, zeros, Pow, I
)
from sympy.utilities.decorator import deprecat... | bsd-3-clause |
zhhf/charging | charging/db/migration/alembic_migrations/versions/338d7508968c_vpnaas_peer_address_.py | 11 | 1656 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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... | apache-2.0 |
nexiles/odoo | addons/mail/tests/__init__.py | 261 | 1173 | # -*- 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 |
tmpgit/intellij-community | python/lib/Lib/site-packages/django/contrib/auth/management/commands/createsuperuser.py | 122 | 5743 | """
Management utility to create superusers.
"""
import getpass
import re
import sys
from optparse import make_option
from django.contrib.auth.models import User
from django.core import exceptions
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext as _
RE_V... | apache-2.0 |
vovanec/supervisor_checks | supervisor_checks/bin/xmlrpc_check.py | 1 | 3794 | #! /usr/bin/env python3
"""Example configuration:
[eventlistener:example_check]
command=/usr/local/bin/supervisor_xmlrpc_check -g example_service -n example_check -u /ping -r 3 -p 8080
events=TICK_60
"""
import argparse
import sys
from supervisor_checks import check_runner
from supervisor_checks.check_modules impor... | mit |
TeoV/cgrates | data/scripts/migrator/dbsmerge_redis.py | 3 | 2673 | #!/usr/bin/python
# depends:
# ^ redis # install via easy_install redis
# asserts:
# ^ destination redis is not password protected when connected from source
# redis server (https://github.com/antirez/redis/pull/2507)
# behaviour:
# ^ the script will not overwrite keys on the destination server/database
im... | gpl-3.0 |
sportorg/pysport | sportorg/modules/live/live.py | 1 | 1390 | from functools import partial
from threading import Thread
import requests
from sportorg.models.memory import race
from sportorg.modules.live import orgeo
class LiveClient:
@staticmethod
def is_enabled():
obj = race()
live_enabled = obj.get_setting('live_enabled', False)
urls = obj.g... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.