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
FowlerLab/Enrich2
enrich2/seqlib.py
1
15885
from __future__ import print_function import logging import os.path import pandas as pd import numpy as np from collections import OrderedDict from matplotlib.backends.backend_pdf import PdfPages import sys from .plots import counts_plot from .storemanager import StoreManager, fix_filename, ELEMENT_LABELS class SeqLi...
bsd-3-clause
MikeAmy/django
tests/admin_changelist/models.py
276
2890
from django.db import models from django.utils.encoding import python_2_unicode_compatible class Event(models.Model): # Oracle can have problems with a column named "date" date = models.DateField(db_column="event_date") class Parent(models.Model): name = models.CharField(max_length=128) class Child(mo...
bsd-3-clause
MRCIEU/melodi
melodi/settings.py
1
8804
""" Django settings for melodi project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths...
mit
RossBrunton/django
django/conf/locale/nl/formats.py
504
4472
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '20 ja...
bsd-3-clause
JonathanSeguin/Mariana
Mariana/regularizations.py
1
1924
from Mariana.abstraction import Abstraction_ABC __all__ = ["SingleLayerRegularizer_ABC", "L1", "L2", "ActivationL1"] class SingleLayerRegularizer_ABC(Abstraction_ABC) : """An abstract regularization to be applied to a layer.""" def apply(self, layer) : """Apply to a layer and update networks's log""" hyps = {}...
apache-2.0
ruuk/script.evernote
lib/evernote/edam/userstore/ttypes.py
2
37784
# # Autogenerated by Thrift Compiler (0.5.0-en-262021) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import evernote.edam.type.ttypes import evernote.edam.error.ttypes from thri...
gpl-2.0
wwfifi/uliweb
uliweb/contrib/staticfiles/wsgi_staticfiles.py
2
3843
import os from werkzeug.wsgi import SharedDataMiddleware from uliweb import settings from uliweb.utils.filedown import filedown class StaticFilesMiddleware(SharedDataMiddleware): """ This WSGI middleware is changed from werkzeug ShareDataMiddleware, but I made it Uliweb compatable. """ def __init_...
bsd-2-clause
carschar/xhtml2pdf
xhtml2pdf/turbogears.py
99
1449
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
googlefonts/pyfontaine
fontaine/charsets/noto_chars/notosansmandaic_regular.py
2
1761
# -*- coding: utf-8 -*- class Charset(object): common_name = 'NotoSansMandaic-Regular' native_name = '' def glyphs(self): chars = [] chars.append(0x0000) #uniFEFF ???? chars.append(0x0640) #uni0640 ARABIC TATWEEL chars.append(0x000D) #uni000D ???? chars.append(0...
gpl-3.0
cicatiello/PokemonGo-Bot
pokemongo_bot/cell_workers/spin_fort.py
3
6272
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time from pgoapi.utilities import f2i from pokemongo_bot.constants import Constants from pokemongo_bot.human_behaviour import sleep from pokemongo_bot.worker_result import WorkerResult from pokemongo_bot.cell_workers.base_task import BaseTask fro...
gpl-3.0
yoer/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/messages/storage/fallback.py
627
2171
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import CookieStorage from django.contrib.messages.storage.session import SessionStorage class FallbackStorage(BaseStorage): """ Tries to store all messages in the first backend, storing any unstored mes...
apache-2.0
crentagon/chess-with-benefits
game/chess/show_piece_stats.py
1
2090
def run(self, board_input, i, j): origin_piece = board_input[i][j].piece max_control = { 1: 2, 3: 8, 4: 13, 5: 14, 9: 27, 0: 8 } origin_piece.status = 'Healthy' is_threatened_undefended = len(origin_piece.attackers) > len(origin_piece.defenders) is_threatened_by_lower_rank = [x for x in origin_pie...
gpl-3.0
ODM2/YODA-Tools
tests/test_converter/test_output/test_dbOutput.py
2
1029
import os from tests.test_util import build_ts_session, build_ts_specimen_session from yodatools.converter.Outputs.dbOutput import dbOutput from odm2api.ODMconnection import dbconnection from odm2api.models import People, SamplingFeatures, MeasurementResultValues, TimeSeriesResultValues curr_folder = os.path.abspath...
bsd-3-clause
crimsonthunder/TRLTE_AOSP_Kernel
tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
ravi-sharma/python-api-library
src/kayako/exception.py
3
1207
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2011, Evan Leis # # Distributed under the terms of the Lesser GNU General Public License (LGPL) #----------------------------------------------------------------------------- ''' Created on May 5, 2011...
bsd-2-clause
q1ang/scikit-learn
examples/preprocessing/plot_function_transformer.py
161
1949
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
bsd-3-clause
sinkuri256/python-for-android
python3-alpha/extra_modules/gdata/test_config.py
46
17822
#!/usr/bin/env python # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
Silviumik/Silviu_Kernel_I9195_LTE_KitKat
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
leahrnh/ticktock_text_api
breakdown_detector.py
1
1533
import readall import gensim import nltk import numpy as np import pickle # we need to extract some features, now we make it easy now to just use the word2vec, one turn previous turn. # model = gensim.models.Word2Vec.load('/tmp/word2vec_50_break') all_v1 = readall.readall('/home/ubuntu/zhou/Backend/rating_log/v1') all...
gpl-2.0
polimediaupv/edx-platform
common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py
114
15224
# -*- 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 'CourseEnrollment.is_active' db.add_column('student_courseenrollment', 'is_active', ...
agpl-3.0
Dziolas/invenio
modules/bibknowledge/lib/bibknowledgeadmin.py
18
31208
## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011, 2012, 2013 CERN. ## ## Invenio 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 ...
gpl-2.0
gltn/stdm
stdm/third_party/FontTools/fontTools/pens/momentsPen.py
1
9410
"""Pen calculating 0th, 1st, and 2nd moments of area of glyph shapes. This is low-level, autogenerated pen. Use statisticsPen instead.""" from fontTools.misc.py23 import * from fontTools.pens.basePen import BasePen __all__ = ["MomentsPen"] class MomentsPen(BasePen): def __init__(self, glyphset=None): BasePen.__...
gpl-2.0
PercyODI/PythonCSharpOOComparison
Utilities/checkLinks.py
1
1091
import sys, os, re pattern = re.compile('\[.+\]\((?P<file>.+?)\)', re.MULTILINE) # Matches [text](directory/file.md) folderDict = {} numBadLinks = 0; os.chdir("..") # Assumes this utility is one directory deep. startDirectory = os.path.abspath(".") mdFiles = [] for root, subFolders, files in os.walk("."): if("\...
mit
ActiveState/code
recipes/Python/577746_Inherit_Method_Docstrings_Using_Only/recipe-577746.py
1
2640
"""docfunc module""" from deferred_binder import DeferredBinder class DocFunc(DeferredBinder): TRIGGER = None def __init__(self, f): super().__init__(f.__name__, f) self.f = self.target @staticmethod def transform(name, context, target, obj=None): """The DeferredBinder trans...
mit
google/cauliflowervest
cauliflowervest/client/base_client.py
1
9496
# 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.0 # # Unless required by applicable law or a...
apache-2.0
waseem18/oh-mainline
vendor/packages/Django/django/utils/archive.py
229
6935
""" Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/ Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors. 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 So...
agpl-3.0
JulienMcJay/eclock
windows/Python27/Lib/site-packages/Cython/Build/Inline.py
8
10878
import sys, os, re, inspect import imp try: import hashlib except ImportError: import md5 as hashlib from distutils.core import Distribution, Extension from distutils.command.build_ext import build_ext import Cython from Cython.Compiler.Main import Context, CompilationOptions, default_options from Cython.Co...
gpl-2.0
jeanlinux/calibre
src/calibre/ebooks/rtf2xml/info.py
24
11629
######################################################################### # # # # # copyright 2002 Paul Henry Tremblay # # ...
gpl-3.0
khkaminska/scikit-learn
examples/ensemble/plot_forest_importances.py
241
1761
""" ========================================= Feature importances with forests of trees ========================================= This examples shows the use of forests of trees to evaluate the importance of features on an artificial classification task. The red bars are the feature importances of the forest, along wi...
bsd-3-clause
pwarren/AGDeviceControl
agdevicecontrol/thirdparty/site-packages/linux2/twisted/test/test_paths.py
3
6972
import os, time, pickle from twisted.python import filepath from twisted.python.runtime import platform from twisted.trial import unittest class FilePathTestCase(unittest.TestCase): f1content = "file 1" f2content = "file 2" def setUp(self): self.now = time.time() cmn = self.mktemp() ...
gpl-2.0
jeremiedecock/pyai
ailib/optimize/functions/unconstrained.py
1
31848
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017,2018,2019 Jeremie DECOCK (http://www.jdhp.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, inclu...
mit
mvbn6789/flask-blog
migrations/env.py
605
2158
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...
mit
gavein/sleeping-god
SleepingGodObjects/Vessel.py
1
2849
#!/usr/bin/python2 # -*- coding: utf-8 -*- from Constants import WEAR_AT_TURN, OXYGEN_AT_TURN, CARGO_WATER, CARGO_MINERALS from SleepingGodObjects.GameObjects import GameObject class Vessel(GameObject): def __init__( self, pos_x, pos_y, char, ...
gpl-3.0
tempbottle/pykafka
pykafka/utils/compat.py
6
3887
import sys __all__ = ['PY3', 'Semaphore'] PY3 = sys.version_info[0] >= 3 if PY3: from threading import Semaphore else: from threading import Condition, Lock # could use monotonic.monotonic() backport as well here... from time import time as _time # -- begin unmodified backport of threading.Sema...
apache-2.0
amarouni/incubator-beam
sdks/python/apache_beam/runners/direct/transform_evaluator.py
2
19545
# # 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 us...
apache-2.0
milmd90/TwitterBot
build/lib/twitter/parse_tweet.py
6
3610
#!/usr/bin/env python import re class Emoticons: POSITIVE = ["*O", "*-*", "*O*", "*o*", "* *", ":P", ":D", ":d", ":p", ";P", ";D", ";d", ";p", ":-)", ";-)", ":=)", ";=)", ":<)", ":>)", ";>)", ";=)", "=}", ":)", "(:;)", ...
apache-2.0
drmrd/ansible
lib/ansible/modules/packaging/os/homebrew_cask.py
18
22697
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.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_...
gpl-3.0
g12mcgov/home-assistant
homeassistant/components/light/hue.py
13
6679
""" homeassistant.components.light.hue ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Hue lights. """ import logging import socket from datetime import timedelta from urllib.parse import urlparse from homeassistant.loader import get_component import homeassistant.util as util from homeassistant.const import CONF_HOST,...
mit
iismd17/scikit-learn
sklearn/metrics/setup.py
299
1024
import os import os.path import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("metrics", parent_package, top_path) cblas_libs, blas_info = get_blas_info() if os.name ==...
bsd-3-clause
edlabh/SickRage
lib/unidecode/x068.py
252
4674
data = ( 'Zhi ', # 0x00 'Liu ', # 0x01 'Mei ', # 0x02 'Hoy ', # 0x03 'Rong ', # 0x04 'Zha ', # 0x05 '[?] ', # 0x06 'Biao ', # 0x07 'Zhan ', # 0x08 'Jie ', # 0x09 'Long ', # 0x0a 'Dong ', # 0x0b 'Lu ', # 0x0c 'Sayng ', # 0x0d 'Li ', # 0x0e 'Lan ', # 0x0f 'Yong ', # 0x10...
gpl-3.0
apache/spark
python/pyspark/sql/tests/test_pandas_udf_window.py
18
12998
# # 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 us...
apache-2.0
leighpauls/k2cro4
third_party/WebKit/Tools/Scripts/webkitpy/common/system/user_mock.py
4
2421
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/core/protobuf/device_properties_pb2.py
2
9216
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/protobuf/device_properties.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.p...
mit
Yeraze/CalendarHangout
apiclient/mimeparse.py
189
6486
# Copyright (C) 2007 Joe Gregorio # # Licensed under the MIT License """MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation. http://www.w3.o...
gpl-2.0
dsandeephegde/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/font.py
11
4135
import ctypes import logging import os import platform from shutil import copy2, rmtree from subprocess import call HERE = os.path.split(__file__)[0] SYSTEM = platform.system().lower() class FontInstaller(object): def __init__(self, font_dir=None, **fonts): self.font_dir = font_dir self.installe...
mpl-2.0
vFense/vFenseAgent-nix
agent/deps/rpm/Python-2.7.5/lib/python2.7/cProfile.py
169
6515
#! /usr/bin/env python """Python interface for the 'lsprof' profiler. Compatible with the 'profile' module. """ __all__ = ["run", "runctx", "help", "Profile"] import _lsprof # ____________________________________________________________ # Simple interface def run(statement, filename=None, sort=-1): """Run s...
lgpl-3.0
gosharplite/kubernetes
cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
19
63197
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
apache-2.0
tinfoil/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
117
39195
# Copyright (c) 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # Copyright (c) 2010 Research In Motion Limited. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are...
bsd-3-clause
ENCODE-DCC/dxencode
scrub.py
1
34431
#!/usr/bin/env python2.7 # scrub.py 1.0.0 # # Scrub.py will remove all files for an experiment [replicate] and genome/annotation # # 1) Lookup experiment type from encoded, based on accession # 2) Locate the experiment accession named folder # 3) Given the experiment type, determine the expected results # 4) Given expe...
mit
nemaniarjun/coala
tests/misc/ContextManagersTest.py
31
5560
import os import subprocess import sys from tempfile import TemporaryDirectory import unittest from coala_utils.ContextManagers import ( change_directory, make_temp, prepare_file, retrieve_stdout, retrieve_stderr, simulate_console_inputs, subprocess_timeout, suppress_stdout) from coalib.processes.Processin...
agpl-3.0
mrkm4ntr/incubator-airflow
airflow/migrations/versions/bbf4a7ad0465_remove_id_column_from_xcom.py
6
1965
# # 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
tinloaf/home-assistant
homeassistant/components/fan/zwave.py
4
2832
""" Z-Wave platform that handles fans. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/fan.zwave/ """ import logging import math from homeassistant.core import callback from homeassistant.components.fan import ( DOMAIN, FanEntity, SPEED_OFF, SPEED_LO...
apache-2.0
qwefi/nova
smoketests/base.py
15
7137
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 (the "License"); you may # not use this file except in compli...
apache-2.0
edx-solutions/edx-platform
cms/djangoapps/course_creators/migrations/0001_initial.py
5
1191
# -*- coding: utf-8 -*- from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='CourseCreator'...
agpl-3.0
jmartinm/invenio
modules/oaiharvest/lib/oai_harvest_dblayer.py
17
17170
## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio 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 versio...
gpl-2.0
amondot/QGIS
python/console/console.py
3
34587
# -*- coding:utf-8 -*- """ /*************************************************************************** Python Console for QGIS ------------------- begin : 2012-09-10 copyright : (C) 2012 by Salvatore Larosa email : lrssvtml (at) gmail (dot) com ***...
gpl-2.0
sadleader/odoo
addons/l10n_co/__openerp__.py
256
1794
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Ivan ...
agpl-3.0
ipfire/collecty
src/collecty/plugins/processor.py
1
7032
#!/usr/bin/python3 ############################################################################### # # # collecty - A system statistics collection daemon for IPFire # # Copyright (C) 2012 IPFire development team ...
gpl-3.0
sinbazhou/odoo
addons/l10n_be/__openerp__.py
251
3666
# -*- 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
jollyroger/debian-buildbot-slave
buildslave/test/unit/test_commands_p4.py
3
6638
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
ovnicraft/server-tools
mail_environment/models/ir_mail_server.py
2
1777
# -*- coding: utf-8 -*- # Copyright 2012-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import api, fields, models from odoo.addons.server_environment import serv_config class IrMailServer(models.Model): _inherit = "ir.mail_server" smtp_host = fields.Char(comput...
agpl-3.0
rmfitzpatrick/ansible
lib/ansible/modules/windows/win_unzip.py
29
4436
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <schwartzmx@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 ...
gpl-3.0
andela-ooladayo/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
retomerz/intellij-community
python/lib/Lib/encodings/iso8859_3.py
593
13345
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
apache-2.0
SWRG/ESWC2015-paper-evaluation
tests/yen_algorithms_test.py
1
1681
import sys,os sys.path.insert(0,os.path.abspath(__file__+"/../..")) import yenalgo2,corefunctions import networkx as nx import unittest class KnownValues(unittest.TestCase): g = nx.Graph() g.add_edge(1,2,{'weight':1}) g.add_edge(1,3,{'weight':2}) g.add_edge(1,4,{'weight':3}) g.add_edge(2,5,{'weight...
gpl-3.0
cloudify-cosmo/cloudify-nsx-plugin
cloudify_nsx/network/dhcp_bind.py
1
5021
######## # Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
dbhirko/ansible-modules-extras
system/ufw.py
96
9822
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Ahti Kitsik <ak@ahtik.com> # (c) 2014, Jarno Keskikangas <jarno.keskikangas@gmail.com> # (c) 2013, Aleksey Ovcharenko <aleksey.ovcharenko@gmail.com> # (c) 2013, James Martin <jmartin@basho.com> # # This file is part of Ansible # # Ansible is free software: you can ...
gpl-3.0
cajone/pychess
lib/pychess/widgets/pydock/PyDockTop.py
1
9627
from __future__ import absolute_import from __future__ import print_function import os from xml.dom import minidom from collections import defaultdict from pychess.System.prefix import addDataPrefix from .PyDockLeaf import PyDockLeaf from .PyDockComposite import PyDockComposite from .ArrowButton import ArrowButton ...
gpl-3.0
Nicop06/ansible
test/units/modules/packaging/os/test_rhn_register.py
18
11684
import json from ansible.compat.tests import unittest from ansible.compat.tests.mock import PropertyMock, patch, mock_open from ansible.module_utils import basic from ansible.module_utils._text import to_native from ansible.module_utils.six.moves import xmlrpc_client from ansible.modules.packaging.os import rhn_regist...
gpl-3.0
svn2github/django
django/contrib/comments/views/utils.py
192
1947
""" A few bits of helper functions for comment views. """ import urllib import textwrap from django.http import HttpResponseRedirect from django.core import urlresolvers from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from...
bsd-3-clause
hhru/ansible
v2/ansible/plugins/callback/__init__.py
12
2941
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
Juniper/tempest
tempest/api/compute/admin/test_security_group_default_rules.py
2
5832
# Copyright 2014 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
rickerc/horizon_audit
openstack_dashboard/dashboards/router/nexus1000v/panel.py
11
1146
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
apehua/pilas
pilasengine/interfaz/ingreso_de_texto.py
6
3144
# -*- encoding: utf-8 -*- # pilas engine: un motor para hacer videojuegos # # Copyright 2010-2014 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar import re from pilasengine.interfaz import elemento class IngresoDeTexto(elemento.Elemento): ...
lgpl-3.0
eternalthinker/flask-server-rq-example
venv/lib/python2.7/site-packages/requests/packages/urllib3/response.py
196
12240
import zlib import io from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .exceptions import ProtocolError, DecodeError, ReadTimeoutError from .packages.six import string_types as basestring, binary_type, PY3 from .connection import HTTPException, BaseSSLError from .util.response ...
apache-2.0
mdanielwork/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/tests/basic.py
137
3575
from django.test import TestCase from django.contrib.auth.models import User, AnonymousUser from django.core.management import call_command from StringIO import StringIO class BasicTestCase(TestCase): def test_user(self): "Check that users can be created and can set their password" u = User.objects...
apache-2.0
MarcosCommunity/odoo
addons/hr_payroll/wizard/__init__.py
442
1159
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
sunny-wyb/xen-4.1.2
tools/python/build/lib.linux-x86_64-2.7/xen/xend/XendPIFMetrics.py
48
2046
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
xju2/hzzws
scripts/low_mass.py
1
2906
#!/usr/bin/env python import common import glob name = "Low" binning = "60, 110, 140" branch = "m4l_constrained, "+binning ###in workspace obs_binning = binning # key: category name # value: TCut on mini-tree categories = { "ggF_4mu_13TeV" : "(event_type==0)", "ggF_2mu2e_13TeV" : "(event_type==2)", "ggF...
mit
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/unittest/test/test_suite.py
108
15184
import unittest import gc import sys import weakref from unittest.test.support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test...
apache-2.0
Lothiraldan/OneTask
onetask/tests.py
1
4351
# -*- coding: utf-8 -*- import os import json import tempfile import unittest from .collection import TaskCollection from subprocess import check_output, CalledProcessError class TaskCollectionTest(unittest.TestCase): def _create_db(self, **kwargs): temp = tempfile.NamedTemporaryFile(prefix='onetasktest...
mit
PremiumGraphics/DirectView
ThirdParty/wxWidgets-3.0.2/docs/doxygen/scripts/sip_tools.py
23
3152
import os from common import * class SIPBuilder: def __init__(self, doxyparse, outputdir): self.doxyparser = doxyparse self.output_dir = outputdir def make_bindings(self): output_dir = os.path.abspath(os.path.join(self.output_dir, "sip")) if not os.path.exists(output_dir): ...
lgpl-3.0
conejoninja/xbmc-seriesly
library_service.py
1
4954
# -*- coding: utf-8 -*- #------------------------------------------------------------ # seriesly - XBMC Plugin # http://blog.tvalacarta.info/plugin-xbmc/seriesly/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os import sys import xbmc,time from core im...
gpl-3.0
joansmith/openmicroscopy
components/tools/OmeroWeb/test/integration/test_chgrp.py
7
12437
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015 University of Dundee & Open Microscopy Environment. # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Founda...
gpl-2.0
MFoster/breeze
django/contrib/localflavor/in_/in_states.py
197
2932
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and an alphabetical list of states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('KA', 'Karnataka'), ('AP', 'Andhra Pr...
bsd-3-clause
xiangel/hue
desktop/core/ext-py/Mako-0.8.1/mako/ext/pygmentplugin.py
38
4540
# ext/pygmentplugin.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from pygments.lexers.web import \ HtmlLexer, XmlLexer, JavascriptLexer, CssLexer from py...
apache-2.0
sparkslabs/kamaelia_
Sketches/MPS/WebCam.py
3
10193
#!/usr/bin/python # # This import line is required to pull in pygame.camera support # import sys ; #sys.path.insert(0, "/home/zathras/Incoming/X/pygame/pygame-nrp/build/lib.linux-i686-2.5") #sys.path.insert(0, "/home/zathras/code.google/pygame-seul/trunk/build/lib.linux-i686-2.5") # sys.path.insert(0, "/home/zathras/...
apache-2.0
looooo/pivy
scons/scons-local-1.2.0.d20090919/SCons/Tool/ifort.py
1
3365
"""SCons.Tool.ifort Tool-specific initialization for newer versions of the Intel Fortran Compiler for Linux/Windows (and possibly Mac OS X). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
isc
Codefans-fan/odoo
addons/analytic/analytic.py
110
18041
# -*- 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
bitglue/shinysdr
shinysdr/plugins/vor/__init__.py
1
9491
# Copyright 2013, 2014, 2015, 2016, 2017 Kevin Reid <kpreid@switchb.org> # # This file is part of ShinySDR. # # ShinySDR 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 # (...
gpl-3.0
zhexiao/ezhost
docs_en/conf.py
1
9557
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ezhost documentation build configuration file, created by # sphinx-quickstart on Wed May 25 11:10:25 2016. # # 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 # aut...
mit
sertac/django
django/core/cache/backends/memcached.py
320
6970
"Memcached cache backend" import pickle import time from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils import six from django.utils.encoding import force_str from django.utils.functional import cached_property class BaseMemcachedCache(BaseCache): def __init__(self, server, ...
bsd-3-clause
shanil-puri/mase
python101/code/pie.py
14
1636
"""This module contains code from Think Python by Allen B. Downey http://thinkpython.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import math try: # see if Swampy is installed as a package from swampy.TurtleWorld import * except ImportError: # otherwise ...
unlicense
Darkmer/masterchief
CourseBuilderenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
2360
3778
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
mit
AdaLovelance/server
djangoTodoEnUno.py
2
2602
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Este script es posible gracias a la siguiente fuente: http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/ Creado por kaotika ada_lovelance@hackingcodeschool.net Visitanos en hackingcodeschool.net Created on Wed Dec 25 04:00:4...
gpl-2.0
oscarolar/odoo
addons/sale_crm/wizard/__init__.py
443
1077
# -*- 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...
agpl-3.0
imply/chuu
chrome/common/extensions/docs/server2/host_file_system_creator.py
23
2437
# 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. from caching_file_system import CachingFileSystem from local_file_system import LocalFileSystem from offline_file_system import OfflineFileSystem from subver...
bsd-3-clause
hvwaldow/inktex
inktex/ui.py
2
8707
import os import pygtk pygtk.require('2.0') import gtk from gtkcodebuffer import CodeBuffer, SyntaxLoader class Ui(object): """ The user interface. This dialog is the LaTeX input window and includes widgets to display compilation logs and a preview. It uses GTK2 which must be installed an importable...
mit
ctgriffiths/twister
installer/installer_client.py
1
8553
# version: 3.005 # File: installer.py ; This file is part of Twister. # Copyright (C) 2012-2013 , Luxoft # Authors: # Andrei Costachi <acostachi@luxoft.com> # Cristi Constantin <crconstantin@luxoft.com> # Mihai Dobre <mihdobre@luxoft.com> # Licensed under the Apache License, Version 2.0 (the "License"); #...
apache-2.0
kennedyshead/home-assistant
homeassistant/components/almond/config_flow.py
2
4060
"""Config flow to connect with Home Assistant.""" import asyncio import logging from aiohttp import ClientError import async_timeout from pyalmond import AlmondLocalAuth, WebAlmondAPI import voluptuous as vol from yarl import URL from homeassistant import config_entries, core, data_entry_flow from homeassistant.helpe...
apache-2.0