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 |
|---|---|---|---|---|---|
hande-qmc/hande | tools/pyhande/tests/error_analysing/test_find_starting_iteration.py | 1 | 18296 | """Test pyhande.error_analysing.find_starting_iteration.py."""
import unittest
import numpy as np
import pandas as pd
import pyhande.error_analysing.find_starting_iteration as find_startit
from tests.create_mock_df import create_qmc_frame
import warnings
class TestFindStartingIterationsBlocking(unittest.TestCase):
... | lgpl-2.1 |
letsencrypt/letsencrypt | certbot-postfix/certbot_postfix/installer.py | 1 | 11888 | """certbot installer plugin for postfix."""
import logging
import os
import zope.interface
import zope.component
import six
from certbot import errors
from certbot import interfaces
from certbot import util as certbot_util
from certbot.plugins import common as plugins_common
from certbot_postfix import constants
fro... | apache-2.0 |
kambysese/mne-python | examples/decoding/plot_ssd_spatial_filters.py | 10 | 5433 | """
===========================================================
Compute Spectro-Spatial Decomposition (SSD) spatial filters
===========================================================
In this example, we will compute spatial filters for retaining
oscillatory brain activity and down-weighting 1/f background signals
as ... | bsd-3-clause |
procamora/Wiki-Personal | img4web.py | 2 | 11240 | #!/usr/bin/env python3
# -*- coding: <utf8> -*-
"""
img4web.py: optimize .jpg and .png images for the web
"""
#==============================================================================
# This Script optimizes .jpg and .png images for the web.
#
# This follows the "Yahoo Best Practices for Speeding Up Your We... | gpl-3.0 |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/core/validators.py | 158 | 6583 | import re
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', [], (), {})
try:
from django... | apache-2.0 |
demarle/VTK | Examples/ImageProcessing/Python/ImageInteractorReslice.py | 29 | 1614 | #!/usr/bin/env python
# A simple vtkInteractorStyleImage example for
# 3D image viewing with the vtkImageResliceMapper.
# Drag Left mouse button to window/level
# Shift-Left drag to rotate (oblique slice)
# Shift-Middle drag to slice through image
# OR Ctrl-Right drag to slice through image
import vtk
from vtk.util.... | bsd-3-clause |
Onetaway/YouCompleteMe | python/ycm/user_options_store.py | 4 | 1268 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | gpl-3.0 |
arvinls/flask | flask/debughelpers.py | 318 | 6024 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string, text_type
from .app import Flask
from .bl... | bsd-3-clause |
amwelch/a10sdk-python | a10sdk/core/lldp/lldp_management_address_dns.py | 2 | 2323 | from a10sdk.common.A10BaseClass import A10BaseClass
class Interface(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param ethernet: {"not-list": ["ve", "management"], "type": "number", "description": "configure lldp management-address interface ethernet. help-val lldp m... | apache-2.0 |
mamaddeveloper/teleadmin | modules/mod_bullshit.py | 2 | 1216 | from modules.module_base import ModuleBase
from tools.bullshit import Bullshit
class ModuleBullshit(ModuleBase):
MAX = 10
def __init__(self, bot):
ModuleBase.__init__(self, bot)
self.name = "ModuleRandShit"
self.bullshit = Bullshit()
def notify_command(self, message_id, from_attr,... | mit |
krzysztof-magosa/ansible-modules-extras | network/wakeonlan.py | 28 | 3882 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Dag Wieers <dag@wieers.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, ... | gpl-3.0 |
twz915/django | tests/custom_columns/tests.py | 31 | 3892 | from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Article, Author
class CustomColumnsTests(TestCase):
def setUp(self):
self.a1 = Author.objects.create(first_name="John", last_name="Smith")
self.a2 = Author.objects.create(first_name="Peter", last_n... | bsd-3-clause |
Gabriel-p/photom | tasks/match_manual.py | 2 | 3863 |
import numpy as np
from match_funcs import reCenter, getTriangles, findRotAngle, standard2observed
from plot_events import refDisplay, refStrSlct
def accptCoords(i):
"""
"""
while True:
answ = raw_input(
"Use coordinates ({})? (y/n): ".format(i)).strip()
if answ in ['y', 'n']:... | gpl-3.0 |
justineaster/interop | server/auvsi_suas/admin.py | 1 | 2139 | from django.contrib import admin
from auvsi_suas.models import AerialPosition
from auvsi_suas.models import FlyZone
from auvsi_suas.models import GpsPosition
from auvsi_suas.models import MissionClockEvent
from auvsi_suas.models import MissionConfig
from auvsi_suas.models import MovingObstacle
from auvsi_suas.models im... | apache-2.0 |
AnselCmy/ARPS | ML_model/model/base/word2vec.py | 3 | 4494 | # -*- coding:utf-8 -*-
from __future__ import print_function, unicode_literals
import os
import six
import numpy as np
from gensim.models import Word2Vec
from sklearn.preprocessing import StandardScaler
from model.base.document import Document
from model.config import EMBEDDING_SIZE
from model.utils import get_docume... | mit |
ojake/pytest | testing/test_session.py | 13 | 8334 | import pytest
class SessionTests:
def test_basic_testitem_events(self, testdir):
tfile = testdir.makepyfile("""
def test_one():
pass
def test_one_one():
assert 0
def test_other():
raise ValueError(23)
class Test... | mit |
silenceli/nova | nova/compute/monitors/cpu_monitor.py | 63 | 2132 | # Copyright 2013 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/django/conf/locale/en_AU/formats.py | 148 | 2111 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oc... | gpl-2.0 |
risicle/django | django/db/backends/base/creation.py | 147 | 10102 | import sys
import time
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
from django.utils.six import StringIO
from django.utils.six.moves import input
# The prefix to put on the default database name when creating
# the test database.
TEST_... | bsd-3-clause |
smnslwl/project_euler | 41/41.py | 1 | 1250 | """
We shall say that an n-digit number is pandigital if it makes use of all
the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital
and is also prime.
What is the largest n-digit pandigital prime that exists?
"""
from math import sqrt
from itertools import permutations
def is_prime(n):... | gpl-3.0 |
zcbenz/cefode-chromium | third_party/tlslite/scripts/tls.py | 83 | 38074 | #! python
import sys
import os
import os.path
import socket
import thread
import time
import httplib
import BaseHTTPServer
import SimpleHTTPServer
try:
from cryptoIDlib.api import *
cryptoIDlibLoaded = True
except:
cryptoIDlibLoaded = False
if __name__ != "__main__":
raise "This must be run as a com... | bsd-3-clause |
alheinecke/tensorflow-xsmm | tensorflow/python/ops/histogram_ops.py | 60 | 3844 | # 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 |
ak2703/edx-platform | openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py | 100 | 7464 | # -*- 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 model 'CourseCohort'
db.create_table('course_groups_coursecohort', (
('id', self.gf('dj... | agpl-3.0 |
waheedahmed/edx-platform | common/djangoapps/student/models.py | 1 | 82169 | """
Models for User Information (students, staff, etc)
Migration Notes
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration student --auto description_of_... | agpl-3.0 |
tanmaykm/edx-platform | lms/djangoapps/courseware/tests/test_masquerade.py | 2 | 18200 | """
Unit tests for masquerade.
"""
import json
import pickle
from mock import patch
from nose.plugins.attrib import attr
from datetime import datetime
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.timezone import UTC
from capa.tests.response_xml_factory import OptionR... | agpl-3.0 |
hippke/TTV-TDV-exomoons | create_figures/kombiplot_systems_i,ii,iii.py | 1 | 9451 | """n-body simulator to derive TDV+TTV diagrams of planet-moon configurations.
Credit for part of the source is given to
https://github.com/akuchling/50-examples/blob/master/gravity.rst
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
"""
import numpy
import math
import matplotlib.pylab as plt... | mit |
pfritzsche/rptoolkit | app/model.py | 1 | 1832 | # 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 th... | apache-2.0 |
sftd/scons | scons-local/SCons/Tool/FortranCommon.py | 8 | 10307 | """SCons.Tool.FortranCommon
Stuff for processing Fortran, common to all fortran dialects.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software a... | mit |
linjeffrey/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/MSVSVersion.py | 137 | 4863 | #!/usr/bin/python
# Copyright (c) 2009 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.
"""Handle version information related to Visual Stuio."""
import os
import re
import subprocess
import sys
class VisualStudioVersion:
"""In... | bsd-3-clause |
analogdevicesinc/openocd | contrib/rpc_examples/ocd_rpc_example.py | 74 | 4291 | #!/usr/bin/env python3
"""
OpenOCD RPC example, covered by GNU GPLv3 or later
Copyright (C) 2014 Andreas Ortmann (ortmann@finf.uni-hannover.de)
Example output:
./ocd_rpc_example.py
echo says hi!
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000188 msp: 0x10000... | gpl-2.0 |
mcanthony/rethinkdb | test/common/scenario_common.py | 50 | 1947 | # Copyright 2010-2014 RethinkDB, all rights reserved.
import random, shlex
import driver, utils, vcoptparse, workload_runner
def prepare_option_parser_mode_flags(opt_parser):
opt_parser["valgrind"] = vcoptparse.BoolFlag("--valgrind")
opt_parser["valgrind-options"] = vcoptparse.StringFlag("--valgrind-options"... | agpl-3.0 |
navrasio/mxnet | python/mxnet/profiler.py | 9 | 13437 | # 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 |
bzennn/blog_flask | python/lib/python3.5/site-packages/setuptools/command/egg_info.py | 50 | 25016 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.errors import DistutilsInternalError
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import... | gpl-3.0 |
rtindru/django | django/core/cache/backends/dummy.py | 629 | 1213 | "Dummy cache backend"
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
key = self.make_key... | bsd-3-clause |
openhatch/new-mini-tasks | vendor/packages/Django/tests/regressiontests/dispatch/tests/test_dispatcher.py | 56 | 5187 | import gc
import sys
import time
from django.dispatch import Signal, receiver
from django.utils import unittest
if sys.platform.startswith('java'):
def garbage_collect():
# Some JVM GCs will execute finalizers in a different thread, meaning
# we need to wait for that to complete before we go on l... | apache-2.0 |
CropCircleSys/bsd-cloudinit | cloudbaseinit/tests/utils/test_dhcp.py | 7 | 7611 | # Copyright 2014 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
crowdhackathon-transport/optimizers | crowdstance-api/venv/lib/python2.7/site-packages/werkzeug/wsgi.py | 147 | 37837 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... | mit |
mverrilli/kombu | kombu/transport/SQS.py | 4 | 16202 | """
kombu.transport.SQS
===================
Amazon SQS transport module for Kombu. This package implements an AMQP-like
interface on top of Amazons SQS service, with the goal of being optimized for
high performance and reliability.
The default settings for this module are focused now on high performance in
task queue... | bsd-3-clause |
yask123/django | django/template/backends/dummy.py | 480 | 2037 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import errno
import io
import string
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import Origin, TemplateDoesNotExist
from django.utils... | bsd-3-clause |
databricks/spark-package-cmd-tool | python/spark_package/spark_package.py | 1 | 28734 | #!/usr/bin/env python
"""
This command line tool aims to provide users a clean interface to help them in developing new
Spark Packages. Major functionalities provided by this tool:
- init Set up an empty project with the standard template
- zip Prepares the package for a release by creating a zip archive that includ... | apache-2.0 |
shearern/PyWizard | src/py_wizard/questions/SimpleQuestion.py | 1 | 2583 | '''
Created on Mar 25, 2013
@author: nate
'''
from WizQuestion import WizQuestion
class SimpleQuestion(WizQuestion):
'''A question that takes a single line of text as an answer'''
def __init__(self, name, question, default=None, max_len=None):
super(SimpleQuestion, self).__init__(name, default)
... | mit |
jstammers/EDMSuite | NavPython/IronPython/Lib/os2emxpath.py | 192 | 4603 | # Module 'os2emxpath' -- common operations on OS/2 pathnames
"""Common pathname manipulations, OS/2 EMX version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
from genericpath import *
from ntpath import (expanduser, expandvars, isabs, islink, spli... | mit |
wd5/jangr | _django/contrib/gis/gdal/__init__.py | 397 | 2173 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-... | bsd-3-clause |
sysalexis/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_simplesubclasses.py | 170 | 1289 | import unittest
from ctypes import *
class MyInt(c_int):
def __eq__(self, other):
if type(other) != MyInt:
return NotImplementedError
return self.value == other.value
class Test(unittest.TestCase):
def test_compare(self):
self.assertEqual(MyInt(3), MyInt(3))
self.a... | lgpl-3.0 |
andyzsf/django | django/db/migrations/questioner.py | 119 | 7690 | from __future__ import print_function, unicode_literals
import importlib
import os
import sys
from django.apps import apps
from django.db.models.fields import NOT_PROVIDED
from django.utils import datetime_safe, six, timezone
from django.utils.six.moves import input
from .loader import MIGRATIONS_MODULE_NAME
class... | bsd-3-clause |
declension/squeeze-alexa | squeezealexa/utils.py | 1 | 3619 | # -*- coding: utf-8 -*-
#
# Copyright 2017-18 Nick Boultbee
# This file is part of squeeze-alexa.
#
# squeeze-alexa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... | gpl-3.0 |
graphite/TeX4Web-INVENIO | modules/bibindex/web/admin/bibindexadmin.py | 10 | 28174 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your ... | gpl-2.0 |
Mistobaan/tensorflow | tensorflow/contrib/timeseries/python/timeseries/state_space_models/periodic.py | 92 | 24154 | # 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 |
gnowgi/gnowsys-studio | objectapp/management/commands/wp2objectapp.py | 3 | 17656 | # Copyright (c) 2011, 2012 Free Software Foundation
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later vers... | agpl-3.0 |
genome-vendor/protobuf | python/google/protobuf/internal/encoder.py | 484 | 25695 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
geoadmin/mapproxy | mapproxy/client/http.py | 5 | 10298 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | apache-2.0 |
azariven/BioSig_SEAS | bin_stable/Retrieval/test_run_mcmc.py | 1 | 8668 | """
"""
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d
DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(DIR, '../..'))
from SEAS_ML.MCMC.retrieve_on_water_VMR import generate_water_VMR,generate_mixing_ratio_file
imp... | gpl-3.0 |
danieljaouen/ansible | lib/ansible/modules/web_infrastructure/taiga_issue.py | 55 | 10818 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Alejandro Guirao <lekumberri@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.... | gpl-3.0 |
Kemanth/Implementation-of-MRED-in-NS3 | utils.py | 179 | 4188 | #! /usr/bin/env python
# These methods are used by test.py and waf to look for and read the
# .ns3rc configuration file, which is used to specify the modules that
# should be enabled
import os
import sys
def get_list_from_file(file_path, list_name):
'''Looks for a Python list called list_name in the file specifi... | gpl-2.0 |
dleehr/cwltool | cwltool/schemas/v1.1.0-dev1/salad/schema_salad/tests/test_errors.py | 1 | 1480 | from __future__ import absolute_import
from __future__ import print_function
from .util import get_data
import unittest
from schema_salad.schema import load_schema, load_and_validate
from schema_salad.validate import ValidationException
from avro.schema import Names
import six
class TestErrors(unittest.TestCase):
... | apache-2.0 |
sergiopasra/numina | numina/util/context.py | 3 | 1681 | import contextlib
import os
@contextlib.contextmanager
def working_directory(path):
"""A context manager which changes the working directory to the given
path, and then changes it back to its previous value on exit.
"""
# http://code.activestate.com/recipes/576620-changedirectory-context-manager/
... | gpl-3.0 |
listochkin/EmberOverflow-OdessaJS-2014 | client/node_modules/ember-cli/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | isc |
pabell/stingray | stingray/bispectrum.py | 1 | 17049 | from __future__ import division
import numpy as np
from scipy.linalg import toeplitz
from scipy.fftpack import fftshift, fft2, ifftshift, fft
from scipy.linalg import hankel
from stingray import lightcurve
import stingray.utils as utils
class Bispectrum(object):
def __init__(self, lc, maxlag=None, window=None,... | mit |
amite/ghostblog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_postgres_builtins.py | 95 | 9692 | # -*- coding: utf-8 -*-
"""
pygments.lexers._postgres_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Self-updating data files for PostgreSQL lexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import urllib.request, urllib.p... | mit |
Fox32/three.js | utils/exporters/blender/addons/io_three/exporter/utilities.py | 225 | 1229 | import uuid
import hashlib
from .. import constants
ROUND = constants.DEFAULT_PRECISION
def bit_mask(flags):
"""Generate a bit mask.
:type flags: dict
:return: int
"""
bit = 0
true = lambda x, y: (x | (1 << y))
false = lambda x, y: (x & (~(1 << y)))
for mask, position in constant... | mit |
eamuntz/Django-Tut | env/lib/python2.7/site-packages/django/contrib/formtools/preview.py | 315 | 5754 | """
Formtools Preview application.
"""
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_time_compare
from django.contrib.formtools.utils import form_hmac
AUTO_ID = 'formtools_%s' # Each form here... | mit |
danielet/ns3Bayes | src/flow-monitor/examples/flowmon-parse-results.py | 86 | 5709 | from __future__ import division
import sys
import os
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
def parse_time_ns(tm):
if tm.endswith('ns'):
return long(tm[:-4])
raise ValueError(tm)
class FiveTuple(object):
__slots__ = ['... | gpl-2.0 |
ppiotr/Invenio | modules/websubmit/lib/functions/Create_Modify_Interface.py | 19 | 12898 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at... | gpl-2.0 |
akopytov/percona-xtrabackup | storage/innobase/xtrabackup/test/python/testtools/tests/test_runtest.py | 42 | 10423 | # Copyright (c) 2009-2010 testtools developers. See LICENSE for details.
"""Tests for the RunTest single test execution logic."""
from testtools import (
ExtendedToOriginalDecorator,
run_test_with,
RunTest,
TestCase,
TestResult,
)
from testtools.matchers import MatchesException, Is, Raises
fro... | gpl-2.0 |
csitarichie/boost_msm_bare_metal | boost/tools/build/v2/test/remove_requirement.py | 20 | 1779 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
project : requirements <threading>multi... | gpl-2.0 |
GoogleCloudPlatform/ml-on-gcp | example_zoo/tensorflow/models/keras_cifar_main/official/resnet/keras/keras_cifar_main.py | 1 | 6886 | # 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 |
toshywoshy/ansible | test/units/modules/network/fortios/test_fortios_firewall_address6.py | 21 | 12605 | # Copyright 2019 Fortinet, 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
PhiInnovations/mdp28-linux-bsp | meta/recipes-devtools/python/python/sitecustomize.py | 228 | 1125 | # OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# GPLv2 or later
# Version: 20081123
# Features:
# * set proper default encoding
# * enable readline completion in the interactive interpreter
# * load command line history on startup
# * save command line history on exit
i... | mit |
mengxn/tensorflow | tensorflow/python/kernel_tests/confusion_matrix_test.py | 52 | 17490 | # 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 |
philsch/ansible | lib/ansible/modules/system/filesystem.py | 48 | 9301 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@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 t... | gpl-3.0 |
s-hertel/ansible | test/integration/targets/ansible-galaxy-collection/files/test_module.py | 21 | 2140 | # -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMEN... | gpl-3.0 |
MattsFleaMarket/python-for-android | python-build/python-libs/gdata/samples/calendar/calendarExample.py | 87 | 25789 | #!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
tdsmith/eleven | eleven/test_eleven.py | 1 | 7669 | #!/usr/bin/env python
import unittest
from eleven import *
from types import *
from sys import stdout
import os
import pandas as pd
mean = lambda seq: float(sum(seq))/len(seq)
class TestExpression(unittest.TestCase):
def setUp(self):
self.sample_list = [
['Exp1', 'Sample 1', 5.0],
... | bsd-2-clause |
jonathansiebert/learning_journal | test_journal.py | 1 | 5654 | # -*- coding: utf-8 -*-
from contextlib import closing
import pytest
import os
from flask import session
from journal import app
from journal import connect_db
from journal import get_database_connection
from journal import init_db
TEST_DSN = 'dbname=test_learning_journal user=' + \
os.environ.get('USER', 'postg... | mit |
zhangzhehust/htcondor | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/pl.py | 10 | 7899 | apiAttachAvailable = u'API jest dost\u0119pne'
apiAttachNotAvailable = u'Niedost\u0119pny'
apiAttachPendingAuthorization = u'Autoryzacja w toku'
apiAttachRefused = u'Odmowa'
apiAttachSuccess = u'Sukces'
apiAttachUnknown = u'Nieznany'
budDeletedFriend = u'Usuni\u0119ty z listy znajomych'
budFriend = u'Znajomy'
b... | apache-2.0 |
grnet/django_oam | utils/rrd.py | 1 | 5380 | #!/usr/bin/python
import urllib
import rrdtool
import os
from helper_functions import get_ends, get_carrier
from oam_multiconnect import get_graph_data
rrd_dir = os.path.join('/'.join(os.path.abspath(__file__).split('/')[:-2]), 'rrd')
DATASOURCE_DICT = {
'average_twoway_delay_variation': 'av2dv',
'average_two... | gpl-2.0 |
paralysedforce/Recipe-Project | Team7/parser2.py | 1 | 3327 | #!usr/bin/python
from string import punctuation
import re
from collections import namedtuple
import nltk.corpus
from data import *
import scrape
Quantity = namedtuple('Quantity', ['amount', 'unit'])
Ingredient = namedtuple('Ingredient', ['name', 'quantity', 'descriptors'])
def parse_ingredient(ingredients):
"""... | mit |
renard/ansible | lib/ansible/plugins/lookup/file.py | 75 | 2847 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: file
author: Daniel H... | gpl-3.0 |
amith01994/intellij-community | plugins/hg4idea/testData/bin/mercurial/httpconnection.py | 91 | 10916 | # httpconnection.py - urllib2 handler for new http support
#
# Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
# Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
# Copyright 2011 Google, Inc.
#
# This software may be used and distribu... | apache-2.0 |
gurneyalex/OpenUpgrade | addons/plugin/plugin_handler.py | 39 | 8515 | '''
Created on 18 oct. 2011
@author: openerp
'''
from openerp.osv import osv
from openerp.tools.translate import _
class plugin_handler(osv.osv_memory):
_name = 'plugin.handler'
def _make_url(self, cr, uid, res_id, model, context=None):
"""
@param res_id: on which document the message is... | agpl-3.0 |
edespino/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/pg_twophase/switch_ckpt_a/trigger_sql/test_triggersqls.py | 42 | 1219 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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 |
skelton/G5_444 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
shi2wei3/tp-libvirt | libguestfs/tests/virt_list_operations.py | 8 | 2424 | import logging
import re
from autotest.client.shared import error
from virttest import utils_libguestfs as lgf
from virttest import utils_test
def run(test, params, env):
"""
Test libguestfs with list commands: virt-list-partitions, virt-filesystems
virt-df, virt-list-f... | gpl-2.0 |
pakozm/camp | install.py | 1 | 1665 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Installation script"""
import getpass
from subprocess import check_call, Popen
WPA_SUPPLICANT_CONF = "/etc/wpa_supplicant/wpa_supplicant.conf"
WIFI_CONFIG = """
network={
ssid="{}"
psk="{}"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
"""
def re... | mit |
alangwansui/mtl_ordercenter | openerp/addons/account/report/account_partner_balance.py | 40 | 12701 | # -*- 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 |
cirocfc/djangoproject | configs/settings.py | 1 | 2922 | """
Django settings for configs project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ... | mit |
rangadi/incubator-beam | sdks/python/apache_beam/metrics/cells.py | 5 | 16147 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
fighterlyt/bite-project | tools/bugs/server/appengine/providers/services.py | 17 | 3225 | # Copyright 2011 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 |
mmariani/dream | dream/simulation/Examples/TwoServers.py | 1 | 2489 | from dream.simulation.imports import Machine, Source, Exit, Part, G, Repairman, Queue, Failure
from dream.simulation.imports import simulate, activate, initialize
#define the objects of the model
R=Repairman('R1', 'Bob')
S=Source('S1','Source', interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.P... | gpl-3.0 |
rajashreer7/autotest-client-tests | linux-tools/augeas/augeas.py | 3 | 1381 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class augeas(test.test):
"""
Autotest module for testing basic functionality
of augeas
@author Mithu Ganesan<miganesa@in.ibm.com> #
"""
version = 1
nfail ... | gpl-2.0 |
argonemyth/sentry | tests/sentry/web/frontend/test_organization_audit_log.py | 25 | 1571 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import AuditLogEntry, AuditLogEntryEvent
from sentry.testutils import TestCase, PermissionTestCase
class OrganizationAuditLogPermissionTest(PermissionTestCase):
def setUp(self):
super(OrganizationAudit... | bsd-3-clause |
carlosalaniz/dogo-property-magament-system | vendor/psy/psysh/test/tools/gen_unvis_fixtures.py | 174 | 3123 | #! /usr/bin/env python3
import sys
from os.path import abspath, expanduser, dirname, join
from itertools import chain
import json
import argparse
from vis import vis, unvis, VIS_WHITE
__dir__ = dirname(abspath(__file__))
OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json')
# Add custom fixtures her... | mit |
Vagab0nd/SiCKRAGE | lib3/future/types/newlist.py | 82 | 2284 | """
A list subclass for Python 2 that behaves like Python 3's list.
The primary difference is that lists have a .copy() method in Py3.
Example use:
>>> from builtins import list
>>> l1 = list() # instead of {} for an empty list
>>> l1.append('hello')
>>> l2 = l1.copy()
"""
import sys
import copy
from future.ut... | gpl-3.0 |
gvb/odoo | openerp/modules/__init__.py | 352 | 1516 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
Tigerwhit4/taiga-back | taiga/base/status.py | 18 | 2861 | # Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | agpl-3.0 |
Cadasta/django-jsonattrs | docs/source/conf.py | 1 | 9744 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# django-jsonattrs documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 20 12:24:00 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in ... | agpl-3.0 |
eul721/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/copy_reg.py | 442 | 6800 | """Helper to provide extensibility for pickle/cPickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
from types import ClassType as _ClassType
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extens... | gpl-2.0 |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/boto/boto/emr/bootstrap_action.py | 153 | 1830 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010 Yelp
#
# 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... | apache-2.0 |
SickGear/SickGear | sickbeard/providers/torrenting.py | 2 | 5059 | # coding=utf-8
#
# This file is part of SickGear.
#
# SickGear 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.
#
# SickGear is distribu... | gpl-3.0 |
DT42/BerryNet | berrynet/client/dashboard.py | 1 | 2725 | # Copyright 2018 DT42
#
# This file is part of BerryNet.
#
# BerryNet 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.
#
# BerryNet is d... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.