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 |
|---|---|---|---|---|---|
njase/numpy | numpy/polynomial/hermite.py | 10 | 57840 | """
Objects for dealing with Hermite series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite series, including a `Hermite` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
d... | bsd-3-clause |
RamonGuiuGou/l10n-spain | l10n_es_payment_order/wizard/csb58.py | 13 | 15269 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved.
# Pedro Tarrafeta <pedro@acysos.com>
# Ignacio I... | agpl-3.0 |
robotican/ric | ric_board/scripts/RiCConfigurator/BAL/Devices/launchFile.py | 1 | 3040 | __author__ = 'tom'
from PyQt4.QtGui import *
from BAL.Interface.DeviceFrame import LAUNCH, EX_DEV, DeviceFrame
from lxml.etree import Element, SubElement, XML
import rospkg
class RosLaunch(DeviceFrame):
def __init__(self, frame, data):
DeviceFrame.__init__(self, EX_DEV, frame, data)
self._pkg = ''... | bsd-3-clause |
carlgao/lenga | images/lenny64-peon/usr/share/python-support/python-boto/boto/mashups/iobject.py | 1 | 3829 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
owlas/moma | googletest/scripts/release_docs.py | 1167 | 6132 | #!/usr/bin/env python
#
# Copyright 2013 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 |
Johnzero/OE7 | openerp/tests/addons/test_exceptions/models.py | 66 | 1289 | # -*- coding: utf-8 -*-
import openerp
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will raise the different
exceptions that must be handled by the server (and its RPC layer)
and the clients.
"""
_name = 'test.exceptions.model'
def generate_except_osv(self,... | agpl-3.0 |
PriceChild/ansible | lib/ansible/playbook/__init__.py | 83 | 4214 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
hardikvasa/hadoop-mapreduce-examples-python | wikipedia-link-analysis-mapper.py | 1 | 2412 | #!/usr/bin/env python
import sys
#Finding 'Next Link' on a given web page
def get_next_link(s):
start_link = s.find("href=")
if start_link == -1: #If no links are found then give an error!
end_quote = 0
link = "no_links"
return link, end_quote
else:
start_quote = s.find('... | mit |
nicholedwight/nichole-theme | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/__init__.py | 194 | 7698 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping import LEX... | mit |
mancoast/CPythonPyc_test | fail/313_inspect_fodder2.py | 179 | 1419 | # line 1
def wrap(foo=None):
def wrapper(func):
return func
return wrapper
# line 7
def replace(func):
def insteadfunc():
print('hello')
return insteadfunc
# line 13
@wrap()
@wrap(wrap)
def wrapped():
pass
# line 19
@replace
def gone():
pass
# line 24
oll = lambda m: m
# lin... | gpl-3.0 |
GitAngel/django | django/db/models/signals.py | 399 | 2734 | from django.apps import apps
from django.dispatch import Signal
from django.utils import six
class_prepared = Signal(providing_args=["class"])
class ModelSignal(Signal):
"""
Signal subclass that allows the sender to be lazily specified as a string
of the `app_label.ModelName` form.
"""
def __in... | bsd-3-clause |
c0defreak/python-for-android | python3-alpha/python3-src/Lib/test/test_shelve.py | 57 | 5834 | import unittest
import shelve
import glob
from test import support
from collections import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
def __... | apache-2.0 |
IronLanguages/ironpython2 | Src/StdLib/Lib/encodings/mac_croatian.py | 593 | 13889 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/network/f5/bigip_facts.py | 72 | 62015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <mhite@hotmail.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 Licens... | gpl-3.0 |
Endika/odoo | addons/pos_restaurant/__openerp__.py | 311 | 2001 | # -*- 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 |
foursquare/commons-old | src/python/twitter/common/process/process_handle.py | 1 | 3405 | from twitter.common.string import ScanfParser
try:
from twitter.common import log
except ImportError:
log = None
class ProcessHandle(object):
"""
ProcessHandle interface. Methods that must be exposed by whatever process
monitoring mechanism you use.
"""
def cpu_time(self):
"""
Total cpu ... | apache-2.0 |
3nids/QGIS | tests/src/python/test_qgsvirtuallayertask.py | 45 | 2761 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVirtualLayerTask.
.. 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 version.
"... | gpl-2.0 |
myyc/kleptes | kleptes/utils.py | 1 | 1213 | import re
import fnmatch
import pandas as pd
# three days
EXPIRE = 259200
def get_re(pattern):
if type(pattern) == str:
return re.compile(fnmatch.translate(pattern), flags=re.IGNORECASE)
elif type(pattern) == list:
return re.compile("|".join(fnmatch.translate(pattern)),
... | bsd-3-clause |
poo12138/gem5-stable | tests/configs/memtest-ruby.py | 9 | 4768 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2010 Advanced Micro Devices, 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 co... | bsd-3-clause |
safwanrahman/kitsune | kitsune/sumo/parser.py | 3 | 13902 | from os.path import basename
from urlparse import urlparse, parse_qs
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _lazy, ugettext as _
from wikimarkup.parser import Parser, ALLOWED_TAGS
from kitsune.gallery.models import Im... | bsd-3-clause |
jsirois/commons | src/python/twitter/common/http/server.py | 14 | 9449 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
JioCloud/python-cinderclient | cinderclient/v2/volume_backups.py | 3 | 3500 | # Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
danielpalomino/gem5 | src/arch/x86/isa/insts/x87/arithmetic/round.py | 91 | 2152 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
jgao54/airflow | airflow/contrib/sensors/cassandra_record_sensor.py | 10 | 2616 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
sander76/home-assistant | tests/components/plant/test_init.py | 5 | 7945 | """Unit tests for platform/plant.py."""
from datetime import datetime, timedelta
import pytest
from homeassistant.components import recorder
import homeassistant.components.plant as plant
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONDUCTIVITY,
LIGHT_LUX,
STATE_OK,
STATE_PROBLEM,
... | apache-2.0 |
MiltosD/CEF-ELRC | lib/python2.7/site-packages/dateutil/rrule.py | 254 | 40402 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import itertools
import datetime
import calendar
import thread
import sys
__all__ = ["... | bsd-3-clause |
xybu/onedrived-dev | onedrived/od_models/webhook_notification.py | 1 | 1902 | """
webhook_notification.py
Implementation of the datatypes used in OneDrive webhook notification, which is absent
from official OneDrive Python SDK.
:copyright: (c) Xiangyu Bu <xybu92@live.com>
:license: MIT
"""
from .. import od_dateutils
class WebhookNotification:
""" https://dev.onedrive.com/resources/web... | mit |
pchauncey/ansible | lib/ansible/utils/shlex.py | 267 | 1279 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
littlstar/chromium.src | content/test/gpu/page_sets/pixel_tests.py | 8 | 1531 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class PixelTestsPage(page_module.Page):
def __init_... | bsd-3-clause |
Acehaidrey/incubator-airflow | airflow/providers/google/cloud/hooks/spanner.py | 8 | 16842 | #
# 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 |
dhimmel/networkx | networkx/algorithms/tests/test_dominating.py | 54 | 1348 | from nose.tools import assert_equal, assert_true, assert_false, raises
import networkx as nx
def test_dominating_set():
G = nx.gnp_random_graph(100, 0.1)
D = nx.dominating_set(G)
assert_true(nx.is_dominating_set(G, D))
D = nx.dominating_set(G, start_with=0)
assert_true(nx.is_dominating_set(G, D))
... | bsd-3-clause |
mats116/ElasticBigQuery | boilerplate/external/wtforms/widgets/core.py | 67 | 8340 | from __future__ import unicode_literals
from cgi import escape
from wtforms.compat import text_type, string_types, iteritems
__all__ = (
'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput',
'RadioInput', 'Select', 'SubmitInput', 'TableWidget', 'TextArea',
'TextInput', 'Option'
)
... | lgpl-3.0 |
oandrew/home-assistant | homeassistant/components/sensor/gpsd.py | 17 | 3323 | """
Support for GPSD.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.gpsd/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_LATITUDE, ATTR_LONGITUD... | mit |
satsumas/prop | qtree.py | 1 | 1595 | """
A presentation layer for generating LaTeX Qtree output.
"""
import copy
class Qtree(object):
r"""
A qtree is rendered as a root with some branches:
ROOT
/ \
b1 b2 ...
"""
def __init__(self, root, branches=[]):
"""
@arg root: A string which is rendered as "ROOT" in t... | gpl-3.0 |
zstars/weblabdeusto | server/src/test/unit/voodoo/test_mapper.py | 2 | 10712 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
clinton-hall/nzbToMedia | core/configuration.py | 1 | 31372 | # coding=utf-8
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import copy
import os
import shutil
from itertools import chain
import configobj
from six import iteritems
import core
from core import logger
class Section(configobj.Section, object):
def is... | gpl-3.0 |
kidaa/bttext | menu.py | 2 | 1342 | import curses
import textout
from textout import btText
import init
import sys
menuTitle = "/\\\\ Menue //\\"
MENU_W = 55
def btExit():
init.quit()
sys.exit()
def btContinue():
pass
menuList = [[str(btText("Continue")), btContinue],
[str(btText("Quit")), btExit]]
def drawMenu(menuWin, choic... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/220_test_rfc822.py | 3 | 7109 | import rfc822
import sys
import test_support
import unittest
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class MessageTestCase(unittest.TestCase):
def create_message(self, msg):
return rfc822.Message(StringIO(msg))
def test_get(self):
msg = s... | gpl-3.0 |
kyleabeauchamp/fah-projects | code/setup_siegetank.py | 1 | 1472 | import base64
import os
import gzip
import siegetank
system_name = "src"
# Need a more secure way to store and load this.
my_token = os.environ["SIEGETANK_TOKEN"]
siegetank.login(my_token)
RUNS_PATH = "/home/kyleb/src/choderalab/FAHNVT/%s/RUNS_NPT/RUN0/" % system_name
opts = {'description': '%s NPT v2.0 In this pr... | gpl-2.0 |
zhoulingjun/django | tests/migrations/test_multidb.py | 366 | 6909 | import unittest
from django.db import connection, migrations, models
from django.db.migrations.state import ProjectState
from django.test import override_settings
from .test_operations import OperationTestBase
try:
import sqlparse
except ImportError:
sqlparse = None
class AgnosticRouter(object):
"""
... | bsd-3-clause |
CEG-FYP-OpenStack/scheduler | nova/tests/unit/objects/test_virt_cpu_topology.py | 94 | 1397 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
adityacs/ansible | lib/ansible/modules/network/ios/ios_vrf.py | 12 | 11615 | #!/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 |
gregdek/ansible | lib/ansible/modules/network/f5/bigip_dns_zone.py | 14 | 19409 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
dhenrygithub/QGIS | python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsFixed.py | 2 | 8734 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RectanglesOvalsDiamondsFixed.py
---------------------
Date : April 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot co... | gpl-2.0 |
aehernandez/HyperSpace | src/python/simple_server.py | 1 | 4104 | from asyncio import coroutine
from random import randint
from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner
from autobahn.wamp.types import PublishOptions
import asyncio
from threading import Thread as Process
# helpfer function to get the current time
import time
millis = lambda: int(round(time.... | gpl-3.0 |
wanglongqi/sympy | sympy/polys/polyfuncs.py | 45 | 7823 | """High-level polynomials manipulation functions. """
from __future__ import print_function, division
from sympy.polys.polytools import (
poly_from_expr, parallel_poly_from_expr, Poly)
from sympy.polys.polyoptions import allowed_flags
from sympy.polys.specialpolys import (
symmetric_poly, interpolating_poly)... | bsd-3-clause |
nuagenetworks/monolithe | monolithe/generators/lang/html/__init__.py | 2 | 1817 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent 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
# no... | bsd-3-clause |
tanmaykm/edx-platform | common/djangoapps/heartbeat/views.py | 199 | 1440 | from xmodule.modulestore.django import modulestore
from dogapi import dog_stats_api
from util.json_request import JsonResponse
from django.db import connection
from django.db.utils import DatabaseError
from xmodule.exceptions import HeartbeatFailure
@dog_stats_api.timed('edxapp.heartbeat')
def heartbeat(request):
... | agpl-3.0 |
abhattad4/Digi-Menu | tests/generic_views/test_edit.py | 7 | 19270 | from __future__ import unicode_literals
import warnings
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.test import TestCase, ignore_warnings, override_settings
from django.test.client import RequestFactory
from django.utils.dep... | bsd-3-clause |
ceb8/astroquery | astroquery/eso/tests/test_eso.py | 2 | 3190 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from ...utils.testing_tools import MockResponse
from ...eso import Eso
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
def data_path(filename):
return os.path.join(DATA_DIR, filename)
DATA_FILES = {'GET': {'http://archive.eso... | bsd-3-clause |
heesub/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
Jgarcia-IAS/SAT | openerp/addons/account_budget/wizard/account_budget_crossovered_report.py | 375 | 2089 | # -*- 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 |
douban/dpark | dpark/tracker.py | 1 | 3549 | from __future__ import absolute_import
import socket
import zmq
import time
from dpark.utils import spawn
from dpark.utils.log import get_logger
logger = get_logger(__name__)
class TrackerMessage(object):
pass
class StopTrackerMessage(TrackerMessage):
pass
class SetValueMessage(TrackerMessage):
def ... | bsd-3-clause |
jazztpt/edx-platform | common/djangoapps/cors_csrf/views.py | 100 | 2533 | """Views for enabling cross-domain requests. """
import logging
import json
from django.conf import settings
from django.views.decorators.cache import cache_page
from django.http import HttpResponseNotFound
from edxmako.shortcuts import render_to_response
from cors_csrf.models import XDomainProxyConfiguration
log = l... | agpl-3.0 |
hzlf/openbroadcast.org | website/tools/crispy_forms_extra/layout.py | 2 | 3726 | import itertools
from django.conf import settings
from django.utils.html import conditional_escape
from crispy_forms.layout import LayoutObject, Div
from crispy_forms.utils import render_field
TEMPLATE_PACK = getattr(settings, "CRISPY_TEMPLATE_PACK", "bootstrap")
class Row(Div):
"""
Layout object. It wraps... | gpl-3.0 |
ulikoehler/Translatron | Translatron/DocumentImport/PMC.py | 1 | 8545 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ctypes import c_bool
import tarfile
import functools
import time
from bs4 import BeautifulSoup, Comment, NavigableString
from Translatron import DocumentDB
from ansicolor import black, red
from multiprocessing import Process, Queue
__author__ = "Uli Köhler"
__copyrig... | apache-2.0 |
soltanmm/grpc | tools/run_tests/package_targets.py | 2 | 5961 | #!/usr/bin/env python2.7
# Copyright 2016, 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 lis... | bsd-3-clause |
monetate/sqlalchemy | test/orm/test_assorted_eager.py | 3 | 37238 | """Exercises for eager loading.
Derived from mailing list-reported problems and issue tracker issues.
These are generally very old 0.1-era tests and at some point should
be cleaned up and modernized.
"""
import datetime
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sq... | mit |
Antiun/odoo | addons/report_webkit/ir_report.py | 382 | 3807 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
Gillu13/scipy | scipy/integrate/tests/test_integrate.py | 55 | 22040 | # Authors: Nils Wagner, Ed Schofield, Pauli Virtanen, John Travers
"""
Tests for numerical integration.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import (arange, zeros, array, dot, sqrt, cos, sin, eye, pi, exp,
allclose)
from scipy._lib.six i... | bsd-3-clause |
mlperf/training_results_v0.6 | NVIDIA/benchmarks/minigo/implementations/tensorflow/minigo/go.py | 3 | 19698 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
CryptopiaNZ/DOT | contrib/testgen/gen_base58_test_vectors.py | 1000 | 4343 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | mit |
SteveHNH/ansible | lib/ansible/modules/cloud/openstack/os_user_role.py | 19 | 6456 | #!/usr/bin/python
# Copyright (c) 2016 IBM
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distrib... | gpl-3.0 |
hanselke/erpnext-1 | erpnext/controllers/trends.py | 52 | 10972 | # 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.utils import getdate
from frappe import _
def get_columns(filters, trans):
validate_filters(filters)
# get conditions for ... | agpl-3.0 |
j0nathan33/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/noco.py | 8 | 3451 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
compat_str,
)
class NocoIE(InfoExtractor):
_VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)'
... | gpl-3.0 |
arjen75/ics-lge-kernel-msm7x27-chick | scripts/rt-tester/rt-tester.py | 1094 | 5362 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
lmazuel/azure-sdk-for-python | azure-batch/azure/batch/models/pool_enable_auto_scale_parameter.py | 1 | 2432 | # 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 |
biddisco/VTK | Examples/Modelling/Python/iceCream.py | 42 | 3209 | #!/usr/bin/env python
# This example demonstrates how to use boolean combinations of implicit
# functions to create a model of an ice cream cone.
import vtk
from vtk.util.colors import chocolate, mint
# Create implicit function primitives. These have been carefully
# placed to give the effect that we want. We are go... | bsd-3-clause |
tlainevool/eatspection | data/test/sql/test_restaurant_storage.py | 1 | 1208 | import unittest
import sqlite3
from data.db_creation.sql.restaurant_table_creator import RestaurantTableCreator
from data.sql.restaurant_storage import RestaurantStorage
from model.restaurant import Restaurant
class TestRestaurantStorage(unittest.TestCase):
def test_insert(self):
conn = sqlite3.connect(... | mit |
abdesslem/CTF | models.py | 2 | 1692 | from flask_login import LoginManager, UserMixin, login_user, logout_user, current_user, login_required
from werkzeug.security import generate_password_hash, check_password_hash
import ctf
class User(UserMixin, ctf.db.Model):
__tablename__ = 'users'
id = ctf.db.Column(ctf.db.Integer, primary_key=True)
user... | mit |
kennethgillen/ansible | lib/ansible/modules/system/pam_limits.py | 27 | 9407 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Sebastien Rohaut <sebastien.rohaut@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 ... | gpl-3.0 |
qdubious/gitinspector | gitinspector/config.py | 51 | 2939 | # coding: utf-8
#
# Copyright © 2013 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 |
benoit-pierre/mcomix | mcomix/run.py | 1 | 10893 |
import os
import sys
import optparse
import signal
if __name__ == '__main__':
print >> sys.stderr, 'PROGRAM TERMINATED'
print >> sys.stderr, 'Please do not run this script directly! Use mcomixstarter.py instead.'
sys.exit(1)
# These modules must not depend on GTK, pkg_resources, PIL,
# or any other optio... | gpl-2.0 |
mahak/neutron | neutron/privileged/__init__.py | 2 | 2057 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
girving/tensorflow | tensorflow/compiler/xla/python_api/types.py | 32 | 4874 | # Copyright 2018 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 |
x111ong/odoo | addons/mass_mailing/wizard/mail_compose_message.py | 308 | 3066 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class MailComposeMessage(osv.TransientModel):
"""Add concept of mass mailing campaign to the mail.compose.message wizard
"""
_inherit = 'mail.compose.message'
_columns = {
'mass_mailing_campaign_id': fields.many2one(
'ma... | agpl-3.0 |
nkgilley/home-assistant | homeassistant/components/point/binary_sensor.py | 6 | 4199 | """Support for Minut Point binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import MinutPointEntity
from .const import DOMAIN as POINT_DOM... | apache-2.0 |
exploreodoo/datStruct | odoo/addons/delivery/partner.py | 383 | 1404 | # -*- 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... | gpl-2.0 |
yfried/ansible | lib/ansible/modules/packaging/os/apt.py | 5 | 41284 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Flowroute LLC
# Written by Matthew Williams <matthew@flowroute.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ ... | gpl-3.0 |
skulbrane/theHarvester | discovery/jigsaw.py | 23 | 1810 | import string
import httplib
import sys
import myparser
import re
# http://www.jigsaw.com/SearchAcrossCompanies.xhtml?opCode=refresh&rpage=4&mode=0&cnCountry=&order=0&orderby=0&cmName=accuvant&cnDead=false&cnExOwned=false&count=0&screenNameType=0&screenName=&omitScreenNameType=0&omitScreenName=&companyI... | gpl-2.0 |
tchernomax/ansible | lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py | 43 | 23695 | #!/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 |
deschler/django-invitation | examples/invitation_project/settings.py | 9 | 1139 | import os
ROOT_PATH = os.path.dirname(__file__)
TEMPLATE_DEBUG = DEBUG = True
MANAGERS = ADMINS = ()
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = os.path.join(ROOT_PATH, 'testdb.sqlite')
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
MEDIA_ROOT = ''
MEDIA_URL = ''
ADMIN_MEDIA_PREFIX ... | bsd-3-clause |
t794104/ansible | test/units/modules/network/cnos/test_cnos_vlan.py | 34 | 7341 | # (c) 2018 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 |
madecoste/swarming | appengine/components/third_party/webtest/forms.py | 5 | 18091 | # -*- coding: utf-8 -*-
"""Helpers to fill and submit forms."""
import re
from bs4 import BeautifulSoup
from webtest.compat import OrderedDict
from webtest import utils
class NoValue(object):
pass
class Upload(object):
"""
A file to upload::
>>> Upload('filename.txt', 'data', 'application/oct... | apache-2.0 |
drewandersonnz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/test/rpm_version_test.py | 56 | 2120 | import pytest
import rpm_version
expected_pkgs = {
"spam": {
"name": "spam",
"version": "3.2.1",
},
"eggs": {
"name": "eggs",
"version": "3.2.1",
},
}
@pytest.mark.parametrize('pkgs, expect_not_found', [
(
{},
["spam", "eggs"], # none found
),
... | apache-2.0 |
rsvip/Django | tests/defer_regress/models.py | 104 | 2530 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerF... | bsd-3-clause |
lpatmo/actionify_the_news | open_connect/accounts/forms.py | 1 | 8077 | """Forms for accounts app."""
# pylint: disable=no-init,no-self-use
from django import forms
from django.contrib.admin import widgets
from django.contrib.auth.models import Group as AuthGroup
from django.contrib.auth.models import Permission
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from d... | mit |
teamtuga4/teamtuga4ever.repository | plugin.video.pancas/resources/lib/resolvers/veehd.py | 23 | 1650 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
Omicia/omicia_api_examples | python/ClinicalReportLaunchers/get_clinical_report.py | 1 | 1764 | """Get a clinical report, either with extended information or not.
Example usages:
python get_clinical_report.py 1801
python get_clinical_report.py 1801 --e true
"""
import os
import requests
from requests.auth import HTTPBasicAuth
import sys
import simplejson as json
import argparse
# Load environment variables fo... | mit |
EDUlib/edx-platform | common/lib/xmodule/xmodule/course_module.py | 1 | 63430 | """
Django module container for classes and operations related to the "Course Module" content type
"""
import json
import logging
from datetime import datetime, timedelta
from io import BytesIO
import dateutil.parser
import requests
from django.conf import settings
from django.core.validators import validate_email
f... | agpl-3.0 |
rapidhere/open-hackathon | open-hackathon-client/src/client/user/__init__.py | 24 | 1396 | # -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this s... | mit |
dev-burbrink/pydslice | pydslice/pydslice_debugger.py | 1 | 1921 | # pydslice_debugger.py
#
# Generic definitions for debuggers
#
# Copyright (C) 2016 Josh Burbrink <dev.burbrink@gmail.com>
#
# Debug level for printing
DEBUG_PRINT_LEVEL_ALWAYS = 0
DEBUG_PRINT_LEVEL_ERROR = 1
DEBUG_PRINT_LEVEL_WARNING = 2
DEBUG_PRINT_LEVEL_INFO = 3
DEBUG_PRINT_LEVEL_VERBOSE = 4
debug_print_leve... | lgpl-3.0 |
jkoelker/ryu | ryu/services/protocols/bgp/processor.py | 10 | 17632 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
felliott/waterbutler | waterbutler/providers/owncloud/metadata.py | 6 | 2005 | from waterbutler.core import metadata
class BaseOwnCloudMetadata(metadata.BaseMetadata):
def __init__(self, href, folder, attributes=None):
super(BaseOwnCloudMetadata, self).__init__(None)
self.attributes = attributes or {}
self._folder = folder
self._href = href
@property
... | apache-2.0 |
Greennut/ostproject | django/contrib/gis/gdal/geomtype.py | 404 | 2967 | from django.contrib.gis.gdal.error import OGRException
#### OGRGeomType ####
class OGRGeomType(object):
"Encapulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0 : 'Unknown',
1 : 'Point',
2 ... | bsd-3-clause |
nguy/PyDisdrometer | pydsd/aux_readers/read_2ds.py | 3 | 4909 | # -*- coding: utf-8 -*-
import csv
import datetime
import itertools
import numpy as np
import numpy.ma as ma
import scipy.optimize
from pytmatrix.psd import GammaPSD
from ..DropSizeDistribution import DropSizeDistribution
from ..io import common
def read_2ds(filename, campaign="acapex"):
"""Read a airborne 2DS... | lgpl-2.1 |
flingone/frameworks_base_cmds_remoted | libs/boost/tools/build/test/searched_lib.py | 6 | 5114 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test usage of searched-libs: one which are found via -l
# switch to... | apache-2.0 |
magic0704/neutron | neutron/tests/unit/db/test_l3_ha_db.py | 2 | 23196 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 |
jimsimon/sky_engine | tools/linux/dump-static-initializers.py | 83 | 8354 | #!/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.
"""Dump functions called by static intializers in a Linux Release binary.
Usage example:
tools/linux/dump-static-intializers.py ... | bsd-3-clause |
TRESCLOUD/odoopub | addons/website_event/models/event.py | 45 | 5258 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.