repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
lancezlin/ml_template_py
lib/python2.7/site-packages/ipywidgets/widgets/tests/test_link.py
6
1058
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import nose.tools as nt from .. import jslink, jsdlink, ToggleButton from .test_interaction import setup, teardown def test_jslink_args(): with nt.assert_raises(TypeError): jslink() w1 = ToggleButton(...
mit
bitsteller/witica
witica/targets/statichtml.py
1
6261
import os, json, shutil, time, codecs, hashlib, glob, re import markdown from markdown.treeprocessors import Treeprocessor from markdown.inlinepatterns import LinkPattern, ImagePattern from markdown.extensions import Extension import xml.etree.ElementTree as ET from witica import * from witica.util import throw, sst...
mit
steveandroulakis/mytardis
tardis/urls.py
1
10640
from django.contrib import admin admin.autodiscover() from django.contrib.auth.views import logout from django.conf.urls.defaults import patterns, include, url from django.conf import settings from django.contrib.staticfiles.urls import staticfiles_urlpatterns from registration.views import register from tardis.tard...
bsd-3-clause
kambysese/mne-python
examples/simulation/plot_source_simulator.py
9
3284
""" ============================== Generate simulated source data ============================== This example illustrates how to use the :class:`mne.simulation.SourceSimulator` class to generate source estimates and raw data. It is meant to be a brief introduction and only highlights the simplest use case. """ # Auth...
bsd-3-clause
minhphung171093/GreenERP_V8
openerp/addons/hr_timesheet_sheet/report/__init__.py
342
1074
# -*- 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
sn1k/app_mundial
lib/python2.7/site-packages/django/core/management/commands/migrate.py
3
17358
# encoding: utf8 from __future__ import unicode_literals from optparse import make_option from collections import OrderedDict from importlib import import_module import itertools import traceback from django.apps import apps from django.core.management import call_command from django.core.management.base import BaseCo...
gpl-2.0
quentin-xia/Maticv
common/action.py
1
4579
#/usr/bin/env python #-*- coding:utf-8 -*- from adb import Adb import gl import keys import platform class Action(Adb): """ send keyevent :Args: - keycode: keyevent code http://developer.android.com/reference/android/view/KeyEvent.html """ def keyevent(self,keycode): cmd...
mit
tell10glu/libgdx
extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/docmaker/formatter.py
132
6019
# # formatter.py # # Convert parsed content blocks to a structured document (library file). # # Copyright 2002, 2004, 2007, 2008, 2014 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.T...
apache-2.0
fdupoux/ansible
lib/ansible/playbook/role/requirement.py
1
7001
# (c) 2014 Michael DeHaan, <michael@ansible.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 later ve...
gpl-3.0
liang42hao/bokeh
bokeh/tests/test_properties.py
16
30049
from __future__ import absolute_import import unittest import numpy as np from bokeh.properties import ( HasProps, NumberSpec, ColorSpec, Bool, Int, Float, Complex, String, Regex, List, Dict, Tuple, Array, Instance, Any, Interval, Either, Enum, Color, Align, DashPattern, Size, Percent, Angle) class Basic...
bsd-3-clause
aktech/sympy
sympy/integrals/risch.py
31
64905
""" The Risch Algorithm for transcendental function integration. The core algorithms for the Risch algorithm are here. The subproblem algorithms are in the rde.py and prde.py files for the Risch Differential Equation solver and the parametric problems solvers, respectively. All important information concerning the d...
bsd-3-clause
rbramwell/pulp
nodes/common/pulp_node/constants.py
10
2259
# Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied, # including the impl...
gpl-2.0
Mozta/pagina-diagnostijuego
venv/lib/python2.7/site-packages/django/contrib/staticfiles/finders.py
478
9854
import os from collections import OrderedDict from django.apps import apps from django.conf import settings from django.contrib.staticfiles import utils from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import ( FileSystemStorage, Storage, default_storage, ) from django.utils i...
gpl-3.0
chidea/GoPythonDLLWrapper
bin/lib/encodings/euc_kr.py
816
1027
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
mit
keedio/hue
desktop/core/ext-py/Pygments-1.3.1/pygments/__init__.py
56
2975
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
apache-2.0
ezeeyahoo/android_kernel_motorola_msm8916
scripts/gcc-wrapper.py
580
3524
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
nkgilley/home-assistant
homeassistant/components/isy994/cover.py
6
3640
"""Support for ISY994 covers.""" from typing import Callable from pyisy.constants import ISY_VALUE_UNKNOWN from homeassistant.components.cover import ( ATTR_POSITION, DOMAIN as COVER, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, CoverEntity, ) from homeassistant.config_entries import Con...
apache-2.0
stefan-caraiman/python-lab
python/solutii/bogdan_iacoboae/caesar/caesar.py
5
1939
# coding=utf-8 # from __future__ import print_function """Împăratul a primit serie de mesaje importante pe care este important să le descifreze cât mai repede. Din păcate mesagerul nu a apucat să îi spună împăratul care au fost cheile alese pentru fiecare mesaj și tu ai fost ales să descifrezi misterul. Informații: ...
mit
komakino/plugin.video.pulsar
resources/site-packages/simplejson/scanner.py
153
4653
"""JSON token scanner """ import re def _import_c_make_scanner(): try: from simplejson._speedups import make_scanner return make_scanner except ImportError: return None c_make_scanner = _import_c_make_scanner() __all__ = ['make_scanner', 'JSONDecodeError'] NUMBER_RE = re.compile( r...
bsd-3-clause
HiSPARC/sapphire
scripts/simulations/store_aires_data.py
1
2309
""" Store AIRES simulation data in HDF5 file This module reads the AIRES binary ground particles file and stores each particle individually in a HDF5 file, using PyTables. This file can then be used as input for the detector simulation. """ import os import os.path import sys import tables from numpy i...
gpl-3.0
OpenTreeOfLife/peyotl
peyotl/test/support/__init__.py
2
3551
#! /usr/bin/env python from peyotl.utility import get_logger from peyotl.nexson_syntax import write_as_json from peyotl.struct_diff import DictDiff _LOG = get_logger(__name__) def equal_blob_check(unit_test, diff_file_tag, first, second): from peyotl.test.support import pathmap if first != second: dd...
bsd-2-clause
ryankanno/froide
froide/publicbody/search_indexes.py
6
1361
from __future__ import print_function from django.conf import settings from haystack import indexes try: from celery_haystack.indexes import CelerySearchIndex as SearchIndex except ImportError: SearchIndex = indexes.SearchIndex from .models import PublicBody PUBLIC_BODY_BOOSTS = settings.FROIDE_CONFIG.get(...
mit
smishenk/blink-crosswalk
Tools/Scripts/webkitpy/common/system/executive.py
12
19248
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 abov...
bsd-3-clause
fr34k8/RestBlockDriver
playground/server.py
3
13748
# Copyright (C) 2014 SCALITY SA - http://www.scality.com # # This file is part of ScalityRestBlock. # # ScalityRestBlock 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 # (a...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/db/backends/postgresql_psycopg2/operations.py
80
10124
from __future__ import unicode_literals from psycopg2.extras import Inet from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def unification_cast_sql(self, output_field): internal_type = output_field.get...
mit
hesam-setareh/nest-simulator
extras/help_generator/generate_helpindex.py
13
1096
# -*- coding: utf-8 -*- # # generate_helpindex.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Lice...
gpl-2.0
pgoeser/gnuradio
grc/base/ParseXML.py
35
3369
""" Copyright 2008 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ...
gpl-3.0
npuichigo/ttsflow
third_party/tensorflow/tensorflow/python/estimator/inputs/numpy_io_test.py
65
9695
# 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
auduny/home-assistant
tests/components/auth/test_init_link_user.py
15
3746
"""Tests for the link user flow.""" from . import async_setup_auth from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI async def async_get_code(hass, aiohttp_client): """Return authorization code for link user tests.""" config = [{ 'name': 'Example', 'type': 'insecure_example', 'u...
apache-2.0
mtholder/taxalotl
taxalotl/resource_manager.py
1
5587
#!/usr/bin/env python from __future__ import print_function import io import json import os from .resource_wrapper import AbstractResourceWrapper from .util import OutFile import logging _LOG = logging.getLogger(__name__) def read_resource_file(fp): try: with io.open(fp, 'rU', encoding='utf-8') as inp: ...
bsd-2-clause
2ndQuadrant/ansible
test/units/modules/network/netvisor/test_pn_port_config.py
15
2809
# Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from units.compat.mock import patch from ansible.modules.network.netvisor import pn...
gpl-3.0
Pecacheu/Eagle2Kicad
Common/Device.py
2
2817
""" Created on 9 Oct 2012 @author: konmik """ class Connect(object): """represents connect tag""" def __init__(self, node, converter): self.gate = node.get("gate") self.pin = node.get("pin") self.pad = node.get("pad") class Technology(object): """represents technology tag""" ...
mit
jcurry/ZenPacks.ZenSystems.Juniper
ZenPacks/ZenSystems/Juniper/JuniperPowerSupply.py
3
4215
########################################################################## # Author: Jane Curry, jane.curry@skills-1st.co.uk # Date: March 1st, 2011 # Revised: # # JuniperPowerSupply object class # # This program can be used under the GNU General Public License version 2 # You can find fu...
gpl-2.0
dash-dash/AutobahnPython
examples/twisted/wamp/pubsub/basic/frontend.py
2
2742
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
mit
Endika/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py
87
2147
""" Tests for the fix_not_found management command """ from django.core.management import CommandError, call_command from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory class ...
agpl-3.0
danielharbor/openerp
addons/resource/tests/common.py
305
5016
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
FireballDWF/cloud-custodian
tools/sandbox/zerodark/zerodark/utils.py
5
1497
# Copyright 2017-2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
openstack/magnum
magnum/db/sqlalchemy/models.py
2
10633
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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
justcool393/TotesMessenger
totes.py
1
16761
import ftplib import logging import os import praw import re import requests import sqlite3 import sys import time import traceback from praw.exceptions import APIException, ClientException, PRAWException from requests.exceptions import RequestException # Internationalization stuff from i18n import TranslationExcepti...
apache-2.0
halfak/MediaWiki-events
mwevents/types/events/user_unblocked.py
3
1710
from .. import Timestamp, Unavailable, User from ... import configuration from ...util import split_page_name from .event import Event from .match import Match class UserUnblocked(Event): MATCHES = [Match("block", "unblock", False, "log")] __slots__ = ('unblocked',) def initialize(self, timestamp, user, c...
mit
ksun6868/xbmc-addons-chinese
plugin.video.cntv-live/addon.py
7
14017
# -*- coding: utf-8 -*- import sys import xbmc import xbmcaddon import xbmcgui import xbmcplugin import re import socket import traceback import urllib import urllib2 import urlparse try: import simplejson as jsonimpl except ImportError: import json as jsonimpl addon = xbmcaddon.Addon(id="plugin.video.cntv-live") ...
gpl-2.0
837468220/python-for-android
python3-alpha/python3-src/Lib/test/test_strftime.py
85
6841
""" Unittest for time.strftime """ import calendar import sys import re from test import support import time import unittest # helper functions def fixasctime(s): if s[8] == ' ': s = s[:8] + '0' + s[9:] return s def escapestr(text, ampm): """ Escape text to deal with possible locale values t...
apache-2.0
gmes/USBMaker
USBMaker/formatting.py
1
9046
# Copyright © 2017 Joaquim Monteiro # # This file is part of USBMaker. # # USBMaker 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 ...
gpl-3.0
eric02138/iot_harvard
node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
mit
zooba/PTVS
Python/Tests/TestData/DebuggerProject/UnhandledException1_v3x.py
7
1577
try: raise Exception() # does not break except: print('handled 1') try: raise Exception() # does not break except Exception: print('handled 2') try: raise Exception() # does not break except Exception as e: print('handled 3') try: raise Exception() # does not break except BaseException: print('handled 5') try: ...
apache-2.0
coreycb/horizon
openstack_dashboard/dashboards/admin/aggregates/tests.py
3
20879
# 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
coinmighty/coinmighty
contrib/pyminer/pyminer.py
1257
6438
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
mit
okolisny/integration_tests
fixtures/virtual_machine.py
4
3970
""" Fixtures ensuring that a VM/instance is in the specified state for the test """ import pytest from cfme.utils.log import logger from cfme.utils.wait import wait_for @pytest.fixture(scope="function") def verify_vm_running(provider, vm_name): """ Ensures that the VM/instance is in running state for the test ...
gpl-2.0
JingJunYin/tensorflow
tensorflow/compiler/tests/lstm.py
132
6452
# Copyright 2017 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
317070/kaggle-heart
configurations/je_ss_smll_nrmsc_noreg.py
1
7872
"""Single slice vgg with normalised scale. """ import functools import lasagne as nn import numpy as np import theano import theano.tensor as T import data_loader import deep_learning_layers import layers import preprocess import postprocess import objectives import theano_printer import updates # Random params rng ...
mit
mpasternak/pyglet-fix-issue-552
tools/wraptypes/ctypesparser.py
28
10431
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from cparser import * ctypes_type_map = { # typename signed longs ('void', True, 0): 'None', ('int', True, 0): 'c_int', ('int', False, 0): 'c_uint', ('int', True, 1): 'c_long', ('int...
bsd-3-clause
barbarubra/Don-t-know-What-i-m-doing.
python/src/Lib/test/test_structmembers.py
56
3373
from _testcapi import test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX import warnings, exceptions, unittest, sys from test import test_support ts=test_structm...
apache-2.0
photoninger/ansible
lib/ansible/modules/files/acl.py
16
10872
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
ishank08/scikit-learn
examples/gaussian_process/plot_gpc_isoprobability.py
64
3049
#!/usr/bin/python # -*- coding: utf-8 -*- """ ================================================================= Iso-probability lines for Gaussian Processes classification (GPC) ================================================================= A two-dimensional classification example showing iso-probability lines for...
bsd-3-clause
tszym/ansible
lib/ansible/modules/cloud/google/gce_tag.py
8
7635
#!/usr/bin/python # # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'],...
gpl-3.0
h-mayorquin/M2_complexity_thesis
Analysis/time_traces_simulation.py
1
4176
''' Created on Jun 4, 2014 @author: ramon ''' from functions import * from analysis_functions import * from plot_functions import plot_mutliplot_bilinear import numpy as np import cPickle import matplotlib.pyplot as plt import os from time import localtime #################### # Load the data #################### ...
bsd-2-clause
nanshihui/PocCollect
component/docker/script/docker_unauth.py
1
5987
#!/usr/bin/env python # -*- coding:utf-8 -*- from urlparse import urlparse, urlunparse, urljoin import json,socket import time import argparse notice = u''' ''' class WavsPlugin(): def choosedocker(self,sock, DocerVulns): total = len(DocerVulns) while True: print "You Can Control: "+st...
mit
shi2wei3/tp-libvirt
libvirt/tests/src/svirt/svirt_undefine_define.py
6
2821
""" svirt guest_undefine_define test. """ import os from autotest.client.shared import error from virttest import utils_selinux, virsh, data_dir from virttest.libvirt_xml.vm_xml import VMXML def run(test, params, env): """ Test svirt in adding disk to VM. (1).Init variables for test. (2).Label the V...
gpl-2.0
sonium0/pymatgen
pymatgen/phasediagram/tests/test_pdanalyzer.py
2
5104
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals import unittest import os from numbers import Number from pymatgen.core.composition import Composition from pymatgen.core.periodic_table import Element from pymatgen.p...
mit
liduanw/viewfinder
marketing/tornado/test/netutil_test.py
23
2781
from __future__ import absolute_import, division, print_function, with_statement import socket from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip from tornado.testing import AsyncTestCase, gen_test from tornado.test.util import unittest try: from concurrent import futures except ImportEr...
apache-2.0
hcarvalhoalves/duplicity
duplicity/commandline.py
2
40312
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
gpl-2.0
reaperrr/OpenRA
packaging/linux/gtk-dialog.py
16
1748
#!/usr/bin/python """A simple GTK3 graphical dialog helper that can be used as a fallback if zenity is not available Compatible with python 2 or 3 with the gi bindings. Three modes are available: test: accepts no arguments, returns 0 if the python dependencies are available, or 1 if not error: show...
gpl-3.0
khushboo9293/mailman3
src/mailman/bin/mailman.py
4
3848
# Copyright (C) 2009-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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-2.0
drssoccer55/RLBot
src/main/python/rlbot/parsing/match_settings_config_parser.py
1
11692
import time from rlbot.parsing.custom_config import ConfigObject from rlbot.utils.logging_utils import get_logger MUTATOR_CONFIGURATION_HEADER = "Mutator Configuration" MUTATOR_MATCH_LENGTH = "Match Length" MUTATOR_MAX_SCORE = "Max Score" MUTATOR_OVERTIME = "Overtime" MUTATOR_SERIES_LENGTH = "Series Length" MUTATOR_G...
mit
wy182000/gyp
pylib/gyp/generator/xcode.py
13
55285
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import sys import posixpath import re import shutil import subprocess import temp...
bsd-3-clause
samfoo/servo
tests/wpt/web-platform-tests/webdriver/navigation/auth_tests.py
58
1384
import os import sys import unittest import ConfigParser sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from webdriver import exceptions from wptserve import server from wptserve.router import any_method from wptserve.handlers import basic_auth_handler class WebDriverAuthTest(un...
mpl-2.0
nadeemsyed/swift
swift/container/reconciler.py
6
32210
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
r-o-b-b-i-e/pootle
pootle/core/views/api.py
3
10453
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import json import operator from django.db....
gpl-3.0
Merinorus/adaisawesome
Homework/03 - Interactive Viz/Mapping onto Switzerland.py
1
1723
# coding: utf-8 # In this part of the exercise, we now need to put the data which we have procured about the funding levels of the different universities that are located in different cantons onto a canton map. We will do so using Folio and take the example TopoJSON mapping which they use. # In[15]: import folium i...
gpl-3.0
mdiener21/python-geospatial-analysis-cookbook
ch10/TileStache-master/TileStache/Goodies/VecTiles/ops.py
13
3894
''' Per-coordinate transformation function for shapely geometries. To be replaced with shapely.ops.transform in Shapely 1.2.18. See also: https://github.com/Toblerity/Shapely/issues/46 >>> from shapely.geometry import * >>> coll0 = GeometryCollection() >>> coll1 = transform(coll0, lambda (x, y): (x+1, y+1)) >>>...
mit
icarito/sugar
tests/test_downloader.py
3
3010
# Copyright (C) 2013, One Laptop per Child # # 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 distrib...
gpl-3.0
zoidbergwill/Diamond
src/collectors/ipmisensor/ipmisensor.py
28
4747
# coding=utf-8 """ This collector uses the [ipmitool](http://openipmi.sourceforge.net/) to read hardware sensors from servers using the Intelligent Platform Management Interface (IPMI). IPMI is very common with server hardware but usually not available in consumer hardware. #### Dependencies * [ipmitool](http://ope...
mit
lyapota/s7e_marshmallow
tools/perf/scripts/python/net_dropmonitor.py
1812
1749
# 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
Atom-machinerule/Atoms_qbo_apps
qbo_ball_tracker/nodes/head_track_node.py
1
6059
#!/usr/bin/env python """ head_track_node.py - Version 1.0 2010-12-28 Move the head to track a target given by (x,y) coordinates Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2010 Patrick Goebel. All rights reserved. This program is free software; you can redist...
lgpl-2.1
codrut3/tensorflow
tensorflow/contrib/tensor_forest/python/ops/model_ops.py
68
4851
# Copyright 2017 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
olympian94/gstudio
gnowsys-ndf/gnowsys_ndf/ndf/management/commands/set_teaches_relation.py
8
3513
''' -- imports from python libraries -- ''' import os import csv import json import ast import datetime ''' imports from installed packages ''' from django.core.management.base import BaseCommand, CommandError from django_mongokit import get_database from mongokit import IS from django.contrib.auth.models import User...
agpl-3.0
ptisserand/ansible
lib/ansible/modules/cloud/amazon/ec2_instance.py
4
61745
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
chrippa/ds4drv
ds4drv/backends/bluetooth.py
5
4743
import socket import subprocess from ..backend import Backend from ..exceptions import BackendError, DeviceError from ..device import DS4Device from ..utils import zero_copy_slice L2CAP_PSM_HIDP_CTRL = 0x11 L2CAP_PSM_HIDP_INTR = 0x13 HIDP_TRANS_SET_REPORT = 0x50 HIDP_DATA_RTYPE_OUTPUT = 0x02 REPORT_ID = 0x11 REPO...
mit
Tesora/tesora-horizon
horizon/test/test_dashboards/dogs/puppies/views.py
89
1077
# 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
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/lib2to3/tests/test_fixers.py
33
118371
""" Test suite for the fixer modules """ # Python imports import os import unittest from itertools import chain from operator import itemgetter # Local imports from lib2to3 import pygram, pytree, refactor, fixer_util from lib2to3.tests import support class FixerTestCase(support.TestCase): # Other test cases ca...
gpl-2.0
anirudhSK/chromium
third_party/jinja2/__init__.py
238
2270
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
bsd-3-clause
postlund/home-assistant
homeassistant/components/huawei_lte/notify.py
8
1932
"""Support for Huawei LTE router notifications.""" import logging import time from typing import Any, List import attr from huawei_lte_api.exceptions import ResponseErrorException from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService from homeassistant.const import CONF_RECIPIENT, CONF_URL...
apache-2.0
shsingh/ansible
test/support/integration/plugins/modules/postgresql_set.py
47
13648
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {...
gpl-3.0
rahul67/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/auth/tests/urls.py
105
4961
from django.conf.urls import patterns, url from django.contrib.auth import context_processors from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset, login from django.contrib.auth.decorators import login_required fr...
apache-2.0
Gustry/QGIS
tests/src/python/test_qgslegendrenderer.py
30
1418
# coding=utf-8 """"Test QgsLegendRenderer JSON export .. note:: 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. Ru...
gpl-2.0
jon-choi/hillsbarber
lib/itsdangerous.py
296
30509
# -*- coding: utf-8 -*- """ itsdangerous ~~~~~~~~~~~~ A module that implements various functions to deal with untrusted sources. Mainly useful for web applications. :copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation. :license: BSD, see LICENSE for more details. """ imp...
apache-2.0
mradamcox/hkstairs
stairdb/views.py
1
2006
from django.shortcuts import render from django.http import HttpResponse from django.template import loader from django.contrib.gis.db.models.functions import Centroid,AsGeoJSON from django.core.serializers import serialize import json from django.utils.decorators import method_decorator from django.views.decorators.ca...
gpl-3.0
jamiecaesar/SecureCRT
s_AireOS_collect_ap_detail.py
2
10307
# $language = "python" # $interface = "1.0" import os import sys import logging import csv from operator import itemgetter # Add script directory to the PYTHONPATH so we can import our modules (only if run from SecureCRT) if 'crt' in globals(): script_dir, script_name = os.path.split(crt.ScriptFullName) if sc...
apache-2.0
puiterwijk/rpm-ostree
src/rpmostreepost.py
1
10175
#!/usr/bin/env python # # Copyright (C) 2012,2013,2014 Colin Walters <walters@verbum.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your ...
lgpl-2.1
makermade/arm_android-21_arm-linux-androideabi-4.8
lib/python2.7/genericpath.py
246
3015
""" Path operations common to more than one OS Do not use directly. The OS specific modules import the appropriate functions from this module themselves. """ import os import stat __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', 'getsize', 'isdir', 'isfile'] # Does a path exist? #...
gpl-2.0
jiangjinjinyxt/vnpy
vnpy/api/xspeed/pyscript/generate_md_functions.py
15
10874
# encoding: UTF-8 __author__ = 'CHENXY' from string import join from xspeed_struct import structDict def processCallBack(line): orignalLine = line line = line.replace(' virtual void ', '') # 删除行首的无效内容 line = line.replace('{};\n', '') # 删除行尾的无效内容 content = line.split('(')...
mit
pombredanne/pulp_deb
plugins/test/unit/plugins/importers/test_web.py
3
3128
from unittest import TestCase from mock import patch, Mock, MagicMock from pulp.plugins.model import Repository from pulp_deb.common import constants from pulp_deb.plugins.importers.web import WebImporter, entry_point class TestImporter(TestCase): @patch('pulp_deb.plugins.importers.web.read_json_config') d...
gpl-2.0
keegancsmith/django-fileflatpages
fileflatpages/management/commands/loadflatpages.py
1
5850
import os.path import re from django.conf import settings from django.core.management.base import BaseCommand from django.db import connections, router, transaction, DEFAULT_DB_ALIAS from django.db.models import get_apps from fileflatpages.models import FileFlatPage class FileFlatPageParser(object): comment_re...
bsd-2-clause
diefenbach/django-lfs
lfs/core/sitemaps.py
1
2306
from django.conf import settings from django.contrib.sitemaps import Sitemap from django.utils import timezone from lfs.catalog.models import Category from lfs.catalog.models import Product from lfs.core.models import Shop from lfs.page.models import Page class ProductSitemap(Sitemap): """Google's XML sitemap fo...
bsd-3-clause
louietsai/python-for-android
python-build/python-libs/xmpppy/xmpp/browser.py
200
10132
## browser.py ## ## Copyright (C) 2004 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ## #...
apache-2.0
promptworks/horizon
openstack_dashboard/dashboards/project/volumes/backups/views.py
26
4337
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
troycomi/microMS
GUICanvases/GUIConstants.py
1
4036
####colors and sizes of GUI components in slideCanvas #default and boarder color of the slide image IMAGE_BACKGROUND = 'black' #color of temporary or test blob find TEMP_BLOB_FIND = 'turquoise' #predicted locations from the current mapper PREDICTED_POINTS = 'yellow' #color of circle and te...
mit
orneryhippo/saturdays
Krakatau-master/Krakatau/Krakatau/assembler/instructions.py
4
4297
OP_NONE = frozenset(['nop', 'aconst_null', 'iconst_m1', 'iconst_0', 'iconst_1', 'iconst_2', 'iconst_3', 'iconst_4', 'iconst_5', 'lconst_0', 'lconst_1', 'fconst_0', 'fconst_1', 'fconst_2', 'dconst_0', 'dconst_1', 'iload_0', 'iload_1', 'iload_2', 'iload_3', 'lload_0', 'lload_1', 'lload_2', 'lload_3', 'fload_0', 'fload_1'...
apache-2.0
nathanial/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/gis/forms/fields.py
405
2746
from django import forms from django.utils.translation import ugettext_lazy as _ # While this couples the geographic forms to the GEOS library, # it decouples from database (by not importing SpatialBackend). from django.contrib.gis.geos import GEOSGeometry class GeometryField(forms.Field): """ This is the bas...
gpl-3.0
BellScurry/gem5-fault-injection
src/arch/x86/isa/insts/simd64/integer/logical/por.py
91
2395
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause