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 |
|---|---|---|---|---|---|
hdweiss/qt-creator-visualizer | src/libs/3rdparty/botan/doc/scripts/primes.py | 14 | 1164 | #!/usr/bin/env python
import sys
def gcd(x,y):
if x <= 0 or y <= 0:
raise ValueError, "Arguments must be positive integers"
g = y
while x > 0:
g = x
x = y % x
y = g
return g
def gen_primes():
primes = [2,3,5,7,11]
# Primes < 11351 fit into less than 256x64 bit... | lgpl-2.1 |
dsquareindia/scikit-learn | sklearn/manifold/isomap.py | 39 | 7519 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
yliu120/K3 | examples/distributed/LeaderElection/run_k3.py | 1 | 2762 | import csv
from optparse import OptionParser
import subprocess
import os
import sys
import time
#run this script on a non-VM machine
if __name__=='__main__':
usage = "Usagge: %prog [options] <config file>"
parser = OptionParser(usage=usage)
parser.add_option("-t", "--topology", type="string", dest="topology_f... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py | 2 | 1567 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Shaps/ansible | lib/ansible/plugins/lookup/inventory_hostnames.py | 51 | 2334 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMEN... | gpl-3.0 |
koharjidan/bitcoin | qa/rpc-tests/mempool_spendcoinbase.py | 9 | 2708 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 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 spending coinbase transactions.
# The coinbase transaction in block N can appear in block
# N+10... | mit |
Drooids/odoo | addons/hr_timesheet_invoice/__openerp__.py | 260 | 2403 | # -*- 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 |
kkalya/seek | seek_bpc.py | 1 | 5383 | #!/usr/bin/env python
# -*- coding: utf-8 vi:ts=4:noet
# Bad pixel correction calibration for seek thermal camera
import sys, os, re, math
import pickle
import numpy as np
import cv2
class BPC_Static(object):
"""
Perform bad-pixels calibration and correction,
assuming images have pixels in 0-1 range.
"""
def __i... | mit |
abdshomad/WebFundamentals | gae/lib/markdown/serializers.py | 129 | 9820 | # markdown/searializers.py
#
# Add x/html serialization to Elementree
# Taken from ElementTree 1.3 preview with slight modifications
#
# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# ------------------------------------------------------------... | apache-2.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/sumaclust/package.py | 5 | 1836 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
tomik/akimot | other/match/tour.py | 1 | 4914 | import os
import sys
import time
import shutil
MATCH_DIR = "matches"
RECORD_FILE = "record"
DIR_LIST = "list.txt"
LOG_FILE = "log"
MODES=['standalone', 'finish_only', 'master', 'slave', 'test']
def setup(opt):
try:
os.mkdir(opt.game_dir)
except:
pass
def default_game_dir():
try:
... | gpl-3.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/nltk/tag/brill_trainer.py | 3 | 27168 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Marcus Uneson <marcus.uneson@gmail.com>
# based on previous (nltk2) version by
# Christopher Maloof, Edward Loper, Steven Bird
# URL: <http://nltk.org/>
# For license information, see... | mit |
reverie/seddit.com | redditchat/urls.py | 1 | 1079 | from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
from django.views.generic.simple import redirect_to
from root_dir import root_dir
admin.autodiscover()
urlpatterns = patterns('core.views',
(r'^d/getauth/$', 'getauth'),
(r'^d/register/$', 'register'),
... | mit |
mathLab/RBniCS | rbnics/backends/dolfin/matrix.py | 1 | 2749 | # Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from dolfin.cpp.la import GenericMatrix
from rbnics.backends.dolfin.function import Function
from rbnics.backends.dolfin.wrapping import to_petsc4py
from rbnics.backends.dolfin.wrapping.diric... | lgpl-3.0 |
ajaali/django | django/contrib/gis/maps/google/overlays.py | 133 | 11921 | from __future__ import unicode_literals
from functools import total_ordering
from django.contrib.gis.geos import (
LinearRing, LineString, Point, Polygon, fromstr,
)
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import html_safe
@html_safe
@pyt... | bsd-3-clause |
LittleBun/My_Ardupilot | Tools/autotest/param_metadata/xmlemit.py | 238 | 2717 | #!/usr/bin/env python
from xml.sax.saxutils import escape, quoteattr
from param import *
from emit import Emit
# Emit APM documentation in an machine readable XML format
class XmlEmit(Emit):
def __init__(self):
wiki_fname = 'apm.pdef.xml'
self.f = open(wiki_fname, mode='w')
preamble ... | gpl-3.0 |
centwave/jg82ksgvqkuan | django/core/files/images.py | 324 | 1733 | """
Utility functions for handling images.
Requires PIL, as you might imagine.
"""
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def _get_width(self):
ret... | bsd-3-clause |
justbrowsing/justbrowsing-adeskbar | src/plugins/tasklist.py | 1 | 21852 | # -*- coding: utf-8 -*-
import time
import gtk
import pango
import adesk.plugin as Plg
import adesk.core as Core
import adesk.draw
try:
import wnck
except:
Core.logINFO('Plugin "tasklist" need python-wnck')
Core.logINFO(' -- debian/ubuntu : "sudo apt-get install python-wnck"')
def_settings = {
'des... | gpl-3.0 |
2015fallproject/2015fallcase2 | static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_email/__init__.py | 28 | 5528 | import os
import sys
import unittest
import test.support
import email
from email.message import Message
from email._policybase import compat32
from test.test_email import __file__ as landmark
# Run all tests in package for '-m unittest test.test_email'
def load_tests(loader, standard_tests, pattern):
this_dir = os... | agpl-3.0 |
iismd17/scikit-learn | sklearn/linear_model/least_angle.py | 61 | 54324 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... | bsd-3-clause |
guywithnose/android-googletest | test/gtest_output_test.py | 496 | 12051 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
dvliman/jaikuengine | .google_appengine/lib/django-0.96/django/contrib/auth/__init__.py | 32 | 2475 | from django.core.exceptions import ImproperlyConfigured
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_backend'
LOGIN_URL = '/accounts/login/'
REDIRECT_FIELD_NAME = 'next'
def load_backend(path):
i = path.rfind('.')
module, attr = path[:i], path[i+1:]
try:
mod = __import__(module,... | apache-2.0 |
frdb194/django | django/utils/translation/__init__.py | 165 | 7180 | """
Internationalization support.
"""
from __future__ import unicode_literals
import re
from django.utils import six
from django.utils.decorators import ContextDecorator
from django.utils.encoding import force_text
from django.utils.functional import lazy
__all__ = [
'activate', 'deactivate', 'override', 'deacti... | bsd-3-clause |
jingwangian/tutorial | python/concurrent/multiprocess_st.py | 1 | 3976 | #!/usr/bin/env python3
'''
multiprocess study
'''
from multiprocessing import Queue
import datetime
import time
import os
import signal
from manager import WorkerManager
from enum import Enum
from taskctl import TaskCtlWorker
class TaskState(Enum):
START = 1
STOP = 2
CONTINUE = 3
class TimeOut():
c... | gpl-3.0 |
interlegis/agenda-evento | RESTAPI/agenda/apps/rest_agenda/migrations/0011_auto_20170822_1649.py | 1 | 1283 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-22 19:49
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('rest_agenda', '0010_auto_20170818_1839... | gpl-3.0 |
ecosoft-odoo/odoo | addons/stock_landed_costs/stock_landed_costs.py | 31 | 19546 | # -*- 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 |
azmd/trigger | tools/tacacsrc2gpg.py | 13 | 1140 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
tacacsrc2gpg.py - Converts clear-text .tacacsrc to GPG-encrypted .tacacsrc.gpg
Intended for use when migrating from clear-text .tacacsrc to GPG.
"""
import os
import pwd
import socket
import sys
from trigger.tacacsrc import Tacacsrc, get_device_password, convert_tac... | bsd-3-clause |
campagnola/acq4 | acq4/devices/Camera/CameraInterfaceTemplate_pyqt5.py | 3 | 2626 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'acq4/devices/Camera/CameraInterfaceTemplate.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, ... | mit |
40223231/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/os.py | 635 | 35582 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... | agpl-3.0 |
Batuu13/Neural-Networks | NN.py | 1 | 5911 | import numpy as np
import matplotlib.pyplot as plt
class Neural:
def __init__(self,lr = 0.0001,lh = 32,lw =4,it = 50000 , decay = 0.9999,precision = 8):
plt.ion()
# lw = Layer Width
# lh = Layer Height
# lr = Learning Rate
# it = Iteration Count
# preci... | gpl-3.0 |
verma-varsha/zulip | zerver/management/commands/set_message_flags.py | 4 | 3274 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Iterable
import logging
import sys
from django.core.management.base import CommandParser
from zerver.lib import utils
from zerver.lib.management import ZulipBaseCommand
from zerver.models import UserMessage
from dja... | apache-2.0 |
rnixx/python-for-android | pythonforandroid/recipes/libbz2/__init__.py | 4 | 1811 | import sh
from multiprocessing import cpu_count
from pythonforandroid.archs import Arch
from pythonforandroid.logger import shprint
from pythonforandroid.recipe import Recipe
from pythonforandroid.util import current_directory
class LibBz2Recipe(Recipe):
version = "1.0.8"
url = "https://sourceware.org/pub/... | mit |
Arcanemagus/SickRage | lib/unidecode/x018.py | 252 | 4099 | data = (
' @ ', # 0x00
' ... ', # 0x01
', ', # 0x02
'. ', # 0x03
': ', # 0x04
' // ', # 0x05
'', # 0x06
'-', # 0x07
', ', # 0x08
'. ', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'[?]', # 0x0f
'0', # 0x10
'1', # 0x11
'2', # 0x12
'3', # 0x13
'... | gpl-3.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/theano/sandbox/gpuarray/elemwise.py | 4 | 118800 | from __future__ import print_function
import copy
from theano.compat import izip
import numpy
import theano
from theano import Apply, scalar, config
from theano import scalar as scal
from six.moves import StringIO, xrange
from theano.gof.utils import MethodNotDefined
from theano.scalar import Scalar
from theano.tensor... | mit |
pcwalton/rust | src/etc/sugarise-doc-comments.py | 13 | 2017 | #!/usr/bin/env python
# xfail-license
#
# this script attempts to turn doc comment attributes (#[doc = "..."])
# into sugared-doc-comments (/** ... */ and /// ...)
#
# it sugarises all .rs/.rc files underneath the working directory
#
import sys, os, fnmatch, re
DOC_PATTERN = '^(?P<indent>[\\t ]*)#\\[(\\s*)doc(\\s*)... | apache-2.0 |
sufengniu/GVIN | irregular/IL/utils.py | 1 | 7127 | import numpy as np
import tensorflow as tf
from scipy.sparse import csr_matrix
import scipy.sparse as sparse
from matplotlib import pyplot as plt
import networkx as nx
# helper methods to print nice table (taken from CGT code)
def fmt_item(x, l):
if isinstance(x, np.ndarray):
assert x.ndim==0
x = ... | mit |
soumith/fbthrift | thrift/lib/py/util/Serializer.py | 12 | 2029 | #
# 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 |
rollend/online-tmv | BasicBrowser/tmv_app/models.py | 3 | 1172 | from django.db import models
class Topic(models.Model):
title = models.CharField(max_length=50)
def __unicode__(self):
return str(self.title)
class Term(models.Model):
title = models.CharField(max_length=50)
class TopicTerm(models.Model):
topic = models.IntegerField()
term = models.I... | gpl-3.0 |
skosukhin/spack | var/spack/repos/builtin/packages/r-htmltable/package.py | 1 | 2251 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
kastriothaliti/techstitution | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | gpl-3.0 |
highweb-project/highweb-webcl-html5spec | ppapi/generate_ppapi_size_checks.py | 177 | 18379 | #!/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.
"""This script should be run manually on occasion to make sure all PPAPI types
have appropriate size checking.
"""
import optparse... | bsd-3-clause |
johankaito/fufuka | microblog/flask/venv/lib/python2.7/site-packages/scipy/linalg/tests/test_decomp.py | 6 | 78814 | """ Test functions for linalg.decomp module
"""
from __future__ import division, print_function, absolute_import
__usage__ = """
Build linalg:
python setup_linalg.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.linalg.test()'
Run tests if linalg is not installed:
python tests/test_decomp... | apache-2.0 |
Kefkius/encompass | lib/mnemonic.py | 12 | 5737 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... | gpl-3.0 |
geggo/pyface | pyface/ui/qt4/workbench/workbench_window_layout.py | 1 | 22123 | #------------------------------------------------------------------------------
# Copyright (c) 2008, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, when used with the GPL version of PyQt the additional terms described in ... | bsd-3-clause |
jaggu303619/asylum-v2.0 | openerp/addons/mail/res_users.py | 36 | 10508 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
campbe13/openhatch | vendor/packages/PyYaml/tests/lib3/test_resolver.py | 62 | 3298 |
import yaml
import pprint
def test_implicit_resolver(data_filename, detect_filename, verbose=False):
correct_tag = None
node = None
try:
correct_tag = open(detect_filename, 'r').read().strip()
node = yaml.compose(open(data_filename, 'rb'))
assert isinstance(node, yaml.SequenceNode)... | agpl-3.0 |
Clyde-fare/openmoltools | openmoltools/openeye.py | 3 | 15515 | import shutil
import os
import mdtraj as md
from openmoltools.utils import import_, enter_temp_directory, run_antechamber, create_ffxml_file
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format="LOG: %(message)s")
# Note: We recommend having every function return *copie... | gpl-2.0 |
BitWriters/Zenith_project | zango/lib/python3.5/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... | mit |
mharrys/untzy | lib/googletest/googlemock/scripts/generator/cpp/ast.py | 384 | 62773 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | gpl-3.0 |
mavit/ansible | lib/ansible/modules/network/avi/avi_healthmonitor.py | 20 | 7366 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
hankcs/HanLP | hanlp/layers/embeddings/contextual_word_embedding.py | 1 | 9795 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-07-05 13:50
from typing import Optional, Union, List, Any, Dict, Tuple
import torch
from torch import nn
from hanlp_common.configurable import AutoConfigurable
from hanlp.layers.embeddings.embedding import Embedding
from hanlp.layers.scalar_mix import ScalarMixWith... | apache-2.0 |
baroobob/futbol_notify | futbol_notify.py | 1 | 4960 | """
Script which sends me e-mail notifications about upcoming soccer matches that
are available on ESPN's website.
"""
# import statements
import re
import sys
import time
from datetime import datetime, timedelta
from pytz import timezone
from watch_espn import get_upcoming_events
from send_mail import smtpServer
from... | mit |
mhaberler/machinekit | src/hal/drivers/rbf2h.py | 40 | 2233 | import sys, getopt
GPL=0
LGPL=0
EXTRA=[]
opts, args = getopt.getopt(sys.argv[1:], "glc:")
for k, v in opts:
if k == "-g":
GPL = 1
elif k == "-l":
LGPL = 1
elif k == "-c":
EXTRA.append("// " + v)
else:
raise SystemExit, "Unknown argument: %r" % k
sys.stdout.write("\n".join(EXTRA))
print """
// ... | lgpl-2.1 |
brotich/CP2-bucket-list-api | app/mod_auth/tests/test_register.py | 2 | 1792 | from app.test_config import BaseTestCase
class RegisterTestCase(BaseTestCase):
def test_creates_new_user_successfully(self):
data = {
'username': 'user',
'password': 'password'
}
response = self.client.post('/auth/register/', data=data, follow_redirects=True)
... | mit |
trenton3983/Fluent_Python | attic/control/adder/coroadder_deco.py | 7 | 1724 | """
>>> adder = adder_coro()
>>> next(adder)
0
>>> adder.send(10)
10
>>> adder.send(20)
30
>>> adder.send(30)
60
>>> try:
... next(adder)
... except StopIteration as exc:
... result = exc.value
...
>>> result
Result(sum=60, terms=3, average=20.0)
... | mit |
adityaduggal/erpnext | erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py | 32 | 3377 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, cint, getdate
def execute(filters=None):
if not filters: filters = {}
float_precisi... | gpl-3.0 |
mvaled/OpenUpgrade | addons/l10n_be_intrastat/__openerp__.py | 257 | 1631 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
asavah/xbmc | tools/EventClients/examples/python/example_simple.py | 21 | 1531 | #!/usr/bin/env python3
# This is a simple example showing how you can send a key press event
# to XBMC using the XBMCClient class
import os
from socket import *
import sys
import time
if os.path.exists("../../lib/python"):
# try loading modules from source directory
sys.path.append("../../lib/python")
f... | gpl-2.0 |
vicky2135/lucious | lib/python2.7/site-packages/pkg_resources/__init__.py | 92 | 104169 | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... | bsd-3-clause |
antonve/s4-project-mooc | lms/djangoapps/courseware/tests/test_access.py | 22 | 18797 | import datetime
import pytz
from django.test import TestCase
from django.core.urlresolvers import reverse
from mock import Mock, patch
from nose.plugins.attrib import attr
from opaque_keys.edx.locations import SlashSeparatedCourseKey
import courseware.access as access
from courseware.masquerade import CourseMasquerad... | agpl-3.0 |
17zuoye/luigi | test/clone_test.py | 6 | 2133 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
VanceKingSaxbeA/DecisionEngine | bin/engine.py | 2 | 2047 | /*Owner & Copyrights: Vance King Saxbe. A.*/""" Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxb... | mit |
40223249-1/-w16b_test | static/Brython3.1.3-20150514-095342/Lib/functools.py | 730 | 13596 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
# and Raymond Hettinger <python at rcn.com>
# Copyright (C) 2006-2... | agpl-3.0 |
philjjoon/Big-Data-Benchmark-for-Big-Bench | engines/hive/queries/q04/variants/q4_abandonedShoppingCarts.py | 6 | 2710 | #"INTEL CONFIDENTIAL"
#Copyright 2015 Intel Corporation All Rights Reserved.
#
#The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers an... | apache-2.0 |
EcmaXp/micropython | opencom/jnupy_ap.py | 1 | 10646 | #!/usr/bin/env python3
### This file is jnupy auto parser ###
from __future__ import print_function
import collections
import hashlib
import base64
import sys
import os
import re
if __name__ != "__main__" or len(sys.argv) != 2:
exit("usage: ./jnupy_ap.py jnupy.c")
# TODO: this file are not documented and lazy.
c... | mit |
chen0510566/MissionPlanner | Lib/site-packages/scipy/fftpack/realtransforms.py | 56 | 6868 | """
Real spectrum tranforms (DCT, DST, MDCT)
"""
__all__ = ['dct', 'idct']
import numpy as np
from scipy.fftpack import _fftpack
from scipy.fftpack.basic import _datacopied
import atexit
atexit.register(_fftpack.destroy_ddct1_cache)
atexit.register(_fftpack.destroy_ddct2_cache)
atexit.register(_fftpack.destroy_dct1_... | gpl-3.0 |
quoclieu/codebrew17-starving | env/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.py | 1107 | 28025 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | mit |
adrienbrault/home-assistant | homeassistant/components/cover/device_condition.py | 4 | 6828 | """Provides device automations for Cover."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES,
CONF_ABOVE,
CONF_BELOW,
CONF_CONDITION,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_I... | mit |
yitian134/chromium | native_client_sdk/src/build_tools/tests/sdk_update_test.py | 7 | 6623 | #!/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.
"""Unit tests for sdk_update.py."""
import exceptions
import mox
import os
import subprocess
import sys
import tempfile
import uni... | bsd-3-clause |
openplans/shareabouts-memphis | src/project/urls.py | 1 | 1141 | from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
# By default, static assets will be served from Django. It is recommended that
# you us... | gpl-3.0 |
adamBrinek/tuned | old_src_tuned/tuned/daemon/daemon.py | 2 | 4772 | import os
import threading
import tuned.logs
from tuned.exceptions import TunedException
import tuned.consts as consts
import tuned.utils.commands
log = tuned.logs.get()
class Daemon(object):
def __init__(self, unit_manager, profile_loader, profile_name=None, config=None):
log.debug("initializing daemon")
self.... | gpl-2.0 |
chagn/chagn.github.com | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_openedgebuiltins.py | 370 | 40661 | # -*- coding: utf-8 -*-
"""
pygments.lexers._openedgebuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = [
'ABSOLUTE', 'ABS', 'ABSO', 'A... | mit |
cedk/odoo | addons/account/wizard/account_reconcile_partner_process.py | 385 | 5775 | # -*- 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 |
tesidroni/mp | Lib/site-packages/scipy/ndimage/filters.py | 55 | 39251 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 d... | gpl-3.0 |
nttks/edx-platform | lms/djangoapps/course_api/tests/mixins.py | 58 | 1069 | """
Common mixins for Course API Tests
"""
from datetime import datetime
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import ToyCourseFactory
TEST_PASSWORD = u'edx'
class CourseApiFactoryMixin(object):
"""
Mixin to allow creation of test courses and users.
"... | agpl-3.0 |
mfixstsci/peewee4cosmo | cosmo_peewee/osm/utils.py | 2 | 1149 | from __future__ import absolute_import
from astropy.io import fits
import numpy as np
__all__ = ['check_shifts']
#-------------------------------------------------------------------------------
class OSMError(Exception):
"""Custom exception"""
pass
#--------------------------------------------------------... | bsd-3-clause |
finnurtorfa/aflafrettir.is | app/admin/forms.py | 1 | 2779 | #pylint: disable-msg=R0903
from flask_wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField, \
DateTimeField, FileField, BooleanField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Optional
class ProfileForm(Form):
na... | mit |
rfguri/vimfiles | bundle/ycm/third_party/ycmd/third_party/JediHTTP/vendor/jedi/jedi/evaluate/imports.py | 1 | 20004 | """
:mod:`jedi.evaluate.imports` is here to resolve import statements and return
the modules/classes/functions/whatever, which they stand for. However there's
not any actual importing done. This module is about finding modules in the
filesystem. This can be quite tricky sometimes, because Python imports are not
always ... | mit |
mverzett/rootpy | rootpy/memory/tests/test_keepalive.py | 5 | 2711 | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
import gc
import weakref
import ROOT as R
import rootpy.plotting
from rootpy.context import invisible_canvas
from rootpy.memory.deletion import monitor_deletion
def test_keepalive():
class went_away:
... | gpl-3.0 |
sunfounder/SunFounder_SensorKit_for_RPi2 | Python/LCD1602.py | 1 | 2054 | #!/usr/bin/env python3
import time
import smbus
BUS = smbus.SMBus(1)
def write_word(addr, data):
global BLEN
temp = data
if BLEN == 1:
temp |= 0x08
else:
temp &= 0xF7
BUS.write_byte(addr ,temp)
def send_command(comm):
# Send bit7-4 firstly
buf = comm & 0xF0
buf |= 0x04 # RS = 0, RW = 0, EN... | gpl-2.0 |
jhawkesworth/ansible | lib/ansible/modules/network/fortios/fortios_endpoint_control_client.py | 24 | 8448 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
sputnick-dev/weboob | modules/feedly/module.py | 4 | 4239 | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | agpl-3.0 |
Gumi8/app-landing-page | vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/styles/borland.py | 135 | 1562 | # -*- coding: utf-8 -*-
"""
pygments.styles.borland
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the Borland IDEs.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token impo... | mit |
peterfpeterson/mantid | qt/python/mantidqt/widgets/workspacedisplay/table/io.py | 3 | 2629 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
studio666/gnuradio | grc/python/Constants.py | 8 | 4555 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
eliasdesousa/indico | indico/modules/events/sessions/controllers/management/sessions.py | 2 | 10457 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
leansoft/edx-platform | common/djangoapps/third_party_auth/admin.py | 8 | 3661 | # -*- coding: utf-8 -*-
"""
Admin site configuration for third party authentication
"""
from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin
from .models import OAuth2ProviderConfig, SAMLProviderConfig, SAMLConfiguration, SAMLProviderData
from .tasks i... | agpl-3.0 |
maropu/spark | python/pyspark/pandas/data_type_ops/binary_ops.py | 2 | 2976 | #
# 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 |
mgugino-upstream-stage/ansible-modules-core | network/nxos/nxos_snmp_contact.py | 25 | 12059 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
rcarrillocruz/ansible | lib/ansible/plugins/cliconf/vyos.py | 58 | 2529 | #
# (c) 2017 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 d... | gpl-3.0 |
nginxxx/ansible | lib/ansible/plugins/filter/core.py | 59 | 11787 | # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | gpl-3.0 |
avoinsystems/odoo | addons/stock_invoice_directly/__init__.py | 374 | 1085 | # -*- 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... | agpl-3.0 |
mtp1376/youtube-dl | test/test_all_urls.py | 5 | 6850 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases
from youtube_dl.extractor import (
FacebookIE,
gen_extractors,
... | unlicense |
lukeiwanski/tensorflow-opencl | tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_functions.py | 2 | 12905 | # 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 |
uannight/reposan | plugin.video.tvalacarta/channels/rtpa.py | 1 | 7883 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Canal para rtpa
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,re
import urllib
import os
from core import config
from ... | gpl-2.0 |
photoninger/ansible | lib/ansible/module_utils/vca.py | 104 | 11177 | #
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope tha... | gpl-3.0 |
Workday/OpenFrame | third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py | 35 | 18316 | # Copyright (C) 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 conditions and the f... | bsd-3-clause |
allenlavoie/tensorflow | tensorflow/python/kernel_tests/matrix_solve_op_test.py | 47 | 7968 | # 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 |
dsfsdgsbngfggb/odoo | addons/sale_crm/__openerp__.py | 260 | 2036 | # -*- 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 |
adamchainz/ansible | lib/ansible/modules/cloud/ovirt/ovirt_datacenters.py | 45 | 7379 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.