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 |
|---|---|---|---|---|---|
freegnu/spacemacs-portable | elpa/floobits-20160804.1135/floo/common/handlers/credentials.py | 10 | 2387 | import os
import sys
import uuid
import binascii
import webbrowser
try:
from . import base
from .. import api, shared as G, utils
from ... import editor
from ..exc_fmt import str_e
from ..protocols import no_reconnect
assert api and G and utils
except (ImportError, ValueError):
import base
... | agpl-3.0 |
ya-yura/snapboard | snapboard/models.py | 3 | 19422 | import logging
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.db import models, connection
from django.db.models import signals, Q
from django.dispatc... | bsd-3-clause |
yusihao51/Minecraft | terrain.py | 4 | 21887 | """
Terrain generating algorithm
"""
# Imports, sorted alphabetically.
# Python packages
from math import sqrt, floor
import random
# Third-party packages
from perlin import SimplexNoise
from noise import *
# Modules from this project
from blocks import *
from utils import FastRandom
from biome import BiomeGenerat... | mit |
alfredoavanzosc/odoomrp-wip-1 | stock_lock_lot/models/stock_production_lot.py | 14 | 2870 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api, exceptions, _
cl... | agpl-3.0 |
victormlourenco/red_kernel_lge_v500 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
rafguns/gefura | gefura.py | 1 | 6447 | # -*- coding: utf-8 -*-
"""Gefura measures for 'bridges' between node groups in a network
These measures are adaptations of betweenness centrality where only shortest
paths between nodes from different groups are taken into account. The gefura
measures thus gauge the extent to which a node bridges between groups (old
... | bsd-3-clause |
edwardgeorge/eventlet_x | eventlet/semaphore.py | 10 | 10557 | from eventlet import greenthread
from eventlet import hubs
class Semaphore(object):
"""An unbounded semaphore.
Optionally initialize with a resource *count*, then :meth:`acquire` and
:meth:`release` resources as needed. Attempting to :meth:`acquire` when
*count* is zero suspends the calling greenthread... | mit |
nabsboss/CouchPotatoServer | libs/sqlalchemy/sql/expression.py | 12 | 192463 | # sql/expression.py
# Copyright (C) 2005-2012 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
"""Defines the base components of SQL expression trees.
All components are derived ... | gpl-3.0 |
CodeDJ/qt5-hidpi | qt/qtwebkit/Tools/Scripts/webkitpy/common/config/contributionareas_unittest.py | 124 | 3225 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lgpl-2.1 |
RoadrunnerWMC/Level-Info-Editor | build_release.py | 1 | 11576 |
import json
import os, os.path
import shutil
import sys
import PyInstaller.__main__
########################################################################
############################### Constants ##############################
########################################################################
# Everything... | gpl-3.0 |
HoracioAlvarado/fwd | venv/Lib/site-packages/pip/_vendor/lockfile/sqlitelockfile.py | 536 | 5506 | from __future__ import absolute_import, division
import time
import os
try:
unicode
except NameError:
unicode = str
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based locking."
testdb = None
def __init__(self, path, ... | mit |
beppec56/core | uitest/packaging/setup.py | 1 | 1041 | from setuptools import setup, find_packages
setup(
name="libreoffice-connection",
version="0.0.1",
description="Connection code for LibreOffice's pyUNO",
long_description="",
url="http://www.libreoffice.org",
author="The LibreOffice developers",
author_email="lib... | gpl-3.0 |
tiagocoutinho/bliss | bliss/controllers/motors/template.py | 1 | 2316 | # -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import time
import serial
from bliss.controllers.motor import Controller
from bliss.comm.util import get_comm
from bliss.common import lo... | lgpl-3.0 |
ageron/tensorflow | tensorflow/lite/testing/generate_examples_report.py | 68 | 4049 | # 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 |
porcobosso/spark-ec2 | lib/boto-2.34.0/boto/gs/bucketlistresultset.py | 168 | 2923 | # Copyright 2012 Google Inc.
# Copyright (c) 2006,2007 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 ... | apache-2.0 |
bslatkin/pycon2014 | lib/asyncio-0.4.1/asyncio/subprocess.py | 16 | 6433 | __all__ = ['create_subprocess_exec', 'create_subprocess_shell']
import collections
import subprocess
from . import events
from . import futures
from . import protocols
from . import streams
from . import tasks
PIPE = subprocess.PIPE
STDOUT = subprocess.STDOUT
DEVNULL = subprocess.DEVNULL
class SubprocessStreamPro... | apache-2.0 |
felixfontein/ansible | lib/ansible/utils/encrypt.py | 11 | 9953 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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
import multiprocessing
import random
import re
impor... | gpl-3.0 |
dyyi/moneybook | venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | apache-2.0 |
vinayan3/clpricehistory | django/contrib/localflavor/pt/forms.py | 309 | 1561 | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | bsd-3-clause |
Ayub-Khan/edx-platform | common/djangoapps/student/admin.py | 22 | 6073 | """ Django admin pages for student app """
from django import forms
from django.contrib.auth.models import User
from ratelimitbackend import admin
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from config_models.admin import Config... | agpl-3.0 |
rackerlabs/solum-horizon | solumdashboard/openstack/common/importutils.py | 1 | 2387 | # Copyright 2011 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 req... | apache-2.0 |
xxsergzzxx/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/utils/compat.py | 361 | 4060 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... | apache-2.0 |
hoangt/tpzsimul.gem5 | src/python/m5/util/grammar.py | 86 | 5078 | # Copyright (c) 2006-2011 Nathan Binkert <nate@binkert.org>
# 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 ... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/distutils/core.py | 75 | 9019 | """distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
__revision__ = "$Id$"... | mit |
dfang/odoo | addons/hr/models/mail_thread.py | 20 | 1930 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, models, _
from odoo.tools import decode_message_header, email_split
_logger = logging.getLogger(__name__)
class MailThread(models.AbstractModel):
_inherit = "mail.thread"
... | agpl-3.0 |
xaowoodenfish/python-1 | bigml/tests/test_15_download_dataset.py | 1 | 2410 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015 BigML
#
# 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 b... | apache-2.0 |
shanzhenren/AFET | DataProcessor/mention_reader.py | 1 | 2145 |
import json
from mention import Mention, Sentence
class MentionReader:
"""
Mention reader. Cache one sentence in advance.
Attributes
==========
mention_file : string
mention file.
current : Sentence
current sentence.
input : File
input stream.
"""
def __ini... | gpl-3.0 |
qedsoftware/commcare-hq | corehq/apps/smsbillables/tests/utils.py | 1 | 1187 | class FakeTwilioMessage(object):
status = 'sent'
def __init__(self, price, num_segments=1):
self.price = price
self.num_segments = unicode(num_segments)
class FakeTwilioMessageFactory(object):
backend_message_id_to_num_segments = {}
backend_message_id_to_price = {}
@classmethod
... | bsd-3-clause |
UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/diagnostic_msgs/srv/_AddDiagnostics.py | 1 | 9119 | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from diagnostic_msgs/AddDiagnosticsRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class AddDiagnosticsRequest(genpy.Message):
_md5sum = "c26cf6e164288fbc6050d7... | gpl-3.0 |
BrianVermeire/PyFR | pyfr/integrators/std/steppers.py | 1 | 6853 | # -*- coding: utf-8 -*-
from pyfr.integrators.std.base import BaseStdIntegrator
class BaseStdStepper(BaseStdIntegrator):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Add kernel cache
self._axnpby_kerns = {}
def collect_stats(self, stats):
super().... | bsd-3-clause |
chidea/GoPythonDLLWrapper | bin/lib/test/test_string.py | 4 | 7879 | import unittest, string
from test import support
class ModuleTest(unittest.TestCase):
def test_attrs(self):
string.whitespace
string.ascii_lowercase
string.ascii_uppercase
string.ascii_letters
string.digits
string.hexdigits
string.octdigits
string.p... | mit |
odoo-arg/odoo_l10n_ar | l10n_ar_afip_webservices_wsaa/models/wsaa_token.py | 1 | 4231 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Licens... | agpl-3.0 |
shelsonjava/TeaJS | deps/v8/testing/gmock/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, 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 |
dav1x/ansible | lib/ansible/modules/cloud/amazon/ec2_remote_facts.py | 49 | 6567 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
lorenzo-desantis/mne-python | mne/viz/montage.py | 13 | 1786 | """Functions to plot EEG sensor montages or digitizer montages
"""
import numpy as np
def plot_montage(montage, scale_factor=1.5, show_names=False, show=True):
"""Plot a montage
Parameters
----------
montage : instance of Montage
The montage to visualize.
scale_factor : float
Dete... | bsd-3-clause |
MridulS/sympy | sympy/ntheory/residue_ntheory.py | 16 | 23167 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
from sympy.core.singleton import S
from sympy.core.numbers import igcd, igcdex
from sympy.core.compatibility import as_int, xrange
from sympy.core.function import Function
from .primetest import isprime
from .factor_ import factorint, trailing, t... | bsd-3-clause |
fibbo/DIRAC | AccountingSystem/private/Plotters/BaseReporter.py | 10 | 14674 | import time, copy, types
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.AccountingSystem.private.DBUtils import DBUtils
from DIRAC.AccountingSystem.private.DataCache import gDataCache
from DIRAC.Core.Utilities import Time
from DIRAC.AccountingSystem.private.Plots import generateNoDataPlot, generateTimedStackedBarP... | gpl-3.0 |
adrianmugnoz/Documentacion-Divulgame | fabfile-development.py | 10 | 2146 | from fabric.api import cd, env, prefix, run, sudo, task
# Fill out USER and HOSTS configuration before running
env.user = ''
env.hosts = ['']
env.code_dir = '/home/%s/rtd/checkouts/readthedocs.org' % (env.user)
env.virtualenv = '/home/%s/rtd' % (env.user)
def install_prerequisites():
"""Install prerequisites.""... | mit |
jasonwzhy/django | tests/gis_tests/geos_tests/test_geos_mutation.py | 183 | 5388 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from unittest import skipUnless
from django.contrib.gis.geos import (
HAS_GEOS, LinearRing, LineString, MultiPoint, Point, P... | bsd-3-clause |
jeffgager/heroesofthefall | playhotf/model.py | 1 | 9257 | '''
@author: Jeff
'''
import re
from string import lower
from google.appengine.api import users
from google.appengine.ext import ndb as db
from google.appengine.ext.ndb.polymodel import PolyModel
class DataModelException(Exception):
"""Raise to halt an operation and report an exception to the clien... | mit |
guschmue/tensorflow | tensorflow/contrib/rnn/python/kernel_tests/benchmarking.py | 67 | 1906 | # 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 |
behrtam/xpython | exercises/twelve-days/twelve_days_test.py | 3 | 6016 | import unittest
from twelve_days import recite
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
class TwelveDaysTest(unittest.TestCase):
def test_first_day_a_partridge_in_a_pear_tree(self):
expected = [
"On the first day of Christmas my true love gave to me: "
... | mit |
mitar/django | django/contrib/auth/tests/forms.py | 5 | 12677 | import os
from django.contrib.auth.models import User
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm)
from django.core import mail
from django.forms.fields import Field, EmailField
from django.test import TestCase
f... | bsd-3-clause |
muupan/chainer | tests/cupy_tests/math_tests/test_hyperbolic.py | 24 | 1081 | import unittest
from cupy import testing
@testing.gpu
class TestHyperbolic(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(atol=1e-5)
def check_unary(self, name, xp, dtype):
a = testing.shaped_arange((2, 3), xp, dtype)
retur... | mit |
viktorTarasov/PyKMIP | kmip/core/messages/payloads/register.py | 1 | 4057 | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | apache-2.0 |
StephenHamilton/gini | backend/src/gloader/xml/xslt/ChooseElement.py | 9 | 2811 | ########################################################################
#
# File Name: ChooseElement.py
#
#
"""
Implementation of the XSLT Spec choose instruction
WWW: http://4suite.com/4XSLT e-mail: support@4suite.com
Copyright (c) 1999-2000 FourThought Inc, USA. All Rights Reserved.
See http://... | mit |
ehostunreach/qemu | scripts/tracetool/format/tcg_helper_c.py | 77 | 1381 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generate trace/generated-helpers.c.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefa... | gpl-2.0 |
caotianwei/django | django/contrib/auth/tests/custom_user.py | 463 | 3662 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom User uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... | bsd-3-clause |
etzhou/edx-platform | common/djangoapps/external_auth/models.py | 55 | 1446 | """
WE'RE USING MIGRATIONS!
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_your_change
3. Add the migration file create... | agpl-3.0 |
rxa254/VibrationsAndWaves | Simulations/TravelingWave-Detail.py | 1 | 2009 | #!/usr/bin/env python
from __future__ import division
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
plt.style.use('seaborn-paper')
#plt.style.use('fivethirtyeight')
import numpy as np
mpl.rcParams.update({'text.usetex': True,
'lines.linewidth': 2.5,
... | mit |
akashin/HSE_AI_Labs | Lab_5/Content/Scripts/play.py | 1 | 3858 | from __future__ import print_function
import gym
from gym import wrappers
import logging
import numpy as np
try:
import cPickle as pickle
except ImportError:
import pickle
import json, sys, os
from os import path
from _policies import BinaryActionLinearPolicy # Different file so it can be unpickled
import argp... | mit |
zentralopensource/zentral | zentral/contrib/monolith/urls.py | 1 | 7961 | from django.urls import path
from django.conf.urls import url
from . import views
app_name = "monolith"
urlpatterns = [
# pkg infos
url(r'^pkg_infos/$', views.PkgInfosView.as_view(), name='pkg_infos'),
url(r'^pkg_infos/(?P<pk>\d+)/update_catalog/$',
views.UpdatePkgInfoCatalogView.as_view(),
... | apache-2.0 |
daodaoliang/python-phonenumbers | python/phonenumbers/data/region_GQ.py | 10 | 1792 | """Auto-generated file, do not edit by hand. GQ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GQ = PhoneMetadata(id='GQ', country_code=240, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[23589]\\d{8}', possible_number_pattern=... | apache-2.0 |
mattlqx/poolpi | temperature.py | 1 | 1500 | #!/usr/bin/python
# Adapted from http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/temperature/
# Run with 'cpu' argument for cpu temp, otherwise read from probe
import sys
class TemperatureProbe:
cpu_device = '/sys/class/thermal/thermal_zone0/temp'
@classmethod
def device_for_serial(cls, serial):
... | mit |
LionelJouin/Projet-STI2D-Parking-Vertical | Programme python/src/style/menu.py | 1 | 2291 | import os
from tkinter import *
from src.style.funct import *
class menu:
# est executer quand la class est demander
def __init__(self, window):
# appele de la classe de recuperation
self.menu = Canvas(window, width=128, height=480-64, background='#333333',borderwidth=0, highlightthickness=0)
self.menu.pack... | gpl-2.0 |
inkvisit/sarmacoins | contrib/devtools/update-translations.py | 1 | 6865 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | mit |
sdw2330976/zookeeper-3.3.4-source | zookeeper-release-3.4.3/src/contrib/huebrowser/zkui/src/zkui/windmilltests.py | 114 | 1033 | # 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 |
romonzaman/newfies-dialer | newfies/apirest/dnc_serializers.py | 4 | 2519 | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Bi... | mpl-2.0 |
loic/django | django/contrib/gis/db/backends/oracle/introspection.py | 539 | 1977 | import sys
import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
from django.utils import six
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDS... | bsd-3-clause |
sim0nx/python-openhab | openhab/types.py | 1 | 6800 | # -*- coding: utf-8 -*-
"""python library for accessing the openHAB REST API."""
#
# Georges Toth (c) 2016-present <georges@trypill.org>
#
# python-openhab 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, eith... | agpl-3.0 |
thaim/ansible | test/units/modules/network/f5/test_bigip_node.py | 22 | 7482 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | mit |
Zyell/home-assistant | homeassistant/components/nest.py | 1 | 1183 | """
Support for Nest thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/thermostat.nest/
"""
import logging
import socket
import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
REQUIREMENTS = ['python-nest==2.6.... | mit |
takeshineshiro/Django-facebook | open_facebook/utils.py | 24 | 8272 | import logging
import re
import sys
import functools
import json
from django.utils import six
try:
unicode = unicode
except NameError:
unicode = str
logger = logging.getLogger(__name__)
URL_PARAM_RE = re.compile('(?P<k>[^(=|&)]+)=(?P<v>[^&]+)(&|$)')
URL_PARAM_NO_VALUE_RE = re.compile('(?P<k>[^(&|?)]+)(&|$)')
... | bsd-3-clause |
stankovski/AutoRest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py | 2 | 1069 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
tirkarthi/guake | src/guake/guake_app.py | 1 | 69838 | # -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2012 Lincoln de Sousa <lincoln@minaslivre.org>
Copyright (C) 2007 Gabriel Falcão <gabrielteratos@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 Foundat... | gpl-2.0 |
hsorby/neon | src/opencmiss/neon/core/neondocument.py | 3 | 6162 | '''
Copyright 2015 University of Auckland
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 agre... | apache-2.0 |
bloy/adventofcode-2015 | dec9.py | 1 | 3119 | #!/usr/bin/env python
import re
class PathFinder(object):
REGEX = re.compile(r'^(.*)\sto\s(.*)\s=\s(\d+)$')
def __init__(self, lines):
self.places = {}
for line in lines:
(place1, place2, distance) = self.REGEX.match(line.strip()).groups()
distance = int(distance)
... | mit |
nthien/pulp | playpen/certs/revoke_cert.py | 11 | 2490 | #!/usr/bin/env python
import os
import sys
from base import run_command, get_parser, update_openssl_config
def setup_env(index_path, crlnumber_path):
if not os.path.exists(os.path.dirname(index_path)):
os.makedirs(os.path.dirname(index_path))
if not os.path.exists(os.path.dirname(crlnumber_path)):
... | gpl-2.0 |
MadanThangavelu/restblog | python/docutils/parsers/rst/languages/he.py | 57 | 3463 | # Author: Meir Kriheli
# Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language:... | bsd-3-clause |
nirs/vdsm | tests/network/unit/nmstate/ovs_bridge_test.py | 2 | 27825 | #
# Copyright 2020-2021 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | gpl-2.0 |
pombredanne/MOG | nova/api/openstack/compute/contrib/config_drive.py | 25 | 3048 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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.apach... | apache-2.0 |
daniorerio/trackpy | doc/sphinxext/plot_generator.py | 9 | 10081 | """
Sphinx plugin to run example scripts and create a gallery page.
Taken from seaborn project, which is turn was lightly
modified from the mpld3 project.
"""
from __future__ import division
import os
import os.path as op
import re
import glob
import token
import tokenize
import shutil
import json
import matplotlib
... | bsd-3-clause |
burzillibus/RobHome | venv/lib/python2.7/site-packages/django/core/cache/backends/locmem.py | 586 | 4287 | "Thread-safe in-memory cache backend."
import time
from contextlib import contextmanager
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.synch import RWLock
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
# Global in-memor... | mit |
nikste/tensorflow | tensorflow/contrib/training/python/training/feeder_test.py | 43 | 10781 | # 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 |
elkingtonmcb/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
bigswitch/nova | nova/tests/unit/test_flavors.py | 1 | 19112 | # Copyright 2011 Ken Pepple
# 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 |
JonathanStein/odoo | addons/mass_mailing/models/mass_mailing_stats.py | 222 | 5066 | # -*- 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 o... | agpl-3.0 |
vmthunder/nova | nova/tests/api/openstack/compute/plugins/v3/test_pause_server.py | 15 | 2597 | # Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
pratikmallya/hue | desktop/core/ext-py/boto-2.38.0/boto/swf/__init__.py | 145 | 1792 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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... | apache-2.0 |
photoninger/ansible | lib/ansible/modules/remote_management/wakeonlan.py | 99 | 3629 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Dag Wieers <dag@wieers.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.1',
... | gpl-3.0 |
ENjOyAbLE1991/scrapy | scrapy/downloadermiddlewares/cookies.py | 128 | 3330 | import os
import six
import logging
from collections import defaultdict
from scrapy.exceptions import NotConfigured
from scrapy.http import Response
from scrapy.http.cookies import CookieJar
from scrapy.utils.python import to_native_str
logger = logging.getLogger(__name__)
class CookiesMiddleware(object):
"""Th... | bsd-3-clause |
clach04/json-rpc | jsonrpc/manager.py | 2 | 4156 | import json
import logging
from .utils import is_invalid_params
from .exceptions import (
JSONRPCInvalidParams,
JSONRPCInvalidRequest,
JSONRPCInvalidRequestException,
JSONRPCMethodNotFound,
JSONRPCParseError,
JSONRPCServerError,
JSONRPCDispatchException,
)
from .jsonrpc1 import JSONRPC10Resp... | mit |
kdheepak89/pypdevs | pypdevs/schedulers/schedulerAH.py | 1 | 8553 | # Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at
# McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/)
#
# 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... | apache-2.0 |
hhsprings/cython | Cython/Compiler/FusedNode.py | 9 | 33517 | from __future__ import absolute_import
import copy
from . import (ExprNodes, PyrexTypes, MemoryView,
ParseTreeTransforms, StringEncoding, Errors)
from .ExprNodes import CloneNode, ProxyNode, TupleNode
from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode
class FusedCFuncDefNode(StatList... | apache-2.0 |
simonjbeaumont/sm | drivers/lvhdutil.py | 7 | 12825 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
scriptnull/coala | coalib/tests/collecting/DependenciesTest.py | 24 | 1533 | import unittest
from coalib.bears.Bear import Bear
from coalib.collecting import Dependencies
class BearWithoutDeps(Bear):
@staticmethod
def get_dependencies():
return []
class ResolvableBear1(Bear):
@staticmethod
def get_dependencies():
return [BearWithoutDeps]
class Resolvable... | agpl-3.0 |
aslab/rct | higgs/branches/ros-groovy/higgs_gazebo_simulation/rqt_robot_plugins/rqt_tf_tree/test/dotcode_tf_test.py | 1 | 3331 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, 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:
#
# * Redistributions of source code... | gpl-3.0 |
erjohnso/ansible | lib/ansible/template/safe_eval.py | 39 | 4919 | # (c) 2012, 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) any lat... | gpl-3.0 |
Mashape/analytics-agent-python | tests/test_wsgi.py | 1 | 2110 | import time
import ujson
from unittest import TestCase
from multiprocessing import Process
from six.moves.urllib.request import urlopen
from werkzeug.test import Client
from wsgiref.simple_server import make_server
from mashapeanalytics.middleware import WsgiMiddleware
from tests.helpers import mock_server
##
# Wsg... | mit |
msegado/edx-platform | openedx/core/djangoapps/credit/partition_schemes.py | 106 | 5323 | """
Partition scheme for in-course reverification.
This is responsible for placing users into one of two groups,
ALLOW or DENY, for a partition associated with a particular
in-course reverification checkpoint.
NOTE: This really should be defined in the verify_student app,
which owns the verification and reverificatio... | agpl-3.0 |
ramnes/qtile | libqtile/widget/currentscreen.py | 2 | 2296 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Alexander Fasching
#
# 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, ... | mit |
g12mcgov/home-assistant | homeassistant/components/thermostat/nest.py | 8 | 5628 | """
homeassistant.components.thermostat.nest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds support for Nest thermostats.
"""
import socket
import logging
from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL,
STATE_IDLE, STATE_HEAT)
from homeassi... | mit |
rezasafi/spark | examples/src/main/python/ml/robust_scaler_example.py | 20 | 1639 | #
# 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 |
chromium/chromium | native_client_sdk/src/build_tools/update_nacl_manifest.py | 30 | 33603 | #!/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.
"""Script that reads omahaproxy and gsutil to determine version of SDK to put
in manifest.
"""
# pylint is convinced the email mod... | bsd-3-clause |
ryancanhelpyou/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_stream.py | 446 | 6264 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import unittest
import codecs
from io import BytesIO
from six.moves import http_client
from html5lib.inputstream import (BufferedStream, HTMLInputStream,
HTMLUnicodeInputStream, ... | mpl-2.0 |
charlieyou/jsetc | strategies/mean_reversion.py | 1 | 1516 | from statistics import mean, variance
length = 10
n = 5
values = {'AAPL': [], 'GOOG': [], 'MSFT': [], 'NOKFH': [], 'NOKUS': [],
'XLK': []}
def update_values(data, symbol):
if symbol in values:
last_trades = values[symbol]
if len(last_trades) >= length:
last_trades = last_tr... | mit |
adrian-zumbler/IdealNews | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/scanner.py | 365 | 3114 | # -*- coding: utf-8 -*-
"""
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like ... | mit |
Forage/Gramps | gramps/gen/lib/addressbase.py | 1 | 5490 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2010 Michiel D. Nauta
#
# 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; e... | gpl-2.0 |
hwjworld/xiaodun-platform | common/djangoapps/student/migrations/0024_add_allow_certificate.py | 183 | 14559 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.allow_certificate'
db.add_column('auth_userprofile', 'allow_certificate',
... | agpl-3.0 |
spacecowboy/offlineimap | test/tests/test_00_imaputil.py | 14 | 3867 | # Copyright (C) 2012- Sebastian Spaeth & contributors
#
# 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-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.