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 |
|---|---|---|---|---|---|
sk1p/django-codemirror2 | examples/examples/settings.py | 1 | 3206 | """
Django settings for examples project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | mit |
marc-sensenich/ansible | lib/ansible/plugins/filter/urlsplit.py | 146 | 1136 | # Copyright (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
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by':... | gpl-3.0 |
sclc/NAEF | exp_scripts/worker_exp_160507.py | 1 | 5393 | """
Experiment Diary 2016-05-07
"""
import sys
from scipy import io
import numpy as np
from scipy.sparse.linalg import *
sys.path.append("../src/")
from worker import Worker
from native_conjugate_gradient import NativeConjugateGradient
from native_conjugate_gradient import NativeBlockConjugateGradient
from gerschgori... | gpl-3.0 |
heuermh/ga4gh-schemas | tools/sphinx/protobuf-uml.py | 5 | 11990 | #!/usr/bin/env python
"""
Authors: Malisa Smith, Adam Novak, David Steinberg
Plugin for generating a UML diagram of the GA4GH schema.
The resulting png file is then used in RST files to create Sphinx documentation.
Usage:
protoc --plugin=protoc-gen-custom=<script path>/protobuf-uml.py --custom_out=<uml dir> <pro... | apache-2.0 |
cowlicks/numpy | numpy/f2py/tests/test_return_real.py | 69 | 5323 | from __future__ import division, absolute_import, print_function
from numpy.testing import *
from numpy import array
from numpy.compat import long
import math
import util
class TestReturnReal(util.F2PyTest):
def check_function(self, t):
if t.__doc__.split()[0] in ['t0', 't4', 's0', 's4']:
err ... | bsd-3-clause |
persandstrom/home-assistant | homeassistant/components/media_player/philips_js.py | 4 | 6851 | """
Media Player component to integrate TVs exposing the Joint Space API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.philips_js/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.m... | apache-2.0 |
Nevax07/FreedomOS | build/tools/img2sdat/rangelib.py | 2 | 8701 | # Copyright (C) 2014 The Android Open Source Project
#
# 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 |
atl/thrifty-p2p | storetest.py | 1 | 2112 | #!/usr/bin/env python
# encoding: utf-8
"""
storetest.py
Created by Adam T. Lindsay on 2009-05-18.
The MIT License
Copyright (c) 2009 Adam T. Lindsay.
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 Sof... | mit |
OmkarPathak/Python-Programs | CompetitiveProgramming/HackerEarth/Bit_Manipulation/P03_MonkAndHisFriends.py | 1 | 1442 | # Monk has a very good friend, Puchi. As weird as his name, are the games he plays.
# One fine day, they decided to play a game to test how diverse their choices are. Both of them choose exactly
# one integer each. Monk chooses an integer M and Puchi chooses an integer P.
# The diversity of their choices is defined as ... | gpl-3.0 |
jjkoletar/panda3d | contrib/src/sceneeditor/seForceGroup.py | 8 | 5543 | from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
from direct.showbase.PhysicsManagerGlobal import *
#Manakel 2/12/2005: replace from pandac import by from pandac.PandaModules import
from pandac.PandaModules import ForceNode
from direct.directnotify import DirectNotifyGlobal
import... | bsd-3-clause |
tictakk/servo | tests/wpt/web-platform-tests/css/tools/w3ctestlib/HTMLSerializer.py | 80 | 10924 | #!/usr/bin/python
# CSS Test Source Manipulation Library
# Initial code by fantasai, joint copyright 2010 W3C and Microsoft
# additions by peter.linss@hp.com copyright 2013 Hewlett-Packard
# Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license>
import lxml
from lxml import etree
... | mpl-2.0 |
davidak/PyZufall | pyzufall/helfer.py | 1 | 4339 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyzufall.helfer
---------------
Stellt diverse Hilfsfunktionen bereit.
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import *
import os, sys
import codecs
import random as r
from datetime import datetime, date... | gpl-3.0 |
ehogan/iris | lib/iris/tests/unit/analysis/cartography/test_project.py | 5 | 5267 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
lucafavatella/intellij-community | python/lib/Lib/distutils/command/install_scripts.py | 80 | 2183 | """distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
Python scripts."""
# contributed by Bastian Kleineidam
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: install_scripts.py 37828 2004-11-10 22:23:15Z loewis $"
import os
from distuti... | apache-2.0 |
deepchem/deepchem | deepchem/models/torch_models/torch_model.py | 2 | 46355 | import numpy as np
import torch
try:
import torch.utils.tensorboard
_has_tensorboard = True
except:
_has_tensorboard = False
import time
import logging
import os
try:
from collections.abc import Sequence as SequenceCollection
except:
from collections import Sequence as SequenceCollection
from deepchem.data i... | mit |
phillipjones2/taskbuster-boilerplate | functional_tests/test_all_users.py | 2 | 2536 | #-*- coding: utf-8 -*-
from selenium import webdriver
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils.translation import activate
from datetime import date
from django.utils import formats
class HomeNewVisitorTest(StaticLiveServerT... | mit |
keithroe/vtkoptix | ThirdParty/Twisted/twisted/conch/test/test_checkers.py | 27 | 22085 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.checkers}.
"""
try:
import crypt
except ImportError:
cryptSkip = 'cannot run without crypt module'
else:
cryptSkip = None
import os, base64
from twisted.python import util
from twisted.python.failure im... | bsd-3-clause |
gezb/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.apfstore/resources/lib/CompLogger.py | 93 | 2077 | import time
from functools import wraps
TEST_LOG_BOOL = True
def test_logger(msg):
print 'test-' + msg
def comprehensive_logger(logger=None, logging=True, maxlength=250, nowait=False):
'''
Decorator to log the inputs and outputs of functions, as well as the time taken
to run the function.
Requires: time, fu... | gpl-2.0 |
trondeau/gnuradio-old | grc/grc_gnuradio/blks2/selector.py | 7 | 5833 | #
# Copyright 2008,2013 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 |
qifeigit/scikit-learn | sklearn/metrics/cluster/supervised.py | 207 | 27395 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | bsd-3-clause |
NiceCircuits/solderingPen | pc/bootloader/niceSolderingPenBootloader.py | 1 | 4651 | # -*- coding: utf-8 -*-
"""Nice Soldering Pen bootloader
Usage: niceSolderingPenBootloader.exe com_name [file_name]
com_name: name of serial port: "COM1" or "/dev/ttyS1"
file_name: name of file (*.bin) to be uploaded.
If not present, "firmware.bin" is used"""
import serial, sys, crcmod, time
def erro... | cc0-1.0 |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/db/backends/util.py | 19 | 4056 | import datetime
import decimal
from time import time
from django.utils.hashcompat import md5_constructor
class CursorDebugWrapper(object):
def __init__(self, cursor, db):
self.cursor = cursor
self.db = db # Instance of a BaseDatabaseWrapper subclass
def execute(self, sql, params=()):
... | apache-2.0 |
NeuralEnsemble/neuroConstruct | lib/jython/Lib/xml/sax/__init__.py | 117 | 3413 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | gpl-2.0 |
nickto/telegram-bot-aurora | tests/test_forecast.py | 1 | 5195 | import datetime
import os
import sys
import unittest
sys.path.append('../')
import forecast as fc
class TestCoodinateConversion(unittest.TestCase):
def setUp(self):
pass
def test_lon_from_360_to_180(self):
self.assertEqual(fc.lon_from_360_to_180(0), 0)
self.assertEqual(fc.lon_from_36... | mit |
Unow/edx-platform | lms/djangoapps/courseware/tests/test_views.py | 10 | 22197 | # coding=UTF-8
"""
Tests courseware views.py
"""
import unittest
from datetime import datetime
from mock import MagicMock, patch
from pytz import UTC
from django.test import TestCase
from django.http import Http404
from django.test.utils import override_settings
from django.contrib.auth.models import User, AnonymousU... | agpl-3.0 |
hsavolai/vmlab | src/kiwi/ui/test/common.py | 1 | 7324 | #
# Kiwi: a Framework and Enhanced Widgets for Python
#
# Copyright (C) 2005,2006 Async Open Source
#
# 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, ... | gpl-3.0 |
oVirt/Node | src/ovirt/node/setup/cim/cim_page.py | 1 | 3665 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# cim_page.py - Copyright (C) 2012 Red Hat, Inc.
# Written by Fabian Deutsch <fabiand@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; ve... | gpl-2.0 |
citrix-openstack-build/python-ceilometerclient | ceilometerclient/tests/v1/test_projects.py | 4 | 1921 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
evildmp/Arkestra | vacancies_and_studentships/managers.py | 2 | 1365 | from django.db import models
from django.db.models import Q
from django.conf import settings
from datetime import datetime
import operator
from arkestra_utilities.managers import ArkestraGenericModelManager
from arkestra_utilities.settings import MULTIPLE_ENTITY_MODE
# class ItemManager(ArkestraGenericModelManager):
... | bsd-2-clause |
oliver-sanders/cylc | cylc/flow/scripts/cylc_poll.py | 1 | 2219 | #!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & 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... | gpl-3.0 |
bjoernricks/python-quilt | quilt/db.py | 1 | 10535 | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 - 2017 Björn Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of python-quilt for details.
from __future__ import print_function
import getopt
import os.path
i... | mit |
abought/osf.io | website/addons/badges/tests/utils.py | 59 | 1215 | import string
import mock
import random
from website.addons.badges.model import Badge
def create_mock_badger(mock_badger):
#mock_badger.configured = True
mock_badger.name = 'Honey'
mock_badger.email = 'Not@real.com'
for _ in range(4):
create_mock_badge(mock_badger)
mock_badger.save()
... | apache-2.0 |
OpenXT/sync-cli | sync_cli/show_disk.py | 1 | 1803 | #
# Copyright (c) 2012 Citrix Systems, 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 dist... | gpl-2.0 |
cbries/utilities | weatherpi/thirdparty/Adafruit/Adafruit_I2C/Adafruit_I2C.py | 116 | 5501 | #!/usr/bin/python
import re
import smbus
# ===========================================================================
# Adafruit_I2C Class
# ===========================================================================
class Adafruit_I2C(object):
@staticmethod
def getPiRevision():
"Gets the version number of ... | mit |
figarocms/thumbor | thumbor/detectors/queued_detector/__init__.py | 6 | 1501 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from redis import Redis, RedisError
from remotecv.unique_queue impor... | mit |
WalrusCow/wmcd.ca | python/blog/posts.py | 1 | 1723 | import functools
import hashlib
from datetime import datetime
import blog.db as db
class Post():
_FIELDS = ('body', 'title', 'author')
_HASH_FIELDS = _FIELDS + ('timestamp',)
_ALL_FIELDS = _HASH_FIELDS + ('id',)
def __init__(self, kvp):
for field in Post._FIELDS:
if field not in k... | mit |
lyynocs/magento-connector-v8 | magentoerpconnect/tests/test_related_action.py | 1 | 3948 | # -*- coding: utf-8 -*-
import mock
import openerp
import openerp.tests.common as common
from openerp.addons.connector.queue.job import (
Job,
OpenERPJobStorage,
)
from openerp.addons.connector.session import (
ConnectorSession)
from .common import mock_api
from .test_data import magento_base_responses
fro... | agpl-3.0 |
linjoahow/W16_test1 | static/Brython3.1.1-20150328-091302/Lib/browser/markdown.py | 623 | 13060 | # -*- coding: utf-8 -*-
try:
import _jsre as re
except:
import re
import random
import time
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if ... | gpl-3.0 |
gorjuce/odoo | addons/hr_timesheet_invoice/report/__init__.py | 433 | 1136 | # -*- 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 |
rpp0/gr-lora | python/qa_receiver.py | 2 | 36952 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but chan... | gpl-3.0 |
jiguanglizipao/ucore_os_lab | related_info/ostep/ostep1-relocation.py | 54 | 3914 | #! /usr/bin/env python
import sys
from optparse import OptionParser
import random
import math
def convert(size):
length = len(size)
lastchar = size[length-1]
if (lastchar == 'k') or (lastchar == 'K'):
m = 1024
nsize = int(size[0:length-1]) * m
elif (lastchar == 'm') or (lastchar == 'M'... | gpl-2.0 |
burkesquires/pyeq2 | Examples/Web/FlaskFit.py | 1 | 15008 | import os, sys, inspect
# ensure pyeq2 can be imported
if -1 != sys.path[0].find('pyeq2-master'):raise Exception('Please rename git checkout directory from "pyeq2-master" to "pyeq2"')
exampleFileDirectory = sys.path[0][:sys.path[0].rfind(os.sep)]
pyeq2ImportDirectory = os.path.join(os.path.join(exampleFileDirectory, ... | bsd-2-clause |
jainayush975/zulip | zerver/views/registration.py | 4 | 19018 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from typing import Any, List, Dict, Optional, Text
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth import authenticate, login, get_backends
from django.core.urlresolvers import reverse
from djang... | apache-2.0 |
kenwmitchell/ansible-modules-core | files/stat.py | 18 | 15327 | #!/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 distributed... | gpl-3.0 |
zzzombat/lucid-python-django | django/conf/locale/hr/formats.py | 232 | 1758 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y.'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. E Y. H:i'
YEAR_MONTH... | bsd-3-clause |
wri/gfw-api | lib/ee/element.py | 4 | 3051 | """Base class for Image, Feature and Collection.
This class is never intended to be instantiated by the user.
"""
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
import apifunction
import computedobject
import ee_exception
class Element(computedobject.ComputedObject)... | gpl-2.0 |
SteveHNH/ansible | lib/ansible/modules/network/cloudengine/ce_snmp_community.py | 27 | 33290 | #!/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 |
fuchao2012/ewcloud | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | mit |
leifos/treconomics | treconomics_project/treconomics/experiment_configuration.py | 1 | 8405 | __author__ = 'leif'
import os
import socket
import logging
import logging.config
import logging.handlers
from autocomplete_trie import AutocompleteTrie
from ifind.search.engines.whooshtrec import Whooshtrec
from experiment_setup import ExperimentSetup
work_dir = os.getcwd()
# when deployed this needs to match up with... | mit |
Nicop06/ansible | lib/ansible/modules/cloud/rackspace/rax_clb_nodes.py | 19 | 8252 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
hmsuorg/telegram-icecast2-bot | tice2bot/api/common/__init__.py | 1 | 3752 | """ Common libraries """
import socket
import json
from urllib import request
from urllib.error import URLError
from config.bot_config import ICECAST2_SERVERS, ICECAST2_STATS_FILE, SERVERS_LIMIT, SSL
class RadioStream:
"""RadioStreams"""
def __init__(self):
"""__init__"""
self.__stream... | mit |
rdbhost/Rdbhdb | examples/ex9.py | 1 | 2803 | # Testing Exception Raising. Direct connection (not through API)
from urllib import urlencode
from urllib2 import Request, urlopen
import json
def postit(url, fields):
postdata = urlencode(fields)
headers = {'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': str(len(postdata... | mit |
TimYi/pybuilder | src/unittest/python/plugins/python/sphinx_plugin_tests.py | 6 | 5239 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | apache-2.0 |
mitya57/django | django/utils/synch.py | 49 | 2550 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock:
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simultaneously... | bsd-3-clause |
mshafiq9/django | django/core/serializers/__init__.py | 347 | 8194 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | bsd-3-clause |
prune998/ansible | lib/ansible/modules/cloud/amazon/sns_topic.py | 21 | 14058 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 distri... | gpl-3.0 |
ssorgatem/pulsar | pulsar/managers/util/condor/__init__.py | 4 | 3923 | """
Condor helper utilities.
"""
from subprocess import Popen, PIPE, STDOUT, check_call, CalledProcessError
from ..external import parse_external_id
DEFAULT_QUERY_CLASSAD = dict(
universe='vanilla',
getenv='true',
notification='NEVER',
)
PROBLEM_RUNNING_CONDOR_SUBMIT = \
"Problem encountered while run... | apache-2.0 |
AladdinSonni/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_xml_outfiles_test.py | 718 | 5312 | #!/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 |
ArcherCraftStore/ArcherVMPeridot | nodechip/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 486 | 15539 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | apache-2.0 |
Houzz/luigi | luigi/target.py | 1 | 12230 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
gamechanger/dusty | dusty/systems/nfs/server.py | 1 | 4327 | from __future__ import absolute_import
import logging
import os
from subprocess import CalledProcessError
from ... import constants
from .. import config_file
from ...compiler.spec_assembler import get_all_repos
from ...log import log_to_client
from ...source import Repo
from ..virtualbox import get_docker_vm_ip
from... | mit |
grangier/python-goose | tests/extractors/links.py | 15 | 1177 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 |
XuGuohui/firmware | hal/src/photon/libraries/crypto/micro-ecc/emk_project.py | 47 | 4375 | import os
c, link, asm, utils = emk.module("c", "link", "asm", "utils")
default_compile_flags = ["-fvisibility=hidden", "-Wall", "-Wextra", "-Wshadow", "-Werror", "-Wno-missing-field-initializers", "-Wno-unused-parameter", \
"-Wno-comment", "-Wno-unused", "-Wno-unknown-pragmas"]
default_link_flags = []
opt_flags ... | gpl-3.0 |
Antiun/odoo | addons/marketing_campaign/report/__init__.py | 441 | 1071 | # -*- 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 |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/boto-2.27.0-py2.7.egg/boto/file/connection.py | 111 | 1480 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | gpl-3.0 |
druuu/django | django/conf/urls/__init__.py | 264 | 4592 | import warnings
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import (
LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver,
)
from django.utils import six
from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedIn... | bsd-3-clause |
learningequality/kolibri | kolibri/core/public/api.py | 1 | 9585 | import datetime
import gzip
import io
import json
import time
from django.db.models import Q
from django.http import HttpResponse
from django.http import HttpResponseBadRequest
from django.http import HttpResponseNotFound
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.gzip import gzi... | mit |
boar/boar | boar/articles/feeds.py | 1 | 4136 | from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.syndication.views import Feed, add_domain
from django.utils.feedgenerator import Atom1Feed
from boar.articles.models import Article, Section, PodcastMetadata, Tag
ITEMS = 30
class ArticlesFeed(Feed):
title... | bsd-3-clause |
ossdemura/django-miniblog | src/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.py | 385 | 76580 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import unichr as chr
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, hexDigits, EOF
from .c... | mit |
unitusdev/unitus | contrib/seeds/generate-seeds.py | 55 | 4341 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | mit |
aclements/mtrace | mtrace-tools/crud/mtracepy/util.py | 2 | 1615 | import sqlite3
import hashlib
import sys
mtrace_label_heap = 1
mtrace_label_block = 2
mtrace_label_static = 3
mtrace_label_percpu = 4
mtrace_label_str = { mtrace_label_heap : 'heap',
mtrace_label_block : 'block',
mtrace_label_stat... | gpl-2.0 |
MiseCZ/apila | tasks/Task.py | 2 | 1396 | class Task(object):
CHANGED = 'changed'
CREATED = 'created'
def __init__(self, name, params, config, register, when, tags, unknown_attributes):
self.name = name
self.params = params
self.config = config
self.unknown_attributes = unknown_attributes
self.register = register
self.when = when
... | mit |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/predictor/saved_model_predictor.py | 55 | 6579 | # 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 |
playfulgod/android_kernel_lge_kk_zee | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/py-lockfile/package.py | 5 | 2151 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
cortedeltimo/SickRage | lib/github/tests/OrganizationHasInMembers.py | 7 | 2192 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2016 Sam Corbett <sjcorbett@apache.org> ... | gpl-3.0 |
V155/qutebrowser | qutebrowser/keyinput/modeparsers.py | 1 | 12376 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 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 S... | gpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/conf/locale/hu/formats.py | 504 | 1117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y. F j.'
TIME_FORMAT = 'G.i'
DATE... | bsd-3-clause |
luizbafilho/fusis | vendor/github.com/osrg/gobgp/test/scenario_test/bgp_router_test.py | 5 | 16341 | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | mit |
phrocker/accumulo | test/system/auto/simple/createAndUse.py | 2 | 1105 | # 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 |
eubr-bigsea/tahiti | migrations/versions/c0510936c9a5_updating_logistic_regression_solver_.py | 1 | 2089 | """updating logistic regression solver param
Revision ID: c0510936c9a5
Revises: dbb12fc54827
Create Date: 2020-01-08 16:13:56.760866
"""
from alembic import op
import sqlalchemy as sa
from alembic import op
import sqlalchemy as sa
from alembic import context
from alembic import op
from sqlalchemy import String, Integ... | apache-2.0 |
spasovski/zamboni | apps/amo/tests/test_messages.py | 6 | 2247 | # -*- coding: utf-8 -*-
import django.contrib.messages as django_messages
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
from nose.tools import eq_
from tower import ugettext as _
from amo.messages import _make_message, info
def test_xss():
title = "<script>aler... | bsd-3-clause |
grnet/synnefo | snf-cyclades-app/synnefo/logic/allocators/base.py | 2 | 2618 | # Copyright (C) 2010-2016 GRNET S.A. and individual 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 3 of the License, or
# (at your option) any later version.
#
# T... | gpl-3.0 |
gilestrolab/ethoscope | scripts/tools/incremental_size_upload.py | 1 | 2210 | """
A tool to backup incrementally one source to one destination directory.
It copies files to the destination if and only if they are larger than in the destination
"""
from optparse import OptionParser
import os
import shutil
import glob
import time
def copy_one_file(src, dst):
src_size = os.stat(src).st_siz... | gpl-3.0 |
jjoaonunes/namebench | libnamebench/mocks.py | 175 | 2503 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
jerryge/zulip | zerver/lib/db.py | 120 | 1569 | from __future__ import absolute_import
import time
from psycopg2.extensions import cursor, connection
# Similar to the tracking done in Django's CursorDebugWrapper, but done at the
# psycopg2 cursor level so it works with SQLAlchemy.
def wrapper_execute(self, action, sql, params=()):
start = time.time()
try:
... | apache-2.0 |
kazemakase/scikit-learn | sklearn/tree/export.py | 75 | 15670 | """
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Trevor... | bsd-3-clause |
zaina/nova | nova/tests/unit/api/openstack/compute/contrib/test_hypervisors.py | 18 | 22740 | # Copyright (c) 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.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
direvus/ansible | lib/ansible/modules/cloud/azure/azure_rm_dnszone_facts.py | 20 | 5086 | #!/usr/bin/python
#
# Copyright (c) 2017 Obezimnaka Boms, <t-ozboms@microsoft.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 |
michael-dev2rights/ansible | lib/ansible/modules/cloud/google/gcp_healthcheck.py | 49 | 15554 | #!/usr/bin/python
# Copyright 2017 Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
vmindru/ansible | lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py | 14 | 3949 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/docutils/docutils/languages/en.py | 246 | 1848 | # $Id: en.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# 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... | agpl-3.0 |
bev-a-tron/pledge_service | build/mailchimp/requests/packages/chardet/latin1prober.py | 950 | 5241 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/sqlite3/__init__.py | 239 | 1037 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# 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 f... | mit |
javivi001/horus | src/horus/engine/board.py | 2 | 7274 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------#
# #
# This file is part of the Horus Project #
# ... | gpl-2.0 |
harish2rb/pyGeoNet | test/test_pygeonet_processing.py | 1 | 4709 | # pyGeoNet_readGeotiff
#import sys
#import os
from osgeo import gdal
#from string import *
import numpy as np
from time import clock
import pygeonet_defaults as defaults
import pygeonet_prepare as Parameters
from math import modf, floor
#from scipy.stats.mstats import mquantiles
def read_dem_from_geotiff(demFileName... | gpl-3.0 |
dkarakats/edx-platform | lms/djangoapps/django_comment_client/forum/tests.py | 14 | 53829 | import json
import logging
import ddt
from django.core import cache
from django.core.urlresolvers import reverse
from django.http import Http404
from django.test.client import Client, RequestFactory
from django.test.utils import override_settings
from edxmako.tests import mako_middleware_process_request
from django_c... | agpl-3.0 |
krast/suse_xen | tools/python/xen/xend/server/netif2.py | 43 | 5574 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
allanlei/django-landlord | landlord/routers.py | 1 | 3170 | # from landlord import landlord
# from landlord.conf import settings
# import logging
# logger = logging.getLogger(__name__)
# class LandlordRouter(object):
# @property
# def ignored_models(self):
# if not getattr(self, '__ignored_models', None):
# from django.db.models.loading import ge... | bsd-3-clause |
JackDandy/SickGear | lib/hachoir_py2/parser/archive/ace.py | 2 | 10181 | """
ACE parser
From wotsit.org and the SDK header (bitflags)
Partial study of a new block type (5) I've called "new_recovery", as its
syntax is very close to the former one (of type 2).
Status: can only read totally file and header blocks.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
Creation date: 19 jan... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.