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
chinmaygarde/mojo
sky/engine/bindings/scripts/dart_compiler.py
14
4699
#!/usr/bin/python # Copyright (C) 2013 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 c...
bsd-3-clause
solus-project/package-management
tests/archivetests.py
3
1918
import pisi import unittest from pisi import util from pisi import uri from pisi import archive from pisi import sourcearchive from pisi import fetcher from pisi.specfile import SpecFile from os.path import join, exists class ArchiveTestCase(unittest.TestCase): def testTarUnpack(self): spec = SpecFile('re...
gpl-2.0
lpirl/ansible
lib/ansible/utils/module_docs_fragments/validate.py
366
1146
# Copyright (c) 2015 Ansible, Inc # # 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. # # Ansi...
gpl-3.0
elainexmas/boto
boto/machinelearning/exceptions.py
127
1596
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
2ndQuadrant/ansible
lib/ansible/modules/monitoring/sensu_handler.py
52
9195
#!/usr/bin/python # (c) 2017, Red Hat Inc. # 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
arahuja/scikit-learn
sklearn/decomposition/tests/test_nmf.py
14
6123
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import raises from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_gr...
bsd-3-clause
tquilian/exelearningTest
twisted/trial/test/detests.py
98
4765
from __future__ import generators from twisted.trial import unittest from twisted.internet import defer, threads, reactor class DeferredSetUpOK(unittest.TestCase): def setUp(self): d = defer.succeed('value') d.addCallback(self._cb_setUpCalled) return d def _cb_setUpCalled(self, ignore...
gpl-2.0
tombh/Topotatolog
settings.py
1
2973
import os import sys sys.path.insert( 0, os.path.join( os.path.dirname(__file__), "blog/lib" ) ) # Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from...
bsd-3-clause
durchflieger/DFAtmo
service.py
1
1119
# --- # Copyright (C) 2011,2012 Andreas Auras <yak54@inkennet.de> # # This file is part of DFAtmo the driver for 'Atmolight' controllers for XBMC and xinelib based video players. # # DFAtmo is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # t...
gpl-2.0
mozilla/olympia
src/olympia/zadmin/management/commands/generate_error.py
4
1435
from django.core.management.base import BaseCommand import olympia.core.logger from olympia.zadmin.tasks import celery_error log = olympia.core.logger.getLogger('z') class Command(BaseCommand): help = 'Generates an exception for testing. From a celery task with --celery' def add_arguments(self, parser): ...
bsd-3-clause
JGrippo/YACS
scheduler/south_migrations/0011_auto__chg_field_savedselection_internal_blocked_times.py
2
9979
# -*- 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 index on 'SavedSelection', fields ['internal_section_ids'] db.create_index(u'scheduler_savedselecti...
mit
mitar/django
django/contrib/gis/geos/tests/test_geos.py
5
42100
import ctypes import random import unittest from django.contrib.gis.geos import * from django.contrib.gis.geos.base import gdal, numpy, GEOSBase from django.contrib.gis.geos.libgeos import GEOS_PREPARE from django.contrib.gis.geometry.test_data import TestDataMixin class GEOSTest(unittest.TestCase, TestDataMixin): ...
bsd-3-clause
pquentin/django
tests/i18n/test_compilation.py
13
8847
# -*- coding: utf-8 -*- import gettext as gettext_module import os import shutil import stat import unittest from django.core.management import ( CommandError, call_command, execute_from_command_line, ) from django.core.management.utils import find_command from django.test import SimpleTestCase, override_settings...
bsd-3-clause
shushen/ansible
v2/test/vars/test_variable_manager.py
23
4269
# (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
scenarios/tensorflow
tensorflow/contrib/learn/python/learn/estimators/prediction_key.py
28
1026
# 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
mylene-campana/hpp-rbprm-corba
script/scenarios/manipulation_romeo_interp.py
1
7693
from hpp.corbaserver.rbprm.problem_solver import ProblemSolver as ProblemSolverRbprm from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver import Client from hpp.gepetto import ViewerFactory from hpp.gepetto import Viewer import sys from hp...
lgpl-3.0
jfantom/incubator-airflow
airflow/contrib/hooks/gcp_dataflow_hook.py
3
6444
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
PappaPeppar/micropython
tests/extmod/framebuf16.py
26
1059
try: import framebuf except ImportError: print("SKIP") raise SystemExit def printbuf(): print("--8<--") for y in range(h): print(buf[y * w * 2:(y + 1) * w * 2]) print("-->8--") w = 4 h = 5 buf = bytearray(w * h * 2) fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.RGB565) # fill fbuf.f...
mit
Beauhurst/django
tests/test_runner/test_discover_runner.py
32
7804
import os from argparse import ArgumentParser from contextlib import contextmanager from unittest import TestSuite, TextTestRunner, defaultTestLoader from django.test import TestCase from django.test.runner import DiscoverRunner @contextmanager def change_cwd(directory): current_dir = os.path.abspath(os.path.dir...
bsd-3-clause
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/raw/GL/APPLE/flush_buffer_range.py
3
1427
'''OpenGL extension APPLE.flush_buffer_range Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_APPLE_flush_buffer_range' _DEPRECATED = False GL_B...
agpl-3.0
johan--/Quiz-Program
vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.7/vendor/v8/tools/testrunner/server/daemon.py
123
3753
#!/usr/bin/env python # This code has been written by Sander Marechal and published at: # http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ # where the author has placed it in the public domain (see comment #6 at # http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c6...
cc0-1.0
allenlavoie/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py
41
31331
# 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
mzizzi/ansible
lib/ansible/modules/network/avi/avi_api_session.py
26
8381
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # 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 publ...
gpl-3.0
googlei18n/TachyFont
run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/misc/homeResFile.py
11
2278
"""Mac-only module to find the home file of a resource.""" from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc import sstruct import array import calldll import macfs, Res def HomeResFile(res): """Return a path to the file in which resource 'res' li...
apache-2.0
daf/OWSLib
owslib/util.py
2
13839
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2008 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # # Contact email: tomkralidis@gmail.com # ============================================================================= imp...
bsd-3-clause
ZimmermanGroup/molecularGSM
TEST/ethyleneRotation/mopac/de-gsm/compare.py
9
1337
# for reading csv format files import csv # function to convert strings to float and skip conversion if the value is not a float def convertToFloat(inList): for element in inList: try: yield float(element) except ValueError: yield element # subtract two floats and skip if s...
mit
felgari/tips
python/string.py
3
1804
# -*- coding: utf-8 -*- # Copyright (c) 2016 Felipe Gallego. All rights reserved. # # This file is part of code-snippets: https://github.com/felgari/snippets # # This 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 Found...
gpl-3.0
Resmin/Resmin
resmin/apps/story/serializers.py
1
1874
from django.contrib.auth.models import User from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): bio = serializers.CharField( source='profile.bio', read_only=True) follower_count = serializers.IntegerField( source='profile.follower_count', read_only=True)...
gpl-3.0
liverbirdkte/iris-panel
iris/packagedb/apiviews.py
7
2551
# -*- coding: utf-8 -*- # This file is part of IRIS: Infrastructure and Release Information System # # Copyright (C) 2013 Intel Corporation # # IRIS is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2.0 as published by the Free Software Foundation....
gpl-2.0
janslow/boto
boto/sqs/__init__.py
129
1705
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit
d-e-s-o/git-blamediff
cleanup/src/deso/cleanup/__init__.py
2
1367
# __init__.py #/*************************************************************************** # * Copyright (C) 2015 Daniel Mueller (deso@posteo.net) * # * * # * This program is free software: you can redistribute it and/or mod...
gpl-3.0
adrienbrault/home-assistant
script/scaffold/templates/reproduce_state/tests/test_reproduce_state.py
5
1943
"""Test reproduce state for NEW_NAME.""" import pytest from homeassistant.core import HomeAssistant, State from tests.common import async_mock_service async def test_reproducing_states( hass: HomeAssistant, caplog: pytest.LogCaptureFixture ) -> None: """Test reproducing NEW_NAME states.""" hass.states.a...
mit
endlessm/chromium-browser
third_party/boringssl/src/third_party/googletest/scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
engdan77/edoAutoHomeMobile
twisted/test/stdio_test_consumer.py
3
1131
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_consumer -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTests.test_consumer} to test that process transports implement ICon...
mit
juanalfonsopr/odoo
openerp/addons/base/ir/__init__.py
379
1444
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
zaccoz/odoo
addons/event_sale/__openerp__.py
306
2163
# -*- 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
towerjoo/mindsbook
django/contrib/gis/db/models/sql/compiler.py
25
12599
from itertools import izip from django.db.backends.util import truncate_name from django.db.models.sql import compiler from django.db.models.sql.constants import TABLE_NAME from django.db.models.sql.query import get_proxied_model SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(compiler.SQLCompiler): def ...
bsd-3-clause
spisneha25/django
tests/migrations/test_loader.py
165
13346
from __future__ import unicode_literals from unittest import skipIf from django.db import connection, connections from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder from djang...
bsd-3-clause
cchurch/ansible
lib/ansible/plugins/action/vyos.py
10
4037
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
ehsan/airmozilla
airmozilla/manage/views/suggestions.py
5
9769
import datetime from django import http from django.contrib import messages from django.shortcuts import render, redirect, get_object_or_404 from django.utils import timezone from django.db import transaction from funfactory.urlresolvers import reverse from airmozilla.main.models import ( Event, Template, ...
bsd-3-clause
skidzo/mubosym
exa_9_moving_pendulum.py
2
2254
# -*- coding: utf-8 -*- """ Created on Wed Jun 3 21:15:49 2015 @author: oliver """ import numpy as np from sympy import symbols import mubosym as mbs ############################################################ # general system setup example myMBS = mbs.MBSworld('moving_pendulum', connect=True, force_db_setup=False...
mit
hbhzwj/imalse
tools/ns-allinone-3.14.1/pybindgen-0.15.0.809/waf-tools/shellcmd.py
137
12146
# Copyright (C) 2008 Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com> # 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. ...
gpl-3.0
AurelienNioche/MonkeyProject
data_management/data_manager.py
1
6946
import numpy as np from data_management.database import Database from utils.utils import log, today class DataManager(object): name = "DataManager" def __init__(self, monkey, starting_point="2016-12-01", end_point=today(), database_path=None): self.db = Database(database_path) self.monkey ...
gpl-3.0
1stvamp/pip
tests/functional/test_install_config.py
2
6536
import os import tempfile import textwrap def test_options_from_env_vars(script): """ Test if ConfigOptionParser reads env vars (e.g. not using PyPI here) """ script.environ['PIP_NO_INDEX'] = '1' result = script.pip('install', '-vvv', 'INITools', expect_error=True) assert "Ignoring indexes:" ...
mit
Stuxnet-Kernel/kernel_g3
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
CGar4/myzsh
plugins/zsh-git-prompt/gitstatus.py
13
2323
#!/usr/bin/env python from __future__ import print_function # change this symbol to whatever you prefer prehash = ':' from subprocess import Popen, PIPE import sys gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE) branch, error = gitsym.communicate() error_string = error.decode('utf-8') if ...
mit
jasonbrooks/kubernetes
hack/boilerplate/boilerplate.py
300
6214
#!/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
shaufi10/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py
386
1736
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
wkeyword/pip
pip/_vendor/cachecontrol/heuristics.py
374
4053
import calendar import time from email.utils import formatdate, parsedate, parsedate_tz from datetime import datetime, timedelta TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT" def expire_after(delta, date=None): date = date or datetime.now() return date + delta def datetime_to_header(dt): return formatdate(c...
mit
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/sql/tools/ssl_certs/create.py
2
3612
# Copyright 2013 Google Inc. All Rights Reserved. """Creates an SSL certificate for a Cloud SQL instance.""" import os from googlecloudsdk.core.util import files from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions from googlecloudsdk.core import log from googlecloudsdk.core.util i...
apache-2.0
appsecyogi/Mobile-Security-Framework-MobSF
StaticAnalyzer/tools/enjarify/enjarify/jvm/optimization/consts.py
13
3287
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
goldeneye-source/ges-python
lib/encodings/__init__.py
764
5067
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
gpl-3.0
Lujeni/ansible
contrib/inventory/spacewalk.py
28
8792
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
gpl-3.0
mqingyn/pyutils
pyutils/storage.py
1
10882
#!/usr/bin/env python # -*- coding: utf-8 -*- try: set except NameError: from sets import Set as set from pyutils.strtools import safeunicode from threading import local as threadlocal import warnings import sys,copy PY3 = (sys.version_info >= (3,)) class Storage(dict): """ from web.p...
bsd-3-clause
kalxas/QGIS
tests/src/python/test_qgsbox3d.py
45
7825
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsBox3d. .. 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. """ __author...
gpl-2.0
Beauhurst/django
django/conf/urls/i18n.py
29
1119
import functools from django.conf import settings from django.conf.urls import url from django.urls import LocaleRegexURLResolver, get_resolver from django.views.i18n import set_language def i18n_patterns(*urls, prefix_default_language=True): """ Add the language code prefix to every URL pattern within this ...
bsd-3-clause
OaklandPeters/validator
setup.py
11
1831
from setuptools import setup # Filling in this template requires filling in: # name # description # packages # classifiers # Development Status :: # ... it would also be beneficial to study/fill in other classifiers # # Also will benefit from confirming the url -- which may change frequently # ... such as if n...
mit
luci/recipes-py
recipe_modules/path/config.py
2
1502
# Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from recipe_engine.config import config_item_context, ConfigGroup, Dict, Static from recipe_engine.config_types import Path def BaseConfig(PLATF...
apache-2.0
benspaulding/django
django/db/models/sql/constants.py
16
1108
from collections import namedtuple import re # Valid query types (a dictionary is used for speedy lookups). QUERY_TERMS = set([ 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', 'month', 'day', 'week_day', 'isn...
bsd-3-clause
tornadomeet/mxnet
example/reinforcement-learning/a3c/launcher.py
34
5327
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
devs4v/devs4v-information-retrieval15
project/venv/lib/python2.7/site-packages/nltk/parse/nonprojectivedependencyparser.py
2
29278
# Natural Language Toolkit: Dependency Grammars # # Copyright (C) 2001-2015 NLTK Project # Author: Jason Narad <jason.narad@gmail.com> # # URL: <http://nltk.org/> # For license information, see LICENSE.TXT # from __future__ import print_function import math import logging from nltk.compat import xrange from nltk.par...
mit
antoniogrillo/fabcrNFC
node-js/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
5099
#!/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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
mit
arcyfelix/Machine-Learning-For-Trading
12_stock_price_plotting_range_and_companies.py
1
1448
import os import pandas as pd import matplotlib.pyplot as plt def symbol_to_path(symbol, base_dir = 'data'): return os.path.join(base_dir, "{}.csv".format(str(symbol))) def dates_creator(): start_date = '2013-01-01' end_date = '2013-12-31' dates = pd.date_range(start_date, end_date) return dates de...
apache-2.0
Godiyos/python-for-android
python-modules/twisted/twisted/python/procutils.py
61
1380
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Utilities for dealing with processes. """ import os def which(name, flags=os.X_OK): """Search PATH for executable files with the given name. On newer versions of MS-Windows, the PATHEXT environment variable will be ...
apache-2.0
takeshineshiro/neutron
neutron/plugins/ml2/drivers/mlnx/mech_mlnx.py
16
2421
# Copyright (c) 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
Acehaidrey/incubator-airflow
airflow/operators/hive_to_druid.py
7
1700
# # 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
kosior/eventful
eventful/userprofiles/migrations/0001_initial.py
1
1729
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-16 18:32 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
mit
pintubigfoot/pinturun
printrun/stlview.py
1
13376
#!/usr/bin/env python # This file is part of the Printrun suite. # # Printrun 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. # # Prin...
gpl-3.0
l8orre/XG8
nxtPwt/nxtDB.py
2
11048
# -*- coding: utf-8 -*- """ Created on Wed Jun 25 10:17:16 2014 @author: azure """ from PyQt4 import QtCore #Qt, from PyQt4.Qt import QTimer from PyQt4.QtCore import QObject , pyqtSignal, pyqtSlot, SIGNAL import sqlite3 as sq from nxtPwt.nxtApiPrototypes import nxtQs import os from requests import Request as R...
mit
chvrga/outdoor-explorer
java/play-1.4.4/python/Lib/hotshot/log.py
3
6336
import _hotshot import os.path import parser import symbol from _hotshot import \ WHAT_ENTER, \ WHAT_EXIT, \ WHAT_LINENO, \ WHAT_DEFINE_FILE, \ WHAT_DEFINE_FUNC, \ WHAT_ADD_INFO __all__ = ["LogReader", "ENTER", "EXIT", "LINE"] ENTER = WHAT_ENTER EXIT = WHAT_EXIT LI...
mit
altcommunitycoin/altcommunitycoin-skunk
contrib/linearize/linearize-hashes.py
4
2762
#!/usr/bin/python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import json import struct impor...
mit
USGSDenverPychron/pychron
pychron/image/cv_wrapper.py
1
7683
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
apache-2.0
hriechmann/distributed_process_manager
src/eu/hriechmann/distributed_process_manager/common.py
1
2777
__author__ = 'hriechma' from enum import Enum import hashlib import os ManagerCommands = Enum("ManagerCommands", "REGISTER INIT_PROCESS START_PROCESS STOP_PROCESS SEND_LOGS KEEPALIVE") ClientCommands = Enum("ClientCommands", "REGISTER PROCESSSTATUS_CHANGED PROCESS_LOGS KEEPALIVE") ServerCommands = Enum("ServerCommand...
mit
JuliaPackageMirrors/NumericExtensions.jl
doc/source/conf.py
4
7870
# -*- coding: utf-8 -*- # # NumericExtensions.jl documentation build configuration file, created by # sphinx-quickstart on Mon Jun 24 08:00:56 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated ...
mit
Aaron0927/xen-4.2.1
tools/tests/utests/run_all_tests.py
42
1310
#============================================================================ # 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
wildchildyn/autism-website
yanni_env/lib/python3.6/site-packages/sqlalchemy/util/queue.py
33
6548
# util/queue.py # Copyright (C) 2005-2017 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 """An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using ...
gpl-3.0
phantasien/falkor
deps/bastian/deps/v8/tools/push-to-trunk/git_recipes.py
8
6598
#!/usr/bin/env python # Copyright 2014 the V8 project authors. 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...
mit
josesanch/django-oscar
sites/demo/apps/offers.py
33
1268
from oscar.apps.offer import models class AlphabetRange(object): name = "Products that start with D" def contains_product(self, product): return product.title.startswith('D') def num_products(self): return None class BasketOwnerCalledBarry(models.Condition): name = "User must be ca...
bsd-3-clause
mazaclub/mazabot-core
plugins/ChannelLogger/test.py
19
1753
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
bsd-3-clause
mstriemer/zamboni
docs/watcher.py
67
1241
""" Watch a bunch of files and run a command if any changes are detected. Usage ----- :: python watcher.py 'echo changes' one.py two.py To automatically keep Sphinx docs up to date:: python watcher.py 'make html' $(find . -name '*.rst') Problems -------- * The file checking would be way more efficient us...
bsd-3-clause
alexandreleroux/mayavi
mayavi/tools/data_wizards/csv_loader.py
5
7005
# Author: Ilan Schnell <ischnell@enthought.com> # Copyright (c) 2008, Enthought, Inc. # License: BSD Style. from traits.api import HasTraits, Str, Int, Array, List, \ Instance, on_trait_change, Property, Button from pyface.api import GUI from traitsui.api import View, Item, HGroup, Group, \ ListEditor, Tabu...
bsd-3-clause
nzt4567/animator
skj_animation.py
1
12444
#!/usr/bin/env python ''' Process a set of frames using ffmpeg to create required animation ''' # IMPORTS import skj_std # AUTHOR __author__ = skj_std.__author__ __email__ = skj_std.__email__ __status__ = skj_std.__status__ __version__ = skj_std.__version__ __license__ = skj_std.__license__ __year__ = skj_std.__year_...
gpl-2.0
trezorg/django
django/db/utils.py
151
6225
import inspect import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module DEFAULT_DB_ALIAS = 'default' # Define some exceptions that mirror the PEP249 interface. # We will rethrow any backend-specific errors using these # commo...
bsd-3-clause
wbrefvem/openshift-ansible
roles/openshift_health_checker/openshift_checks/mixins.py
26
2322
""" Mixin classes meant to be used with subclasses of OpenShiftCheck. """ class NotContainerizedMixin(object): """Mixin for checks that are only active when not in containerized mode.""" # permanent # pylint: disable=too-few-public-methods # Reason: The mixin is not intended to stand on its own as a class...
apache-2.0
keedio/hue
desktop/core/ext-py/Django-1.6.10/django/utils/functional.py
105
15418
import copy import operator from functools import wraps import sys from django.utils import six from django.utils.six.moves import copyreg # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools.partial (on # CPython) is a type and it...
apache-2.0
ericmjonas/pySpaRSA
pysparsa/sparsa.py
1
6917
import numpy as np import sys import util import time default_phi_function = lambda x: np.sum(np.abs(x)) default_psi_function = util.soft def sparsa(y, Aop, tau, stopCriterion = 2, tolA = 0.01, tolD = 0.001, debias=0, maxiter = 10000, maxiter_debias = 200, miniter = 5, miniter_debias=0, ...
mit
JohnGeorgiadis/invenio
invenio/legacy/bibsched/webapi.py
4
4015
# This file is part of Invenio. # Copyright (C) 2011, 2012, 2014, 2015 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 version...
gpl-2.0
sarvex/depot-tools
third_party/gsutil/gslib/commands/setcors.py
51
5235
# Copyright 2012 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...
bsd-3-clause
antgonza/qiime
scripts/summarize_taxa.py
15
12694
#!/usr/bin/env python # File created on 09 Feb 2010 from __future__ import division __author__ = "Rob Knight" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Rob Knight", "Catherine Lozupone", "Justin Kuczynski", "Julia Goodrich", "Daniel McDonald", "Antonio Gonzalez Pena", ...
gpl-2.0
adit-chandra/tensorflow
tensorflow/python/kernel_tests/extract_image_patches_grad_test.py
14
6046
# Copyright 2015 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
recall704/django-r3call-blog
blogproject/thirdparty/south/db/sql_server/pyodbc.py
118
19579
from datetime import date, datetime, time from warnings import warn from django.db import models from django.db.models import fields from south.db import generic from south.db.generic import delete_column_constraints, invalidate_table_constraints, copy_column_constraints from south.exceptions import ConstraintDropped f...
apache-2.0
bbannier/ROOT
interpreter/llvm/src/utils/llvm-build/llvmbuild/componentinfo.py
10
17424
""" Descriptor objects for entities that are part of the LLVM project. """ import ConfigParser import StringIO import sys from util import * class ParseError(Exception): pass class ComponentInfo(object): """ Base class for component descriptions. """ type_name = None @staticmethod def ...
lgpl-2.1
jusdng/odoo
addons/account_budget/report/analytic_account_budget_report.py
360
7589
# -*- 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
alejandrodob/mamba
mamba/reporter.py
7
1647
# -*- coding: utf-8 -*- import datetime class Reporter(object): def __init__(self, *formatters): self.listeners = formatters @property def failed_count(self): return len(self.failed_examples) def start(self): self.begin = datetime.datetime.utcnow() self.duration = d...
mit
dezynetechnologies/odoo
addons/hr_contract/hr_contract.py
302
5377
# -*- 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
haoxli/web-testing-service
wts/tests/csp/csp_script-src_unsafe-inline_unsafe-eval.py
30
2983
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "script-src 'self' 'un...
bsd-3-clause
MattCCS/PyVault
site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py
153
10350
from __future__ import absolute_import import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. ...
mit
jiangzhixiao/odoo
addons/base_geolocalize/__openerp__.py
49
1459
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
aforalee/keystone
keystone/contrib/federation/utils.py
6
26299
# 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
don-github/edx-platform
lms/djangoapps/django_comment_client/management/commands/assign_role.py
251
1144
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django_comment_common.models import Role from django.contrib.auth.models import User class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--remove', ac...
agpl-3.0