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
maxsocl/django
django/dispatch/dispatcher.py
37
12239
import sys import threading import warnings import weakref from django.utils.deprecation import RemovedInDjango21Warning from django.utils.six.moves import range if sys.version_info < (3, 4): from .weakref_backports import WeakMethod else: from weakref import WeakMethod def _make_id(target): if hasattr(...
bsd-3-clause
Celedhrim/persomov
libs/tornado/template.py
142
31156
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
p0psicles/SickRage
lib/github/Repository.py
21
92750
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Christopher Gilbert <christopher.john.gilbert@gmail.com> # # Copyright 2012 Steve English <steve.english@naveta...
gpl-3.0
naresh21/synergetics-edx-platform
openedx/core/djangoapps/user_api/preferences/tests/test_views.py
21
23538
# -*- coding: utf-8 -*- """ Unit tests for preference APIs. """ import unittest import ddt import json from mock import patch from django.core.urlresolvers import reverse from django.conf import settings from django.test.testcases import TransactionTestCase from rest_framework.test import APIClient from student.tests...
agpl-3.0
JeremyNGalloway/portAuthority
portAuthority.py
2
2475
import subprocess import datetime import logging import sys from netaddr import IPNetwork from time import sleep netcount = 0 ipcount = 0 date = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S') logging.basicConfig(filename='example.log',level=logging.DEBUG) logging.debug('This message should go to the log file')...
gpl-2.0
brennie/reviewboard
reviewboard/oauth/forms.py
1
11912
"""Forms for OAuth2 applications.""" from __future__ import unicode_literals from django import forms from django.core.exceptions import ValidationError from django.forms import widgets from django.utils.translation import ugettext, ugettext_lazy as _ from djblets.forms.widgets import CopyableTextInput, ListEditWidge...
mit
LiuLang/bcloud
bcloud/util.py
10
6706
# Copyright (C) 2014-2015 LiuLang <gsushzhsosgsu@gmail.com> # Use of this source code is governed by GPLv3 license that can be found # in http://www.gnu.org/licenses/gpl-3.0.html import base64 import datetime import hashlib import json import os import random import re import traceback import urllib.parse import time...
gpl-3.0
d10genes/gensim
gensim/models/phrases.py
17
10461
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automatically detect common phrases (multiword expressions) from a stream of sentences. The phrases are collocations (frequently co-occurring tokens). See [1]_ for the exact formula. For examp...
gpl-3.0
playfulgod/kernel-M865
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
TAKEALOT/Diamond
src/diamond/test/testcollector.py
24
1083
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import unittest import configobj from diamond.collector import Collector class BaseCollectorTest(unittest.TestCase): def test_SetCustomHostname(self): config = configobj.ConfigObj...
mit
frankrousseau/weboob
modules/adecco/module.py
7
17064
# -*- coding: utf-8 -*- # Copyright(C) 2013 Bezleputh # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
agpl-3.0
lemonade512/personal-blog
lib/click/core.py
136
70254
import errno import os import sys from contextlib import contextmanager from itertools import repeat from functools import update_wrapper from .types import convert_type, IntRange, BOOL from .utils import make_str, make_default_short_help, echo, get_os_args from .exceptions import ClickException, UsageError, BadParame...
mit
feketemihai/l10n-romania
l10n_ro_siruta/__init__.py
2
1033
# -*- coding: utf-8 -*- ############################################################################## # # Author: Fekete Mihai <mihai.fekete@forbiom.eu> # Copyright (C) 2014 FOREST AND BIOMASS SERVICES ROMANIA SA # (http://www.forbiom.eu). # # This program is free software: you can redistribute it and/or...
agpl-3.0
40223204/w16b_test
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/util.py
696
9917
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
agpl-3.0
dgwakeman/mne-python
mne/preprocessing/tests/test_ctps.py
20
3124
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # # License: BSD 3 clause import numpy as np from mne.time_frequency import morlet from nose.tools import assert_true, assert_raises from numpy.testing import assert_array_equal from mne.preprocessing.ctps_ import (ctps, _prob_kuiper, ...
bsd-3-clause
cpennington/edx-platform
openedx/core/lib/grade_utils.py
9
2509
""" Helpers functions for grades and scores. """ import math def compare_scores(earned1, possible1, earned2, possible2, treat_undefined_as_zero=False): """ Returns a tuple of: 1. Whether the 2nd set of scores is higher than the first. 2. Grade percentage of 1st set of scores. 3. Grade ...
agpl-3.0
Aloomaio/googleads-python-lib
examples/ad_manager/v201808/creative_template_service/get_system_defined_creative_templates.py
1
2005
#!/usr/bin/env python # # Copyright 2016 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 requir...
apache-2.0
ChromiumWebApps/chromium
chrome/test/functional/media/media_jerky.py
78
8162
#!/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. """Jerkiness performance test for video playback. Uses jerky tool, (http://go/jerky), to record a jerkiness metric for videos sens...
bsd-3-clause
jessekl/flixr
venv/lib/python2.7/site-packages/Crypto/SelfTest/Util/__init__.py
116
1743
# -*- coding: utf-8 -*- # # SelfTest/Util/__init__.py: Self-test for utility modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication t...
mit
urthbound/google-python-exercises
basic/string1.py
1
3701
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
apache-2.0
BehavioralInsightsTeam/edx-platform
openedx/core/djangoapps/lang_pref/tests/test_middleware.py
9
10069
""" Tests for lang_pref middleware. """ import itertools import mock import ddt from django.conf import settings from django.test import TestCase from django.urls import reverse from django.test.client import RequestFactory from django.http import HttpResponse from django.contrib.sessions.middleware import SessionMid...
agpl-3.0
takis/django
tests/auth_tests/test_context_processors.py
269
6773
import datetime from django.contrib.auth import authenticate from django.contrib.auth.context_processors import PermLookupDict, PermWrapper from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.db.models import Q from django.test import SimpleTes...
bsd-3-clause
liavkoren/djangoDev
tests/logging_tests/tests.py
19
13277
from __future__ import unicode_literals import logging import warnings from django.core import mail from django.test import TestCase, RequestFactory, override_settings from django.test.utils import patch_logger from django.utils.encoding import force_text from django.utils.deprecation import RemovedInNextVersionWarni...
bsd-3-clause
api-ai/api-ai-python
setup.py
3
2304
# -*- coding:utf8 -*- # !/usr/bin/env python # Copyright 2017 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...
apache-2.0
praekelt/nurseconnect
nurseconnect/tests/test_utils.py
1
4506
from freezegun import freeze_time from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from molo.core.tests.base import MoloTestCaseMixin from molo.core.models import SiteLanguageRelation, Languages, Main from molo.surveys.models import MoloSurveyPage, Mo...
bsd-2-clause
oscaro/django
django/db/models/query.py
48
77464
""" The main QuerySet implementation. This provides the public API for the ORM. """ from collections import deque import copy import sys from django.conf import settings from django.core import exceptions from django.db import connections, router, transaction, IntegrityError from django.db.models.constants import LOO...
bsd-3-clause
Patreon/cartographer
cartographer/field_types/schema_relationship.py
1
4047
from cartographer.resources import get_resource_registry from cartographer.resources.resource_registry import ResourceRegistryKeys class SchemaRelationship(object): """ `SchemaRelationship` describes how to translate related resources to and from JSON API and our Python models. `SchemaRelationship` is ha...
apache-2.0
andresgz/django
tests/raw_query/tests.py
119
12624
from __future__ import unicode_literals from datetime import date from django.db.models.query_utils import InvalidQuery from django.test import TestCase, skipUnlessDBFeature from .models import Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, Reviewer class RawQueryTests(TestCase): @classmethod def setUp...
bsd-3-clause
ecino/compassion-switzerland
account_reconcile_compassion/models/statement_operation.py
3
1033
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
agpl-3.0
mdaniel/intellij-community
python/helpers/coveragepy/coverage/report.py
47
3608
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Reporter foundation for coverage.py.""" import os import warnings from coverage.files import prep_patterns, FnmatchMatcher from coverage.misc import CoverageEx...
apache-2.0
avtoritet/httpie
httpie/client.py
25
4019
import json import sys from pprint import pformat import requests from requests.packages import urllib3 from httpie import sessions from httpie import __version__ from httpie.compat import str from httpie.plugins import plugin_manager # https://urllib3.readthedocs.org/en/latest/security.html urllib3.disable_warning...
bsd-3-clause
SamuelYvon/radish
docs/conf.py
1
9715
# -*- coding: utf-8 -*- # # radish documentation build configuration file, created by # sphinx-quickstart on Sat Jun 13 21:58:55 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
mit
RyuKojiro/YouCompleteMe
python/ycm/diagnostic_interface.py
33
8511
#!/usr/bin/env python # # Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
gpl-3.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/elasticsearch/helpers/test.py
7
1851
import time import os try: # python 2.6 from unittest2 import TestCase, SkipTest except ImportError: from unittest import TestCase, SkipTest from elasticsearch import Elasticsearch from elasticsearch.exceptions import ConnectionError def get_test_client(nowait=False, **kwargs): # construct kwargs from...
apache-2.0
devincoughlin/swift
utils/incrparse/incr_transfer_tree.py
16
3754
#!/usr/bin/env python from __future__ import print_function import argparse import os import subprocess import sys from test_util import TestFailedError, run_command, \ serializeIncrParseMarkupFile def main(): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, ...
apache-2.0
gonboy/sl4a
python/src/Lib/ctypes/test/test_strings.py
51
6957
import unittest from ctypes import * class StringArrayTestCase(unittest.TestCase): def test(self): BUF = c_char * 4 buf = BUF("a", "b", "c") self.failUnlessEqual(buf.value, "abc") self.failUnlessEqual(buf.raw, "abc\000") buf.value = "ABCD" self.failUnlessEqual(buf....
apache-2.0
roadmapper/ansible
lib/ansible/modules/cloud/vmware/vmware_vm_shell.py
23
13417
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015-16, Ritesh Khadgaray <khadgaray () gmail.com> # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__...
gpl-3.0
Stanford-Online/edx-platform
common/djangoapps/course_modes/migrations/0008_course_key_field_to_foreign_key.py
13
2277
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from opaque_keys.edx.django.models import CourseKeyField # This should only be used for migrations that have be verified to have a net-neutral sql # change generated by Django class NoSqlAlterField(migrations.Alt...
agpl-3.0
MiLk/ansible
lib/ansible/module_utils/facts/hardware/base.py
60
1746
# 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 distributed in the hope that ...
gpl-3.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/tool_shed/tools/tool_validator.py
1
19484
import filecmp import logging import os import tempfile from galaxy.tools import Tool from galaxy.tools import parameters from galaxy.tools.parameters import dynamic_options from tool_shed.tools import data_table_manager from tool_shed.util import basic_util from tool_shed.util import hg_util from tool_shed.util imp...
gpl-3.0
broferek/ansible
lib/ansible/plugins/callback/skippy.py
83
1404
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' ...
gpl-3.0
JohnDoee/autotorrent
autotorrent/tests/test_db.py
2
8809
from __future__ import unicode_literals import logging import os import shutil import tempfile from io import open from logging.handlers import BufferingHandler from unittest import TestCase from ..db import Database def create_file(temp_folder, path, size): path = os.path.join(temp_folder, *path) dirname =...
mit
titienmiami/mmc.repository
plugin.video.SportsDevil/lib/utils/github/GitTag.py
7
3445
# -*- coding: utf-8 -*- # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub 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 Softwar...
gpl-2.0
pet1330/zoidbot
interactive_face/src/zoidberg.py
3
1720
#!/usr/bin/python import cv2 from cv_bridge import CvBridge from cv_bridge import CvBridgeError import numpy as np import rosparam import rospy from sensor_msgs.msg import Image import sys import tf import rospkg class interactive_face: def __init__(self): self.pub = rospy.Publisher('/robot/xdisplay', Ima...
mit
ArseniyK/Sunflower
application/operation.py
1
48288
import os import gtk import gobject import fnmatch from threading import Thread, Event from gui.input_dialog import OverwriteFileDialog, OverwriteDirectoryDialog, OperationError, QuestionOperationError from gui.operation_dialog import CopyDialog, MoveDialog, DeleteDialog, RenameDialog from gui.error_list import ErrorL...
gpl-3.0
impulze/paludis
python/version_operator_TEST.py
5
1657
#!/usr/bin/env python # vim: set fileencoding=utf-8 sw=4 sts=4 et : # # Copyright (c) 2007 Piotr Jaroszyński # # This file is part of the Paludis package manager. Paludis 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...
gpl-2.0
wummel/linkchecker
tests/test_fileutil.py
9
1360
# -*- coding: iso-8859-1 -*- # Copyright (C) 2010-2014 Bastian Kleineidam # # 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 versi...
gpl-2.0
rjschof/gem5
tests/long/se/60.bzip2/test.py
56
1754
# Copyright (c) 2006-2007 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 ...
bsd-3-clause
sujithshankar/anaconda
pyanaconda/constants.py
1
6817
# # constants.py: anaconda constants # # Copyright (C) 2001 Red Hat, Inc. All rights reserved. # # 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 ...
gpl-2.0
mwclient/mwclient
mwclient/page.py
1
20723
import six from six import text_type import time from mwclient.util import parse_timestamp import mwclient.listing import mwclient.errors class Page(object): def __init__(self, site, name, info=None, extra_properties=None): if type(name) is type(self): self.__dict__.update(name.__dict__) ...
mit
l-hedgehog/bedrock
bedrock/facebookapps/tests/test_utils.py
25
5007
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import urllib from django.conf import settings from django.utils.translation import get_langua...
mpl-2.0
jeehyn/NewWorld_kernel_ef52
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
LockScreen/Backend
venv/lib/python2.7/site-packages/boto/ec2/instanceinfo.py
152
1893
# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
Wakeupbuddy/pexpect
examples/chess.py
18
4483
#!/usr/bin/env python '''This demonstrates controlling a screen oriented application (curses). It starts two instances of gnuchess and then pits them against each other. PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copy...
isc
cliqz/socorro
socorro/external/es/index_creator.py
10
3323
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import elasticsearch import json import os from configman import Namespace, RequiredConfig from configman.converters im...
mpl-2.0
dmittov/AlcoBot
bot.py
1
2312
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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 dist...
gpl-3.0
moijes12/oh-mainline
vendor/packages/Django/django/contrib/localflavor/cl/forms.py
101
3238
""" Chile specific form helpers. """ from __future__ import absolute_import, unicode_literals from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.utils.encoding i...
agpl-3.0
nullzero/wprobot
wp/ltime.py
1
1990
# -*- coding: utf-8 -*- """ Library to manage everything about date and time. """ __version__ = "1.0.2" __author__ = "Sorawee Porncharoenwase" import datetime import time def wrapMonth(m): """Convert zero-based month number to zero-based month number.""" m -= 1 if m < 0: m += 12 if m >= 12: ...
mit
h3llrais3r/SickRage
lib/sqlalchemy/schema.py
75
1103
# schema.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 """Compatiblity namespace for sqlalchemy.sql.schema and related. """ from .sql.base import...
gpl-3.0
ovilab/atomify-lammps
libs/lammps/tools/moltemplate/moltemplate/dump2data.py
8
62572
#!/usr/bin/env python # -*- coding: utf-8 -*- """ dump2data.py Extract dynamical degrees of freedom from a lammps DUMP file (from the stdin) and construct a new DATA file (to the stdout). A reference DATA file is needed (argument). basic usage ./dump2data.py orig_file.data < dump.lammpstrj > new_file.data (This...
gpl-3.0
alaski/nova
nova/policies/flavors.py
6
1064
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
JVillella/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/invert_test.py
141
3581
# 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
Gui13/CouchPotatoServer
libs/subliminal/exceptions.py
170
1050
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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 3 of...
gpl-3.0
Gr8z/Legend-Cogs
profanity/profanity.py
1
2085
import discord from discord.ext import commands from .utils.dataIO import dataIO, fileIO import os import asyncio BOTCOMMANDER_ROLES = ["Family Representative", "Clan Manager", "Clan Deputy", "Co-Leader", "Hub Officer", "admin"] class profanity: """profanity!""" def __init__(self, bot): self.bot = b...
mit
mseroczynski/platformio
platformio/telemetry.py
4
9325
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. import atexit import platform import Queue import re import sys import threading import uuid from collections import deque from os import getenv from time import sleep, time import click import requests from platformio import __version__, app,...
mit
jchodera/ensembler
ensembler/cli_commands/testrun_pipeline.py
3
3371
import os import ensembler.cli_commands helpstring = """\ Conduct a testrun of the entire ensembler pipeline in the current directory, using the target protein EGFR_HUMAN, and one template structure from AURKB_HUMAN. """ docopt_helpstring = '' def dispatch(args): ensembler.cli_commands.init.dispatch( args={...
gpl-2.0
finway-china/p2pool
nattraverso/portmapper.py
288
4157
""" Generic NAT Port mapping interface. TODO: Example @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from twisted.internet.base import BasePort # Public API def get_port_mapper(proto="TCP"): ...
gpl-3.0
re4lfl0w/pyconkr-2015
pyconkr/tests.py
6
1158
# -*- coding: utf-8 -*- from django.test import TestCase from django.http import HttpResponse from django.test import Client from django.core.urlresolvers import reverse_lazy, reverse from django.contrib.auth import get_user_model from pyconkr.helper import render_io_error User = get_user_model() class HelperFunct...
mit
ojengwa/odoo
addons/l10n_fr/report/compute_resultant_report.py
374
4004
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...
agpl-3.0
doomsterinc/odoo
addons/point_of_sale/wizard/pos_payment.py
344
4976
# -*- 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
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/__future__.py
134
4584
"""Record of phased-in incompatible language changes. Each line is of the form: FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," CompilerFlag ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples of the same form as sys.version_info: (...
lgpl-3.0
andersx/cclib
src/cclib/method/population.py
5
3285
# -*- coding: utf-8 -*- # # This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2006-2015, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser Gen...
lgpl-2.1
mxia/engine
build/gyp_environment.py
101
1320
# 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. """ Sets up various automatic gyp environment variables. These are used by gyp_chromium and landmines.py which run at different stages of runhooks. To make s...
bsd-3-clause
mhlechner/psi4
psi4/driver/qcdb/periodictable.py
2
78237
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2017 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
gpl-2.0
muffinresearch/amo-validator
validator/outputhandlers/shellcolors.py
8
2788
import re try: import curses except ImportError: curses = None import os import sys from StringIO import StringIO COLORS = ('BLUE', 'RED', 'GREEN', 'YELLOW', 'WHITE', 'BLACK') class OutputHandler: """A handler that hooks up with the error bundler to colorize the output of the application for *nix-ba...
bsd-3-clause
evanma92/routeh
flask/lib/python2.7/site-packages/passlib/utils/handlers.py
19
62539
"""passlib.handler - code for implementing handlers, and global registry for handlers""" #============================================================================= # imports #============================================================================= from __future__ import with_statement # core import inspect imp...
bsd-3-clause
eerwitt/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/categorical_vocabulary.py
94
4204
# 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
Kjili/analysis-preservation.cern.ch
cap/modules/experiments/permissions/atlas.py
2
1583
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2016 CERN. # # CERN Analysis Preservation Framework 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...
gpl-2.0
nanolearningllc/edx-platform-cypress-2
common/djangoapps/student/views.py
12
91744
""" Student Views """ import datetime import logging import uuid import json import warnings from collections import defaultdict from pytz import UTC from requests import HTTPError from ipware.ip import get_ip from django.conf import settings from django.contrib.auth import logout, authenticate, login from django.cont...
agpl-3.0
a10networks/a10sdk-python
a10sdk/core/ip/ip_dns_secondary.py
2
1344
from a10sdk.common.A10BaseClass import A10BaseClass class Secondary(A10BaseClass): """Class Description:: Secondary DNS server. Class secondary supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param ip_v4_addr: {"not": "...
apache-2.0
myerssr/volatility
volatility/plugins/mac/arp.py
58
1398
# 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 ...
gpl-2.0
jaggu303619/asylum
setup.py
15
5075
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from glob import glob from setuptools import find_packages, setup from os.path import join, dirname execfile(join(dirname(__file__), 'openerp', 'release.py')) # Load release variables lib_name = 'openerp' def py2exe_datafiles(): data_files = {}...
agpl-3.0
GaetanCambier/CouchPotatoServer
libs/axl/axel.py
65
13262
# axel.py # # Copyright (C) 2010 Adrian Cristea adrian dot cristea at gmail dotcom # Edits by Ruud Burger # # Based on an idea by Peter Thatcher, found on # http://www.valuedlessons.com/2008/04/events-in-python.html # # This module is part of Axel and is released under # the MIT License: http://www.opensource.org/licen...
gpl-3.0
marratj/ansible
lib/ansible/template/vars.py
32
4293
# (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
samuelfekete/Pythonometer
tests/test_questions.py
1
1786
"""Test all questions.""" import os import sys import unittest sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from pythonometer.quiz import all_questions from pythonometer.questions.base import WrongAnswer class TestQuestions(unittest.TestCase): """Test the questions. A...
mit
bowlofstew/changes
changes/api/job_log_details.py
2
2316
from __future__ import absolute_import, division, unicode_literals from flask import Response, request from changes.api.base import APIView from changes.models import LogSource, LogChunk LOG_BATCH_SIZE = 50000 # in length of chars class JobLogDetailsAPIView(APIView): def get(self, job_id, source_id): ...
apache-2.0
isaac-philip/loolu
common/django/utils/http.py
29
3849
import re import urllib from email.Utils import formatdate from django.utils.encoding import smart_str, force_unicode from django.utils.functional import allow_lazy ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"') def urlquote(url, safe='/'): """ A version of Python's urllib.quote() function that can ope...
mit
helldorado/ansible
lib/ansible/plugins/lookup/pipe.py
150
2325
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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) __metaclass__ = type DOCUMENTATION = """ lookup: pipe author: Daniel H...
gpl-3.0
koharjidan/dogecoin
qa/rpc-tests/smartfees.py
6
12419
#!/usr/bin/env python2 # Copyright (c) 2014-2015 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 fee estimation code # from test_framework.test_framework import BitcoinTestFramework from test_...
mit
i5o/sugar-toolkit-gtk3
examples/radiotoolbutton.py
2
1488
from gi.repository import Gtk from sugar3.graphics.radiotoolbutton import RadioToolButton from sugar3.graphics.radiopalette import RadioPalette, RadioMenuButton from sugar3.graphics.xocolor import XoColor from common import set_theme set_theme() window = Gtk.Window() window.show() window.connect("delete-event", Gtk....
lgpl-2.1
cchurch/ansible
lib/ansible/plugins/lookup/nios_next_network.py
77
4174
# # Copyright 2018 Red Hat | Ansible # # 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. # # A...
gpl-3.0
Nicop06/ansible
lib/ansible/modules/cloud/amazon/iam_policy.py
19
14055
#!/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 distributed...
gpl-3.0
iocast/poiservice
lib/FilterEncodingWizard.py
1
2742
''' Created on May 16, 2011 @author: michel ''' import json class FilterEncodingWizard(object): comparision = [{ 'value' : 'PropertyIsEqualTo', 'display' : '=', 'xml' : '<PropertyIsEqualTo><PropertyName>${value}</PropertyName><Literal>${literal}</Literal></PropertyIsEqu...
mit
triggerNZ/illacceptanything
code/recursive_cmp.py
12
1262
#!/usr/bin/env python3 CHECK_CONTENT = False import os import sys import subprocess join = os.path.join def compare_dirs(dir1, dir2): l1 = set(os.listdir(dir1)) l2 = set(os.listdir(dir2)) if l1 != l2: print('“%s” and “%s” differ:' % (dir1, dir2)) print('\tfirst has: %s' % (l1-l2)) ...
mit
wagnerand/addons-server
src/olympia/zadmin/admin.py
4
2189
from django.conf import settings from django.contrib import admin, auth from django.core.exceptions import PermissionDenied from django.shortcuts import redirect from django.utils.html import format_html from django.urls import reverse from olympia.accounts.utils import redirect_for_login from . import models def r...
bsd-3-clause
lepistone/odoo
addons/website_forum/models/res_users.py
21
2538
# -*- coding: utf-8 -*- from openerp.osv import osv, fields class Users(osv.Model): _inherit = 'res.users' def __init__(self, pool, cr): init_res = super(Users, self).__init__(pool, cr) self.SELF_WRITEABLE_FIELDS = list(set( self.SELF_WRITEABLE_FIELDS + \ ['co...
agpl-3.0
takeshineshiro/cinder
cinder/tests/unit/api/common.py
44
1204
# Copyright 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 requ...
apache-2.0
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/webpagereplay/rules_parser.py
30
5179
# Copyright 2015 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 ...
bsd-3-clause
akarki15/mozillians
vendor-local/lib/python/tablib/packages/openpyxl/shared/exc.py
118
2259
# file openpyxl/shared/exc.py # Copyright (c) 2010 openpyxl # # 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, mod...
bsd-3-clause
tanglu-org/tgl-misago
misago/apps/admin/bans/views.py
3
5489
from django.core.urlresolvers import reverse as django_reverse from django.db.models import Q from django.template import RequestContext from django.utils.translation import ugettext as _ from misago import messages from misago.admin import site from misago.apps.admin.widgets import * from misago.messages import Messag...
gpl-3.0