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 |
|---|---|---|---|---|---|
snakecon/AI_Lab | spider/book/book/pipelines.py | 1 | 4704 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import book.database as db
from scrapy import Request
from scrapy.utils.misc import arg_to_iter
from twisted.internet.defer import DeferredList
from scrapy.pipelines.images import ImagesPipeline
from book.items import Subject, Meta, Comment
class BookPipe... | apache-2.0 |
elkingtonmcb/bcbio-nextgen | bcbio/variation/validateplot.py | 1 | 15359 | """Plot validation results from variant calling comparisons.
Handles data normalization and plotting, emphasizing comparisons on methodology
differences.
"""
import collections
import os
import numpy as np
import pandas as pd
try:
import matplotlib as mpl
mpl.use('Agg', force=True)
import matplotlib.pypl... | mit |
jeremiahmarks/sl4a | python/src/Doc/includes/tzinfo-examples.py | 32 | 5063 | from datetime import tzinfo, timedelta, datetime
ZERO = timedelta(0)
HOUR = timedelta(hours=1)
# A UTC class.
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return ZERO
utc = UTC()
# A class building... | apache-2.0 |
stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/modules/dnsutil.py | 1 | 11113 | # -*- coding: utf-8 -*-
'''
Compendium of generic DNS utilities
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils
import socket
# Import python libs
import logging
import time
log = logging.getLogger(__name__)
def __virtual__():
'''
Generic, should work on any platform (includ... | apache-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/cms/utils/placeholder.py | 10 | 5642 | # -*- coding: utf-8 -*-
import operator
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.query_utils import Q
from django.utils import six
from sekizai.helpers import get_varname
from cms.utils import get_cms_setting
from cms.utils.compat.dj import force_u... | mit |
iffy/AutobahnPython | examples/twisted/websocket/wrapping/client_endpoint.py | 2 | 2032 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
rouault/Quantum-GIS | python/plugins/processing/algs/grass7/ext/r_li_padrange_ascii.py | 12 | 1544 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padrange_ascii.py
----------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************... | gpl-2.0 |
shiburizu/py2discord | py2discord.py | 1 | 8389 | import discord
import sqlite3 as sql
import logging
import cleverbot
import random
logging.basicConfig(level=logging.INFO)
import urllib3.contrib.pyopenssl
urllib3.contrib.pyopenssl.inject_into_urllib3()
from apiclient.discovery import build
import apiclient.errors
# Please refer to the README to find where you should ... | isc |
icexelloss/spark | python/pyspark/rddsampler.py | 157 | 4250 | #
# 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 |
adrienbrault/home-assistant | homeassistant/components/powerwall/sensor.py | 3 | 4166 | """Support for August sensors."""
import logging
from tesla_powerwall import MeterType
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DEVICE_CLASS_BATTERY, DEVICE_CLASS_POWER, PERCENTAGE
from .const import (
ATTR_ENERGY_EXPORTED,
ATTR_ENERGY_IMPORTED,
ATTR_FREQUE... | mit |
Serag8/Bachelor | google_appengine/lib/django-1.5/django/middleware/cache.py | 37 | 9386 | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | mit |
LMSlay/wiper | modules/clamav.py | 1 | 2875 | # This file is part of Viper - https://github.com/botherder/viper
# See the file 'LICENSE' for copying permission.
import getopt
try:
import pyclamd
HAVE_CLAMD = True
except ImportError:
HAVE_CLAMD = False
from viper.common.out import *
from viper.common.abstracts import Module
from viper.core.session im... | bsd-3-clause |
guymakam/Kodi-Israel | plugin.video.MakoTV/resources/lib/crypto/app/filecrypt.py | 7 | 3051 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
""" cipher.app.filecrypt
File encryption script.
Current uses an 'extended' AES algorithm.
2002 by Paul A. Lambert
Read LICENSE.txt for license information.
"""
import sys, getpass, getopt, os
from crypto.cipher.trolldoll import Trolldoll
from crypto... | gpl-2.0 |
eicher31/compassion-modules | thankyou_letters/models/partner_communication.py | 3 | 6485 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | agpl-3.0 |
susansls/zulip | zerver/management/commands/knight.py | 15 | 2864 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
from zerver.lib.actions import do_change_is_admin
from zerver.m... | apache-2.0 |
sunlianqiang/kbengine | kbe/src/lib/python/Tools/demo/vector.py | 110 | 1452 | #!/usr/bin/env python3
"""
A demonstration of classes and their special methods in Python.
"""
class Vec:
"""A simple vector class.
Instances of the Vec class can be constructed from numbers
>>> a = Vec(1, 2, 3)
>>> b = Vec(3, 2, 1)
added
>>> a + b
Vec(4, 4, 4)
subtracted
>>> a... | lgpl-3.0 |
syjeon/new_edx | lms/djangoapps/courseware/migrations/0001_initial.py | 194 | 8306 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'StudentModule'
db.create_table('courseware_studentmodule', (
('id', self.gf('django.d... | agpl-3.0 |
vmendez/DIRAC | Resources/Storage/StorageElement.py | 1 | 35478 | """ This is the StorageElement class.
"""
from types import ListType
__RCSID__ = "$Id$"
# # custom duty
import re
import time
import datetime
import copy
import errno
# # from DIRAC
from DIRAC import gLogger, gConfig, siteName
from DIRAC.Core.Utilities import DErrno, DError
from DIRAC.Core.Utilities.ReturnValues impor... | gpl-3.0 |
lukasmartinelli/py14 | py14/scope.py | 1 | 2384 | import ast
from contextlib import contextmanager
def add_scope_context(node):
"""Provide to scope context to all nodes"""
return ScopeTransformer().visit(node)
class ScopeMixin(object):
"""
Adds a scope property with the current scope (function, module)
a node is part of.
"""
scopes = []... | mit |
sajeeshcs/nested_quota_latest | nova/tests/unit/cert/test_rpcapi.py | 6 | 2951 | # Copyright 2012, Red Hat, 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 agr... | apache-2.0 |
MiLk/youtube-dl | youtube_dl/extractor/franceinter.py | 15 | 1141 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FranceInterIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
_TEST = {
'url': 'http://www.franceinter.fr/player/reecouter?play=793962',
... | unlicense |
syhost/android_kernel_pantech_ef50l | scripts/gcc-wrapper.py | 501 | 3410 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 |
wayneicn/crazyflie-clients-python | lib/cflib/crazyflie/console.py | 26 | 2060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
deter-project/magi | magi/tests/023_multicastNetworkTestServer.py | 1 | 1888 | #!/usr/bin/env python
import unittest2
import logging
import time
from magi.messaging.magimessage import MAGIMessage
from magi.messaging.transportMulticast import MulticastTransport
from magi.testbed import testbed
from magi.messaging.api import Messenger
class TransportTest(unittest2.TestCase):
"""
Testing of b... | gpl-2.0 |
linjoahow/2015cda_lego | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/process.py | 694 | 2304 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Process', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import itert... | agpl-3.0 |
JioCloud/tempest | tempest/api/compute/admin/test_hosts_negative.py | 9 | 7067 | # Copyright 2013 Huawei Technologies Co.,LTD.
#
# 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 |
Leila20/django | tests/fixtures/tests.py | 14 | 42302 | from __future__ import unicode_literals
import os
import sys
import tempfile
import unittest
import warnings
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.files.temp import NamedTemporaryFile
from django.core.management import CommandErro... | bsd-3-clause |
80vs90/libsaas | libsaas/services/zendesk/service.py | 4 | 5909 | import json
from libsaas import http, parsers, port
from libsaas.filters import auth
from libsaas.services import base
from . import resources
class Zendesk(base.Resource):
"""
"""
def __init__(self, subdomain, username=None, password=None,
access_token=None):
"""
Creat... | mit |
rcharp/toyota-flask | numpy/numpy/doc/subclassing.py | 139 | 20225 | """
=============================
Subclassing ndarray in python
=============================
Credits
-------
This page is based with thanks on the wiki page on subclassing by Pierre
Gerard-Marchant - http://www.scipy.org/Subclasses.
Introduction
------------
Subclassing ndarray is relatively simple, but it has som... | apache-2.0 |
grhawk/ASE | ase/old.py | 10 | 6716 | import numpy as np
try:
import Numeric as num
except ImportError:
pass
else:
def npy2num(a, typecode=num.Float):
return num.array(a, typecode)
if num.__version__ <= '23.8':
#def npy2num(a, typecode=num.Float):
# return num.array(a.tolist(), typecode)
def npy2num(a, typ... | gpl-2.0 |
Soya93/Extract-Refactoring | python/helpers/py2only/roman.py | 227 | 2687 | """Convert to and from Roman numerals"""
__author__ = "Mark Pilgrim (f8dy@diveintopython.org)"
__version__ = "1.4"
__date__ = "8 August 2001"
__copyright__ = """Copyright (c) 2001 Mark Pilgrim
This program is part of "Dive Into Python", a free Python tutorial for
experienced programmers. Visit http://diveintopython.... | apache-2.0 |
mapbased/phantomjs | src/qt/qtwebkit/Source/WebCore/inspector/CodeGeneratorInspector.py | 117 | 97853 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. 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 sou... | bsd-3-clause |
faroit/loudness | python/tests/test_FrameGenerator.py | 1 | 1471 | import numpy as np
import loudness as ln
fs = 32000
N = 10000
x = np.arange(0, N)
# Input SignalBank
bufSize = 32
nEars = 2
nChannels = 1
inputBank = ln.SignalBank()
inputBank.initialize(nEars, nChannels, bufSize, int(fs))
# Frame generator
frameSize = 2048
hopSize = 32
startAtWindowCentre = True
frameGen = ln.Frame... | gpl-3.0 |
aricchen/openHR | openerp/addons/account_followup/wizard/__init__.py | 437 | 1076 | # -*- 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 |
minhtuancn/odoo | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
elba7r/builder | frappe/patches/v5_0/update_shared.py | 20 | 1398 | import frappe
import frappe.share
def execute():
frappe.reload_doc("core", "doctype", "docperm")
frappe.reload_doc("core", "doctype", "docshare")
frappe.reload_doc('email', 'doctype', 'email_account')
# default share to all writes
frappe.db.sql("""update tabDocPerm set `share`=1 where ifnull(`write`,0)=1 and ifn... | mit |
robinkraft/cloudless | src/cloudless/train/predict.py | 1 | 7335 | import os
import caffe
import numpy as np
import plyvel
import skimage
from caffe_pb2 import Datum
import constants
def predict(image_path):
"""
Takes a single image, and makes a prediction whether it has a cloud or not.
"""
print "Generating prediction for %s..." % image_path
net, transformer ... | apache-2.0 |
carlomt/dicom_tools | dicom_tools/pyqtgraph/exporters/CSVExporter.py | 44 | 2798 | from ..Qt import QtGui, QtCore
from .Exporter import Exporter
from ..parametertree import Parameter
from .. import PlotItem
__all__ = ['CSVExporter']
class CSVExporter(Exporter):
Name = "CSV from plot data"
windows = []
def __init__(self, item):
Exporter.__init__(self, item)
self.... | mit |
odootr/odoo | addons/account_analytic_default/account_analytic_default.py | 57 | 9022 | # -*- 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 GN... | agpl-3.0 |
vmthunder/nova | nova/scheduler/filters/num_instances_filter.py | 15 | 2837 | # 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 |
uiri/pxqz | venv/lib/python2.7/site-packages/django/core/serializers/pyyaml.py | 81 | 2170 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
from StringIO import StringIO
import decimal
import yaml
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSeriali... | gpl-3.0 |
Johnzero/OE7 | openerp/addons-modules/hr_attendance/wizard/hr_attendance_error.py | 7 | 2918 | # -*- 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 |
azureplus/hue | desktop/core/ext-py/Paste-2.0.1/paste/exceptions/reporter.py | 50 | 4576 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import smtplib
import time
try:
from socket import sslerror
ex... | apache-2.0 |
pradeepnazareth/NS-3-begining | waf-tools/clang_compilation_database.py | 99 | 1830 | #!/usr/bin/env python
# encoding: utf-8
# Christoph Koke, 2013
"""
Writes the c and cpp compile commands into build/compile_commands.json
see http://clang.llvm.org/docs/JSONCompilationDatabase.html
Usage:
def configure(conf):
conf.load('compiler_cxx')
...
conf.load('clang_compilation_data... | gpl-2.0 |
firerszd/kbengine | kbe/src/lib/python/Lib/encodings/iso2022_kr.py | 816 | 1053 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | lgpl-3.0 |
conan-io/conan | conans/test/functional/scm/tools/test_git.py | 1 | 15486 | # coding=utf-8
import os
import re
import subprocess
import unittest
import pytest
import six
from mock import patch
from parameterized import parameterized
from conans.client import tools
from conans.client.tools.scm import Git
from conans.errors import ConanException
from conans.test.utils.scm import create_local_g... | mit |
zaccoz/odoo | addons/account/wizard/account_statement_from_invoice.py | 224 | 4128 | # -*- 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 |
PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/third_party/ply/test/testlex.py | 62 | 23233 | # testlex.py
import unittest
try:
import StringIO
except ImportError:
import io as StringIO
import sys
import os
import imp
import warnings
sys.path.insert(0,"..")
sys.tracebacklimit = 0
import ply.lex
def make_pymodule_path(filename):
path = os.path.dirname(filename)
file = os.path.basename(filena... | bsd-2-clause |
melund/python-prompt-toolkit | prompt_toolkit/history.py | 23 | 2853 | from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass
import datetime
import os
__all__ = (
'FileHistory',
'History',
'InMemoryHistory',
)
class History(with_metaclass(ABCMeta, object)):
"""
Base ``History`` interface.
"""
@abstrac... | bsd-3-clause |
FuzzyHobbit/letsencrypt | letsencrypt-apache/letsencrypt_apache/tests/util.py | 8 | 5326 | """Common utilities for letsencrypt_apache."""
import os
import sys
import unittest
import augeas
import mock
import zope.component
from acme import jose
from letsencrypt.display import util as display_util
from letsencrypt.plugins import common
from letsencrypt.tests import test_util
from letsencrypt_apache impo... | apache-2.0 |
iceout/python_koans_practice | python2/koans/about_new_style_classes.py | 1 | 2171 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python... | mit |
prakritish/ansible | test/integration/cleanup_gce.py | 66 | 2621 | '''
Find and delete GCE resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete your *ENTIRE* GCE infrastructure.
'''
import os
import re
import sys
import optparse
import yaml
try:
from libclo... | gpl-3.0 |
praveenkumar/ansible | lib/ansible/plugins/strategies/linear.py | 1 | 14325 | # (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 |
bilgili/Voreen | modules/python/ext/python27/modules/tempfile.py | 35 | 18061 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | gpl-2.0 |
o5k/openerp-oemedical-v0.1 | openerp/addons/stock/wizard/stock_inventory_line_split.py | 64 | 4976 | # -*- 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 |
athompso/ansible-modules-core | cloud/openstack/os_ironic_node.py | 131 | 12309 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module 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 optio... | gpl-3.0 |
raildo/nova | nova/virt/vmwareapi/error_util.py | 59 | 1118 | # Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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
#
# http://www.apache.org/licenses/LICENSE-2.0... | apache-2.0 |
The-Compiler/qutebrowser | tests/helpers/messagemock.py | 1 | 2576 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 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 |
yxl/emscripten-calligra-mobile | 3rdparty/google-breakpad/src/tools/gyp/pylib/gyp/generator/android.py | 25 | 43345 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | gpl-2.0 |
jackrzhang/zulip | zerver/lib/timestamp.py | 16 | 1534 | import datetime
import calendar
from django.utils.timezone import utc as timezone_utc
class TimezoneNotUTCException(Exception):
pass
def verify_UTC(dt: datetime.datetime) -> None:
if dt.tzinfo is None or dt.tzinfo.utcoffset(dt) != timezone_utc.utcoffset(dt):
raise TimezoneNotUTCException("Datetime %s ... | apache-2.0 |
openstack-hyper-v-python/numpy | numpy/core/tests/test_unicode.py | 69 | 12594 | from __future__ import division, absolute_import, print_function
import sys
from numpy.testing import *
from numpy.core import *
from numpy.compat import asbytes, sixu
# Guess the UCS length for this python interpreter
if sys.version_info[:2] >= (3, 3):
# Python 3.3 uses a flexible string representation
ucs4... | bsd-3-clause |
Odingod/mne-python | mne/realtime/tests/test_fieldtrip_client.py | 5 | 2801 | # Author: Mainak Jas <mainak@neuro.hut.fi>
#
# License: BSD (3-clause)
import time
import os
import threading
import subprocess
import warnings
import os.path as op
from nose.tools import assert_true
import mne
from mne.utils import requires_neuromag2ft, run_tests_if_main
from mne.realtime import FieldTripClient
fro... | bsd-3-clause |
consulo/consulo-python | plugin/src/main/dist/helpers/pydev/pydev_ipython/inputhookqt4.py | 104 | 7242 | # -*- coding: utf-8 -*-
"""
Qt4's inputhook support function
Author: Christian Boos
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, d... | apache-2.0 |
soumyajitpaul/Soumyajit-Github-Byte-3 | lib/flask/sessions.py | 348 | 12882 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from datetime import datetime
from werkzeug.http import http_date, ... | apache-2.0 |
jaggu303619/asylum | openerp/netsvc.py | 8 | 12196 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
renzon/pswdless | backend/appengine/config/template_middleware.py | 35 | 3100 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from google.appengine.api.namespace_manager import get_namespace
from jinja2.exceptions import TemplateNotFound
from tekton import router
from tekton.gae.middleware.response import ResponseBase
from tekton.gae.middleware import Middleware... | gpl-2.0 |
dcjohnston/geojs | dashboard/github_service/dashboard.py | 2 | 5762 | #!/usr/bin/env python
import os
import shutil
import socket
from datetime import datetime
import subprocess as sp
import json
from pymongo import MongoClient
_ctest = '''
set(CTEST_SOURCE_DIRECTORY "{source}")
set(CTEST_BINARY_DIRECTORY "{build}")
include(${{CTEST_SOURCE_DIRECTORY}}/CTestConfig.cmake)
set(CTEST_SI... | bsd-3-clause |
hujiajie/chromium-crosswalk | tools/perf_expectations/update_perf_expectations_unittest.py | 161 | 10350 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""Unit tests for update_perf_expectations."""
import copy
from StringIO import StringIO
import unittest
import make_expectations as... | bsd-3-clause |
mozilla/stoneridge | python/src/Lib/lib-tk/test/test_ttk/test_widgets.py | 21 | 39530 | import unittest
import Tkinter
import ttk
from test.test_support import requires, run_unittest
import sys
import support
from test_functions import MockTclObj, MockStateSpec
requires('gui')
class WidgetTest(unittest.TestCase):
"""Tests methods available in every ttk widget."""
def setUp(self):
suppo... | mpl-2.0 |
ojengwa/odoo | addons/product_extended/wizard/wizard_price.py | 270 | 3043 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>).
# $Id$
#
# This program is free... | agpl-3.0 |
andrewcmyers/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/layers/fully_connected.py | 106 | 2900 | # 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 |
kittiu/account-invoicing | account_group_invoice_lines/__openerp__.py | 4 | 1576 | # -*- coding: utf-8 -*-
##############################################################################
#
# account_group_invoice_lines module for Odoo
# Copyright (C) 2012-2015 SYLEAM Info Services (<http://www.syleam.fr/>)
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author: Sébastien LANGE <... | agpl-3.0 |
mholgatem/GPIOnext | config/menus.py | 1 | 4183 | import time
from config.constants import *
from config import SQL
from cursesmenu import *
from cursesmenu.items import *
import curses
'''
---------------------------------------------------------
This script handles menu navigation
RETURNS: dictionary containing device name,
number of buttons, number of axis
-... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/comtypes-1.1.3-py2.7.egg/comtypes/client/__init__.py | 5 | 10460 | '''comtypes.client - High level client level COM support package.
'''
################################################################
#
# TODO:
#
# - refactor some code into modules
#
################################################################
import sys, os
import ctypes
import comtypes
from comtypes.hresult ... | gpl-3.0 |
Statoil/libres | python/tests/res/enkf/data/test_custom_kw.py | 1 | 4935 | import os
import pytest
from res.enkf.enums import EnkfRunType
from res.enkf import ErtRunContext
from res.enkf.config import CustomKWConfig
from res.enkf.data import CustomKW
from res.enkf.enkf_simulation_runner import EnkfSimulationRunner
from res.enkf.export import custom_kw_collector
from res.enkf.export.custom_k... | gpl-3.0 |
kashefy/nideep | nideep/iow/test_read_img.py | 1 | 5461 | '''
Created on Oct 30, 2015
@author: kashefy
'''
from nose.tools import assert_equal, assert_almost_equals
from mock import patch
import os
import tempfile
import shutil
import numpy as np
import cv2 as cv2
import read_img as r
class TestReadImage:
@classmethod
def setup_class(self):
self.dir_tmp = ... | bsd-2-clause |
mottosso/mindbender-setup | bin/pythonpath/bson/raw_bson.py | 17 | 3504 | # Copyright 2015 MongoDB, 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 writing, so... | mit |
jgeskens/django | tests/aggregation_regress/tests.py | 5 | 44406 | from __future__ import absolute_import, unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.core.exceptions import FieldError
from django.contrib.contenttypes.models import ContentType
from django.db.models import Count, Max, Avg, Sum, StdDev, Varianc... | bsd-3-clause |
jwlawson/tensorflow | tensorflow/contrib/boosted_trees/examples/mnist.py | 64 | 5840 | # 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 |
mahim97/zulip | zerver/management/commands/set_default_streams.py | 8 | 1912 |
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
from typing import Any, Dict, Text
from zerver.lib.actions import set_default_streams
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help = """Set default streams for a realm
Users created under this realm ... | apache-2.0 |
aldian/tensorflow | tensorflow/python/keras/_impl/keras/utils/vis_utils.py | 13 | 5438 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
rlr/fjord | vendor/packages/urllib3/dummyserver/proxy.py | 22 | 4707 | #!/usr/bin/env python
#
# Simple asynchronous HTTP proxy with tunnelling (CONNECT).
#
# GET/POST proxying based on
# http://groups.google.com/group/python-tornado/msg/7bea08e7a049cf26
#
# Copyright (C) 2012 Senko Rasic <senko.rasic@dobarkod.hr>
#
# Permission is hereby granted, free of charge, to any person obtaining a... | bsd-3-clause |
ltiao/networkx | networkx/generators/social.py | 45 | 10871 | """
Famous social networks.
"""
import networkx as nx
__author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>',
'Katy Bold <kbold@princeton.edu>',
'Aric Hagberg <aric.hagberg@gmail.com)'])
__all__ = ['karate_club_graph', 'davis_southern_women_graph',
... | bsd-3-clause |
lexus24/w16b_test | static/Brython3.1.1-20150328-091302/Lib/_codecs.py | 526 | 4147 |
def ascii_decode(*args,**kw):
pass
def ascii_encode(*args,**kw):
pass
def charbuffer_encode(*args,**kw):
pass
def charmap_build(*args,**kw):
pass
def charmap_decode(*args,**kw):
pass
def charmap_encode(*args,**kw):
pass
def decode(*args,**kw):
"""decode(obj, [encoding[,errors]]) -> ob... | agpl-3.0 |
ojengwa/oh-mainline | vendor/packages/docutils/test/local_dummy_lang.py | 18 | 5350 | # $Id: local_dummy_lang.py 7504 2012-08-27 07:55:20Z grubert $
# 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 b... | agpl-3.0 |
Mhynlo/SickRage | lib/tornado/test/options_test.py | 14 | 10324 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, with_statement
import datetime
import os
import sys
from tornado.options import OptionParser, Error
from tornado.util import basestring_type, PY3
from tornado.test.util import unittest
if PY3:
from io import StringIO
else:
... | gpl-3.0 |
ryano144/intellij-community | python/lib/Lib/xml/etree/__init__.py | 183 | 1604 | # $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2004 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | apache-2.0 |
auready/django | django/contrib/gis/db/backends/spatialite/schema.py | 33 | 6791 | from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
from django.db.utils import DatabaseError
class SpatialiteSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_column = (
"SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, "
"%(geom_type)s, %(dim)s, %(null)s)"
)
sq... | bsd-3-clause |
endlessm/chromium-browser | third_party/shaderc/src/glslc/test/option_dash_M.py | 3 | 33038 | # Copyright 2015 The Shaderc 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 applicable... | bsd-3-clause |
srepho/BDA_py_demos | demos_ch10/demo10_1.py | 19 | 4102 | """Bayesian data analysis
Chapter 10, demo 1
Rejection sampling example
"""
from __future__ import division
import numpy as np
from scipy import stats
import matplotlib as mpl
import matplotlib.pyplot as plt
# edit default plot settings (colours from colorbrewer2.org)
plt.rc('font', size=14)
plt.rc('lines', color='... | gpl-3.0 |
jctanner/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/lldp_interfaces/lldp_interfaces.py | 47 | 5314 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos lldp_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based ... | gpl-3.0 |
tanium/pytan | EXAMPLES/PYTAN_API/export_basetype_csv_with_sort_list.py | 1 | 6607 | #!/usr/bin/env python
"""
Export a BaseType from getting objects as CSV with name and description for header_sort
"""
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me t... | mit |
vijaysbhat/incubator-airflow | airflow/utils/email.py | 22 | 4195 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
alexston/calibre-webserver | src/calibre/ebooks/metadata/worker.py | 6 | 11994 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from threading import Thread
from Queue import Empty
import os, time, sys, shutil, js... | gpl-3.0 |
oudalab/fajita | pythonAPI/flask/lib/python3.5/site-packages/setuptools/command/install_scripts.py | 454 | 2439 | from distutils import log
import distutils.command.install_scripts as orig
import os
import sys
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
... | mit |
tm1249wk/WASHLIGGGHTS-2.3.7 | python/examples/pizza/vmd.py | 31 | 8758 | # Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html
# Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
#
# Copyright (2005) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is... | gpl-2.0 |
OpenPathView/batchPanoMaker | opv_import/helpers/udev_observer.py | 1 | 1433 | # coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# 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.
# ... | gpl-3.0 |
Linkid/numpy | doc/f2py/collectinput.py | 111 | 2300 | #!/usr/bin/env python
"""
collectinput - Collects all files that are included to a main Latex document
with \input or \include commands. These commands must be
in separate lines.
Copyright 1999 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, an... | bsd-3-clause |
shanglt/youtube-dl | youtube_dl/extractor/bild.py | 94 | 1485 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
fix_xml_ampersands,
)
class BildIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bild\.de/(?:[^/]+/)+(?P<display_id>[^/]+)-(?P<id>\d+)(?:,auto=true)?\.bild\.html'
IE_DESC =... | unlicense |
adam-lee/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.