repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
peterhogan/data-analytics | webUI/webpage/webpage/settings.py | 1 | 3168 | """
Django settings for webpage project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | gpl-3.0 |
pforret/python-for-android | python-modules/twisted/twisted/words/protocols/jabber/sasl.py | 53 | 7681 | # Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
XMPP-specific SASL profile.
"""
import re
from twisted.internet import defer
from twisted.words.protocols.jabber import sasl_mechanisms, xmlstream
from twisted.words.xish import domish
# The b64decode and b64encode functions from t... | apache-2.0 |
JimCircadian/ansible | test/units/modules/network/f5/test_bigip_device_sshd.py | 23 | 4054 | # -*- 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
from nose.plugins.skip import SkipTest
i... | gpl-3.0 |
nchammas/spark | python/pyspark/tests/test_join.py | 23 | 2944 | #
# 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 |
gurkih/lammps | tools/i-pi/ipi/utils/io/io_binary.py | 41 | 1532 | """Contains the functions used to print the trajectories and read input
configurations (or even full status dump) as unformatted binary.
Copyright (C) 2013, Joshua More and Michele Ceriotti
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... | gpl-2.0 |
apark263/tensorflow | tensorflow/python/data/experimental/kernel_tests/serialization/interleave_dataset_serialization_test.py | 21 | 3086 | # 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 |
dohoangkhiem/uwsgi | contrib/spoolqueue/tasksconsumer.py | 21 | 1047 | from uwsgidecorators import spool
import Queue
from threading import Thread
queues = {}
class queueconsumer(object):
def __init__(self, name, num=1, **kwargs):
self.name = name
self.num = num
self.queue = Queue.Queue()
self.threads = []
self.func = None
queues[sel... | gpl-2.0 |
cedk/odoo | addons/project_issue_sheet/__openerp__.py | 260 | 1814 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
egraba/vbox_openbsd | VirtualBox-5.0.0/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/CommonDataClass/FdfClass.py | 11 | 9967 | ## @file
# classes represent data in FDF
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license... | mit |
mariodebian/tcosconfig | TcosGui.py | 1 | 37114 | # -*- coding: UTF-8 -*-
# TcosConfig version __VERSION__
#
# Copyright (c) 2006-2011 Mario Izquierdo <mariodebian@gmail.com>
#
# This package 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... | gpl-2.0 |
gangadharkadam/vervefrappe | frappe/custom/doctype/customize_form/customize_form.py | 5 | 8017 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Customize Form is a Single DocType used to mask the Property Setter
Thus providing a better UI from user perspective
"""
import frappe, json
from frappe import _
from frappe... | mit |
gimite/personfinder | app/vendors/pyasn1/debug.py | 6 | 3361 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import logging
from pyasn1 import __version__
from pyasn1 import error
from pyasn1.compat.octets import octs2ints
__all__ = ['Debug', 'setLogger', 'hexdump']
fl... | apache-2.0 |
glaudsonml/kurgan-ai | tools/sqlmap/lib/core/datatype.py | 1 | 2973 | #!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import copy
import types
from lib.core.exception import SqlmapDataException
class AttribDict(dict):
"""
This class defines the sqlmap object, inheriting from Python ... | apache-2.0 |
arahuja/generative-tf | generative-tf/models/variational_autoencoder.py | 1 | 7955 | import tensorflow as tf
import numpy as np
from initialization import xavier_glorot_initialization
class VariationalAutoencoder():
def __init__(self,
input_dim,
latent_dim,
hidden_dim=10,
batch_size=100,
num_layers=0,
... | apache-2.0 |
ahmadiga/min_edx | common/lib/xmodule/xmodule/modulestore/__init__.py | 11 | 54817 | """
This module provides an abstraction for working with XModuleDescriptors
that are stored in a database an accessible using their Location as an identifier
"""
import logging
import re
import json
import datetime
from pytz import UTC
from collections import defaultdict
import collections
from contextlib import cont... | agpl-3.0 |
dcosentino/edx-platform | common/djangoapps/student/tests/test_verification_status.py | 8 | 12784 | """Tests for per-course verification status on the dashboard. """
from datetime import datetime, timedelta
import unittest
import ddt
from mock import patch
from pytz import UTC
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from student.h... | agpl-3.0 |
Anonymouslemming/ansible | lib/ansible/plugins/action/fail.py | 227 | 1391 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, 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 ... | gpl-3.0 |
mameneses/python-deployment | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | mit |
sbalde/edxplatform | lms/djangoapps/instructor/paidcourse_enrollment_report.py | 11 | 8911 | """
Defines concrete class for cybersource Enrollment Report.
"""
from courseware.access import has_access
import collections
from django.conf import settings
from django.utils.translation import ugettext as _
from courseware.courses import get_course_by_id
from instructor.enrollment_report import BaseAbstractEnrollm... | agpl-3.0 |
tbinjiayou/Odoo | addons/account/wizard/account_move_line_unreconcile_select.py | 385 | 1864 | # -*- 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 |
dietrichc/streamline-ppc-reports | examples/dfa/v1_20/create_html_asset.py | 4 | 2263 | #!/usr/bin/python
#
# Copyright 2014 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 |
hiroakis/ansible | lib/ansible/plugins/inventory/ini.py | 90 | 2220 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
st-tu-dresden/inloop | inloop/statistics/forms.py | 1 | 1232 | from django import forms
from django.core.exceptions import ValidationError
ALLOWED_TRUNCATOR_IDENTIFIERS = ["minute", "hour", "day", "month", "year"]
VALID_DATETIME_FORMATS = ["%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%d"]
def validate_granularity(value: str) -> None:
"""
Validate that a given value corresponds to
... | gpl-3.0 |
Kingclove/INFO3180 | server/lib/werkzeug/wsgi.py | 312 | 37386 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2013 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... | apache-2.0 |
guiquanz/googletest | test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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 |
gnieboer/tensorflow | tensorflow/python/ops/distributions/student_t.py | 72 | 12995 | # 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 |
qistoph/thug | src/ActiveX/modules/SymantecBackupExec.py | 8 | 1609 | # Symantec BackupExec
# CVE-2007-6016,CVE-2007-6017
import logging
log = logging.getLogger("Thug")
def Set_DOWText0(self, val):
self.__dict__['_DOWText0'] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(self._window.url,
"Symantec BackupExec Active... | gpl-2.0 |
mweisman/QGIS | python/plugins/processing/algs/RasterLayerHistogram.py | 6 | 3219 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RasterLayerHistogram.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | gpl-2.0 |
alanjds/fen | images.py | 1 | 47284 | #!/usr/bin/env python
black_bishop = """\
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://ww... | gpl-3.0 |
initOS/server-tools | module_auto_update/tests/test_module.py | 6 | 9647 | # -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import os
import tempfile
import mock
from openerp.modules import get_module_path
from openerp.tests import common
from openerp.tests.common import TransactionCase
fro... | agpl-3.0 |
coelias/SatMapper | resourcefetcher.py | 1 | 2994 | #!/usr/bin/python
# SatMapper - 2012-2013 Carlos del Ojo and John Cole.
# This code is part of the SATMAPPER software and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import os
import logging
import sys
import bz2
from lib.fastgzip import FastGzip
im... | gpl-2.0 |
weaver-viii/h2o-3 | py2/testdir_rapids/test_rapids_basic_with_funs_pick5.py | 21 | 11375 | import unittest, random, sys, time, re
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd
from h2o_test import dump_json, verboseprint
initList = [
'(+ (* #2 #2) (* #5 #5))',
'(* #1 (+ (* #2 #2) (* #5 #5)))',
'(= !x... | apache-2.0 |
timfreund/hyde | hydeengine/site_pre_processors.py | 1 | 2563 | import sys
from hydeengine.siteinfo import ContentNode
from django.conf import settings
from hydeengine.file_system import Folder
from siteinfo import SiteNode
"""
PRE PROCESSORS
Can be launched before the parsing of each templates and
after the loading of site info.
"""
class Category:
def __ini... | mit |
Kagami/kisa | lib/twisted/conch/ssh/common.py | 20 | 2781 | # -*- test-case-name: twisted.conch.test.test_ssh -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Common functions for the SSH classes.
Maintainer: Paul Swartz
"""
import struct, warnings
try:
from Crypto import Util
except ImportError:
warnings.warn("PyCrypto not installed,... | cc0-1.0 |
chen0031/distributed-deep-q | main.py | 2 | 6137 | """
Barista serves as an interface to a long-running caffe process.
"""
import os
import sys
import time
import argparse
import socket
import threading
import caffe
from caffe import SGDSolver
import barista
from barista.baristanet import BaristaNet
from barista import netutils
from replay import ReplayDataset
from g... | mit |
dagwieers/ansible | lib/ansible/modules/cloud/opennebula/one_service.py | 31 | 25610 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
(c) 2017, Milan Ilic <milani@nordeus.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the ter... | gpl-3.0 |
caoxiongkun/ardupilot | Tools/autotest/jsb_sim/runsim.py | 167 | 12772 | #!/usr/bin/env python
# run a jsbsim model as a child process
import sys, os, pexpect, socket
import math, time, select, struct, signal, errno
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'pysim'))
import util, atexit, fdpexpect
from pymavlink import fgFDM
class control_state(o... | gpl-3.0 |
pdebuyl/lammps | tools/i-pi/ipi/utils/io/io_binary.py | 41 | 1532 | """Contains the functions used to print the trajectories and read input
configurations (or even full status dump) as unformatted binary.
Copyright (C) 2013, Joshua More and Michele Ceriotti
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... | gpl-2.0 |
Belxjander/Kirito | Python-3.5.0-main/Lib/test/test_nntplib.py | 10 | 59796 | import io
import socket
import datetime
import textwrap
import unittest
import functools
import contextlib
from test import support
from nntplib import NNTP, GroupInfo
import nntplib
from unittest.mock import patch
try:
import ssl
except ImportError:
ssl = None
TIMEOUT = 30
# TODO:
# - test the `file` arg to ... | gpl-3.0 |
jonathanverner/brython | www/src/Lib/test/test_metaclass.py | 132 | 6350 | doctests = """
Basic class construction.
>>> class C:
... def meth(self): print("Hello")
...
>>> C.__class__ is type
True
>>> a = C()
>>> a.__class__ is C
True
>>> a.meth()
Hello
>>>
Use *args notation for the bases.
>>> class A: pass
>>> class B: pass
>>>... | bsd-3-clause |
maxamillion/ansible-modules-core | database/postgresql/postgresql_db.py | 11 | 11257 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
Kao9/Kao9.github.io | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 1524 | 22178 | #!/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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | apache-2.0 |
ltiao/networkx | networkx/algorithms/connectivity/kcutsets.py | 12 | 7220 | # -*- coding: utf-8 -*-
"""
Kanevsky all minimum node k cutsets algorithm.
"""
from operator import itemgetter
import networkx as nx
from .utils import build_auxiliary_node_connectivity
from networkx.algorithms.flow import (
build_residual_network,
edmonds_karp,
shortest_augmenting_path,
)
default_flow_fun... | bsd-3-clause |
Ebag333/Pyfa | gui/builtinStatsViews/resourcesViewFull.py | 1 | 14704 | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... | gpl-3.0 |
MaxTyutyunnikov/lino | docs/tutorials/matrix_tutorial/models.py | 1 | 4630 | ## Copyright 2013 Luc Saffre
## This file is part of the Lino project.
import datetime
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from lino import dd
contacts = dd.resolve_app('contacts')
class EntryType(dd.BabelNamed):
cl... | gpl-3.0 |
IndexBraille/liblouis | tools/lou_maketable.d/make_suggestions.py | 8 | 4835 | # liblouis Braille Translation and Back-Translation Library
#
# Copyright (C) 2017 Bert Frees
#
# This file is part of liblouis.
#
# liblouis 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 versi... | lgpl-2.1 |
peterwilletts24/Python-Scripts | EMBRACE/Surface_Pressure_Diurnal_Monsoon_Trough.py | 2 | 2835 | import os, sys
import datetime
import iris
import iris.unit as unit
import iris.analysis.cartography
import numpy as np
import iris.analysis.geometry
from shapely.geometry import Polygon
from iris.coord_categorisation import add_categorised_coord
import imp
imp.load_source('UnrotateUpdateCube', '/nfs/see-fs-01_us... | mit |
bikong2/django | tests/template_tests/syntax_tests/test_if_equal.py | 368 | 9892 | from django.test import SimpleTestCase
from ..utils import setup
class IfEqualTagTests(SimpleTestCase):
@setup({'ifequal01': '{% ifequal a b %}yes{% endifequal %}'})
def test_ifequal01(self):
output = self.engine.render_to_string('ifequal01', {'a': 1, 'b': 2})
self.assertEqual(output, '')
... | bsd-3-clause |
PW-Sat2/PWSat2OBC | integration_tests/devices/comm_beacon.py | 1 | 5684 | from struct import pack
from bitarray import bitarray
from emulator.beacon_parser.full_beacon_parser import FullBeaconParser
from emulator.beacon_parser.parser import BitReader, BeaconStorage
import experiment_type
class BeaconFrame(object):
def __init__(self, payload):
self._payload = payload
t... | agpl-3.0 |
mbrukman/libcloud | libcloud/loadbalancer/drivers/softlayer.py | 49 | 15112 | # 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 use ... | apache-2.0 |
mottosso/mindbender-setup | bin/pythonpath/raven/conf/defaults.py | 20 | 1428 | """
raven.conf.defaults
~~~~~~~~~~~~~~~~~~~
Represents the default values for all Sentry settings.
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import os
import os.path
import socket
ROOT = os.path... | mit |
SkyroverTech/SkyroverCF | lib/cppcheck-1.71/tools/rundaca2.py | 4 | 2790 | #!/usr/bin/python
import subprocess
import pexpect
import os
import shutil
import time
import sys
PASSWORD = ''
if len(sys.argv) == 2:
PASSWORD = sys.argv[1]
# Upload file to sourceforge web server using scp
def upload(file_to_upload, destination):
if not os.path.isfile(file_to_upload):
return
t... | gpl-3.0 |
shaggytwodope/qutebrowser | qutebrowser/browser/webengine/interceptor.py | 2 | 2630 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Softwa... | gpl-3.0 |
M1cha/android_kernel_xiaomi_aries | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
conejoninja/plugin.video.pelisalacarta | pelisalacarta/channels/stagevusite.py | 8 | 7919 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para buscar en stagevu
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
impor... | gpl-3.0 |
Aravinthu/odoo | setup/odoo-wsgi.example.py | 36 | 1723 | # WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --... | agpl-3.0 |
40223136/-2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/fractions.py | 722 | 23203 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Fraction, infinite-precision, real numbers."""
from decimal import Decimal
import math
import numbers
import operator
import re
import sys
__all__ = ['Fraction', 'gcd']
def gcd(a, b):
"""Calcu... | gpl-3.0 |
marquesarthur/mahadeva_agenda | oauth2client/clientsecrets.py | 226 | 4405 | # Copyright (C) 2011 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 or agreed to in writ... | gpl-2.0 |
homecon/homecon | homecon/core/__init__.py | 2 | 3191 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import sys
# import os
# import importlib
#
#
# db = None
# measurements_db = None
#
# event = None
# states = None
# components = None
# plugins = None
# websocket = None
#
#
# def initialize(dbpath='{}/lib/homecon/'.format(sys.prefix), dbname='home... | gpl-3.0 |
njoubert/MAVProxy | MAVProxy/modules/mavproxy_help.py | 2 | 5131 | """
MAVProxy help/versioning module
"""
import os, time, platform, re
from urllib2 import Request, urlopen, URLError, HTTPError
from pymavlink import mavwp, mavutil
from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import mp_module
if mp_util.has_wxpython:
from MAVProxy.modules.lib.mp_menu impo... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/279_test_transformer.py | 136 | 1120 | import unittest
from test import test_support
# Silence Py3k warning
test_support.import_module('compiler', deprecated=True)
from compiler import transformer, ast
from compiler import compile
class Tests(unittest.TestCase):
def testMultipleLHS(self):
""" Test multiple targets on the left hand side. """
... | gpl-3.0 |
javiercantero/streamlink | tests/test_plugin_bfmtv.py | 5 | 1803 | import unittest
from streamlink.plugins.bfmtv import BFMTV
class TestPluginBFMTV(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(BFMTV.can_handle_url("https://www.bfmtv.com/mediaplayer/live-video/"))
self.assertTrue(BFMTV.can_handle_url("https://bfmbusine... | bsd-2-clause |
maciek263/django2 | myvenv/Lib/site-packages/django/contrib/gis/db/backends/oracle/schema.py | 608 | 4050 | from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.oracle.schema import DatabaseSchemaEditor
from django.db.backends.utils import truncate_name
class OracleGISSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_metadata = ("""
INSERT INTO USER_SDO_GEOM_METADATA
... | mit |
DevSwift/Kernel-3.4-U8500 | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
s40523145/2016fallcp_hw | plugin/liquid_tags/spotify.py | 313 | 1304 | """
Spotify Tag
---------
This implements a Liquid-style spotify tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% spotify id %}
Example
-------
{% spotify 1HNZcRFlIKwHAJD3LxvX4d %}
Output
------
<iframe
src='https://embed.spotify.com/?uri=spotify:track:1HNZcRFlIKwHAJD3LxvX4d'
... | agpl-3.0 |
Servir-Mekong/SurfaceWaterTool | lib/google/auth/crypt/_cryptography_rsa.py | 1 | 4988 | # Copyright 2017 Google LLC
#
# 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, ... | gpl-3.0 |
kaedroho/wagtail | wagtail/documents/tests/test_models.py | 7 | 11768 | from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.files.base import ContentFile
from django.db import transaction
from django.test import TestCase, TransactionTestCase
from django.test.utils... | bsd-3-clause |
dnet/pySSTV | pysstv/sstv.py | 1 | 4354 | #!/usr/bin/env python
from __future__ import division, with_statement
from math import sin, pi
from random import random
from contextlib import closing
from itertools import cycle, chain
from array import array
import wave
FREQ_VIS_BIT1 = 1100
FREQ_SYNC = 1200
FREQ_VIS_BIT0 = 1300
FREQ_BLACK = 1500
FREQ_VIS_START = 1... | mit |
moijes12/oh-mainline | vendor/packages/celery/celery/tests/test_backends/test_base.py | 18 | 10279 | from __future__ import absolute_import
from __future__ import with_statement
import sys
import types
from mock import Mock
from nose import SkipTest
from celery.utils import serialization
from celery.utils.serialization import subclass_exception
from celery.utils.serialization import \
find_nearest_pickleabl... | agpl-3.0 |
hiepcm/update-scripts | tests/ltsi-3.10/controller/common/tty-ping.py | 27 | 11549 | #!/usr/bin/python
# tty-ping.py
#
# Simple test for communication over a serial port-backed TTY
#
# Copyright (C) 2013 Horms Solutions Ltd.
#
# Contact: Simon Horman <horms@verge.net.au>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | gpl-2.0 |
strk/QGIS | scripts/appinfo2ui.py | 49 | 2095 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
/***************************************************************************
appinfo2cpp.py
-------------------
begin : 2018-09-24
copyright : (C) 2018 by Jürgen E. Fischer
... | gpl-2.0 |
ychen820/microblog | src/lib/wtforms/ext/sqlalchemy/fields.py | 54 | 6679 | """
Useful form fields for use with SQLAlchemy ORM.
"""
from __future__ import unicode_literals
import operator
from wtforms import widgets
from wtforms.compat import text_type, string_types
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
try:
from sqlalchemy.orm.util im... | bsd-3-clause |
Sbalbp/DIRAC | ConfigurationSystem/scripts/dirac-admin-add-resources.py | 2 | 16049 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-admin-add-resources
# Author : Andrei Tsaregorodtsev
########################################################################
"""
Add resources from the BDII database for a given VO
"""
__RCSID... | gpl-3.0 |
ContextLogic/eventmaster | plugin_scripts/flush_to_es.py | 1 | 5132 | import argparse
from collections import defaultdict
import datetime
import requests
import socket
import sys
import time
import ujson
from elasticsearch import Elasticsearch
from eventmaster_pb2 import *
from eventmaster_pb2_grpc import *
BATCH_LIMIT = 200
parser = argparse.ArgumentParser(description='Configuration ... | mit |
michael-dev2rights/ansible | contrib/inventory/mdt_dynamic_inventory.py | 117 | 4538 | #!/usr/bin/env python
# (c) 2016, Julian Barnett <jbarnett@tableau.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 ... | gpl-3.0 |
rosmo/ansible | lib/ansible/module_utils/oracle/oci_utils.py | 29 | 81039 | # Copyright (c) 2017, 2018, 2019 Oracle and/or its affiliates.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import
import logging
import logging.config
import os
import tempfile
from datetime import datetime
from operator import eq
impor... | gpl-3.0 |
shadowmint/nwidget | lib/cocos2d-0.5.5/test/test_flip_y.py | 1 | 1153 | # This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 1, s, t 2, s, t 3, s, t 4.1, s, t 4.2, s, q"
tags = "FlipY"
import cocos
from cocos.director import director
from cocos.actions ... | apache-2.0 |
yakky/django | django/utils/decorators.py | 31 | 7500 | "Functions that help with dynamically creating decorators for views."
try:
from contextlib import ContextDecorator
except ImportError:
ContextDecorator = None
from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps
from django.utils import six
class classonlymethod(classmethod):
def __get__(se... | bsd-3-clause |
rcucui/Pisa-util-fix | demo/tgpisa/tgpisa/commands.py | 14 | 1682 | # -*- coding: utf-8 -*-
"""This module contains functions called from console script entry points."""
import os
import sys
from os.path import dirname, exists, join
import pkg_resources
pkg_resources.require("TurboGears")
import turbogears
import cherrypy
cherrypy.lowercase_api = True
class Config... | apache-2.0 |
fw1121/genomics | NGS-general/fastq_sniffer.py | 1 | 5079 | #!/usr/bin/env python
#
# fastq_sniffer.py: "sniff" FASTQ file to determine quality encoding
# Copyright (C) University of Manchester 2013 Peter Briggs
#
########################################################################
#
# fastq_sniffer.py
#
##############################################################... | artistic-2.0 |
DARKPOP/external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/tool/main.py | 44 | 3144 | # Copyright (c) 2010 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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... | bsd-3-clause |
praneethkumarpidugu/matchmaking | lib/python2.7/site-packages/pycparser/c_parser.py | 39 | 62212 | #------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
import re
from ... | mit |
tseaver/google-cloud-python | error_reporting/google/cloud/errorreporting_v1beta1/gapic/error_stats_service_client.py | 2 | 24986 | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
saradbowman/osf.io | admin_tests/preprints/test_views.py | 3 | 27624 | import pytest
import mock
from django.test import RequestFactory
from django.core.urlresolvers import reverse
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import Permission, Group, AnonymousUser
from django.contrib.messages.storage.fallback import FallbackStorage
from tests.base... | apache-2.0 |
marcore/edx-platform | pavelib/paver_tests/test_paver_quality.py | 11 | 15407 | """
Tests for paver quality tasks
"""
import os
from path import Path as path
import tempfile
import textwrap
import unittest
from mock import patch, MagicMock, mock_open
from ddt import ddt, file_data
import pavelib.quality
import paver.easy
import paver.tasks
from paver.easy import BuildFailure
@ddt
class TestPave... | agpl-3.0 |
sandvine/sandvine-nfv-descriptors | attic/rift/tse_pktgen_nsd/scripts/pts_scale.py | 2 | 5967 | #!/usr/bin/env python
import argparse
import logging
import os
import subprocess
import sys
import time
from pysvapi.elementdriver.sshdriver import sshdriver
from pysvapi.svapiclient import client
import yaml
import re
vnfd_names={"tse": "TSE",
"pts": "PTS",
"spb": "SPB"}
class TSEConfigTool... | apache-2.0 |
kmonsoor/python-for-android | python3-alpha/python3-src/Lib/unittest/result.py | 50 | 6292 | """Test result object"""
import os
import io
import sys
import traceback
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args,... | apache-2.0 |
NathanSegerlind/incubator-spot | spot-ingest/pipelines/flow/worker.py | 10 | 5076 | #!/bin/env python
#
# 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 "Licens... | apache-2.0 |
Russell-IO/ansible | lib/ansible/modules/network/eos/eos_eapi.py | 69 | 14834 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
Konbonix/DisasterSupplyTracker | apptest.py | 2 | 1316 | #!/usr/bin/python
import sys, os
import unittest2
import warnings
# silences Python's complaints about imports
warnings.filterwarnings('ignore',category=UserWarning)
USAGE = """
Path to your sdk must be the first argument. To run type:
$ apptest.py path/to/your/appengine/installation
Remember to set envi... | apache-2.0 |
pyecs/servo | tests/wpt/web-platform-tests/tools/html5lib/doc/conf.py | 436 | 9028 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# html5lib documentation build configuration file, created by
# sphinx-quickstart on Wed May 8 00:04:49 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | mpl-2.0 |
akhilman/cement | cement/ext/ext_configobj.py | 1 | 5599 | """
The ConfigObj Extension provides configuration handling based on
`configobj <http://www.voidspace.org.uk/python/configobj.html>`_. It is a
drop-in replacement for the default config handler
:class:`cement.ext.ext_configparser.ConfigParserConfigHandler`.
One of the primary features of ConfigObj is that you can acc... | bsd-3-clause |
jseabold/statsmodels | statsmodels/examples/ex_generic_mle.py | 5 | 14932 |
from functools import partial
import numpy as np
from scipy import stats
import statsmodels.api as sm
from statsmodels.base.model import GenericLikelihoodModel
from statsmodels.tools.numdiff import approx_fprime, approx_hess
data = sm.datasets.spector.load(as_pandas=False)
data.exog = sm.add_constant(data.exog, pre... | bsd-3-clause |
cbingos/cpro | jieba/posseg/__init__.py | 3 | 7424 | from __future__ import with_statement
import re
import os
import viterbi
import jieba
import sys
import marshal
from functools import wraps
default_encoding = sys.getfilesystemencoding()
PROB_START_P = "prob_start.p"
PROB_TRANS_P = "prob_trans.p"
PROB_EMIT_P = "prob_emit.p"
CHAR_STATE_TAB_P = "char_state_tab.p"
userd... | mit |
mancoast/CPythonPyc_test | fail/310_test_codecmaps_kr.py | 9 | 1412 | #!/usr/bin/env python
#
# test_codecmaps_kr.py
# Codec mapping tests for ROK encodings
#
from test import support
from test import test_multibytecodec_support
import unittest
class TestCP949Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'cp949'
mapfileurl... | gpl-3.0 |
lmcro/webserver | admin/plugins/round_robin.py | 5 | 1034 | # -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free S... | gpl-2.0 |
jmcguire/learning | design_patterns/composite/composite_iterator.py | 1 | 1535 | from menu import MenuComponent, MenuItem, MenuComposite, create_test_data, Waitress
class MenuComponentIterator(object):
"""an iterator for MenuComponent"""
def __init__(self, component):
self.component = component
self.i = 0
self.sub_iter = None
def __iter__(self):
return self
def next(self)... | mit |
vprime/puuuu | env/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 1727 | 10500 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... | mit |
gmt/portage | pym/portage/tests/resolver/test_slot_collisions.py | 9 | 9455 | # Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
class SlotCollisionTestCase(TestCase):
def testSlotCollision(self):
eb... | gpl-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/rlcompleter.py | 57 | 5816 | """Word completion for GNU readline.
The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.
It's very cool to do "import sys" type "sys.", hit the com... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.