repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
mKeRix/home-assistant | homeassistant/components/bbox/sensor.py | 16 | 6275 | """Support for Bbox Bouygues Modem Router."""
from datetime import timedelta
import logging
import pybbox
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_MONITORED_VARIABLES,
CONF_NAME,
DATA_R... | mit |
talha81/TACTIC-DEV | src/bin/fixes/mod_widget_config_code.py | 6 | 1161 | import sys
import tacticenv
from pyasm.biz import Project
from pyasm.security import Batch
from pyasm.command import Command
from pyasm.search import Search
class ModCodeCmd(Command):
def execute(my):
search = Search('config/widget_config')
sobjects = search.get_sobjects()
... | epl-1.0 |
rizac/gfz-reportgen | gfzreport/sphinxbuild/map/__init__.py | 2 | 43603 | '''
This module implements the function `plotmap` which plots scattered points on a map
retrieved using ArgGIS Server REST API. The function is highly customizable and is basically a
wrapper around the `Basemap` library (for the map background)
plus matplotlib utilities (for plotting points, shapes, labels and legend)
... | gpl-3.0 |
horstjens/internationalopenmagazine | plugins/tag_cloud/tag_cloud.py | 39 | 2377 | '''
tag_cloud
===================================
This plugin generates a tag cloud from available tags
'''
from __future__ import unicode_literals
from collections import defaultdict
from operator import attrgetter, itemgetter
import logging
import math
import random
from pelican import signals, contents
logger =... | gpl-3.0 |
theatlantic/django-categories | categories/editor/templatetags/admin_tree_list_tags.py | 8 | 6665 | import django
from django.db import models
from django.template import Library
from django.contrib.admin.templatetags.admin_list import result_headers, _boolean_icon
try:
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
except ImportError:
from categories.editor.utils impor... | apache-2.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/boto-2.19.0-py2.7.egg/boto/mws/connection.py | 2 | 34595 | # Copyright (c) 2012 Andy Davidoff http://www.disruptek.com/
#
# 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, mod... | apache-2.0 |
Syrcon/servo | components/script/dom/bindings/codegen/parser/tests/test_const.py | 134 | 3000 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestConsts {
const byte zero = 0;
const byte b = -1;
const octet o = 2;
const short s = -3;
const unsigned short us = 0x4;
const long l = -0X5;
const unsigned long... | mpl-2.0 |
leandro86/epubcreator | epubcreator/epubbase/ebook.py | 1 | 14784 | import os
from lxml import etree
from epubcreator.pyepub.pyepubwriter import epub
from epubcreator.epubbase import ebook_metadata, ebook_data, files, images
from epubcreator.misc import utils
from epubcreator.misc.options import Options, Option
class Ebook(Options):
OPTIONS = [Option(name="includeOptionalFiles"... | unlicense |
daishaowei/dpark | dpark/serialize.py | 6 | 9855 | import sys, types
from cStringIO import StringIO
import marshal, new, cPickle
import itertools
from pickle import Pickler, whichmodule
import logging
logger = logging.getLogger(__name__)
class MyPickler(Pickler):
dispatch = Pickler.dispatch.copy()
@classmethod
def register(cls, type, reduce):
def ... | bsd-3-clause |
yglazko/bedrock | bedrock/mozorg/tests/test_credits.py | 29 | 3418 | # -*- coding: utf-8 -*-
# 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/.
from collections import OrderedDict
from mock import Mock
from bedrock.mozorg import credits
fr... | mpl-2.0 |
spencerrecneps/tdg-heroku-test | src/project/wsgi.py | 8 | 1436 | """
WSGI config for project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | gpl-3.0 |
rjwil1086/android_kernel_hp_pine | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
sdh11/gnuradio | gr-uhd/apps/uhd_app.py | 7 | 19018 | #!/usr/bin/env python
#
# Copyright 2015-2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
srimai/odoo | addons/project/wizard/project_task_delegate.py | 142 | 6479 | # -*- 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 |
lmyrefelt/CouchPotatoServer | libs/requests/packages/chardet/hebrewprober.py | 215 | 13240 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | gpl-3.0 |
luca76/QGIS | python/console/console_editor.py | 4 | 58453 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Console for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) com
***... | gpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pillow-2.9.0/PIL/ImagePalette.py | 26 | 6692 | #
# The Python Imaging Library.
# $Id$
#
# image palette object
#
# History:
# 1996-03-11 fl Rewritten.
# 1997-01-03 fl Up and running.
# 1997-08-23 fl Added load hack
# 2001-04-16 fl Fixed randint shadow bug in random()
#
# Copyright (c) 1997-2001 by Secret Labs AB
# Copyright (c) 1996-1997 by Fredrik Lundh
#
... | mit |
davidjrichardson/uwcs-zarya | events/migrations/0002_auto_20160917_1617.py | 1 | 4285 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-17 16:17
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.bloc... | mit |
redhat-openstack/nova | nova/tests/virt/test_volumeutils.py | 36 | 1781 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright 2012 University Of Minho
# Copyright 2010 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
... | apache-2.0 |
MotorolaMobilityLLC/external-chromium_org | native_client_sdk/src/tools/tests/quote_test.py | 54 | 5596 | #!/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.
import optparse
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.... | bsd-3-clause |
praekelt/go-http-api | go_http/tests/test_account.py | 1 | 8152 | """
Tests for go_http.account
"""
import collections
import copy
import json
from unittest import TestCase
from requests import HTTPError, Session
from requests.adapters import HTTPAdapter
from requests_testadapter import TestSession, Resp, TestAdapter
from go_http.account import AccountApiClient
from go_http.except... | bsd-3-clause |
tscohen/chainer | examples/word2vec/train_word2vec.py | 9 | 5456 | #!/usr/bin/env python
"""Sample script of word embedding model.
This code implements skip-gram model and continuous-bow model.
Use ../ptb/download.py to download 'ptb.train.txt'.
"""
import argparse
import collections
import time
import numpy as np
import six.moves.cPickle as pickle
import chainer
from chainer impor... | mit |
artminster/artminster | core/utils/fields.py | 1 | 10035 | from django.utils.translation import ugettext as _
from django.db import models, connection
from django.utils.text import capfirst
from itertools import chain
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode, smart_unicode
fro... | mit |
gnieboer/gnuradio | gr-wxgui/python/wxgui/gui.py | 76 | 4565 | #
# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-3.0 |
crcresearch/osf.io | scripts/tests/test_embargo_registrations.py | 17 | 6441 | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.utils import timezone
from nose.tools import * # noqa
from tests.base import OsfTestCase
from osf_tests.factories import RegistrationFactory, UserFactory
from scripts.embargo_registrations import main
class TestRetractRegistrations(OsfTestCase):
... | apache-2.0 |
girving/tensorflow | tensorflow/compiler/tests/nullary_ops_test.py | 19 | 2828 | # 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 |
stclair/wes-cms | django/conf/global_settings.py | 95 | 21089 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | bsd-3-clause |
thinkerou/grpc | tools/run_tests/performance/patch_scenario_results_schema.py | 16 | 1841 | #!/usr/bin/env python
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/docutils/parsers/rst/languages/he.py | 128 | 3640 | # Author: Meir Kriheli
# Id: $Id: he.py 7119 2011-09-02 13:00:23Z milde $
# 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: ... | gpl-2.0 |
apache/dispatch | tests/mock/dispatch.py | 6 | 1917 | # 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 |
rubencabrera/odoo | addons/l10n_co/wizard/__init__.py | 313 | 1165 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) David Arnold (devCO).
# Author David Arnold (devCO), dar@devco.co
# Co-Authors Juan Pablo Aries (devCO), jpa@devco.co
# Hector Iva... | agpl-3.0 |
tiwillia/openshift-tools | ansible/roles/lib_openshift_3.2/build/src/oc_serviceaccount.py | 13 | 2920 | # pylint: skip-file
# pylint: disable=too-many-instance-attributes
class OCServiceAccount(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'sa'
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
config,
verbose=False):
... | apache-2.0 |
nopjmp/SickRage | lib/pgi/codegen/cbargs.py | 19 | 3599 | # Copyright 2013 Christoph Reiter
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
from pgi.clib.gir import G... | gpl-3.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/turtle.py | 70 | 143547 | #
# turtle.py: a Tkinter based turtle graphics module for Python
# Version 1.1b - 4. 5. 2009
#
# Copyright (C) 2006 - 2010 Gregor Lingl
# email: glingl@aon.at
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from th... | lgpl-3.0 |
meteorcloudy/tensorflow | tensorflow/python/debug/lib/debug_graph_reconstruction_test.py | 13 | 7413 | # 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 |
warner83/micropython | tests/basics/unpack1.py | 57 | 1749 | # unpack sequences
a, = 1, ; print(a)
a, b = 2, 3 ; print(a, b)
a, b, c = 1, 2, 3; print(a, b, c)
a, = range(1); print(a)
a, b = range(2); print(a, b)
a, b, c = range(3); print(a, b, c)
(a) = range(1); print(a)
(a,) = range(1); print(a)
(a, b) = range(2); print(a, b)
(a, b, c) = range(3); print(a, b, c)
# lists... | mit |
JioCloud/oslo-incubator | openstack/common/db/sqlalchemy/migration.py | 1 | 10048 | # coding: utf-8
#
# Copyright (c) 2013 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
#
# Unle... | apache-2.0 |
aron-bordin/kivy-designer | designer/components/start_page.py | 4 | 2797 | import webbrowser
from designer.utils.utils import get_designer, get_fs_encoding
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.scrollview import ScrollView
class DesignerLinkLabel(Button):
'''DesignerLinkLabel ... | mit |
heiths/allura | Allura/allura/tests/test_decorators.py | 3 | 1951 | # 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 (t... | apache-2.0 |
enikesha/pacioli | pacioli/views.py | 1 | 31775 | # Copyright (c) 2014, Satoshi Nakamoto Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditio... | bsd-3-clause |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_4/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py | 88 | 14807 | from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.formtools.wizard.views import (NamedUrlSessionWizardView,
NamedUrlCookieWizardView)
from dj... | mit |
n0trax/ansible | lib/ansible/modules/packaging/language/cpanm.py | 14 | 6523 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Franck Cuny <franck@lumberjaph.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jpasosa/asturiana | plugins/apostrophePlugin/web/js/fckeditor/fckeditor.py | 86 | 4371 | """
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/license... | mit |
yanlend/scikit-learn | doc/datasets/mldata_fixture.py | 367 | 1183 | """Fixture module to skip the datasets loading when offline
Mock urllib2 access to mldata.org and create a temporary data folder.
"""
from os import makedirs
from os.path import join
import numpy as np
import tempfile
import shutil
from sklearn import datasets
from sklearn.utils.testing import install_mldata_mock
fr... | bsd-3-clause |
Russell-IO/ansible | test/runner/lib/sanity/pep8.py | 28 | 6213 | """Sanity test for PEP 8 style guidelines using pycodestyle."""
from __future__ import absolute_import, print_function
import os
import re
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
)
from lib.util import (
SubprocessError,
display,
run_comm... | gpl-3.0 |
waseem18/bedrock | vendor-local/lib/python/south/creator/freezer.py | 129 | 7258 | """
Handles freezing of models into FakeORMs.
"""
from __future__ import print_function
import sys
from django.db import models
from django.db.models.base import ModelBase, Model
from django.contrib.contenttypes.generic import GenericRelation
from south.utils import get_attribute, auto_through
from south import mod... | mpl-2.0 |
dermoth/gramps | gramps/gen/utils/place.py | 4 | 31276 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2009 B. Malengier
# Copyright (C) 2009 Swoon on bug tracker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | gpl-2.0 |
aidanlister/django | django/contrib/gis/sitemaps/views.py | 341 | 2421 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.functions import AsKML, Transform
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExi... | bsd-3-clause |
zding5/Microblog-Flask | flask/lib/python2.7/site-packages/pbr/git.py | 25 | 9311 | # Copyright 2011 OpenStack LLC.
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# 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
#
# htt... | mit |
Motorhead1991/android_kernel_samsung_s5pv210 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
rdmorganiser/rdmo | rdmo/projects/models/value.py | 1 | 6697 | import mimetypes
from pathlib import Path
import iso8601
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django_cleanup import cleanup
from rdmo.core.constants import (VALUE_TYPE_BOOLEAN, VALUE_TYPE_CHOICES,
VALU... | apache-2.0 |
sxjscience/tvm | tests/python/relay/test_ir_parser.py | 1 | 22635 | # 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 |
yrobla/nova | nova/api/openstack/compute/contrib/floating_ip_dns.py | 4 | 10974 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Andrew Bogott for the Wikimedia Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | apache-2.0 |
pombredanne/django-rest-framework | tests/test_validators.py | 2 | 15929 | import datetime
from django.db import models
from django.test import TestCase
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
def dedent(blocktext):
return '\n'.join([line[12:] for line in blocktext.splitlines()[1:-1]])
# Tests for `UniqueValidator`
# -------------... | bsd-2-clause |
highweb-project/highweb-webcl-html5spec | third_party/jinja2/_compat.py | 638 | 4042 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | bsd-3-clause |
lokeshh/lokeshh-stem | stem/util/lru_cache.py | 7 | 7373 | # Drop in replace for python 3.2's collections.lru_cache, from...
# http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/
#
# ... which is under the MIT license. Stem users should *not* rely upon this
# module. It will be removed when we drop support for python 3.2 and below.
"""
M... | lgpl-3.0 |
jbtule/keyczar | cpp/src/tools/swtoolkit/test/help_test.py | 18 | 2153 | #!/usr/bin/python2.4
# 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 of... | apache-2.0 |
ewheeler/tracpro | tracpro/msgs/tests.py | 1 | 4100 | from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils import timezone
from mock import patch
from temba.types import Broadcast
from tracpro.msgs.models import Message, COHORT_ALL, COHORT_RESPONDENTS, COHOR... | bsd-3-clause |
masterkorp/obfsproxy | obfsproxy/transports/obfs3_dh.py | 15 | 3248 | import binascii
import obfsproxy.common.rand as rand
import obfsproxy.common.modexp as modexp
def int_to_bytes(lvalue, width):
fmt = '%%.%dx' % (2*width)
return binascii.unhexlify(fmt % (lvalue & ((1L<<8*width)-1)))
class UniformDH:
"""
This is a class that implements a DH handshake that uses public
... | bsd-3-clause |
Carmezim/tensorflow | tensorflow/python/client/device_lib.py | 149 | 1308 | # 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 |
subutai/nupic | examples/prediction/experiments/dutyCycle/problem/description.py | 50 | 1547 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
wdaher/zulip | zerver/management/commands/process_queue.py | 120 | 1460 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from django.conf import settings
from zerver.worker.queue_processors import get_worker
import sys
import signal
import logging
class Command(BaseCommand):
def add_arguments(se... | apache-2.0 |
mrnamingo/vix4-34-enigma2-bcm | lib/python/Components/Converter/ServiceOrbitalPosition.py | 102 | 1768 | # -*- coding: utf-8 -*-
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceCenter
from ServiceReference import resolveAlternate
from Components.Element import cached
class ServiceOrbitalPosition(Converter, object):
FULL = 0
SHO... | gpl-2.0 |
sparkslabs/kamaelia | Sketches/JMB/Logger/Log.py | 3 | 7081 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | apache-2.0 |
xhchrn/gegan | train.py | 1 | 3732 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import argparse
from model.gegan import GEGAN
parser = argparse.ArgumentParser(description='Train')
parser.add_argument('--experiment_dir', dest='experiment_dir', required=True,
... | apache-2.0 |
Bloodyaugust/sugarlabcppboilerplate | lib/boost/tools/build/src/build/build_request.py | 6 | 8018 | # Status: being ported by Vladimir Prus
# TODO: need to re-compare with mainline of .jam
# Base revision: 40480
#
# (C) Copyright David Abrahams 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provide... | gpl-2.0 |
cdgriffith/PyFoto | pyfoto/config.py | 1 | 2058 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import logging
import yaml
import reusables
default_config = dict(
storage_directory="storage",
# TODO add {date}, {time}, {type}, {hash}, {size}
dir_names="{increment}",
file_names="{increment}.{ext}",
remove_source=False,
folder_limit... | mit |
endlessm/chromium-browser | tools/json_schema_compiler/h_generator.py | 4 | 15267 | # 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.
import os
from code import Code
from model import PropertyType
import cpp_util
import schema_util
class HGenerator(object):
def __init__(self, type_g... | bsd-3-clause |
DanielSBrown/osf.io | api_tests/guids/views/test_guid_detail.py | 8 | 6233 | from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from website.files.models.osfstorage import OsfStorageFile
from website.settings import API_DOMAIN
from tests.base import ApiTestCase
from tests.factories import (AuthUserFactory, ProjectFactory, RegistrationFactory,
... | apache-2.0 |
terbolous/SickRage | lib/github/InputGitAuthor.py | 47 | 2633 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Google/Gmailv2/Threads/DeleteThread.py | 5 | 4936 | # -*- coding: utf-8 -*-
###############################################################################
#
# DeleteThread
# Permanently deletes a specific thread.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this ... | apache-2.0 |
Ictp/indico | bin/utils/changeStyle.py | 1 | 1781 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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... | gpl-3.0 |
40223226/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/keyword.py | 761 | 2049 | #! /usr/bin/env python3
"""Keywords (from "graminit.c")
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree after building the interpreter and run:
./python Lib/keyword.py
"""
__all__ = ["iskeyword", "kwlist"]
k... | gpl-3.0 |
msimacek/samba | python/samba/schema.py | 33 | 8356 | #
# Unix SMB/CIFS implementation.
# backend code for provisioning a Samba4 server
#
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009
# Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009
#
# This program is free software; you can redistribute ... | gpl-3.0 |
mastizada/kuma | vendor/packages/nose/functional_tests/test_cases.py | 10 | 1232 | import unittest
from nose.config import Config
from nose import case
from nose.plugins import Plugin, PluginManager
class TestTestCasePluginCalls(unittest.TestCase):
def test_describe_test_called(self):
class Descrip(Plugin):
counter = 0
enabled = True
def describeTest(... | mpl-2.0 |
nhazekam/cctools | weaver/src/weaver/function.py | 13 | 10224 | # Copyright (c) 2010- The University of Notre Dame.
# This software is distributed under the GNU General Public License.
# See the file COPYING for details.
""" Weaver function module """
from weaver.compat import callable, getfuncname
from weaver.data import parse_input_list, parse_output_list
from weaver.logger... | gpl-2.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/scipy/optimize/tests/test_cobyla.py | 100 | 3562 | from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.testing import assert_allclose, TestCase, run_module_suite, \
assert_
from scipy.optimize import fmin_cobyla, minimize
class TestCobyla(TestCase):
def setUp(self):
self.x0 = [4.95, 0.66]
... | gpl-3.0 |
cancan101/tensorflow | tensorflow/python/kernel_tests/metrics_test.py | 11 | 129672 | # 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 |
Fat-Zer/FreeCAD_sf_master | src/Mod/Fem/femexamples/meshes/mesh_rc_wall_2d_tria6.py | 23 | 82470 | def create_nodes(femmesh):
# nodes
femmesh.addNode(0.0, 0.0, 0.0, 1)
femmesh.addNode(0.0, 2000.0, 0.0, 2)
femmesh.addNode(500.0, 0.0, 0.0, 3)
femmesh.addNode(4000.0, 2000.0, 0.0, 4)
femmesh.addNode(3500.0, 0.0, 0.0, 5)
femmesh.addNode(4000.0, 0.0, 0.0, 6)
femmesh.addNode(0.0, -2000.0, 0.... | lgpl-2.1 |
beni55/scrapy | tests/test_dupefilter.py | 25 | 1609 | import hashlib
import unittest
from scrapy.dupefilter import RFPDupeFilter
from scrapy.http import Request
class RFPDupeFilterTest(unittest.TestCase):
def test_filter(self):
dupefilter = RFPDupeFilter()
dupefilter.open()
r1 = Request('http://scrapytest.org/1')
r2 = Request('http... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/dates.py | 6 | 52305 | """
Matplotlib provides sophisticated date plotting capabilities, standing on the
shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and
:mod:`dateutil`. :class:`datetime` objects are converted to floating point
numbers which represent time in days since 0001-01-01 UTC, plus 1. For
example, 0001-01-0... | gpl-3.0 |
tkaitchuck/nupic | external/common/lib/python2.6/site-packages/logilab/astng/test/unittest_inference.py | 1 | 41136 | # copyright 2003-2010 Sylvain Thenault, all rights reserved.
# contact mailto:thenault@gmail.com
#
# This file is part of logilab-astng.
#
# logilab-astng 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,... | gpl-3.0 |
MattsFleaMarket/python-for-android | python-modules/twisted/twisted/web/test/test_httpauth.py | 49 | 21718 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web._auth}.
"""
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet.error im... | apache-2.0 |
Livit/Livit.Learn.EdX | common/lib/dogstats/dogstats_wrapper/wrapper.py | 211 | 1586 | """
Wrapper for dog_stats_api, ensuring tags are valid.
See: http://help.datadoghq.com/customer/portal/questions/908720-api-guidelines
"""
from dogapi import dog_stats_api
def _clean_tags(tags):
"""
Helper method that does the actual cleaning of tags for sending to statsd.
1. Handles any type of tag - a p... | agpl-3.0 |
saurabh6790/medsyn-app | stock/doctype/warehouse/warehouse.py | 18 | 5226 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, validate_email_add
from webnotes import msgprint, _
class DocType:
def __init__(self, doc, doclist... | agpl-3.0 |
Lh4cKg/sl4a | python-build/python-libs/gdata/src/gdata/apps/emailsettings/service.py | 143 | 8840 | #!/usr/bin/python
#
# Copyright (C) 2008 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 |
ximion/appstream-dep11 | dep11/parsers.py | 2 | 14680 | #!/usr/bin/env python3
"""
Reads AppStream XML metadata and metadata from
XDG .desktop files.
"""
# Copyright (c) 2014 Abhishek Bhattacharjee <abhishek.bhattacharjee11@gmail.com>
# Copyright (c) 2014-2016 Matthias Klumpp <mak@debian.org>
#
# This program is free software; you can redistribute it and/or
# modify it un... | lgpl-3.0 |
RachitKansal/scikit-learn | examples/ensemble/plot_gradient_boosting_regularization.py | 355 | 2843 | """
================================
Gradient Boosting regularization
================================
Illustration of the effect of different regularization strategies
for Gradient Boosting. The example is taken from Hastie et al 2009.
The loss function used is binomial deviance. Regularization via
shrinkage (``lear... | bsd-3-clause |
dfalt974/SickRage | lib/sqlalchemy/connectors/mxodbc.py | 79 | 5362 | # connectors/mxodbc.py
# Copyright (C) 2005-2014 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
"""
Provide an SQLALchemy connector for the eGenix mxODBC commercial
Python adapt... | gpl-3.0 |
jeremypogue/ansible | lib/ansible/plugins/lookup/subelements.py | 6 | 4311 | # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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)... | gpl-3.0 |
bhargav/scikit-learn | doc/conf.py | 26 | 8446 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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 file.
... | bsd-3-clause |
luser/socorro | scripts/hive_adi_test.py | 14 | 3016 | #!/usr/bin/env python
import codecs
import datetime
import optparse
import os
import pyhs2
import tempfile
import unicodedata
import urllib2
# Example command-line usage:
# $ . /etc/socorro/socorrorc
# $ $PYTHON hive_adi_test.py -d '2015-01-21' -s peach-gw.peach.metrics.scl3.mozilla.com -o /tmp/output_adi.txt
def ma... | mpl-2.0 |
caioserra/apiAdwords | examples/adspygoogle/dfp/v201308/activity_service/update_activities.py | 2 | 2132 | #!/usr/bin/python
#
# Copyright 2013 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 b... | apache-2.0 |
Drooids/odoo | addons/pad/pad.py | 84 | 4296 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
import random
import re
import string
import urllib2
import logging
from openerp import SUPERUSER_ID
from openerp.tools.translate import _
from openerp.tools import html2plaintext
from py_etherpad import EtherpadLiteClient
_logger = logging.getLogger(__name__... | agpl-3.0 |
virtualnobi/MediaFiler | nobi/ProductTraderPattern.py | 1 | 2526 | """Product Trader Pattern
This class implements a simple version of the Product Trader Pattern:
A SimpleProductTrader manages a registry mapping specifications to classes.
Strings are used as Specification.
For each Product, a SimpleProductTrader is created.
Subclasses of Product register with this SimpleProd... | gpl-3.0 |
KohlsTechnology/ansible | test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py | 26 | 10303 | # -*- 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 sys
import pytest
from nose.plugins.skip imp... | gpl-3.0 |
Alignak-monitoring/alignak | tests/test_satellite_link.py | 1 | 3229 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | agpl-3.0 |
ttsirkia/a-plus | exercise/cache/hierarchy.py | 3 | 10105 | from course.models import CourseModule, LearningObjectCategory
from ..models import LearningObject
class NoSuchContent(Exception):
pass
class HierarchyIterator(object):
def __init__(self, children, idx=None, tree=None, visited=False, enclosed=True):
if idx is None:
self._default_start(c... | gpl-3.0 |
vietdh85/vh-utility | script/rcb/graspgold.py | 1 | 1037 | import sys
import os.path
from pyquery import PyQuery as pq
import time
import common
def getValues(item):
url = item[3]
print("getValues(): ", url)
format = "%b %d %Y %H:%M:%S"
d = pq(url=url)
list = d(".list td")
index = 0
while index < len(list):
try :
obj = {}
obj['date'] = common.removeNumber... | gpl-3.0 |
JamieFBousfield/heekscnc | pycnc/DepthOp.py | 25 | 2388 | from SpeedOp import SpeedOp
from consts import *
from CNCConfig import CNCConfig
import HeeksCNC
class DepthOp(SpeedOp):
def __init__(self):
SpeedOp.__init__(self)
def ReadDefaultValues(self):
SpeedOp.ReadDefaultValues(self)
config = CNCConfig()
self.abs_mode = config.R... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.