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 |
|---|---|---|---|---|---|
kholidfu/django | django/contrib/gis/geos/linestring.py | 259 | 5843 | from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateMixin,
)
from django.contrib.gis.geos.point import Point
from django... | bsd-3-clause |
microcom/odoo | addons/account_budget/wizard/account_budget_crossovered_report.py | 47 | 1144 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import fields, osv
class account_budget_crossvered_report(osv.osv_memory):
_name = "account.budget.crossvered.report"
_description = "Account Budget crossovered report"
_column... | agpl-3.0 |
qedi-r/home-assistant | tests/components/automation/test_time_pattern.py | 4 | 6381 | """The tests for the time_pattern automation."""
import pytest
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.common import async_fire_time_changed, mock_component
from tests.components.automation import... | apache-2.0 |
waseem18/oh-mainline | vendor/packages/oauthlib/oauthlib/signals.py | 98 | 1521 | # -*- coding: utf-8 -*-
"""
Implements signals based on blinker if available, otherwise
falls silently back to a noop. Shamelessly stolen from flask.signals:
https://github.com/mitsuhiko/flask/blob/master/flask/signals.py
"""
signals_available = False
try:
from blinker import Namespace
signals_avail... | agpl-3.0 |
TRESCLOUD/odoopub | addons/point_of_sale/wizard/pos_box.py | 381 | 2211 |
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.addons.account.wizard.pos_box import CashBox
class PosBox(CashBox):
_register = False
def run(self, cr, uid, ids, context=None):
if not context:
context = dict()
active_model = context.get('active_mod... | agpl-3.0 |
flake123p/ProjectH | Cpp_Platform2X/_toolchain/list_to_build_script.py | 1 | 3345 | #!/usr/bin/python
# Usage: list_to_make_var.py <in-file1:mod list> <in-file2:OFS> <out-file1:build script> <out-file2:clean script> <OS>
# argv: argv[0] argv[1] argv[2] argv[3] argv[4] argv[5]
#
# Include library
#
import os
import sys
def O... | gpl-3.0 |
awkspace/ansible | lib/ansible/plugins/doc_fragments/a10.py | 44 | 1356 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016, John Barker <jobarker@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
host:
description:
... | gpl-3.0 |
gutensite/Gutensite-Docs | conf.py | 2 | 1379 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
from datetime import datetime
# import os
# import sys
# import sphinx_rtd_theme
# sys.path.insert(0, os.path.abspath('..'))
# sys.path.append(os.path.dirname(__file__))
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "read... | gpl-2.0 |
crackerhead/nemio-flask-old | lib/python2.7/site-packages/pip/_vendor/requests/utils.py | 222 | 19653 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... | mit |
daeilkim/refinery | refinery/lib/sbd_util.py | 11 | 2957 | import re, cPickle, os, gzip, sys, math
def save_pickle(data, path):
o = gzip.open(path, 'wb')
cPickle.dump(data, o)
o.close()
def load_pickle(path):
i = gzip.open(path, 'rb')
data = cPickle.load(i)
i.close()
return data
def die(msg):
print '\nERROR: %s' %msg
sys.exit()
def logit... | mit |
koomik/CouchPotatoServer | libs/requests/packages/charade/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/253_test_dummy_threading.py | 43 | 1761 | # Very rudimentary test of threading module
# Create a bunch of threads, let each do some work, wait until all are done
from test.test_support import verbose
import random
import dummy_threading as _threading
import time
class TestThread(_threading.Thread):
def run(self):
global running
# Uncom... | gpl-3.0 |
yanyao/openstack-deployment-liberty | doc/source/conf.py | 5 | 9592 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# openstack-ansible documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 13 20:42:26 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | apache-2.0 |
mweisman/QGIS | python/console/console_output.py | 4 | 12735 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Console for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) com
***... | gpl-2.0 |
priestc/moneywagon | moneywagon/tx.py | 1 | 10878 | from moneywagon import (
get_unspent_outputs, CurrentPrice, get_optimal_fee, PushTx,
get_onchain_exchange_rates
)
from moneywagon.core import get_optimal_services, get_magic_bytes
from bitcoin import mktx, sign, pubtoaddr, privtopub
from .crypto_data import crypto_data
from .currency_support import CurrencySupp... | mit |
jfrkuska/sigrokdecode | decoders/edid/__init__.py | 7 | 1423 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Bert Vermeulen <bert@biot.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; either version 2 of the Lice... | gpl-3.0 |
latlontude/oceanbase | oceanbase_0.4/tests/sql/gen_tablet_scan_test_data.py | 12 | 5651 | import random
import gen_test_data
class IntObj:
def __init__(self):
self.is_add = False
self.value = 0
def __init__(self, is_add, value):
self.is_add = is_add
self.value = value
def to_string(self):
if self.is_add:
return "%d+" % self.value
else:
return "%d" % self.value
... | gpl-2.0 |
argriffing/cvxpy | cvxpy/constraints/soc_elemwise.py | 11 | 2882 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... | gpl-3.0 |
jseabold/scipy | scipy/cluster/doc/ex1.py | 83 | 1319 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.cluster import vq
def cluster_data(data,cluster_cnt,iter=20,thresh=1e-5):
""" Group data into a number of common clusters
data -- 2D array of data points. Each point is a row in the array.
cluster_cnt... | bsd-3-clause |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/checkperms/checkperms.py | 1 | 13388 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the executable
permission... | mit |
bdfoster/blumate | blumate/components/mongo.py | 1 | 5577 | """
A component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influxdb/
"""
import logging
from blumate.helpers.entity import Entity
import blumate.util as util
from blumate import bootstrap
from bl... | mit |
tarzan0820/odoo | openerp/addons/base/res/__init__.py | 384 | 1261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
leb2dg/osf.io | api_tests/nodes/views/test_node_list.py | 2 | 112755 | import pytest
from api.base.settings.defaults import API_BASE, MAX_PAGE_SIZE
from api_tests.nodes.filters.test_filters import NodesListFilteringMixin, NodesListDateFilteringMixin
from framework.auth.core import Auth
from osf.models import AbstractNode, Node, NodeLog
from osf_tests.factories import (
CollectionFact... | apache-2.0 |
kapilgarg1996/gmc | gmc/conf/__init__.py | 1 | 1489 | import os
import importlib
from gmc.conf import global_settings
ENVIRONMENT_VARIABLE = "GMC_SETTINGS_MODULE"
class Settings:
"""
Module to load settings to configure gmc
"""
def __init__(self, *args, **kwargs):
self.settings = None
self.settings_module = None
def __getattr__(self, ... | mit |
doirisks/dori | models/10.1016:j.jacc.2013.11.013/config_gener_a.py | 1 | 7083 | # -*- coding: utf-8 -*-
# a template for making config.json files for functions
#import pprint
#pp = pprint.PrettyPrinter(indent=4)
config = {}
# human and machine readable names for the model
config['id'] = {}
config['id']['DOI'] = '10.1016/j.jacc.2013.11.013'
config['id']['papertitle'] = 'Factors Associated With M... | gpl-3.0 |
thanhuwng/namebench | nb_third_party/dns/rdtypes/IN/PX.py | 248 | 3792 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
youfoh/webkit-efl | Tools/Scripts/webkitpy/common/watchlist/watchlistrule.py | 132 | 2153 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lgpl-2.1 |
40023154/final0627 | static/Brython3.1.1-20150328-091302/Lib/test/re_tests.py | 879 | 31796 | #!/usr/bin/env python3
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex... | gpl-3.0 |
happyleavesaoc/home-assistant | tests/components/mqtt/test_server.py | 21 | 3006 | """The tests for the MQTT component embedded server."""
from unittest.mock import Mock, MagicMock, patch
from homeassistant.setup import setup_component
import homeassistant.components.mqtt as mqtt
from tests.common import (
get_test_home_assistant, mock_coro, mock_http_component)
class TestMQTT:
"""Test th... | apache-2.0 |
babycaseny/audacity | lib-src/lv2/lv2/waflib/Tools/c_preproc.py | 181 | 16705 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re,string,traceback
from waflib import Logs,Utils,Errors
from waflib.Logs import debug,error
class PreprocError(Errors.WafError):
pass
POPFILE='-'
recursion_limit=150
... | gpl-2.0 |
wskplho/sl4a | python/src/Lib/test/test_pprint.py | 55 | 24560 | import pprint
import test.test_support
import unittest
import test.test_set
try:
uni = unicode
except NameError:
def uni(x):
return x
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
pass
class list3(list):
def __repr__(self):
return list.__repr... | apache-2.0 |
cchurch/ansible | lib/ansible/modules/windows/win_timezone.py | 50 | 1848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Phil Schwartz <schwartzmx@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by... | gpl-3.0 |
foromer4/scrapy | scrapy/utils/url.py | 11 | 3775 | """
This module contains general purpose URL functions not found in the standard
library.
Some of the functions that used to be imported from this module have been moved
to the w3lib.url module. Always import those from there instead.
"""
import posixpath
import re
from six.moves.urllib.parse import (ParseResult, urld... | bsd-3-clause |
rotofly/odoo | addons/l10n_es/__openerp__.py | 314 | 2772 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# Copy... | agpl-3.0 |
tzanussi/linux-yocto-micro-3.17 | Documentation/target/tcm_mod_builder.py | 868 | 40692 | #!/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 |
mozilla/addons-server | src/olympia/api/pagination.py | 4 | 2100 | from collections import OrderedDict
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from olympia.amo.pagination import ESPaginator
class CustomPageNumberPagination(PageNumberPagination):
page_size_query_param = 'page_size'
max_page_size = 50
def g... | bsd-3-clause |
GunnerJnr/_CodeInstitute | Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/2.How-To-Test-Views-And-Urls/we_are_social/accounts/forms.py | 8 | 1889 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.core.exceptions import ValidationError
from accounts.models import User
class UserRegistrationForm(UserCreationForm):
MONTH_ABBREVIATIONS = [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June',
'July', 'Aug', 'Sept... | mit |
rvmoura96/projeto-almoxarifado | myvenv/Lib/site-packages/pip/operations/freeze.py | 342 | 5194 | from __future__ import absolute_import
import logging
import re
import pip
from pip.req import InstallRequirement
from pip.req.req_file import COMMENT_RE
from pip.utils import get_installed_distributions
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.p... | mit |
UNINETT/nav | python/nav/statemon/abstractchecker.py | 2 | 9142 | #
# Copyright (C) 2018 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 3 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope... | gpl-2.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.91/library/kubeclient_ca.py | 19 | 2823 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
''' kubeclient_ca ansible module '''
import base64
import yaml
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
---
module: kubeclient_ca
short_description: Modify kubeclient certificate-authority-data
author: ... | apache-2.0 |
bearstech/ansible | lib/ansible/modules/network/junos/junos_system.py | 5 | 5973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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.0',
... | gpl-3.0 |
MSEMJEJME/Get-Dumped | renpy/defaultstore.py | 1 | 10575 | # Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... | gpl-2.0 |
sarvex/depot-tools | third_party/gsutil/gslib/addlhelp/prod.py | 51 | 8580 | # Copyright 2012 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 a... | bsd-3-clause |
Mistobaan/tensorflow | tensorflow/python/estimator/run_config_test.py | 11 | 41429 | # 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 |
40223240/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementTree.py | 730 | 61800 | #
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl removed support for ... | agpl-3.0 |
ihrwein/yarg | yarg/gui/listmodel.py | 1 | 8053 | from PyQt5 import QtCore
class QObjectListModel(QtCore.QAbstractListModel):
"""
QObjectListModel provides a more powerful, but still easy to use, alternative to using
QObjectList lists as models for QML views. As a QAbstractListModel, it has the ability to
automatically notify the view of specific cha... | gpl-2.0 |
jmartty/taller2server | tests/rest/Test_rest.py | 1 | 25876 | # -*- coding: utf-8 -*-
import requests
import unittest
import json
class TestRestApi(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestRestApi, self).__init__(*args, **kwargs)
self.__api_base_url = "http://localhost:5000"
self.__user_url = "/usuario/"
self.__ruser = "?r_user="
self.__toke... | gpl-2.0 |
XiaodunServerGroup/medicalmooc | common/djangoapps/student/migrations/0015_auto__add_courseenrollment__add_unique_courseenrollment_user_course_id.py | 188 | 10997 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseEnrollment'
db.create_table('student_courseenrollment', (
('id', self.gf('... | agpl-3.0 |
spektom/incubator-airflow | airflow/providers/apache/spark/operators/spark_jdbc.py | 4 | 10102 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
caramucho/ns3-ndnsim | examples/tutorial/first.py | 97 | 2115 | # /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the ... | gpl-2.0 |
k11a/snmptablemixer | pyasn1/type/univ.py | 11 | 97547 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import sys
import math
from pyasn1.type import base, tag, constraint, namedtype, namedval, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat import octets, inte... | gpl-3.0 |
smartfile/django-1.4 | django/template/loaders/app_directories.py | 88 | 2337 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... | bsd-3-clause |
Smart-Torvy/torvy-home-assistant | homeassistant/components/sensor/openexchangerates.py | 5 | 3655 | """
Support for openexchangerates.org exchange rates service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.openexchangerates/
"""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
from homeassistant.compone... | mit |
purism/pdak | dak/dakdb/update70.py | 1 | 3429 | #!/usr/bin/env python
# coding=utf8
"""
Add suite options for overrides and control-suite to DB
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2011 Mark Hymers <mhy@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or ... | gpl-2.0 |
tnemis/staging-server | teachers/forms.py | 2 | 4419 | from django import forms
from teachers.models import *
# from baseapp.models import *
class Teacher_detailform(forms.ModelForm):
class Meta:
model = Teacher_detail
exclude = ('count','transfer_flag','ofs_flag','ofs_reason','ofs_date','super_annum_flag')
class Teacher_outofserviceform(forms.ModelFo... | mit |
dsyang/buck | third-party/py/pex/pex/translator.py | 39 | 6441 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import os
import traceback
from abc import abstractmethod
from .archiver import Archiver
from .common import chmod_plus_w, safe_copy, safe_mkdtemp,... | apache-2.0 |
ygol/odoo | addons/website_event/tests/__init__.py | 413 | 1072 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 20123TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
l0b0/cds-invenio-vengmark | modules/bibformat/lib/elements/bfe_publi_info.py | 4 | 2964 | # -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio 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 versio... | gpl-2.0 |
coder-han/hugula | Client/tools/site-packages/xlrd/biffh.py | 8 | 17536 | # -*- coding: cp1252 -*-
##
# Support module for the xlrd package.
#
# <p>Portions copyright © 2005-2010 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p>
##
# 2010-03-01 SJM Reading SCL record
# 2010-03-01 SJM Added more record IDs ... | mit |
emc-openstack/storops | storops/unity/resource/quota_config.py | 1 | 3711 | # coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# 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
#
#... | apache-2.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/python/ops/nn_batchnorm_test.py | 100 | 30491 | # 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... | mit |
xyguo/scikit-learn | benchmarks/bench_plot_incremental_pca.py | 374 | 6430 | """
========================
IncrementalPCA benchmark
========================
Benchmarks for IncrementalPCA
"""
import numpy as np
import gc
from time import time
from collections import defaultdict
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_lfw_people
from sklearn.decomposition import Incre... | bsd-3-clause |
tuxfux-hlp-notes/python-batches | archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/template/base.py | 37 | 52380 | """
This is the Django template system.
How it works:
The Lexer.tokenize() function converts a template string (i.e., a string containing
markup with custom template tags) to tokens, which can be either plain text
(TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK).
The Parser() class takes a list ... | gpl-3.0 |
spyder-ide/spyder.line_profiler | spyder_line_profiler/widgets/lineprofiler.py | 1 | 22093 | # -*- coding: utf-8 -*-
#
# Copyright © 2011 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
"""
Line Profiler widget
See the official documentation of line_profiler:
http://pythonhosted.org/line_profiler/
"""
# Standard library imports
from __future__ import ... | mit |
aselle/tensorflow | tensorflow/contrib/autograph/converters/builtin_functions.py | 11 | 2541 | # 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 |
ryfeus/lambda-packs | Spacy/source2.7/spacy/tokens/printers.py | 1 | 2687 | # coding: utf8
from __future__ import unicode_literals
from .doc import Doc
from ..symbols import HEAD, TAG, DEP, ENT_IOB, ENT_TYPE
def merge_ents(doc):
"""Helper: merge adjacent entities into single tokens; modifies the doc."""
for ent in doc.ents:
ent.merge(ent.root.tag_, ent.text, ent.label_)
... | mit |
petewarden/tensorflow | tensorflow/python/tpu/profiler/capture_tpu_profile.py | 10 | 8276 | # Copyright 2019 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 |
pombredanne/django-url-filter | url_filter/backends/sqlalchemy.py | 1 | 4251 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import itertools
from sqlalchemy import func
from sqlalchemy.orm import class_mapper
from sqlalchemy.sql.expression import not_
from .base import BaseFilterBackend
def lower(value):
try:
return value.lower()... | mit |
kreeger/etcetera | urls.py | 1 | 1576 | from django.conf.urls.defaults import *
from django.contrib.auth.views import login, logout
from django.contrib import admin
from etcetera.settings import SITE_ROOT, DEBUG
admin.autodiscover()
# For master/general use.
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
... | bsd-3-clause |
ephes/gunicorn | examples/frameworks/pylonstest/pylonstest/controllers/error.py | 29 | 1634 | import cgi
from paste.urlparser import PkgResourcesParser
from pylons import request
from pylons.controllers.util import forward
from pylons.middleware import error_document_template
from webhelpers.html.builder import literal
from pylonstest.lib.base import BaseController
class ErrorController(BaseController):
... | mit |
irwinlove/scrapy | tests/test_responsetypes.py | 97 | 3803 | import unittest
from scrapy.responsetypes import responsetypes
from scrapy.http import Response, TextResponse, XmlResponse, HtmlResponse, Headers
class ResponseTypesTest(unittest.TestCase):
def test_from_filename(self):
mappings = [
('data.bin', Response),
('file.txt', TextRespons... | bsd-3-clause |
kaplun/ops | modules/bibupload/lib/bibupload.py | 1 | 146505 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN.
##
## Invenio 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 ... | gpl-2.0 |
javrasya/watchdog | run_tests.py | 1 | 1034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import unittest
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
current_path,
tests_path,
]
all_tests = [f[:-3] for f in os.listdir(tests_path)
if f.start... | apache-2.0 |
ptressel/sahana-eden-madpub | static/selenium/client/test_i18n.py | 9 | 1769 | """
Copyright 2006 ThoughtWorks, 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... | mit |
mamachanko/lymph | lymph/cli/main.py | 7 | 2989 |
def setup_config(args):
import os
import sys
from lymph.config import Configuration
from lymph.utils.sockets import guess_external_ip
vars_file = args.get('--vars') or os.environ.get('LYMPH_VARS')
env_vars = Configuration(raw=True)
if vars_file:
env_vars.load_file(vars_file)
... | apache-2.0 |
TRox1972/youtube-dl | youtube_dl/extractor/pornoxo.py | 8 | 1948 | from __future__ import unicode_literals
import re
from .jwplatform import JWPlatformBaseIE
from ..utils import (
str_to_int,
)
class PornoXOIE(JWPlatformBaseIE):
_VALID_URL = r'https?://(?:www\.)?pornoxo\.com/videos/(?P<id>\d+)/(?P<display_id>[^/]+)\.html'
_TEST = {
'url': 'http://www.pornoxo.co... | unlicense |
redhat-openstack/glance | glance/tests/unit/common/test_scripts.py | 20 | 1442 | # Copyright 2014 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 |
gfarnadi/FairPSL | problems/performance_review/evaluation.py | 1 | 4029 |
def calculate(counts,result):
n1 = 0.0
n2 = 0.0
a = 0.0
c = 0.0
for f1,f2,d in counts:
f1f2 = max(f1+f2-1,0)
nf1f2 = max(-f1+f2,0)
n1 += f1f2
n2 += nf1f2
if d[0]:
a+= max(f1f2 - d[1],0)
c+= max(nf1f2 - d[1],0)
else:
... | mit |
DXCanas/kolibri | kolibri/core/auth/migrations/0001_initial.py | 1 | 8724 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-14 05:22
from __future__ import unicode_literals
import uuid
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import morango.utils.uuids
import mptt.fields
from django.db import migrations
from django.db import m... | mit |
sashs/Ropper | ropper/common/enum.py | 1 | 7565 | # coding=utf-8
# Copyright 2018 Sascha Schirra
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following di... | bsd-3-clause |
mucximilian/gimpmaps | gimprenderer/draw_circle.py | 1 | 1230 | #!/usr/bin/env python
# Draws a 150 px radius circle centered in an 800x600 px image
# Adapted from a scheme script-fu contributed by Simon Budig
from gimpfu import *
def draw_circle():
width = 600
height = 600
image = pdb.gimp_image_new(width, height, RGB)
layer = gimp.Layer(image, "layer", image.width, ... | gpl-2.0 |
fluxw42/youtube-dl | youtube_dl/extractor/thesun.py | 45 | 1067 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .ooyala import OoyalaIE
class TheSunIE(InfoExtractor):
_VALID_URL = r'https://(?:www\.)?thesun\.co\.uk/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'https://www.thesun.co.uk/tvandshowbiz/2261604/orlando-bloom-and-katy-pe... | unlicense |
warmchang/shadowsocks | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
heeraj123/oh-mainline | vendor/packages/html5lib/html5lib/treewalkers/soup.py | 106 | 2423 | import re
import gettext
_ = gettext.gettext
from BeautifulSoup import BeautifulSoup, Declaration, Comment, Tag
from html5lib.constants import namespaces
import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
doctype_regexp = re.compile(
r'DOCTYPE\s+(?P<name>[^\s]*)(\s*PUBLIC\s*"(?P<publicId>.*)"\s*... | agpl-3.0 |
alexanderlz/redash | redash/query_runner/dynamodb_sql.py | 3 | 4120 | import logging
import sys
from redash.query_runner import *
from redash.utils import json_dumps
logger = logging.getLogger(__name__)
try:
from dql import Engine, FragmentEngine
from dynamo3 import DynamoDBError
from pyparsing import ParseException
enabled = True
except ImportError as e:
enabled ... | bsd-2-clause |
cntnboys/410Lab6 | build/django/django/contrib/gis/gdal/prototypes/ds.py | 79 | 4256 | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from djang... | apache-2.0 |
inspirehep/invenio | modules/bibauthorid/lib/bibauthorid_rabbit_regression_tests.py | 4 | 35958 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN.
#
# Invenio 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 |
Bideau/SmartForrest | PythonServer/lib/python2.7/site-packages/setuptools/command/bdist_rpm.py | 1049 | 1508 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | mit |
nagyistoce/odoo-dev-odoo | addons/account/wizard/account_subscription_generate.py | 347 | 2254 | # -*- 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 |
grze/parentheses | clc/eucadmin/eucadmin/describeeucalyptus.py | 7 | 1992 | # Copyright 2011-2012 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | gpl-3.0 |
jingyu/git-repo | git_config.py | 20 | 20725 | #
# Copyright (C) 2008 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 la... | apache-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py | 451 | 4833 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... | mit |
igraph/xdata-igraph | interfaces/python/igraph/drawing/graph.py | 2 | 40269 | """
Drawing routines to draw graphs.
This module contains routines to draw graphs on:
- Cairo surfaces (L{DefaultGraphDrawer})
- UbiGraph displays (L{UbiGraphDrawer}, see U{http://ubietylab.net/ubigraph})
It also contains routines to send an igraph graph directly to
(U{Cytoscape<http://www.cytoscape.org>}) using... | gpl-2.0 |
beagles/neutron_hacking | neutron/services/vpn/service_drivers/__init__.py | 1 | 3163 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013, Nachi Ueno, NTT I3, 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-2.0 |
absoludity/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | mpl-2.0 |
schriftgestalt/robofab | Tools/installFontLab/installerScript.py | 8 | 1195 | # This is a automatically generated installer script for FontLab
# Generated on %(timeStamp)s
# scriptVersion: %(scriptVersion)s
p = "%(appLogPath)s"
log(p,"-" * 50)
log(p,"hello, this is application: %(appName)s")
log(p,"Running script version: %(scriptVersion)s")
log(p,"Platform:"+platform.platform())
resultData = [... | bsd-3-clause |
lattwood/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/findusers.py | 121 | 2222 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
sierisimo/PySongGen | PySongGen.py | 1 | 2115 | #! /usr/bin/env python3
# Name: PySongGen
#
# Version: 0.0.1
#
# Author: Sinuhe Jaime Valencia
#
# Author_email: sierisimo@gmail.com
#
# Description:
# Main code for running instances of pysonggen
from pysonggen import grammar
from pysonggen.songgen import SongG
gram = grammar.Grammar('./examples/example.mgram')... | gpl-2.0 |
fnouama/intellij-community | python/lib/Lib/sre_parse.py | 116 | 26883 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | apache-2.0 |
kuiwei/kuiwei | common/djangoapps/util/cache.py | 62 | 2167 | """
This module aims to give a little more fine-tuned control of caching and cache
invalidation. Import these instead of django.core.cache.
Note that 'default' is being preserved for user session caching, which we're
not migrating so as not to inconvenience users by logging them all out.
"""
from functools import wrap... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.