repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ganzenmg/lammps_current
python/examples/pizza/pdbfile.py
85
9342
# Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html # Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories # # Copyright (2005) Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains # certain rights in this software. This software is...
gpl-2.0
Lind-Project/native_client
tests/spec2k/extract_timings.py
1
3119
#!/usr/bin/python2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This script produces csv data from multiple benchmarking runs with the # spec2k harness. # # A typical usage would be # # expor...
bsd-3-clause
ressu/SickGear
lib/html5lib/trie/py.py
817
1763
from __future__ import absolute_import, division, unicode_literals from six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError("All keys m...
gpl-3.0
leppa/home-assistant
homeassistant/components/mhz19/sensor.py
3
4631
"""Support for CO2 sensor connected to a serial port.""" from datetime import timedelta import logging from pmsensor import co2sensor import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_TEMPERATURE, CONF_MONITORED_CONDITIONS, CONF_NAM...
apache-2.0
CXQERP/ODOOERP
addons/account_followup/wizard/account_followup_print.py
217
16379
# -*- 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
plxaye/chromium
src/tools/code_coverage/croc_scan.py
178
4383
# Copyright (c) 2011 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. """Crocodile source scanners.""" import re class Scanner(object): """Generic source scanner.""" def __init__(self): """Constructor.""" ...
apache-2.0
edmond-chhung/linkchecker
third_party/dnspython/dns/tsig.py
66
7681
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-2.0
biskett/mic
mic/utils/fs_related.py
5
31322
#!/usr/bin/python -tt # # Copyright (c) 2007, Red Hat, Inc. # Copyright (c) 2009, 2010, 2011 Intel, Inc. # # 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; version 2 of the License # # This progr...
gpl-2.0
intel-analytics/analytics-zoo
pyzoo/test/zoo/common/test_util.py
1
1233
# # Copyright 2018 Analytics Zoo 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 applicable law or agreed to...
apache-2.0
sffjunkie/home-assistant
tests/components/binary_sensor/test_tcp.py
17
2422
"""The tests for the TCP binary sensor platform.""" from copy import copy from unittest.mock import patch, Mock from homeassistant.components.sensor import tcp from homeassistant.components.binary_sensor import tcp as bin_tcp from tests.common import get_test_home_assistant from tests.components.sensor import test_tcp...
mit
Mitchkoens/sympy
bin/mailmap_update.py
12
3323
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A tool to help keep .mailmap and AUTHORS up-to-date. """ # TODO: # - Check doc/src/aboutus.rst # - Make it easier to update .mailmap or AUTHORS with the correct entries. from __future__ import unicode_literals from __future__ import print_function import os import sys...
bsd-3-clause
tripplet/watch-cat
backend/LogHandler.py
1
1234
#!/usr/bin/env python import webapp2 import jinja2 import os from LogEntry import LogEntry from WatchJob import WatchJob from GermanTzInfo import GermanTzInfo jinja_environment = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(__file__))) class LogHandler(webapp2.RequestHandler): @staticmethod...
agpl-3.0
TheProjecter/google-apis-client-generator
src/googleapis/codegen/api.py
4
52242
#!/usr/bin/python2.7 # Copyright 2010 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 requi...
apache-2.0
idea4bsd/idea4bsd
python/helpers/profiler/thriftpy/transport/buffered/__init__.py
25
1561
# -*- coding: utf-8 -*- from __future__ import absolute_import from io import BytesIO from thriftpy._compat import CYTHON from .. import TTransportBase class TBufferedTransport(TTransportBase): """Class that wraps another transport and buffers its I/O. The implementation uses a (configurable) fixed-size r...
apache-2.0
michalkurka/h2o-3
h2o-bindings/bin/custom/R/gen_kmeans.py
2
2447
extensions = dict( required_params=['training_frame', 'x'], validate_required_params="", set_required_params=""" parms$training_frame <- training_frame if(!missing(x)){ parms$ignored_columns <- .verify_datacols(training_frame, x)$cols_ignore if(!missing(fold_column)){ parms$ignored_columns <- setdif...
apache-2.0
AKS1996/VOCOWA
Monte Carlo Model.py
1
4186
# The function localize takes the following arguments: # # colors: # 2D list, each entry either 'R' (for red cell) or 'G' (for green cell) # # measurements: # list of measurements taken by the robot, each entry either 'R' or 'G' # # motions: # list of actions taken by the robot, each entry of the f...
mit
VasuAgrawal/tartanHacks2015
site/flask/lib/python2.7/site-packages/sqlparse/__init__.py
33
2333
# Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php. """Parse SQL statements.""" __version__ = '0.1.14' # Setup namespace from sqlparse import engine from sqlparse import f...
mit
arunhotra/tensorflow
tensorflow/python/training/moving_averages_test.py
4
5395
"""Functional test for moving_averages.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.python.platform from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.framework import test_util from tensorfl...
apache-2.0
bstroebl/QGIS
python/plugins/sextante/core/SextanteUtils.py
1
3056
# -*- coding: utf-8 -*- """ *************************************************************************** SextanteUtils.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
gpl-2.0
Split-Screen/android_kernel_oneplus_msm8974
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
laiqiqi886/kbengine
kbe/res/scripts/common/Lib/distutils/dir_util.py
59
7780
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" import os import errno from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminates redundant "creating ...
lgpl-3.0
alexgorban/models
research/inception/inception/inception_distributed_train.py
15
14074
# 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 required by applicable law or a...
apache-2.0
GabrielNicolasAvellaneda/riak-python-client
riak/client/transport.py
2
6227
""" Copyright 2012 Basho Technologies, Inc. This file is provided to you 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 agr...
apache-2.0
tragiclifestories/django
tests/gis_tests/geos_tests/test_geos.py
38
44711
from __future__ import unicode_literals import ctypes import json import random import unittest from binascii import a2b_hex, b2a_hex from io import BytesIO from unittest import skipUnless from django.contrib.gis import gdal from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import ( HAS_GE...
bsd-3-clause
ArcherSys/ArcherSys
Lib/idlelib/MultiCall.py
1
55853
<<<<<<< HEAD <<<<<<< HEAD """ MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions per virtual event - all matching events will be called, not only the most specific one. This is done by wrapping the event functions - event_add, event_delete a...
mit
atosorigin/ansible
test/units/modules/test_known_hosts.py
35
4373
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import tempfile from ansible.module_utils import basic from units.compat import unittest from ansible.module_utils._text import to_bytes from ansible.module_utils.basic import AnsibleModule from ansible.modules.known_ho...
gpl-3.0
amyvmiwei/chromium
tools/grit/grit/grd_reader.py
3
4219
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Class for reading GRD files into memory, without processing them. ''' import os.path import types import xml.sax import xml...
bsd-3-clause
moritzschaefer/the-search-engine
tsg/indexer/page_rank.py
1
4665
import re from collections import OrderedDict from lxml import etree import os from os.path import splitext from tsg.config import RAW_DIR import operator import logging def parse_link(doc_link): ''' Define a function which take a link and obtain the doc_filename string and the type of document: journal, ...
mit
ajayuranakar/django-blog
lib/python2.7/site-packages/django/db/backends/mysql/creation.py
74
2231
import subprocess import sys from django.db.backends.base.creation import BaseDatabaseCreation from .client import DatabaseClient class DatabaseCreation(BaseDatabaseCreation): def sql_table_creation_suffix(self): suffix = [] test_settings = self.connection.settings_dict['TEST'] if test_...
gpl-3.0
nimbusproject/pidantic
setup.py
1
1649
#!/usr/bin/env pythonv # Copyright 2013 University of Chicago try: from setuptools import setup except ImportError: from distutils.core import setup import sys VERSION = "0.1.3" if float("%d.%d" % sys.version_info[:2]) < 2.5: sys.stderr.write("Your Python version %d.%d.%d is not supported.\n" % sys.versi...
apache-2.0
yu-peng/english-pddl-translator
launchTkinterGUI.py
1
38281
''' Created on Dec 6, 2012 @author: yupeng ''' #from PIL import Image, ImageTk from Tkinter import * from ttk import * from notebook import * from parseSentence import * from getElement import * from getElementSubtree import * from GraphPlanWrapper import * class UhuraGUI(Frame): def __init__(self, parent):...
mit
afbarnard/fitamord
fitamord/env.py
1
4176
"""Environments of hierarchical bindings""" # Copyright (c) 2016 Aubrey Barnard. This is free software released # under the MIT License. See `LICENSE.txt` for details. from . import general from . import parse # TODO parse YAML with provenance def flatten_dicts(dicts): # TODO return () class Environment:...
mit
benchisell/photostream-bc
flask/lib/python2.7/site-packages/flup/server/ajp_fork.py
19
7429
# Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
bsd-3-clause
surgebiswas/poker
PokerBots_2017/Johnny/external/protobuf/python/google/protobuf/reflection.py
50
4422
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
mit
m8ttyB/socorro
alembic/versions/335c2bfd99a6_bug_1255444_fix_fennecandroid_for_new_.py
3
3200
"""bug 1255444 fix fennecandroid for new release repository Revision ID: 335c2bfd99a6 Revises: 9371b45451b Create Date: 2016-03-10 13:24:35.662063 """ # revision identifiers, used by Alembic. revision = '335c2bfd99a6' down_revision = '9371b45451b' from alembic import op from socorro.lib import citexttype, jsontype,...
mpl-2.0
lucasrangit/twitter-winner
twitter-winner/oauthlib/oauth2/rfc6749/grant_types/implicit.py
13
15811
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import from oauthlib import common from oauthlib.common import log from oauthlib.uri_validate import is_absolute_uri from .base import GrantTypeBase from .. import ...
mit
electrum/presto
docs/src/main/sphinx/ext/download.py
3
2129
# # 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 ...
apache-2.0
meredith-digops/ansible
lib/ansible/modules/cloud/amazon/lightsail.py
68
16237
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
jforbess/pvlib-python
pvlib/pvsystem.py
1
42489
""" The ``pvsystem`` module contains functions for modeling the output and performance of PV modules and inverters. """ from __future__ import division import logging pvl_logger = logging.getLogger('pvlib') import io try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen imp...
bsd-3-clause
jtux270/translate
FreeIPA/freeipa-3.0.0/tests/test_xmlrpc/test_selinuxusermap_plugin.py
2
28881
# Authors: # Rob Crittenden <rcritten@redhat.com> # # Copyright (C) 2011 Red Hat # see file 'COPYING' for use and warranty information # # 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...
gpl-3.0
esaunders/autopsy
pythonExamples/Aug2015DataSourceTutorial/RunExe.py
5
7492
# Sample module in the public domain. Feel free to use this as a template # for your modules (and you can remove this header and take complete credit # and liability) # # Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] # # This is free and unencumbered software released into the public domain. # # Anyone is f...
apache-2.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/bsddb/test/test_fileid.py
111
1830
"""TestCase for reseting File ID. """ import os import shutil import unittest from test_all import db, test_support, get_new_environment_path, get_new_database_path class FileidResetTestCase(unittest.TestCase): def setUp(self): self.db_path_1 = get_new_database_path() self.db_path_2 = get_new_dat...
gpl-2.0
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/numpy/distutils/system_info.py
15
83925
#!/bin/env python """ This file defines a set of system_info classes for getting information about various resources (libraries, library directories, include directories, etc.) in the system. Currently, the following classes are available: atlas_info atlas_threads_info atlas_blas_info atlas_blas_threads_info ...
mit
pabloborrego93/edx-platform
lms/djangoapps/instructor/views/coupons.py
61
6574
""" E-commerce Tab Instructor Dashboard Coupons Operations views """ from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.views.decorators.http import require_POST from django.utils.translation import ugettext as _ from util.json_request import Json...
agpl-3.0
jose-raul-barreras/letscode
textJustification.py
1
2695
# -*- coding: utf-8 -*- """ Created on Fri Feb 17 12:04:09 2017 @author: jrb """ def justify(strings, L): res = [] if len(strings) == 1: rest = L - sum([len(w) for w in strings[0]]) res.append(' '.join(strings[0])+' ') else: for s in strings: rest = L - sum([len(w) for w...
mit
wshallum/ansible
lib/ansible/utils/module_docs_fragments/aws.py
16
3156
# (c) 2014, Will Thames <will@thames.id.au> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
gpl-3.0
ferabra/edx-platform
lms/djangoapps/teams/models.py
8
9825
"""Django models related to teams functionality.""" from datetime import datetime from uuid import uuid4 import pytz from datetime import datetime from model_utils import FieldTracker from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.models import User from django.db import models from dj...
agpl-3.0
OWASP/django-DefectDojo
dojo/tools/openscap/parser.py
2
6339
from xml.dom import NamespaceErr import hashlib from urllib.parse import urlparse import re from defusedxml import ElementTree as ET from dojo.models import Endpoint, Finding __author__ = 'dr3dd589' class OpenscapXMLParser(object): def __init__(self, file, test): self.dupes = dict() self.items = ...
bsd-3-clause
neumerance/deploy
.venv/lib/python2.7/site-packages/nose_exclude.py
3
3293
import os import logging from nose.plugins import Plugin log = logging.getLogger('nose.plugins.nose_exclude') class NoseExclude(Plugin): def options(self, parser, env=os.environ): """Define the command line options for the plugin.""" super(NoseExclude, self).options(parser, env) env_dirs ...
apache-2.0
morrillo/l10n_ar_chart_generic
__init__.py
2
1024
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 OpenERP - Team de Localización Argentina. # https://launchpad.net/~openerp-l10n-ar-localization # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
hypernicon/pyec
pyec/distribution/nn/net_gpu.py
1
5196
""" Copyright (C) 2012 Alan J Lockett 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, modify, merge, publish, distribute,...
mit
Biles430/FPF_PIV
piv_outer.py
1
3559
import pandas as pd from pandas import DataFrame import numpy as np import PIV import h5py import matplotlib.pyplot as plt import hotwire as hw ################################################ # PURPOSE # 1. Compute Integral Parameters # 2. Outer Normalize # 3. Plot ############################################...
mit
abenzbiria/clients_odoo
addons/l10n_hr/__init__.py
432
1164
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Module: l10n_hr # Author: Goran Kliska # mail: goran.kliska(AT)slobodni-programi.hr # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb # Contrib...
agpl-3.0
skirsdeda/django
django/contrib/sitemaps/__init__.py
26
6010
from django.apps import apps as django_apps from django.conf import settings from django.core import urlresolvers, paginator from django.core.exceptions import ImproperlyConfigured from django.utils import translation from django.utils.six.moves.urllib.parse import urlencode from django.utils.six.moves.urllib.request i...
bsd-3-clause
sbidoul/buildbot
worker/buildbot_worker/null.py
15
1618
# 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
darktears/chromium-crosswalk
tools/telemetry/telemetry/testing/disabled_cases.py
17
1242
# 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. import unittest from telemetry import decorators # These are not real unittests. # They are merely to test our Enable/Disable annotations. class DisabledC...
bsd-3-clause
tracierenea/gnuradio
gr-trellis/examples/python/test_cpm.py
24
5571
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: CPM test # Author: Achilleas Anastasopoulos # Description: gnuradio flow graph # Generated: Thu Feb 19 23:16:23 2009 ################################################## from gnuradio import gr from gnuradio im...
gpl-3.0
tfmorris/cc-mrjob
tag_counter.py
4
1852
import re # from collections import Counter # from mrcc import CCJob def get_tag_count(data, ctr=None): """Extract the names and total usage count of all the opening HTML tags in the document""" if ctr is None: ctr = Counter() # Convert the document to lower case as HTML tags are case insensitive ctr.upda...
mit
JamesMura/sentry
src/sentry/filters/web_crawlers.py
3
1518
from __future__ import absolute_import import re from .base import Filter # not all of these agents are guaranteed to execute JavaScript, but to avoid # overhead of identifying which ones do, and which ones will over time we simply # target all of the major ones CRAWLERS = re.compile(r'|'.join(( # various Google...
bsd-3-clause
loicdubois/pdm_crazyflie
catkin_old/build_isolated/crazyflie/catkin_generated/installspace/_setup_util.py
5
12465
#!/usr/bin/python # -*- coding: utf-8 -*- # Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, 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: # # * Redistrib...
mit
likr/causalnet
bin/json_to_neo4j.py
1
2689
import csv import json import os.path import argparse variables_header = [ 'name:ID(Phenotype)', 'description', 'timeGroup', 'timeGroupDetail', 'timeOrder:INT', 'unit', 'type', 'cells:STRING[]', 'data:DOUBLE[]', ] edges_header = [ ':START_ID(Phenotype)', ':END_ID(Phenotype)'...
mit
upibhalla/moose-core
python/moose/chemMerge/merge.py
4
35192
# -*- coding: utf-8 -*- #******************************************************************* # * File: merge.py # * Description: # * Author: HarshaRani # * E-mail: hrani@ncbs.res.in # ********************************************************************/ # ***********************************...
gpl-3.0
Manojkumar91/odoo_inresto
addons/hw_proxy/__openerp__.py
8
1608
# -*- 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
mj-5/volatility
volatility/plugins/mac/netstat.py
44
2242
# 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
codestersnyc/codesters-graphics
codesters/hitbox.py
1
3277
import math from Tkinter import Tk, Canvas from .manager import Manager class Hitbox(object): def __init__(self, top_right, top_left, bottom_right, bottom_left, sprite): self.root = Manager.canvas self.canvas = Manager.canvas self.sprite = sprite self.base_top_right_x = top_right[...
mit
theo-l/django
tests/postgres_tests/test_citext.py
89
2781
""" The citext PostgreSQL extension supports indexing of case-insensitive text strings and thus eliminates the need for operations such as iexact and other modifiers to enforce use of an index. """ from django.db import IntegrityError from django.test.utils import modify_settings from . import PostgreSQLTestCase from ...
bsd-3-clause
deepesch/scikit-learn
sklearn/tests/test_lda.py
77
6258
import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert...
bsd-3-clause
candrews/portage
pym/portage/tests/resolver/soname/test_unsatisfiable.py
10
1585
# Copyright 2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import ( ResolverPlayground, ResolverPlaygroundTestCase) class SonameUnsatisfiableTestCase(TestCase): def testSonameUnsatisfiable(s...
gpl-2.0
NewpTone/stacklab-nova
debian/tmp/usr/lib/python2.7/dist-packages/nova/virt/hyperv/volumeops.py
7
13426
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Pedro Navarro Perez # 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...
apache-2.0
soarpenguin/ansible
lib/ansible/modules/packaging/language/pip.py
4
21299
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # 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', ...
gpl-3.0
kgao/MediaDrop
mediadrop/controllers/login.py
1
5182
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2014 MediaDrop contributors # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See LICENSE.txt in the main project ...
gpl-3.0
procangroup/edx-platform
pavelib/paver_tests/test_extract_and_generate.py
15
4704
""" This test tests that i18n extraction (`paver i18n_extract -v`) works properly. """ import os import random import re import string import subprocess import sys from datetime import datetime, timedelta from unittest import TestCase from i18n import config, dummy, extract, generate from polib import pofile from pytz...
agpl-3.0
KyleJamesWalker/ansible
lib/ansible/modules/cloud/openstack/os_router.py
27
14113
#!/usr/bin/python # # This module 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 software is distributed in the hope that it ...
gpl-3.0
fireplume/tennis-club
club/tests.py
1
2690
from django.test import TestCase from club.models import * class ClubTestCase(TestCase): def test_model_creation(self): jdoe_address = Address.objects.create(address="123 MyStreet apt 666", city='MyCity', state_pro...
gpl-3.0
GunoH/intellij-community
python/testData/inspections/PyUnresolvedReferencesInspection/operators.py
83
8516
class C(object): def __add__(self, other): return int(other) def __or__(self, other): return other def __rsub__(self, other): return other def __neg__(self): return self def test_object(): o1 = object() o2 = object() o1 <warning descr="Class 'object' does...
apache-2.0
elaske/mufund
html5lib/tests/test_treewalkers.py
429
13692
from __future__ import absolute_import, division, unicode_literals import os import sys import unittest import warnings from difflib import unified_diff try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual = unittest.TestCase.assertEquals from .support import get_data_files...
gpl-3.0
twitchyliquid64/misc-scripts
s3tool/boto/ec2/autoscale/policy.py
152
6230
# Copyright (c) 2009-2010 Reza Lotun http://reza.lotun.name/ # Copyright (c) 2011 Jann Kleen # # 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 limitat...
mit
h4ck3rm1k3/ansible
lib/ansible/runner/lookup_plugins/sequence.py
85
6836
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # # 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 v...
gpl-3.0
puzan/ansible
lib/ansible/playbook/role/definition.py
26
9039
# (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
gabrielfalcao/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/localflavor/uk/forms.py
313
1943
""" UK-specific Form helpers """ import re from django.forms.fields import CharField, Select from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ class UKPostcodeField(CharField): """ A form field that validates its input is a UK postcode. The regular expressi...
gpl-3.0
bdero/edx-platform
common/test/acceptance/pages/studio/settings_group_configurations.py
8
6420
""" Course Group Configurations page. """ from .course_page import CoursePage from .utils import confirm_prompt class GroupConfigurationsPage(CoursePage): """ Course Group Configurations page. """ url_path = "group_configurations" def is_browser_on_page(self): return self.q(css='body.vi...
agpl-3.0
zenweasel/loggerglue
loggerglue/tests/rfc5424.py
1
4512
import unittest from loggerglue.rfc5424 import * valids = ( """<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - \xef\xbb\xbf'su root' failed for lonvick on /dev/pts/8""", """<165>1 2003-08-24T05:14:15.000003-07:00 192.0.2.1 myproc 8710 - - %% It's time to make the do-nuts.""", "...
mit
foss-transportationmodeling/rettina-server
flask/local/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/pymysql.py
21
1232
# mysql/pymysql.py # Copyright (C) 2005-2015 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 """ .. dialect:: mysql+pymysql :name: PyMySQL :dbapi: pymysql :connect...
apache-2.0
elkingtonmcb/django
tests/urlpatterns_reverse/included_namespace_urls.py
199
1357
import warnings from django.conf.urls import include, patterns, url from django.utils.deprecation import RemovedInDjango110Warning from .namespace_urls import URLObject from .views import view_class_instance testobj3 = URLObject('testapp', 'test-ns3') testobj4 = URLObject('testapp', 'test-ns4') # test deprecated pa...
bsd-3-clause
bkendzior/scipy
scipy/fftpack/setup.py
102
1514
#!/usr/bin/env python # Created by Pearu Peterson, August 2002 from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('fftpack',parent_package, t...
bsd-3-clause
mkieszek/odoo
addons/pad/pad.py
30
4250
# -*- coding: utf-8 -*- from openerp.osv import fields, osv import random import re import string import urllib2 import logging from openerp import SUPERUSER_ID from openerp.tools.translate import _ from openerp.tools import html2plaintext from py_etherpad import EtherpadLiteClient from openerp.exceptions import UserEr...
agpl-3.0
funson/rt-xen
tools/python/logging/logging-0.4.9.2/test/logconf.py
42
62356
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
gpl-2.0
maartenq/ansible
lib/ansible/modules/network/aci/aci_config_snapshot.py
10
9721
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
kevin-coder/tensorflow-fork
tensorflow/python/util/serialization_test.py
32
2724
# Copyright 2018 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
papados/ordersys
Lib/encodings/cp037.py
593
13377
""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.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...
unlicense
fbradyirl/home-assistant
homeassistant/components/satel_integra/switch.py
3
3172
"""Support for Satel Integra modifiable outputs represented as switches.""" import logging from homeassistant.components.switch import SwitchDevice from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ( CONF_DEVICE_CODE, CONF_SWITCHABLE_OU...
apache-2.0
bpsinc-native/src_tools_grit
grit/tool/build_unittest.py
5
3033
#!/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. '''Unit tests for the 'grit build' tool. ''' import os import sys import tempfile if __name__ == '__main__': sys.path.append(os....
bsd-2-clause
mavit/ansible
lib/ansible/modules/cloud/rackspace/rax_clb.py
65
9095
#!/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
BigTone2009/sms-tools
software/transformations_interface/hpsMorph_GUI_frame.py
21
14975
# GUI frame for the hpsMorph_function.py from Tkinter import * import tkFileDialog, tkMessageBox import sys, os from scipy.io.wavfile import read import numpy as np import hpsMorph_function as hM sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) import utilFunctions as UF class...
agpl-3.0
thehub/hubplus
apps/plus_permissions/types/Contact.py
1
2187
from apps.plus_permissions.interfaces import InterfaceReadProperty, InterfaceWriteProperty, InterfaceCallProperty, InterfaceReadWriteProperty from apps.plus_permissions.models import SetSliderOptions, SetAgentDefaults, SetPossibleTypes, SetSliderAgents from apps.plus_contacts.models import Contact from apps.plus_grou...
gpl-3.0
benosteen/mypaint
lib/command.py
1
10185
# This file is part of MyPaint. # Copyright (C) 2007-2008 by Martin Renold <martinxyz@gmx.ch> # # 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 opt...
gpl-2.0
rgerkin/neuroConstruct
lib/jython/Lib/distutils/tests/test_dir_util.py
106
4382
"""Tests for distutils.dir_util.""" import unittest import os import stat import shutil import sys from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, ensure_relative) from distutils import log from distutils.tests import support from test.test_support import r...
gpl-2.0
spring-week-topos/nova-week
nova/virt/xenapi/driver.py
6
29913
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
apache-2.0
AhanM/ChessAI
action.py
1
1274
# action.py # --------- from game import * class Action(object): ''' An Action object would basically be used to formalize moves defined by a paticular piece and it's new position. It will be used to determine whether an action is feasable in terms of collisions etc. or not and whether an action involves a ca...
mit
Celthi/youtube-dl-GUI
youtube_dl/extractor/glide.py
153
1402
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class GlideIE(InfoExtractor): IE_DESC = 'Glide mobile video messages (glide.me)' _VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)' _TEST = { 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dC...
mit