repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
waytai/odoo | addons/l10n_fr/wizard/fr_report_compute_resultant.py | 374 | 2312 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
anentropic/django-saml2-idp | saml2idp/metadata.py | 2 | 1727 | """
Query metadata from settings.
"""
# Django imports
from django.core.exceptions import ImproperlyConfigured
# Local imports
from saml2idp_metadata import SAML2IDP_CONFIG, SAML2IDP_REMOTES
def get_config_for_acs(acs_url):
"""
Return SP configuration instance that handles acs_url.
"""
for friendlyname... | mit |
pranavtbhat/EE219 | project2/c.py | 2 | 4916 | from StdSuites.AppleScript_Suite import vector
import cPickle
from sklearn.feature_extraction import text
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.pipeline import Pipeline
from pa... | unlicense |
thebravoman/software_engineering_2016 | hm_term2_rest_api_projects/11a_03_11/gpu_catalog/settings.py | 1 | 3281 | """
Django settings for gpu_catalog project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | mit |
dealien/Red-Magician | cogs/pokedex.py | 1 | 20781 | # Developed by Redjumpman for Redbot by Twentysix26
# Inspired by Danny/Rapptz pokedex for Robo Danny
# Standard Library
import aiohttp
import random
import re
# Discord and Redbot
import discord
from discord.ext import commands
from __main__ import send_cmd_help
# Third Party Libraries
try: # check i... | gpl-3.0 |
geimer/easybuild-framework | easybuild/toolchains/fft/fftw.py | 3 | 2437 | ##
# Copyright 2012-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
jhancock93/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/multiple_responses_operations.py | 14 | 57800 | # 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 |
rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/whoosh/codec/whoosh3.py | 30 | 42321 | # Copyright 2012 Matt Chaput. All rights reserved.
#
# 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... | mit |
beernarrd/gramps | gramps/gen/utils/docgen/tabbeddoc.py | 10 | 1567 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2003 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
odoobgorg/odoo | addons/website_hr_recruitment/controllers/main.py | 43 | 4069 | # -*- coding: utf-8 -*-
import base64
from openerp import SUPERUSER_ID
from openerp import http
from openerp.tools.translate import _
from openerp.http import request
from openerp.addons.website.models.website import slug
class website_hr_recruitment(http.Controller):
@http.route([
'/jobs',
'/job... | gpl-3.0 |
rgerkin/neuroConstruct | lib/jython/Lib/site-packages/xlrd/xlsx.py | 17 | 31809 | ##
# Portions copyright (c) 2008-2012 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd package, which is released under a BSD-style licence.
##
from __future__ import print_function, unicode_literals
DEBUG = 0
import sys
import re
from .timemachine import *
from .book import Book, Na... | gpl-2.0 |
marinho/geraldo | site/newsite/site-geraldo/django/core/paginator.py | 356 | 4021 | from math import ceil
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
self.object_list = object_list
self.per_pa... | lgpl-3.0 |
mpalmi/clip | packages/scap-security-guide/scap-security-guide-0.1.25/shared/modules/splitchecks_module.py | 4 | 3741 | #!/usr/bin/python
import sys
import os
import errno
import string
import re
from optparse import OptionParser
import lxml.etree as ET
xmlns = {
"o": "http://oval.mitre.org/XMLSchema/oval-definitions-5",
"xsi": "http://www.w3.org/2001/XMLSchema-instance",
"oval": "http://oval.mitre.org/XMLSchema/oval-commo... | apache-2.0 |
ruuk/script.module.youtube.dl | lib/youtube_dl/extractor/mgoon.py | 64 | 2696 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
qualities,
unified_strdate,
)
class MgoonIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:(:?m\.)?mgoon\.com/(?:ch/(?:.+)/v|play/view)|
... | gpl-2.0 |
TakayukiSakai/tensorflow | tensorflow/python/ops/sparse_grad.py | 3 | 9601 | # 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 |
computersalat/ansible | test/units/playbook/test_included_file.py | 38 | 11094 | # (c) 2016, Adrian Likins <alikins@redhat.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 vers... | gpl-3.0 |
drawks/ansible | contrib/inventory/vbox.py | 52 | 3266 | #!/usr/bin/env 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 distr... | gpl-3.0 |
detiber/ansible | lib/ansible/modules/windows/win_domain_membership.py | 32 | 3374 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (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 ... | gpl-3.0 |
beni55/cayley | svg/svg.py | 39 | 3624 | # Copyright 2014 The Cayley Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
manjunaths/tensorflow | tensorflow/contrib/layers/__init__.py | 9 | 4048 | # 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 |
Austin503/support-tools | googlecode-issues-exporter/bitbucket_issue_converter_test.py | 90 | 6338 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
madphysicist/numpy | numpy/typing/tests/data/pass/scalars.py | 2 | 2937 | import sys
import datetime as dt
import pytest
import numpy as np
# Construction
class D:
def __index__(self) -> int:
return 0
class C:
def __complex__(self) -> complex:
return 3j
class B:
def __int__(self) -> int:
return 4
class A:
def __float__(self) -> float:
... | bsd-3-clause |
Danielhiversen/home-assistant | homeassistant/components/fan/template.py | 3 | 13211 | """
Support for Template fans.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/fan.template/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.fan import (
SPEED_LOW, SPEED_ME... | mit |
davidmueller13/f2fs-backport | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
peterbe/airmozilla | airmozilla/manage/forms.py | 1 | 9589 | import pytz
from django import forms
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.contrib.flatpages.models import FlatPage
from funfactory.urlresolvers import reverse
from airmozilla.base.forms import BaseModelForm
from airmozilla.main.models import (Approval, Categ... | bsd-3-clause |
carlodri/moviepy | moviepy/video/compositing/concatenate.py | 14 | 4364 | import numpy as np
from moviepy.tools import deprecated_version_of
from moviepy.video.VideoClip import VideoClip, ColorClip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.audio.AudioClip import CompositeAudioClip
from moviepy.video.compositing.on_color import on_color
def c... | mit |
andrewsmedina/django | tests/foreign_object/models.py | 8 | 5128 | import datetime
from django.db import models
from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import get_language
class Country(models.Model):
# Table Column Fields
name = models.CharFie... | bsd-3-clause |
LockScreen/Backend | venv/lib/python2.7/site-packages/boto/swf/layer2.py | 130 | 13056 | """Object-oriented interface to SWF wrapping boto.swf.layer1.Layer1"""
import time
from functools import wraps
from boto.swf.layer1 import Layer1
from boto.swf.layer1_decisions import Layer1Decisions
DEFAULT_CREDENTIALS = {
'aws_access_key_id': None,
'aws_secret_access_key': None
}
def set_default_credential... | mit |
yoer/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_encoding.py | 49 | 1231 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.utils import unittest
from django.utils.encoding import force_bytes, filepath_to_uri, python_2_unicode_compatible
from django.utils import six
class TestEncodingUtils(unittest.TestCase):
def test_force_bytes_exception(self):
""... | apache-2.0 |
brettchien/LeetCode | 13_RomanToInteger.py | 1 | 1364 | class Solution:
# @param {string} s
# @return {integer}
def romanToInt(self, s):
ROMAN_NUM = {
"I": 1,
"V": 5,
"X": 10,
"L": 50,
"C": 100,
"D": 500,
"M": 1000}
result = 0
f... | mit |
angr/cle | cle/backends/java/jar.py | 1 | 3125 | import logging
from zipfile import ZipFile
from .. import register_backend
from .soot import Soot
l = logging.getLogger(name=__name__)
class Jar(Soot):
"""
Backend for lifting JARs to Soot.
"""
is_default = True # let CLE automatically use this backend
def __init__(self, jar_path, binary_stre... | bsd-2-clause |
TRESCLOUD/odoo | addons/lunch/tests/__init__.py | 172 | 1107 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
praekeltfoundation/ndoh-hub | eventstore/migrations/0021_covid19triage.py | 1 | 3634 | # Generated by Django 2.2.8 on 2020-04-02 14:45
import uuid
import django.contrib.postgres.fields.jsonb
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("eventstore", "0020_auto_20200302_1458")]
operations = [
migrations.... | bsd-3-clause |
7kbird/chrome | tools/telemetry/telemetry/core/backends/chrome/inspector_page.py | 6 | 5579 | # 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 json
import logging
import sys
import time
from telemetry.core import util
class InspectorPage(object):
def __init__(self, inspector_backend, time... | bsd-3-clause |
miconof/CouchPotatoServer | libs/enzyme/flv.py | 180 | 6375 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public Lice... | gpl-3.0 |
g12mcgov/home-assistant | tests/components/test_device_sun_light_trigger.py | 16 | 3719 | """
tests.test_component_device_sun_light_trigger
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests device sun light trigger component.
"""
# pylint: disable=too-many-public-methods,protected-access
import os
import unittest
import homeassistant.loader as loader
from homeassistant.const import CONF_PLATFORM, STATE_HOME, STATE_NOT_HOM... | mit |
minrk/sympy | sympy/polys/tests/test_polyclasses.py | 4 | 11852 | """Tests for OO layer of several polynomial representations. """
from sympy.polys.polyclasses import (
DMP, init_normal_DMP,
DMF, init_normal_DMF,
ANP, init_normal_ANP,
)
from sympy.polys.domains import ZZ, QQ
from sympy.polys.specialpolys import f_4
from sympy.polys.polyerrors import (
ExactQuotient... | bsd-3-clause |
workhorsy/identify_playstation1_games | iso9660.py | 2 | 11915 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2015, Matthew Brennan Jones <matthew.brennan.jones@gmail.com>
# Copyright (C) 2013-2014 Barnaby Gale
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to... | mit |
blacklin/kbengine | kbe/res/scripts/common/Lib/asyncio/windows_events.py | 63 | 23240 | """Selector and proactor event loops for Windows."""
import _winapi
import errno
import math
import socket
import struct
import weakref
from . import events
from . import base_subprocess
from . import futures
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
f... | lgpl-3.0 |
jt6562/XX-Net | python27/1.0/lib/atexit.py | 73 | 1770 | """
atexit.py - allow programmer to define multiple exit functions to be executed
upon normal program termination.
One public function, register, is defined.
"""
__all__ = ["register"]
import sys
_exithandlers = []
def _run_exitfuncs():
"""run any registered exit functions
_exithandlers is t... | bsd-2-clause |
tylertian/Openstack | openstack F/nova/nova/tests/hyperv/hypervutils.py | 7 | 8846 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
#
# 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/LICE... | apache-2.0 |
MediaKraken/MediaKraken_Deployment | source/testing/test_subprogram/test_subprogram_broadcast.py | 1 | 1712 | """
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | gpl-3.0 |
kyunghyuncho/GroundHog | groundhog/trainer/SGD_adadelta.py | 9 | 8035 | """
Stochastic Gradient Descent.
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import time
import logging
import theano
import th... | bsd-3-clause |
tomspur/shedskin | examples/c64/tape.py | 7 | 4626 | #!/usr/bin/env python2
# tape emulation
from symbols import *
import loaders
import loaders.t64
import loaders.prg
tape_loader = loaders.t64.Loader() # public. set this from the main emu GUI.
T_EOF = 0x40
WRITE_LEADER = 0x0A
WRITE_BLOCK = 0x08
READ_BLOCK = 0x0E
# SCAN_KEY = 0x0C
err = 0
def get_tape_buffer(memory)... | gpl-3.0 |
ZxlAaron/mypros | python/pyspark/ml/util.py | 10 | 8851 | #
# 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 |
mydongistiny/external_chromium_org | third_party/jinja2/_compat.py | 638 | 4042 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | bsd-3-clause |
eunchong/build | scripts/slave/recipe_modules/chromium_tests/chromium_perf.py | 1 | 5954 | # Copyright 2015 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 collections
from . import steps
_builders = collections.defaultdict(dict)
SPEC = {
'builders': {},
'settings': {
'build_gs_bucket': 'chro... | bsd-3-clause |
noironetworks/group-based-policy | gbpservice/neutron/services/grouppolicy/drivers/nsp_manager.py | 1 | 7884 | # 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 |
endlessm/chromium-browser | third_party/llvm/lldb/examples/summaries/cocoa/CFArray.py | 13 | 7899 | """
LLDB AppKit formatters
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""
# example summary provider for NSArray
# the real summary is now C++ code built into LLDB
import... | bsd-3-clause |
lyarwood/sosreport | sos/plugins/apache.py | 6 | 2338 | # 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.
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
sudovijay/youtube-dl | youtube_dl/extractor/xminus.py | 118 | 2776 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_chr,
compat_ord,
)
from ..utils import (
int_or_none,
parse_filesize,
)
class XMinusIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?x-minus\.org/track/(?P<id>[0-... | unlicense |
gienkov/ACE3 | tools/setup.py | 21 | 3794 | #!/usr/bin/env python3
#######################
# ACE3 Setup Script #
#######################
import os
import sys
import shutil
import platform
import subprocess
import winreg
######## GLOBALS #########
MAINDIR = "z"
PROJECTDIR = "ace"
CBA = "P:\\x\\cba"
##########################
def main():
FULLDIR = "{}\\{... | gpl-2.0 |
Tehsmash/nova | nova/vnc/xvp_proxy.py | 40 | 6230 | #!/usr/bin/env python
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | apache-2.0 |
dynaryu/inasafe | safe/gui/tools/test/test_function_options_dialog.py | 3 | 10292 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **GUI Test Cases.**
Contact : ole.moller.nielsen@gmail.com
.. 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 Fre... | gpl-3.0 |
hujiajie/chromium-crosswalk | third_party/cython/src/Cython/Compiler/UtilityCode.py | 98 | 6918 | from TreeFragment import parse_from_strings, StringParseContext
import Symtab
import Naming
import Code
class NonManglingModuleScope(Symtab.ModuleScope):
def __init__(self, prefix, *args, **kw):
self.prefix = prefix
self.cython_scope = None
Symtab.ModuleScope.__init__(self, *args, **kw)
... | bsd-3-clause |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/contrib/gis/utils/layermapping.py | 34 | 27264 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | mit |
mdjurfeldt/nest-simulator | topology/examples/conncon_sources.py | 16 | 3092 | # -*- coding: utf-8 -*-
#
# conncon_sources.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
jmcanterafonseca/fiware-cygnus | test/acceptance/tools/fabric_utils.py | 1 | 7626 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of Short Term Historic (FI-WARE project).
#
# fiware-cygnus 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 Softwar... | agpl-3.0 |
turbokongen/home-assistant | homeassistant/components/onewire/__init__.py | 6 | 1439 | """The 1-Wire component."""
import asyncio
from homeassistant.config_entries import ConfigEntry
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.typing import HomeAssistantType
from .const import DOMAIN, SUPPORTED_PLATFORMS
from .onewirehub import CannotConnect, OneWireHub
async d... | apache-2.0 |
garbled1/ansible | lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py | 23 | 25815 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tmimori/erpnext | erpnext/stock/report/stock_ledger/stock_ledger.py | 32 | 3783 | # 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 _
def execute(filters=None):
columns = get_columns()
sl_entries = get_stock_ledger_entries(filters)
item_details = ... | agpl-3.0 |
alfa-addon/addon | plugin.video.alfa/lib/js2py/constructors/jsuint8array.py | 9 | 2436 | # this is based on jsarray.py
from ..base import *
try:
import numpy
except:
pass
@Js
def Uint8Array():
TypedArray = (PyJsInt8Array, PyJsUint8Array, PyJsUint8ClampedArray,
PyJsInt16Array, PyJsUint16Array, PyJsInt32Array,
PyJsUint32Array, PyJsFloat32Array, PyJsFloat64Ar... | gpl-3.0 |
etherkit/OpenBeacon2 | client/win/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 102 | 14122 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | gpl-3.0 |
thaumos/ansible | lib/ansible/plugins/callback/log_plays.py | 42 | 3291 | # (C) 2012, Michael DeHaan, <michael.dehaan@gmail.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
DOCUMENTATION = '''
callback: log_plays
type: n... | gpl-3.0 |
fyfcauc/android_external_chromium-org | chrome/common/extensions/docs/server2/patcher.py | 121 | 1026 | # 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.
class Patcher(object):
def GetPatchedFiles(self, version=None):
'''Returns patched files as(added_files, deleted_files, modified_files)
from the pa... | bsd-3-clause |
felipeZ/nonAdiabaticCoupling | nac/integrals/multipole_matrices.py | 1 | 3122 | from compute_integrals import compute_integrals_multipole
from nac.common import (
Matrix, retrieve_hdf5_data, is_data_in_hdf5,
store_arrays_in_hdf5, tuplesXYZ_to_plams)
from os.path import join
import os
import uuid
def get_multipole_matrix(config: dict, inp: dict, multipole: str) -> Matrix:
"""
Retr... | mit |
m2dsupsdlclass/lectures-labs | labs/10_unsupervised_generative_models/solutions/conv_encoder.py | 1 | 1359 |
from tensorflow.keras.layers import BatchNormalization
def make_conv_encoder(img_rows, img_cols, img_chns,
latent_dim, intermediate_dim):
x = Input(shape=(img_rows, img_cols, img_chns))
x_conv = Conv2D(filters,
kernel_size=kernel_size,
padding='sa... | mit |
ptemplier/ansible | lib/ansible/modules/network/panos/panos_dag.py | 29 | 4264 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
mahinthjoe/bedrock | bedrock/press/forms.py | 19 | 6883 | # coding: utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django import forms
from lib.l10n_utils.dotlang import _, _lazy
from bedrock.mozorg.forms import... | mpl-2.0 |
martinbede/second-sight | tensorflow/python/framework/tensor_shape_div_test.py | 15 | 1483 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
marioluan/mit-opencourseware-cs | 600/unit-2/introduction-to-simulation-and-random-walks/problem-set/ps5/ps5.py | 1 | 11443 | DEBUG = False
# 6.00 Problem Set 5
# RSS Feed Filter
import feedparser
import string
import re
import time
import copy
from project_util import translate_html
from news_gui import Popup
#-----------------------------------------------------------------------
#
# Problem Set 5
#======================
# Code for retr... | mit |
met-office-lab/cloud-processing-config | analysis_config.py | 1 | 3204 | import iris
import functools
import numpy as np
import os
max_val = 255 # maximum data value (i.e. 8 bit uint)
thredds_server = "http://thredds.3dvis.informaticslab.co.uk/thredds/dodsC/testLab/"
img_data_server = "http://data.3dvis.informaticslab.co.uk/molab-3dwx-ds/media/"
vid_data_server = img_data_server
roothal =... | lgpl-3.0 |
efiring/numpy-work | numpy/testing/utils.py | 1 | 25446 | """
Utility function to facilitate testing.
"""
import os
import sys
import re
import operator
from nosetester import import_nose
__all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal',
'assert_array_equal', 'assert_array_less', 'assert_string_equal',
'assert_array_almost_equal',... | bsd-3-clause |
LoLab-VU/pymc | pymc/step_methods/hmc.py | 2 | 3269 | '''
Created on Mar 7, 2011
@author: johnsalvatier
'''
from numpy import floor
from .quadpotential import *
from .arraystep import *
from ..core import *
from ..tuning import guess_scaling
import numpy as np
from scipy.sparse import issparse
from collections import namedtuple
__all__ = ['HamiltonianMC']
# TODO:
# a... | apache-2.0 |
bolkedebruin/airflow | tests/test_impersonation.py | 2 | 7598 | # -*- 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 |
gaomingnudt/gm-flask2.0 | tests/test_templating.py | 148 | 13057 | # -*- coding: utf-8 -*-
"""
tests.templating
~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import logging
from jinja2 import TemplateNotFound
def test_context_processing():
app = f... | bsd-3-clause |
rlefevre1/hpp-rbprm-corba | script/scenarios/demos/siggraph_asia/stair_bauzil_hrp2_path3.py | 2 | 3993 | from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.gepetto import Viewer
from hpp.corbaserver import Client
from hpp.corbaserver.robot import Robot as Parent
class Robot (Parent):
rootJointType = 'freeflyer'
packageName = 'hpp-rbprm-corba'
meshPackageName = 'hpp-rbprm-corba'
# URDF file describing the... | lgpl-3.0 |
jiangzhixiao/odoo | addons/board/__init__.py | 439 | 1144 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
koniiiik/django | django/core/management/sql.py | 108 | 1972 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False):
"""
Returns a list of the SQL statements used to flush the database.
If only_django is True, then only table n... | bsd-3-clause |
meisamhe/GPLshared | Research_Projects_UTD/DataScientistCompetitionCode/clickthroughratepredictionkagglecompetitioncodes/vowpelWabbitOutputCreationBu.py | 1 | 1919 | #======================================================
# create the output from output of vowpel wabbit
# to start just open vW output and put simple prediction word at top
# to make the files syncronized
#======================================================
logisticOut ="C:\\Users\\mxh109420\\Desktop\\KaggleCometi... | gpl-3.0 |
jeoliva/hls-analyzer | m3u8/__init__.py | 2 | 2424 | # coding: utf-8
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
import sys
PYTHON_MAJOR_VERSION = sys.version_info
import os
import posixpath
try:
from cookielib import CookieJar
except ImportE... | mit |
anbasile/flask_sample | flask/lib/python2.7/site-packages/flask/testsuite/templating.py | 562 | 11237 | # -*- coding: utf-8 -*-
"""
flask.testsuite.templating
~~~~~~~~~~~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class TemplatingTestCase(Flask... | mit |
DelazJ/QGIS | tests/src/python/test_qgsvectorlayer.py | 11 | 156846 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVectorLayer.
.. 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 |
fajoy/nova | nova/tests/virt/xenapi/test_volumeops.py | 2 | 4068 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Citrix Systems, 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/LICE... | apache-2.0 |
ron1818/Singaboat_RobotX2016 | robotx_nav/nodes/task1_toplevel.py | 3 | 9161 | #!/usr/bin/env python
""" task 1:
-----------------
Created by Ren Ye @ 2016-11-06
Authors: Ren Ye, Reinaldo
-----------------
<put the descriptions from robotx.org pdf file>
<put the algorithms in natural language, can use bullet points, best is to use markdown format>
<if you have plan... | gpl-3.0 |
mandeepdhami/horizon | openstack_dashboard/dashboards/project/images/tests.py | 9 | 19522 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | apache-2.0 |
davidcox/glumpy | setup.py | 1 | 1234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (C) 2009,2010,2011 Nicolas P. Rougier
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#----------... | bsd-3-clause |
Gui13/CouchPotatoServer | CouchPotato.py | 5 | 4531 | #!/usr/bin/env python
from __future__ import print_function
from logging import handlers
from os.path import dirname
import logging
import os
import select
import signal
import socket
import subprocess
import sys
import traceback
import time
# Root path
base_path = dirname(os.path.abspath(__file__))
# Insert local di... | gpl-3.0 |
resmo/ansible | lib/ansible/modules/storage/netapp/_na_cdot_aggregate.py | 44 | 7263 | #!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['deprecated'],
... | gpl-3.0 |
funbaker/astropy | astropy/utils/argparse.py | 2 | 1552 | """Utilities and extensions for use with `argparse`."""
import os
import argparse
def directory(arg):
"""
An argument type (for use with the ``type=`` argument to
`argparse.ArgumentParser.add_argument` which determines if the argument is
an existing directory (and returns the absolute path).
""... | bsd-3-clause |
Eagles2F/sync-engine | inbox/models/backends/oauth.py | 3 | 2666 | """
Generic OAuth class that provides abstraction for access and
refresh tokens.
"""
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from inbox.models.secret import Secret
from nyla... | agpl-3.0 |
kallimachos/archive | pygame/inkspill/inkspill.py | 1 | 18847 | # Ink Spill (a Flood It clone)
# http://inventwithpython.com/pygame
# By Al Sweigart al@inventwithpython.com
# Released under a "Simplified BSD" license
import random, sys, webbrowser, copy, pygame
from pygame.locals import *
# There are different box sizes, number of boxes, and
# life depending on the "boar... | gpl-3.0 |
erkanay/django | django/db/migrations/operations/fields.py | 14 | 8948 | from __future__ import unicode_literals
from django.db.models.fields import NOT_PROVIDED
from django.utils import six
from .base import Operation
class AddField(Operation):
"""
Adds a field to a model.
"""
def __init__(self, model_name, name, field, preserve_default=True):
self.model_name = ... | bsd-3-clause |
pratapvardhan/scikit-image | skimage/util/tests/test_apply_parallel.py | 8 | 1976 | from __future__ import absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal
from numpy.testing.decorators import skipif
from skimage.filters import threshold_adaptive, gaussian
from skimage.util.apply_parallel import apply_parallel, dask_available
@skipif(not dask_available)
def te... | bsd-3-clause |
pocmo/focus-android | tools/search/scrape_plugins.py | 7 | 7472 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from lxml import html
from lxml import etree
import copy
import json
import os
import requests
im... | mpl-2.0 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/AuthorizeNet/CustomerInformationManager/GetCustomerProfileIds.py | 5 | 3771 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetCustomerProfileIds
# Retrieves all existing customer profile IDs.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | gpl-3.0 |
Gebesa-Dev/Addons-gebesa | sale_order_state_change/models/stock_move.py | 1 | 3539 | # -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
from openerp.exceptions import UserError
import logging
_logger = logging.getLogger(__name__)
class StockMove(models.Model):
_inherit = 'stock.move'
... | agpl-3.0 |
ovnicraft/edx-platform | lms/djangoapps/course_api/tests/test_api.py | 19 | 8401 | """
Test for course API
"""
from hashlib import md5
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from opaque_keys.edx.keys import CourseKey
from rest_framework.exceptions import PermissionDenied
from rest_framework.request import Request
from rest_framework.test import APIReques... | agpl-3.0 |
abhishek-ch/hue | desktop/core/ext-py/Django-1.6.10/tests/model_regress/tests.py | 54 | 8927 | from __future__ import absolute_import, unicode_literals
import datetime
from operator import attrgetter
import sys
from django.core.exceptions import ValidationError
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils import tzinfo
from django.utils import unittest
fr... | apache-2.0 |
havard024/prego | venv/lib/python2.7/site-packages/unidecode/x05d.py | 252 | 4670 | data = (
'Lang ', # 0x00
'Kan ', # 0x01
'Lao ', # 0x02
'Lai ', # 0x03
'Xian ', # 0x04
'Que ', # 0x05
'Kong ', # 0x06
'Chong ', # 0x07
'Chong ', # 0x08
'Ta ', # 0x09
'Lin ', # 0x0a
'Hua ', # 0x0b
'Ju ', # 0x0c
'Lai ', # 0x0d
'Qi ', # 0x0e
'Min ', # 0x0f
'Kun ', # 0x10
'... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.