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 |
|---|---|---|---|---|---|
dmckinney5/SlackOff | slackoff/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
cartersgenes/shinysdr | shinysdr/test/test_rtty.py | 4 | 1968 | # Copyright 2014 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
google-code-export/camlistore | lib/python/simplejson/scanner.py | 674 | 2560 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | apache-2.0 |
gepd/Stino | stino/pyarduino/base/pyserial/serialposix.py | 18 | 24318 | #!/usr/bin/env python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# module for serial IO for POSIX compatible systems, like Linux
# see __init__.py
#
# (C) 2001-2010 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# parts based on code from Gran... | mit |
nagyistoce/odoo-dev-odoo | openerp/addons/test_new_api/tests/test_onchange.py | 208 | 7641 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestOnChange(common.TransactionCase):
def setUp(self):
super(TestOnChange, self).setUp()
self.Discussion = self.env['test_new_api.discussion']
self.Message = self.env['test_new_api.message']
def test_default_get(self):
... | agpl-3.0 |
rowemoore/odoo | addons/account/wizard/account_unreconcile.py | 385 | 2086 | # -*- 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 |
JasonGross/mozjs | testing/mozbase/mozdevice/tests/sut_pull.py | 5 | 1910 | from sut import MockAgent
import mozdevice
import mozlog
import unittest
import hashlib
import tempfile
import os
class PullTest(unittest.TestCase):
def test_pull_success(self):
for count in [ 1, 4, 1024, 2048 ]:
cheeseburgers = ""
for i in range(count):
cheeseburge... | mpl-2.0 |
jmerkow/ITK | Wrapping/Generators/Python/Tests/GrayscaleDilateImageFilter.py | 19 | 1673 | #!/usr/bin/env python
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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 Licen... | apache-2.0 |
beijingren/roche-website | djiki/forms.py | 2 | 3676 | from django import forms
from django.utils.translation import ugettext as _
from diff_match_patch import diff_match_patch
from . import models, utils
class PageEditForm(forms.ModelForm):
prev_revision = forms.ModelChoiceField(
queryset=models.PageRevision.objects.none(),
widget=forms.HiddenInput(),
required=Fal... | mit |
Edraak/edraak-platform | openedx/core/djangoapps/theming/management/commands/compile_sass.py | 14 | 5404 | """
Management command for compiling sass.
"""
from __future__ import unicode_literals
from django.core.management import BaseCommand, CommandError
from paver.easy import call_task
from pavelib.assets import ALL_SYSTEMS
from openedx.core.djangoapps.theming.helpers import get_themes, get_theme_base_dirs, is_comprehe... | agpl-3.0 |
KyleBenson/ns3 | src/config-store/bindings/modulegen__gcc_ILP32.py | 72 | 54535 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
fffonion/you-get | src/you_get/extractors/mixcloud.py | 19 | 1185 | #!/usr/bin/env python
__all__ = ['mixcloud_download']
from ..common import *
def mixcloud_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url)
title = r1(r'<meta property="og:title" content="([^"]*)"', html)
preview_url = r1("m-preview=\"([^\"]+)\"", html)
url = re.... | mit |
CouchPotato/CouchPotatoV1 | library/sqlalchemy/sql/util.py | 11 | 24697 | from sqlalchemy import exc, schema, topological, util, sql, types as sqltypes
from sqlalchemy.sql import expression, operators, visitors
from itertools import chain
"""Utility functions that build upon SQL and Schema constructs."""
def sort_tables(tables):
"""sort a collection of Table objects in order of their f... | gpl-3.0 |
roadmapper/ansible | test/ansible_test/unit/test_diff.py | 66 | 3212 | """Tests for diff module."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import subprocess
import pytest
from ansible_test._internal.util import (
to_text,
to_bytes,
)
from ansible_test._internal.diff import (
parse_diff,
FileDiff,
)
def get_dif... | gpl-3.0 |
jusdng/odoo | addons/stock/wizard/stock_return_picking.py | 218 | 10043 | # -*- 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 |
lakshayg/tensorflow | tensorflow/contrib/integrate/python/ops/odes.py | 60 | 24150 | # 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 |
miloszz/DIRAC | StorageManagementSystem/scripts/dirac-stager-monitor-jobs.py | 11 | 8613 | #! /usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-stager-monitor-jobs
# Author : Daniela Remenska
########################################################################
"""
Report the summary of the staging progress of jobs
"""
__RCSID__ =... | gpl-3.0 |
sidhart/antlr4 | runtime/Python3/src/antlr4/tree/ParseTreeMatch.py | 17 | 5761 | #
# [The "BSD license"]
# Copyright (c) 2013 Terence Parr
# Copyright (c) 2013 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redistributio... | bsd-3-clause |
drj11/pypng | code/iccp.py | 1 | 16295 | #!/usr/bin/env python
# iccp
#
# International Color Consortium Profile
#
# Tools for manipulating ICC profiles.
#
# An ICC profile can be extracted from a PNG image (iCCP chunk).
#
#
# Non-standard ICCP tags.
#
# Apple use some (widespread but) non-standard tags. These can be
# displayed in Apple's ColorSync Utility... | mit |
NovaPointGroup/purchase-workflow | framework_agreement/model/purchase.py | 20 | 7426 | # -*- coding: utf-8 -*-
# Author: Nicolas Bessi, Leonardo Pistone
# Copyright 2013-2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of ... | agpl-3.0 |
calfonso/ansible | lib/ansible/modules/network/vyos/vyos_config.py | 13 | 9333 | #!/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 |
bkosawa/admin-recommendation | crawler/migrations/0001_initial.py | 1 | 3457 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-13 02:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='App',
... | apache-2.0 |
clovett/MissionPlanner | Lib/site-packages/scipy/fftpack/benchmarks/bench_basic.py | 63 | 7559 | """ Test functions for fftpack.basic module
"""
import sys
from numpy.testing import *
from scipy.fftpack import ifft, fft, fftn, irfft, rfft
from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble
import numpy.fft
from numpy.random import rand
def random(size):
return rand(*size)
def direct_dft(... | gpl-3.0 |
LABSN/mnefun | mnefun/_status.py | 3 | 4312 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, LABS^N
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from os import path as op
from .externals import tabulate
from ._paths import (get_raw_fnames, get_event_fnames, get_cov_fwd_inv_fnames,
get_epochs_evokeds_fnames, get_re... | bsd-3-clause |
glennrub/micropython | tests/extmod/vfs_fat_finaliser.py | 14 | 1906 | # Test VfsFat class and its finaliser
try:
import uerrno, uos
uos.VfsFat
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
def __init__(self, blocks, sec_size=512):
self.sec_size = sec_size
self.data = bytearray(blocks * self.sec_size)
... | mit |
jcasner/nupic | src/nupic/math/dist.py | 50 | 8248 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
oesst/Sound_Analytics | old_stuff/mic_read.py | 1 | 1715 | """
mic_read.py
Created By Alexander Yared (akyared@gmail.com)
Microphone controller module for the Live Spectrogram project, a real time
spectrogram visualization tool
Dependencies: pyaudio, numpy and matplotlib
"""
############### Import Libraries ###############
import pyaudio
import numpy as np
import matplotlib.py... | mit |
krzysztof/invenio-migrator | invenio_migrator/version.py | 1 | 1187 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
adobe-research/video-lecture-summaries | Scripts/dynamic_linebreak_wo_ygap.py | 1 | 15999 |
'''
Created on Dec 18, 2014
@author: hijungshin
'''
from visualobjects import *
class LineBreaker:
def __init__(self, list_of_objs, panorama, outvideo=None):
self.list_of_lines = []
self.list_of_objs = list_of_objs
self.panorama = panorama
self.nobjs = len(list_of_objs)
# ... | bsd-2-clause |
escher9/vdebug-python | tests/test_dbgp_connection.py | 8 | 2354 | if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
import unittest2 as unittest
import vdebug.dbgp
class SocketMockError():
pass
class SocketMock():
def __init__(self):
self.response = []
self.last_msg = None
def recv(self,length):
ret = self.respon... | mit |
mo-g/iris | lib/iris/tests/unit/analysis/cartography/test__xy_range.py | 14 | 2274 | # (C) British Crown Copyright 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
hkawasaki/kawasaki-aio8-0 | common/djangoapps/terrain/stubs/lti.py | 14 | 12431 | """
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
from uuid import uuid4
import textwrap
import urllib
import re
from oauthlib.oauth... | agpl-3.0 |
kmoocdev2/edx-platform | common/djangoapps/third_party_auth/nhiiprovider.py | 1 | 1854 | import json
from social_core.backends.oauth import BaseOAuth2
class OAuth2(BaseOAuth2):
# callback name
name = 'logodi'
AUTHORIZATION_URL = 'http://e-learning.nhi.go.kr/external/kmooc.do'
ACCESS_TOKEN_URL = 'https://policy.nhi.go.kr/oauth2/token.do'
USER_INFO_URL = 'https://policy.nhi.go.kr/oauth... | agpl-3.0 |
tavaresdong/courses-notes | ucb_cs61A/projects/ants/tests/03A.py | 4 | 5381 | test = {
'name': 'Problem 3A',
'partner': 'A',
'points': 2,
'suites': [
{
'cases': [
{
'answer': 'Always; after adding the insect, reduce its armor to 0 if it is not watersafe',
'choices': [
'Always; after adding the insect, reduce its armor to 0 if it is not wa... | mit |
xiaoyang2022/V2EX | v2ex/babel/ext/sessions.py | 19 | 2933 | import os
import time
import datetime
import random
import Cookie
import logging
from google.appengine.api import memcache
from django.utils import simplejson as json
# Note - please do not use this for production applications
# see: http://code.google.com/p/appengine-utitlies/
COOKIE_NAME = 'appengine-simple-session... | bsd-3-clause |
anthonyfok/frescobaldi | frescobaldi_app/charmap/widget.py | 1 | 3842 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_metadata_operations.py | 1 | 7768 | # 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 may ... | mit |
tobynance/simple_mud | src/store.py | 1 | 1739 | import os
import json
from entity import Entity
from entity_database import EntityDatabase
base = os.path.dirname(__file__)
store_database = None
########################################################################
class Store(Entity):
####################################################################
... | mit |
dwweiss/pmLib | src/matter/HydraulicOil.py | 1 | 4914 | """
Copyright (c) 2016- by Dietmar W Weiss
This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 3.0 of
the License, or (at your option) any later version.
This software ... | lgpl-3.0 |
ashang/calibre | src/calibre/gui2/convert/search_and_replace.py | 14 | 11470 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>, 2012 Eli Algranti <idea00@hotmail.com>'
__docformat__ = 'restructuredtext en'
import re, codecs, json
from PyQt5.Qt import Qt, QTableWidgetItem
from calibre.gui2.convert.search_and_replace_ui import Ui_Form
fr... | gpl-3.0 |
helldorado/ansible | lib/ansible/modules/network/fortios/fortios_firewall_central_snat_map.py | 24 | 12414 | #!/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 |
jmartinm/invenio-master | modules/bibrank/lib/bibrank_word_searcher.py | 12 | 17098 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at... | gpl-2.0 |
mrambausek/PPFem | ppfem/__init__.py | 1 | 1648 | # PPFem: An educational finite element code
# Copyright (C) 2015 Matthias Rambausek
#
# 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 ... | gpl-3.0 |
msouto/20171-redes-2t-programacao-redes | 02_sockets/21_multithread.py | 1 | 1535 | import socket
import threading
class ThreadServer(object):
#construtor da classe
def __init__(self, host, port):
self.host = host #passando por parametro
self.port = port #passando por parametro
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #descritor do socket
... | gpl-3.0 |
x111ong/odoo | addons/event/event.py | 224 | 18601 | # -*- 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 |
rbelzile/python-myfitnesspal | myfitnesspal/commands.py | 1 | 3881 | from __future__ import print_function
import argparse
from datetime import datetime
from getpass import getpass
import logging
from blessed import Terminal
from dateutil.parser import parse as dateparse
from .keyring_utils import (
delete_password_in_keyring,
get_password_from_keyring_or_interactive,
sto... | mit |
dabiboo/youtube-dl | youtube_dl/extractor/stanfordoc.py | 173 | 3526 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
orderedSet,
unescapeHTML,
)
class StanfordOpenClassroomIE(InfoExtractor):
IE_NAME = 'stanfordoc'
IE_DESC = 'Stanford Open ClassRoom'
_VALID_URL = r'https?://openclassroom... | unlicense |
schristakidis/p2ner | startGui.py | 1 | 1043 | # -*- coding: utf-8 -*-
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# U... | apache-2.0 |
nhenezi/kuma | vendor/lib/python/south/models.py | 76 | 1190 | from django.db import models
from south.db import DEFAULT_DB_ALIAS
class MigrationHistory(models.Model):
app_name = models.CharField(max_length=255)
migration = models.CharField(max_length=255)
applied = models.DateTimeField(blank=True)
@classmethod
def for_migration(cls, migration, database):
... | mpl-2.0 |
pymedusa/SickRage | ext/tornado/test/process_test.py | 2 | 11629 | from __future__ import absolute_import, division, print_function
import logging
import os
import signal
import subprocess
import sys
from tornado.httpclient import HTTPClient, HTTPError
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log import gen_log
from tornado.process imp... | gpl-3.0 |
paninetworks/neutron | neutron/tests/unit/services/metering/drivers/test_iptables.py | 34 | 21296 | # Copyright (C) 2013 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 |
sightmachine/simplecv2-barcode | simplecv_barcode/features.py | 2 | 4334 | from math import sqrt
import numpy as np
from copy import copy
import scipy.spatial.distance as spsd
from simplecv.features.features import Feature
class Barcode(Feature):
"""
**SUMMARY**
The Barcode Feature wrappers the object returned by find_barcode(), a zbar
symbol
* The x,y coordinate is ... | bsd-2-clause |
pschmitt/home-assistant | homeassistant/components/trackr/device_tracker.py | 23 | 2368 | """Support for the TrackR platform."""
import logging
from pytrackr.api import trackrApiInterface
import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
from homeassi... | apache-2.0 |
rackerlabs/heat-pyrax | tests/unit/test_autoscale.py | 1 | 84594 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import random
import unittest
from mock import patch
from mock import MagicMock as Mock
import pyrax
import pyrax.autoscale
from pyrax.autoscale import AutoScaleClient
from pyrax.autoscale import AutoScalePolicy
from pyrax.autoscale import AutoScaleWebhook
... | apache-2.0 |
taknevski/tensorflow-xsmm | tensorflow/python/training/adagrad.py | 64 | 4181 | # 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 |
thaumos/ansible | lib/ansible/module_utils/network/iosxr/providers/module.py | 18 | 2093 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import Connection
from ansible.module_utils.network.iosxr.providers import providers
from ansible... | gpl-3.0 |
sebrandon1/tempest | tempest/api/volume/v3/base.py | 1 | 2283 | # Copyright 2016 Andrew Kerr
# 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 a... | apache-2.0 |
admetricks/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/xcode.py | 137 | 50429 | #!/usr/bin/python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import posixpath
import re
import shutil
import subprocess
imp... | bsd-3-clause |
mhaberler/machinekit | lib/python/yapps/grammar.py | 42 | 8821 | # grammar.py, part of Yapps 2 - yet another python parser system
# Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu>
#
# This version of the Yapps 2 grammar can be distributed under the
# terms of the MIT open source license, either found in the LICENSE
# file included with the Yapps distribution
# <http://t... | lgpl-2.1 |
rjschwei/azure-sdk-for-python | azure-batch/azure/batch/models/metadata_item.py | 4 | 1187 | # 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 |
adwiputra/LUMENS-repo | processing/outputs/OutputFactory.py | 5 | 2121 | # -*- coding: utf-8 -*-
"""
***************************************************************************
OutputFactory.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
JorgeCoock/django | tests/signed_cookies_tests/tests.py | 288 | 2768 | from __future__ import unicode_literals
from django.core import signing
from django.http import HttpRequest, HttpResponse
from django.test import SimpleTestCase, override_settings
from django.test.utils import freeze_time
class SignedCookieTest(SimpleTestCase):
def test_can_set_and_read_signed_cookies(self):
... | bsd-3-clause |
mlperf/training_results_v0.5 | v0.5.0/nvidia/submission/code/translation/pytorch/fairseq/sequence_generator.py | 1 | 24455 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
from fa... | apache-2.0 |
MaizerGomes/youtube-dl | youtube_dl/extractor/spankwire.py | 35 | 4171 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_urlparse,
compat_urllib_request,
)
from ..utils import (
str_to_int,
unified_strdate,
)
from ..aes import aes_decrypt_text
class SpankwireIE... | unlicense |
redhat-openstack/rdopkg | rdopkg/actions/distgit/actions.py | 2 | 38374 | """
This is the main rdopkg action module with actions for distgit management.
"""
from __future__ import print_function
from distroinfo.query import get_package
import itertools
import os
import re
import six
from six.moves import input
import sys
from rdopkg.conf import cfg, cfg_files
from rdopkg import exception
fr... | apache-2.0 |
Samreay/ChainConsumer | tests/test_diagnostic.py | 1 | 4632 | import numpy as np
import pytest
from chainconsumer import ChainConsumer
def test_gelman_rubin_index():
data = np.vstack((np.random.normal(loc=0.0, size=100000),
np.random.normal(loc=1.0, size=100000))).T
consumer = ChainConsumer()
consumer.add_chain(data, walkers=4)
assert cons... | mit |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/encodings/punycode.py | 250 | 6881 | """ Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = bytearray()
extended = set()
for c in str:
if ord... | apache-2.0 |
fracting/depot_tools | PRESUBMIT.py | 11 | 4554 | # 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.
"""Top-level presubmit script for depot tools.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit ... | bsd-3-clause |
wraiden/spacewalk | proxy/proxy/apacheHandler.py | 10 | 23646 | # Main entry point for apacheServer.py for the Spacewalk Proxy
# and/or SSL Redirect Server.
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warr... | gpl-2.0 |
Fat-Zer/FreeCAD_sf_master | src/Mod/PartDesign/PartDesignTests/TestPad.py | 11 | 8233 | # (c) Juergen Riegel (FreeCAD@juergen-riegel.net) 2011 LGPL *
# *
# This file is part of the FreeCAD CAx development system. *
# *
# This program... | lgpl-2.1 |
hpcugent/easybuild-easyblocks | easybuild/easyblocks/f/flex.py | 3 | 2546 | ##
# Copyright 2009-2021 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://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
shravan-achar/servo | tests/wpt/web-platform-tests/mathml/tools/mathvariant-transforms.py | 67 | 4734 | #!/usr/bin/python
from __future__ import print_function
from lxml import etree
from utils.misc import downloadWithProgressBar
from utils import mathfont
import json
# Retrieve the unicode.xml file if necessary.
unicodeXML = downloadWithProgressBar("http://www.w3.org/2003/entities/2007xml/unicode.xml")
# Extract the ... | mpl-2.0 |
lepistone/odoo | addons/mail/res_partner.py | 379 | 2454 | # -*- 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 |
imcom/pyleus | examples/apparent_temperature/apparent_temperature/wind_chill_calculator.py | 9 | 2149 | from __future__ import absolute_import
from array import array
from collections import defaultdict
import logging
import time
from pyleus.storm import SimpleBolt
from apparent_temperature.measure_generator import Measure
log = logging.getLogger('wind_chill_bolt')
def _wind_chill(temp, wind):
wind_pow = pow(wi... | apache-2.0 |
skevy/django | django/contrib/localflavor/is_/is_postalcodes.py | 438 | 4913 | # -*- coding: utf-8 -*-
IS_POSTALCODES = (
('101', u'101 Reykjavík'),
('103', u'103 Reykjavík'),
('104', u'104 Reykjavík'),
('105', u'105 Reykjavík'),
('107', u'107 Reykjavík'),
('108', u'108 Reykjavík'),
('109', u'109 Reykjavík'),
('110', u'110 Reykjavík'),
('111', u'111 Reykjavík'... | bsd-3-clause |
petecummings/NewsBlur | apps/feed_import/migrations/0002_oauth.py | 18 | 4508 |
from south.db import db
from django.db import models
from apps.feed_import.models import *
class Migration:
def forwards(self, orm):
# Adding model 'OAuthToken'
db.create_table('feed_import_oauthtoken', (
('id', orm['feed_import.oauthtoken:id']),
('user', orm[... | mit |
nestorsalceda/mamba | spec/errors_in_hooks_spec.py | 1 | 4841 | from mamba import description, before, it, context
from expects import expect, be_none, be_a, be_true, be_false
from doublex import Spy
from mamba import reporter, runnable
from spec.object_mother import *
with description('Errors in hooks') as self:
with before.each:
self.reporter = Spy(reporter.Reporte... | mit |
jgcaaprom/android_kernel_oneplus_msm8974 | scripts/build-all.py | 1474 | 10189 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
vitalti/sapl | sapl/materia/tests/test_email_templates.py | 1 | 2707 | from django.core import mail
from sapl.materia.email_utils import enviar_emails, load_email_templates
def test_email_template_loading():
expected = "<html><body>Hello Django</body></html>"
emails = load_email_templates(['email/test_tramitacao.html'],
context={"name": "Django... | gpl-3.0 |
honnibal/spaCy | spacy/lang/fr/stop_words.py | 1 | 4160 | # coding: utf8
from __future__ import unicode_literals
STOP_WORDS = set(
"""
a à â abord absolument afin ah ai aie ailleurs ainsi ait allaient allo allons
allô alors anterieur anterieure anterieures apres après as assez attendu au
aucun aucune aujourd aujourd'hui aupres auquel aura auraient aurait auront
aussi au... | mit |
OmarIthawi/edx-platform | common/djangoapps/terrain/stubs/http.py | 9 | 8495 | """
Stub implementation of an HTTP service.
"""
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import urlparse
import threading
import json
from functools import wraps
from lazy import lazy
from logging import getLogger
LOGGER = getLogger(__name__)
def require_params(method, *required_keys):
"""
... | agpl-3.0 |
hmen89/odoo | addons/website_blog/controllers/main.py | 56 | 16620 | # -*- coding: utf-8 -*-
import datetime
import werkzeug
from openerp import tools
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug
from openerp.osv.orm import browse_record
from openerp.tools.translate import _
from openerp import S... | agpl-3.0 |
Tythos/pyroclast | basic.py | 1 | 1323 | """Basic data handling mechanisms for lists of dictionaries, including alignment
(i.e., given all dictionaries in a list uniform keysets), filtering, and
string value parsing.
"""
def filter(dicts, filters):
"""Returns a subset of the given entries in dicts (a list of dictionaries)
for which the fields spec... | mit |
rektide/linux | scripts/gdb/linux/utils.py | 630 | 4267 | #
# gdb helper commands and functions for Linux kernel debugging
#
# common utilities
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
class CachedType:
def __init__(self, name):
s... | gpl-2.0 |
VillageAlliance/django-cms | cms/migrations/0013_site_copy.py | 8 | 17793 | # -*- coding: utf-8 -*-
from south.db import db
from django.db import models
from cms.models import *
class Migration:
def forwards(self, orm):
if not db.dry_run:
for page in orm.Page.objects.all():
page.site_id = 1
page.save()
def backw... | bsd-3-clause |
da1z/intellij-community | python/testData/inspections/PyUnresolvedReferencesInspection/operators.py | 83 | 8516 | class C(object):
def __add__(self, other):
return int(other)
def __or__(self, other):
return other
def __rsub__(self, other):
return other
def __neg__(self):
return self
def test_object():
o1 = object()
o2 = object()
o1 <warning descr="Class 'object' does... | apache-2.0 |
vgrem/SharePointOnline-REST-Python-Client | office365/onedrive/drive.py | 1 | 1268 | from office365.onedrive.baseItem import BaseItem
from office365.onedrive.driveItem import DriveItem
from office365.onedrive.driveItemCollection import DriveItemCollection
from office365.onedrive.list import List
from office365.runtime.resource_path import ResourcePath
class Drive(BaseItem):
"""The drive resource ... | mit |
RafaelTorrealba/odoo | addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py | 340 | 8789 | # -*- 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 |
nathanleclaire/WALinuxAgent | azurelinuxagent/event.py | 1 | 4917 | # Copyright 2014 Microsoft 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 applicable law or agreed to in... | apache-2.0 |
npe9/depot_tools | third_party/colorama/initialise.py | 484 | 1297 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... | bsd-3-clause |
amalshehu/exercism-python | allergies/allergies_test.py | 8 | 1390 | import unittest
from allergies import Allergies
class AllergiesTests(unittest.TestCase):
def test_no_allergies_means_not_allergic(self):
allergies = Allergies(0)
self.assertFalse(allergies.is_allergic_to('peanuts'))
self.assertFalse(allergies.is_allergic_to('cats'))
self.assertFa... | mit |
bollwyvl/ipymd | ipymd/formats/markdown.py | 1 | 5024 | # -*- coding: utf-8 -*-
"""Markdown readers and writers
Much of the code comes from the mistune library.
"""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import re
from collections import Or... | bsd-3-clause |
MingfeiPan/leetcode | backtracking/401.py | 1 | 1042 | import itertools
class Solution:
def readBinaryWatch(self, num):
"""
:type num: int
:rtype: List[str]
"""
mapper = {
1:8,
2:4,
3:2,
4:1,
5:32,
6:16,
7:8,
8:4,
... | apache-2.0 |
kenwang815/KodiPlugins | script.module.oceanktv/lib/youtube_dl/extractor/streetvoice.py | 23 | 1614 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import unified_strdate
class StreetVoiceIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://s... | gpl-2.0 |
martynovp/edx-platform | common/test/acceptance/pages/lms/problem.py | 26 | 2370 | """
Problem Page.
"""
from bok_choy.page_object import PageObject
class ProblemPage(PageObject):
"""
View of problem page.
"""
url = None
def is_browser_on_page(self):
return self.q(css='.xblock-student_view').present
@property
def problem_name(self):
"""
Return ... | agpl-3.0 |
mobiledayadmin/DenyHosts | DenyHosts/lockfile.py | 6 | 1374 | import os
from util import die
class LockFile:
def __init__(self, lockpath):
self.lockpath = lockpath
self.fd = None
def exists(self):
return os.access(self.lockpath, os.F_OK)
def get_pid(self):
pid = ""
try:
fp = open(self.lockpath, "r")
p... | gpl-2.0 |
andymckay/django | django/contrib/localflavor/mx/mx_states.py | 88 | 1296 | # -*- coding: utf-8 -*-
"""
A list of Mexican states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from django.utils.translation import ugettext_lazy as _
# All 31 states, plus the `Distrito Federal`.
STATE_CHOICES = (
... | bsd-3-clause |
frouty/odoogoeen | addons/product_visible_discount/product_visible_discount.py | 3 | 4871 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
amrdraz/kodr | app/brython/www/src/Lib/xml/etree/ElementInclude.py | 784 | 5146 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | mit |
gchaimovitz/CouchPotatoServer | libs/bs4/builder/__init__.py | 447 | 11151 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a Tree... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.