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 |
|---|---|---|---|---|---|
LeonChambers/bwhglass-server | lib/cloudstorage/errors.py | 147 | 3957 | # 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 ag... | apache-2.0 |
pacoqueen/bbinn | BD/init_db.py | 2 | 1771 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Inicializa la base de datos de la copia de seguridad tomando los parámetros
del archivo de configuración indicado en el segundo parámetro.
"""
import os, sys
def usage():
print "%s dump_datos.sql[.tar.bz2] ../framework/ginn.conf(.xxxx)" % sys.argv[0]
def descom... | gpl-2.0 |
popazerty/enigma2-obh | lib/python/Plugins/SystemPlugins/OSDPositionSetup/plugin.py | 43 | 4969 | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry
config.plugins.OSDPositionSetup = ConfigSubsection()
config.plugins.OSDPositionSetup.dst_left = ConfigInteger(default = 0)
config.... | gpl-2.0 |
dewaka/python-koans | python3/koans/about_dictionaries.py | 26 | 1965 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutHashes in the Ruby Koans
#
from runner.koan import *
class AboutDictionaries(Koan):
def test_creating_dictionaries(self):
empty_dict = dict()
self.assertEqual(dict, type(empty_dict))
self.assertDictEqual({}, empty_dict)
... | mit |
mlesche/deep_seq_pipeline | deep_seq_pipeline/src/configfile/configbuild.py | 1 | 5486 | '''
The MIT License (MIT)
Copyright (c) <2014> <Mathias Lesche>
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, ... | mit |
B-MOOC/edx-platform | lms/djangoapps/courseware/features/events.py | 177 | 2247 | # pylint: disable=missing-docstring
from lettuce import step
from lettuce import world
from lettuce import before
from pymongo import MongoClient
from nose.tools import assert_equals
from nose.tools import assert_in
REQUIRED_EVENT_FIELDS = [
'agent',
'event',
'event_source',
'event_type',
'host',
... | agpl-3.0 |
Jgarcia-IAS/SAT | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/l10n_pe_ple06/__init__.py | 4 | 1484 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
mudler/entropy | lib/entropy/const.py | 5 | 56058 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Framework constants module}.
This module contains all the Entropy constants used all around
the "entropy" package.
Some of the co... | gpl-2.0 |
ryenus/vbox | src/VBox/GuestHost/OpenGL/state_tracker/convert.py | 26 | 1874 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
# Two different paths to the packer and opengl_stub directories since this
# script will be called from both cr/state_tracker/ and cr/spu/tilesort/.
sys.path.append... | gpl-2.0 |
rupesh0314/cassandra | pylib/cqlshlib/test/test_cqlsh_output.py | 43 | 32248 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
EuroPython/djep | pyconde/core/management/commands/optimize_media_images.py | 2 | 3005 | import json
import os
import re
import subprocess
from optparse import make_option
from django.conf import settings
from django.core.management import BaseCommand
from easy_thumbnails.conf import settings as thumbnail_settings
thumb_re = re.compile(
r'^%s(.*)\.\d{1,}x\d{1,}_[-\w]*q([1-9]\d?|100)(_crop)?\.(jpg|... | bsd-3-clause |
heiths/allura | ForgeWiki/forgewiki/tests/test_converters.py | 3 | 3119 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | apache-2.0 |
bigdataelephants/scikit-learn | sklearn/ensemble/weight_boosting.py | 26 | 40570 | """Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseWeightBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each ot... | bsd-3-clause |
gurneyalex/OpenUpgrade | addons/l10n_in_hr_payroll/report/report_payroll_advice.py | 374 | 3442 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
Anonymouslemming/ansible | lib/ansible/modules/files/iso_extract.py | 17 | 3672 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>
# (c) 2016, Matt Robinson <git@nerdoftheherd.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
# th... | gpl-3.0 |
KanchanChauhan/erpnext | erpnext/patches/v5_8/update_order_reference_in_return_entries.py | 69 | 3464 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Delivery Note")
frappe.reload_doctype("Sales Invoice")
frappe.reload_doctype("Purchase Receip... | gpl-3.0 |
robdennis/sideboard | tests/plugins/manypackages/multi/env/lib/python2.7/site-packages/paver/deps/path3.py | 12 | 35230 | #
# Copyright (c) 2010 Mikhail Gusarov
#
# 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, d... | bsd-3-clause |
ilexius/odoo | addons/mass_mailing/__openerp__.py | 8 | 1414 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Mass Mailing Campaigns',
'summary': 'Design, send and track emails',
'description': """
Easily send mass mailing to your leads, opportunities or customers. Track
marketing campaigns performance to ... | gpl-3.0 |
AtScaleInc/Impala | tests/metadata/test_set.py | 10 | 1349 | #!/usr/bin/env python
# Copyright (c) 2014 Cloudera, 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 requir... | apache-2.0 |
kiith-sa/QGIS | tests/src/python/test_qgsspatialindex.py | 7 | 2064 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSpatialIndex.
.. note:: 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 versi... | gpl-2.0 |
mindnervestech/mnrp | addons/google_spreadsheet/google_spreadsheet.py | 103 | 5583 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | agpl-3.0 |
kuiwei/kuiwei | common/djangoapps/student/migrations/0023_add_test_center_registration.py | 183 | 19003 | # -*- 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 'TestCenterRegistration'
db.create_table('student_testcenterregistration', (
('id... | agpl-3.0 |
shitizadmirer/unimap.ns-3noc | bindings/python/apidefs/gcc-ILP32/ns3_module_emu.py | 10 | 13584 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## emu-net-device.h: ns3::EmuNetDevice [class]
module.add_class('EmuNetDevice', parent=root_module['ns3::NetDevice'])
## emu-net-device.h: ns3::EmuNetDevice... | gpl-2.0 |
Wingless-Archangel/spiderfoot | ext/pythonwhois/net.py | 8 | 4043 | import socket, re, sys
from codecs import encode, decode
from . import shared
def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=False, with_server_list=False, server_list=None):
previous = previous or []
server_list = server_list or []
# Sometimes IANA simply won't give us the right root W... | gpl-2.0 |
rigetticomputing/grove | grove/alpha/fermion_transforms/bktransform.py | 1 | 4976 | ###############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | apache-2.0 |
Jannes123/django-oscar | src/oscar/apps/analytics/migrations/0001_initial.py | 49 | 3890 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from decimal import Decimal
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations =... | bsd-3-clause |
2087829p/tangowithdjango | tango_with_django_project/tango_with_django_project/settings.py | 1 | 3469 | """
Django settings for tango_with_django_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join... | gpl-2.0 |
hilaglanz/TCE | StarFromMesaCSVFile.py | 1 | 4614 | import os
from amuse.datamodel import *
from amuse.community.mesa.interface import MESA
from amuse.units import constants
def ParseCSV(filePath):
print "**"
dictionary = dict()
with open(filePath) as csvFile:
headers = csvFile.readline().replace('\n','').split(", ")
print '---------------'
... | gpl-2.0 |
appsembler/edx-platform | openedx/core/djangoapps/theming/middleware.py | 22 | 1071 | """
Middleware for theming app
Note:
This middleware depends on "django_sites_extensions" app
So it must be added to INSTALLED_APPS in django settings files.
"""
from django.conf import settings
from .models import SiteTheme
from .views import get_user_preview_site_theme
class CurrentSiteThemeMiddleware(obj... | agpl-3.0 |
catapult-project/catapult | third_party/Paste/tests/test_grantip.py | 47 | 1272 | from paste.auth import grantip
from paste.fixture import *
def test_make_app():
def application(environ, start_response):
start_response('200 OK', [('content-type', 'text/plain')])
lines = [
str(environ.get('REMOTE_USER')),
':',
str(environ.get('REMOTE_USER_TOKEN... | bsd-3-clause |
cloew/DevLog | devlog/dates/log_month.py | 1 | 1389 | from .log_day import LogDay
from ..files import DateFiles
from kao_list import KaoList
from kao_try import Try
class LogMonth:
""" Represents a specific Log Month directory """
def __init__(self, date, year):
""" Initialize with the date to wrap and the parent year """
self.dat... | mit |
dmccue/ansible | lib/ansible/playbook/role/definition.py | 7 | 6892 | # (c) 2014 Michael DeHaan, <michael@ansible.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) any later ve... | gpl-3.0 |
ardekantur/pyglet | experimental/input/dinput.py | 28 | 15854 | #!/usr/bin/python
# $Id:$
import ctypes
import pyglet
from pyglet import com
from pyglet.window.win32 import _kernel32
lib = ctypes.oledll.dinput8
LPVOID = ctypes.c_void_p
WORD = ctypes.c_uint16
DWORD = ctypes.c_uint32
LPDWORD = ctypes.POINTER(DWORD)
BOOL = ctypes.c_int
WCHAR = ctypes.c_wchar
UINT ... | bsd-3-clause |
jaimahajan1997/sympy | sympy/core/tests/test_logic.py | 46 | 4889 | from sympy.core.logic import (fuzzy_not, Logic, And, Or, Not, fuzzy_and,
fuzzy_or, _fuzzy_group, _torf)
from sympy.utilities.pytest import raises
T = True
F = False
U = None
def test_torf():
from sympy.utilities.iterables import cartes
v = [T, F, U]
for i in cartes(*[v]*3):
assert _torf(i) is... | bsd-3-clause |
silky/PeachPy | test/x86_64/encoding/test_avx.py | 5 | 133850 | # This file is auto-generated by /codegen/x86_64_test_encoding.py
# Reference opcodes are generated by:
# GNU assembler (GNU Binutils) 2.25
from peachpy.x86_64 import *
import unittest
class TestVMOVSS(unittest.TestCase):
def runTest(self):
self.assertEqual(bytearray([0xC4, 0xC1, 0x7A, 0x10, 0x4C, 0x... | bsd-2-clause |
yvaucher/vertical-ngo | framework_agreement_sourcing/tests/test_logistic_order_line_to_source_line.py | 1 | 7030 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
jblackburne/scikit-learn | examples/gaussian_process/plot_gpc_isoprobability.py | 64 | 3049 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=================================================================
Iso-probability lines for Gaussian Processes classification (GPC)
=================================================================
A two-dimensional classification example showing iso-probability lines for... | bsd-3-clause |
thefab/rdlm-py | setup.py | 1 | 1924 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of rdlm-py released under the MIT license.
# See the LICENSE file for more information.
from setuptools import setup, find_packages
import rdlmpy
DESCRIPTION = "rdlm-py is a python client for RDLM (Restful Distributed Lock Manager)"
try:
with ope... | mit |
pythonlittleboy/python_gentleman_crawler | ml/Forcast.py | 1 | 2599 | from index import MovieDAO
from index import SysConst
from ml import BayesTrainingFromDB as bayes
def forcastToDB():
localBayes = bayes.BayesTrainingFromDB("local")
vrBayes = bayes.BayesTrainingFromDB("vr")
movies = MovieDAO.getMoviesByCondition("local is null")
conn = SysConst.getConnect()
for ... | apache-2.0 |
EPDCenter/android_kernel_rikomagic_mk808 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
srikantbmandal/ansible | lib/ansible/modules/network/dellos9/dellos9_facts.py | 62 | 18074 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# 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 versi... | gpl-3.0 |
tersmitten/ansible | lib/ansible/playbook/play_context.py | 36 | 17092 | # -*- coding: utf-8 -*-
# (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,... | gpl-3.0 |
m1ssou/zulip | zerver/management/commands/realm_alias.py | 113 | 1791 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import Realm, RealmAlias, get_realm
from zerver.lib.actions import realm_aliases
import sys
class Command(BaseCommand):
help = """Manage aliases for the specified realm"""
def add_arguments(self, par... | apache-2.0 |
segurac/richEmbeddings | models/single_modality/word_embeddings/seq_model.py | 1 | 3772 | import torch
import torch.nn as nn
import torchvision.models as models
from torch.autograd import Variable
import numpy as np
class Word_Embeddings_sequence_model(nn.Module):
def __init__(self, vocab_size, embedding_size, nhid, nlayers, dropout=0.5, pretrained_embedding_path = None):
super(Word_Embeddings... | apache-2.0 |
yrizk/django-blog | blogvenv/lib/python3.4/site-packages/django/contrib/gis/gdal/datasource.py | 82 | 4913 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | apache-2.0 |
spottradingllc/zoom | server/zoom/agent/predicate/pred_and.py | 1 | 2478 | import logging
from zoom.agent.predicate.simple import SimplePredicate
class PredicateAnd(SimplePredicate):
def __init__(self, comp_name, predicates, parent=None):
"""
:type comp_name: str
:type predicates: list of zoom.agent.entities.predicate objects
:type parent: str or None
... | gpl-2.0 |
JanLaureys/chirp | python-twitter-1.1/twitter_test.py | 6 | 29907 | #!/usr/bin/env python
# -*- coding: utf-8 -*-#
# vim: sw=2 ts=2 sts=2
#
# Copyright 2007 The Python-Twitter Developers
#
# 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.apach... | mit |
nazo/ansible | lib/ansible/modules/packaging/os/homebrew_tap.py | 42 | 7344 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# Based on homebrew (Andrew Dunham <andrew@du.nham.ca>)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the... | gpl-3.0 |
CCI-MOC/haas | hil/cli/project.py | 2 | 4238 | """Commands related to projects are in this module"""
import click
import time
import sys
from hil.cli.client_setup import client
from hil.cli.helper import print_json, make_table, HIL_TIMEOUT
@click.group()
def project():
"""Commands related to project"""
@project.command(name='create')
@click.argument('projec... | apache-2.0 |
sinuos/breakpad | src/testing/gtest/test/run_tests_test.py | 8 | 20128 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | bsd-3-clause |
AndroidOpenDevelopment/android_external_chromium_org | chrome/common/extensions/docs/server2/api_list_data_source_test.py | 7 | 7638 | #!/usr/bin/env python
# Copyright 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.
import unittest
import json
from api_list_data_source import APIListDataSource
from extensions_paths import CHROME_EXTENSIONS
from ser... | bsd-3-clause |
xzYue/odoo | addons/hw_escpos/__openerp__.py | 315 | 1780 | # -*- 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 |
Slezhuk/ansible | lib/ansible/modules/cloud/rackspace/rax_cdb_database.py | 70 | 5029 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
bocaaust/FreshLife | django_project/env/lib/python2.7/site-packages/django/views/generic/detail.py | 108 | 6233 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.db import models
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
class Sin... | apache-2.0 |
svub/whatsapp-rest-webservice | service/quickstart/migrations/0003_auto_20170704_0923.py | 1 | 1147 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-04 09:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quickstart', '0002_auto_20170704_0922'),
]
operations = [
migrations.AlterF... | mit |
b-me/django | tests/model_inheritance/tests.py | 283 | 17419 | from __future__ import unicode_literals
from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, TransactionTestCase
from django.test.utils import CaptureQueriesCont... | bsd-3-clause |
msabramo/ansible | contrib/inventory/openshift.py | 196 | 3274 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# 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 o... | gpl-3.0 |
charbeljc/partner-contact | partner_auto_salesman/res_partner.py | 37 | 1153 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under... | agpl-3.0 |
manasdas17/sandhi | tests/time_tags_test.py | 8 | 2367 | # Copyright (C) by Josh Blum. See LICENSE.txt for licensing information.
import unittest
import gras
import numpy
import time
class TimeTagsTest(unittest.TestCase):
def test_make_time_tag(self):
t0 = gras.TimeTag()
def test_make_time_tag_from_ticks(self):
t0 = gras.TimeTag.from_ticks(42)
... | gpl-3.0 |
takis/django | django/contrib/gis/gdal/prototypes/srs.py | 471 | 3513 | from ctypes import POINTER, c_char_p, c_int, c_void_p
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (
const_string_output, double_output, int_output, srs_output, string_output,
void_output,
)
# Shortcut generation for routines with known... | bsd-3-clause |
kmonsoor/pyglet | tools/gl_info.py | 21 | 4422 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | bsd-3-clause |
shaufi/odoo | addons/payment_ogone/models/ogone.py | 54 | 19237 | # -*- coding: utf-'8' "-*-"
from hashlib import sha1
import logging
from lxml import etree, objectify
from pprint import pformat
import time
from datetime import datetime
from urllib import urlencode
import urllib2
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp... | agpl-3.0 |
risicle/django | django/contrib/gis/geos/collections.py | 292 | 4986 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
import json
from ctypes import byref, c_int, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateM... | bsd-3-clause |
jmhsi/justin_tinker | data_science/courses/learning_dl_packages/models/research/swivel/text2bin.py | 23 | 2485 | #!/usr/bin/env python
#
# Copyright 2016 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 require... | apache-2.0 |
AOSP-S4-KK/platform_external_chromium_org | tools/perf/measurements/record_per_area.py | 25 | 2273 | # Copyright 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.
import time
from metrics import smoothness
from telemetry.page import page_measurement
class RecordPerArea(page_measurement.PageMeasurement):
def __init_... | bsd-3-clause |
youdonghai/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/ru.py | 128 | 3306 | # -*- coding: utf-8 -*-
# $Id: ru.py 7123 2011-09-12 08:28:31Z milde $
# Author: Roman Suzi <rnd@onego.ru>
# 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... | apache-2.0 |
brahimalaya/K-OS--Konnex-Operating-System | k_os/OIL/Parser.py | 2 | 50101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__version__ = '0.9.0'
__copyright__ = \
"""
k_os (Konnex Operating-System based on the OSEK/VDX-Standard).
(C) 2007-2011 by Christoph Schueler <github.com/Christoph2,
cpu12.gems@googlemail.com>
All Rights Reserved
This... | gpl-2.0 |
gacarrillor/QGIS | python/plugins/processing/tools/raster.py | 39 | 2775 | # -*- coding: utf-8 -*-
"""
***************************************************************************
raster.py
---------------------
Date : February 2013
Copyright : (C) 2013 by Victor Olaya and Alexander Bruy
Email : volayaf at gmail dot com
**********... | gpl-2.0 |
destenson/bitcoin--bitcoin | test/functional/txn_clone.py | 32 | 7658 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fro... | mit |
jzt5132/scikit-learn | examples/manifold/plot_manifold_sphere.py | 258 | 5101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
domob1812/huntercore | test/functional/test_framework/names.py | 1 | 5790 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Daniel Kraft
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# General code for Namecoin tests.
from .test_framework import BitcoinTestFramework
from .util import *
class Name... | mit |
jendap/tensorflow | tensorflow/compiler/tests/xla_test.py | 18 | 10817 | # 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 |
andres-hurtado-lopez/naranjaverdeprod | app/registro_averias/__init__.py | 1 | 9094 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle import template, redirect, abort
import utils
import time
from datetime import datetime
import json
import LogicaNegocios
def GET(**params):
return template('registro_averias_index.html')
def consultar_equipos_GET(**params):
db = utils.ConnectDB()
... | mit |
sunze/py_flask | venv/lib/python3.4/site-packages/kombu/pidbox.py | 23 | 12704 | """
kombu.pidbox
===============
Generic process mailbox.
"""
from __future__ import absolute_import
import socket
import warnings
from collections import defaultdict, deque
from copy import copy
from itertools import count
from threading import local
from time import time
from . import Exchange, Queue, Consumer, ... | mit |
Cazomino05/Test1 | vendor/google-breakpad/src/tools/gyp/test/win/gyptest-link-enable-uac.py | 242 | 3382 | #!/usr/bin/env python
# Copyright 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.
"""
Verifies that embedding UAC information into the manifest works.
"""
import TestGyp
import sys
from xml.dom.minidom import parseString
if... | gpl-3.0 |
ojengwa/grr | parsers/linux_file_parser.py | 2 | 6294 | #!/usr/bin/env python
"""Simple parsers for Linux files."""
import re
from grr.lib import config_lib
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib import utils
class PasswdParser(parsers.FileParser):
"""Parser for passwd files. Yields KnowledgeBaseUser semantic values."""
output_types =... | apache-2.0 |
MiLk/ansible | test/units/modules/network/nxos/test_nxos_interface.py | 27 | 2472 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/idna/idnadata.py | 62 | 32979 | # This file is automatically generated by build-idnadata.py
scripts = {
'Greek': (
0x37000000374,
0x37500000378,
0x37a0000037e,
0x38400000385,
0x38600000387,
0x3880000038b,
0x38c0000038d,
0x38e000003a2,
0x3a3000003e2,
0x3f000000400,
... | gpl-2.0 |
nilnvoid/wagtail | wagtail/wagtailcore/query.py | 3 | 14325 | from __future__ import absolute_import, unicode_literals
import posixpath
from collections import defaultdict
from django import VERSION as DJANGO_VERSION
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.db.models import CharField, Q
from django.db.models.functions i... | bsd-3-clause |
nareshganatra/apiai | lib/jinja2/environment.py | 132 | 50848 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from functools import reduce, partial
from ji... | apache-2.0 |
cmoutard/mne-python | mne/commands/mne_flash_bem.py | 6 | 3560 | #!/usr/bin/env python
"""Create 3-Layers BEM model from Flash MRI images
This program assumes that FreeSurfer and MNE are installed and
sourced properly.
This function extracts the BEM surfaces (outer skull, inner skull, and
outer skin) from multiecho FLASH MRI data with spin angles of 5 and 30
degrees. The multiecho... | bsd-3-clause |
ashishkrishnan/android_kernel_samsung_smdk4412 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
mikewiebe-ansible/ansible | lib/ansible/modules/system/sefcontext.py | 40 | 9800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Dag Wieers (@dagwieers) <dag@wieers.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_ve... | gpl-3.0 |
madengr/nbfm_rec | apps/nbfm_rec.py | 1 | 11302 | #!/usr/bin/env python
"""
Created on Sat Mar 22 17:53:33 2014
@author: madengr
"""
#
# nbfm_rec.py for GNU Radio 3.7
# Louis Brown, KD4HSO
# 6/10/2014
#
# Program to monitor and record multiple NBFM channels.
# Program has been tested on the Ettus N210 + WBX, and Ettus B200.
# Channel list is read from newline delimit... | gpl-3.0 |
jgrocha/QGIS | python/plugins/grassprovider/ext/r_li_cwed_ascii.py | 45 | 1438 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_cwed_ascii.py
------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**********************... | gpl-2.0 |
whelan957/leetcode | python3/LinkedList/leetcode876. Middle of the Linked List.py | 1 | 1168 | # Given a non-empty, singly linked list with head node head, return a middle node of linked list.
# If there are two middle nodes, return the second middle node.
# Example 1:
# Input: [1,2,3,4,5]
# Output: Node 3 from this list (Serialization: [3,4,5])
# The returned node has value 3. (The judge's serialization ... | gpl-3.0 |
sivikt/cassandra | pylib/cqlshlib/cql3handling.py | 9 | 50941 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
xxshutong/openerp-7.0 | openerp/addons/hr_evaluation/__init__.py | 432 | 1084 | # -*- encoding: 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 G... | agpl-3.0 |
ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/pip/_vendor/distlib/util.py | 224 | 51518 | #
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | apache-2.0 |
bblay/iris | lib/iris/tests/test_pickling.py | 2 | 4374 | # (C) British Crown Copyright 2010 - 2013, 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... | gpl-3.0 |
mrquim/mrquimrepo | plugin.video.rebirth/resources/lib/modules/pyaes/blockfeeder.py | 106 | 6646 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | gpl-2.0 |
jbaudoux/account-invoicing | __unported__/account_invoice_merge/wizard/__init__.py | 3 | 1070 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2011 Elico Corp. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
bowlofstew/changes | tests/changes/api/test_snapshotimage_details.py | 2 | 1745 | from changes.config import db
from changes.models import SnapshotImage, SnapshotStatus
from changes.testutils import APITestCase
class SnapshotImageDetailsTest(APITestCase):
def test_simple(self):
project = self.create_project()
snapshot = self.create_snapshot(project)
plan = self.create_p... | apache-2.0 |
KronicKernel/falcon | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
PriceChild/ansible | lib/ansible/utils/unicode.py | 80 | 2250 | # (c) 2012-2014, Toshio Kuratomi <a.badger@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) any lat... | gpl-3.0 |
leandrotoledo/python-telegram-bot | examples/deeplinking.py | 2 | 5294 | #!/usr/bin/env python
# pylint: disable=C0116,W0613
# This program is dedicated to the public domain under the CC0 license.
"""Bot that explains Telegram's "Deep Linking Parameters" functionality.
This program is dedicated to the public domain under the CC0 license.
This Bot uses the Updater class to handle the bot.... | lgpl-3.0 |
ewbankkit/cloud-custodian | tools/c7n_mailer/tests/test_utils.py | 3 | 6663 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from mock import Mock, patch
from c7n_mailer import utils
class FormatStruct(unittest.TestCase):
def test_formats_struct(self):
expected = '{\n "foo": "bar"\n}'
actual = u... | apache-2.0 |
google-code-export/evennia | src/server/oobhandler.py | 2 | 16151 | """
OOBHandler - Out Of Band Handler
The OOBHandler is called directly by out-of-band protocols. It supplies three
pieces of functionality:
function execution - the oob protocol can execute a function directly on
the server. The available functions must be defined
... | bsd-3-clause |
benhuang21828/System-perfomance-graph | examples/twitterstream/twitterstream/serve.py | 12 | 2293 | from gevent import monkey; monkey.patch_all()
import gevent
import tweetstream
import getpass
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
def broadcast_msg(server, ns_name, event, *args):
pkt = dict(type="event",
name... | bsd-3-clause |
vmendez/DIRAC | Core/Security/Properties.py | 10 | 1532 | # $HeadURL$
__RCSID__ = "$Id$"
#
TRUSTED_HOST = "TrustedHost"
# Normal user operations
NORMAL_USER = "NormalUser"
# CS Administrator - possibility to edit the Configuration Service
CS_ADMINISTRATOR = "CSAdministrator"
# Job sharing among members of a group
JOB_SHARING = "JobSharing"
# DIRAC Service Administrator
SERVIC... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.