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 |
|---|---|---|---|---|---|
fergaljd/pep_ga | chromosomes/base_chromosome.py | 1 | 2239 | import random
def basic_mutation(sequence, mutation_rate, building_blocks):
"""
An amino acid is randomly mutated into any other amino acid.
"""
mutated_sequence = []
for element in sequence:
if random.random() < mutation_rate:
new_element = random.choice(building_blocks)
... | gpl-2.0 |
kevinastone/sentry | src/sentry/utils/email.py | 14 | 6441 | """
sentry.utils.email
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import toronado
from django.conf import settings
from django.core.mail import get_connection, EmailMultiAlterna... | bsd-3-clause |
michellab/SireUnitTests | unittests/SireMM/test_extract.py | 1 | 2046 |
from Sire.Mol import *
from Sire.MM import *
from Sire.IO import *
from nose.tools import assert_almost_equal
(molecules, space) = Amber().readCrdTop("../io/proteinbox.crd", "../io/proteinbox.top")
molnums = molecules.molNums()
for molnum in molnums:
protein = molecules[molnum].molecule()
if protein.nAtom... | gpl-3.0 |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/pbr/tests/test_commands.py | 33 | 3688 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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... | mit |
sccn/SNAP | src/rpyc/__init__.py | 2 | 2209 | """
::
##### ##### ####
## ## ## ## ## ####
## ## ## ## ## #
##### ##### ## ## ## ##
## ## ## ## ## ## #
## ## ## ### ## ##... | bsd-3-clause |
niwtr/map-walker | src/server/fake_client_test.py | 1 | 1246 | #! /usr/bin/python
# -*- coding: utf-8 -*-
import socket
import time
import threading
#get the com.
ip_address='119.29.232.198'#socket.gethostbyname(socket.gethostname())#'10.201.12.244'
ds=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
ds.connect((ip_address,9999))
print(ds.recv(1024).decode('utf-8'))
addr=int(ds.... | mit |
matbu/ansible-modules-extras | cloud/amazon/ec2_vpc_net_facts.py | 23 | 3693 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
hsnr-gamera/gamera | gamera/gui/compat_wx.py | 1 | 14251 | #
# Copyright (C) 2018 Jens Dahlmanns
#
# 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 distrib... | gpl-2.0 |
ba50/nanobeam_electron_diffraction | Dm3Reader3_1.py | 1 | 10395 | # '<i' == little endian byte ordering
# stworzyc klase tag_group, tag itp.
# sizes of different datatypes in bytes
type_size = { 'char': 1, 'bool': 1, 'i8': 1, 'i16': 2, 'i32': 4, 'float': 4, 'double': 8 }
# format strings for different datatypes to be used inside the struct.unpack() function
type_format = { 'char': ... | gpl-3.0 |
autosub-team/autosub | VELS_WEB/languages/zh-cn.py | 142 | 10465 | # coding: utf8
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" 应为选择表达式, 格式如 "field1=\'value\'". 但是对 JOIN 的结果不可以使用 update 或者 delete"',
'%s %%{row} deleted': '已删除 %s 笔',
'%s %%{row} updated': '已更新 %s... | gpl-2.0 |
ezcall-net-tw/EZCall | jni/pjsip/sources/doc/pjsip-book/fetch_trac.py | 61 | 1722 | import urllib2
import sys
import unicodedata
def fetch_rst(url):
print 'Fetching %s..' % url
req = urllib2.Request(url)
fd = urllib2.urlopen(req, timeout=30)
body = fd.read()
body = body.replace("\r\n", "\n")
body = body.decode('utf8', 'ignore').encode('ascii', 'ignore')
pos = body.find("{{{")
if pos >= 0... | lgpl-3.0 |
saguas/jasper_erpnext_report | jasper_erpnext_report/core/FrappeTask.py | 1 | 2201 | __author__ = 'luissaguas'
#import json
from jnius import PythonJavaClass, java_method
import frappe, re, os
class FrappeTask(PythonJavaClass):
__javainterfaces__ = ['IFrappeTask']
def read_config(self):
config = frappe.get_conf() or {}
curr_site = os.path.join("currentsite.txt")
config.default_site = frapp... | mit |
rversteegen/commandergenius | project/jni/python/src/Lib/encodings/cp865.py | 593 | 34874 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.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_map)
def decode(self,input,errors='strict'):
... | lgpl-2.1 |
odoousers2014/LibrERP | l10n_ch_payment_slip/invoice.py | 4 | 9610 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright 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 t... | agpl-3.0 |
parenthetical-e/simfMRI | runclass.py | 1 | 3264 | """ A template Class for top-level experimental runs. """
import os
from numpy.random import RandomState
from multiprocessing import Pool
from simfMRI.io import write_hdf, get_model_names
from simfMRI.analysis.plot import hist_t
from simfMRI.mapreduce import create_chunks, reduce_chunks
from simfMRI.misc import process... | bsd-2-clause |
eonpatapon/nova | nova/api/openstack/compute/plugins/v3/assisted_volume_snapshots.py | 33 | 3882 | # Copyright 2013 Red Hat, Inc.
# Copyright 2014 IBM Corp.
# 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.... | apache-2.0 |
mou4e/zirconium | tools/telemetry/telemetry/image_processing/io/frame_generator.py | 52 | 1479 | # 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.
import abc
class FrameReadError(Exception):
pass
class FrameGenerator(object):
""" Defines an interface for reading input frames.
Attributes:
... | bsd-3-clause |
chapmanb/cwltool | cwltool/process.py | 1 | 32827 | import abc
import copy
import errno
import hashlib
import json
import logging
import os
import shutil
import stat
import tempfile
import urlparse
import uuid
from collections import Iterable
import functools
import avro.schema
import schema_salad.schema
import schema_salad.validate as validate
from pkg_resources impor... | apache-2.0 |
WorldViews/Spirals | YEI/examples/pairing_wireless_devices.py | 1 | 3016 | ## Pairing the YEI 3-Space Sensor Wireless devices with the YEI 3-Space Sensor
## Dongle devices for a wireless connection with Python 2.7, PySerial 2.6, and
## YEI 3-Space Python API
import threespace_api as ts_api
## If the COM port is not known or the device type is not known for the 3-Space
## Sensor device, we m... | mit |
MER-GROUP/intellij-community | plugins/hg4idea/testData/bin/hgext/blackbox.py | 94 | 5258 | # blackbox.py - log repository events to a file for post-mortem debugging
#
# Copyright 2010 Nicolas Dumazet
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""log repository events to a blackbox fo... | apache-2.0 |
mitdbg/modeldb | client/verta/verta/_protos/public/uac/Telemetry_pb2.py | 2 | 5162 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: uac/Telemetry.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sy... | mit |
dundeemt/SoCo | soco/music_library.py | 1 | 21591 | # -*- coding: utf-8 -*-
"""Music Library access."""
from __future__ import unicode_literals
import logging
from . import discovery
from .data_structures import (
SearchResult,
from_didl_string,
DidlResource,
DidlObject,
DidlMusicAlbum
)
from .exceptions import SoCoUPnPException
from .utils impor... | mit |
dpassante/ansible | lib/ansible/module_utils/facts/hardware/linux.py | 23 | 33933 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
polimediaupv/edx-platform | common/test/acceptance/tests/studio/test_studio_library.py | 11 | 27414 | """
Acceptance tests for Content Libraries in Studio
"""
from ddt import ddt, data
from nose.plugins.attrib import attr
from flaky import flaky
from .base_studio_test import StudioLibraryTest
from ...fixtures.course import XBlockFixtureDesc
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.utils ... | agpl-3.0 |
moijes12/oh-mainline | vendor/packages/python-social-auth/social/backends/evernote.py | 61 | 2704 | """
Evernote OAuth1 backend (with sandbox mode support), docs at:
http://psa.matiasaguirre.net/docs/backends/evernote.html
"""
from requests import HTTPError
from social.exceptions import AuthCanceled
from social.backends.oauth import BaseOAuth1
class EvernoteOAuth(BaseOAuth1):
"""
Evernote OAuth authent... | agpl-3.0 |
CARocha/sitioreddes | sitioreddes/urls.py | 1 | 2187 | from django.conf.urls import patterns, include, url
from settings import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from noticias.feeds import CategoriaFeed
from noticias.feeds import N... | mit |
Mozta/pagina-diagnostijuego | venv/lib/python2.7/site-packages/django/contrib/auth/password_validation.py | 57 | 7538 | from __future__ import unicode_literals
import gzip
import os
import re
from difflib import SequenceMatcher
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.encoding import ... | gpl-3.0 |
akashsinghal/Speech-Memorization-App | speech/Swift/Speech-gRPC-Streaming/env/lib/python3.6/site-packages/pip/_vendor/requests/compat.py | 327 | 1687 | # -*- coding: utf-8 -*-
"""
requests.compat
~~~~~~~~~~~~~~~
This module handles import compatibility issues between Python 2 and
Python 3.
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_p... | apache-2.0 |
Brainiq7/Ananse | ananse_dl/extractor/tenplay.py | 31 | 3423 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TenPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ten(play)?\.com\.au/.+'
_TEST = {
'url': 'http://tenplay.com.au/ten-insider/extra/season-2013/tenplay-tv-your-way',
'info_dict': {
... | unlicense |
OptiPop/external_chromium_org | tools/telemetry/telemetry/timeline/thread.py | 33 | 9408 | # 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.
import telemetry.timeline.async_slice as async_slice_module
import telemetry.timeline.event_container as event_container
import telemetry.timeline.flow_event ... | bsd-3-clause |
exploreodoo/datStruct | odoo/openerp/tools/convert.py | 205 | 41282 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-2.0 |
SimVascular/VTK | ThirdParty/Twisted/twisted/trial/test/test_doctest.py | 31 | 1715 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test Twisted's doctest support.
"""
from twisted.trial import itrial, runner, unittest, reporter
from twisted.trial.test import mockdoctest
class TestRunners(unittest.SynchronousTestCase):
"""
Tests for Twisted's doctest support.
... | bsd-3-clause |
RaphaelCavalcante/pymtp | tools/tabs2spaces.py | 2 | 2259 | #!/usr/bin/python
#-------------------------------------------------------------------------------
# Name: tabs2spaces.py
# Purpose: Takes one filename as the first argument and converts each tab
# into the number of spaces specified with the second argument.
#
# Usage: tabs2spaces.py <fil... | gpl-3.0 |
mendhak/onetimepass | onetimepass/__init__.py | 1 | 5850 | """
onetimepass module is designed to work for one-time passwords - HMAC-based and
time-based. It is compatible with Google Authenticator application and
applications based on it.
@version: 0.2.2
@author: Tomasz Jaskowski
@contact: http://github.com/tadeck
@license: MIT
>>> secret = b'MFRGGZDFMZTWQ2LK'
>>> get_hotp(s... | mit |
TeamEOS/external_chromium_org | third_party/markdown/extensions/nl2br.py | 109 | 2625 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
braams/shtoom | shtoom/ui/wxui/main.py | 1 | 9579 | from wxPython.wx import *
from wxshtoomframe import ShtoomMainFrame
from wxlogframe import LogFrame
from shtoom.ui.base import ShtoomBaseUI
from twisted.python import log
from twisted.internet import reactor, defer
from prefs import PreferencesDialog
import thread
import os
# Implements the ShtoomMainFrame class as ge... | lgpl-2.1 |
cuilishen/cuilishenMissionPlanner | Lib/site-packages/scipy/stats/setup.py | 51 | 1085 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('stats', parent_package, top_path)
config.add_data_... | gpl-3.0 |
tbadgu/Barcamp-Bangalore-Android-App | gcm_flask/werkzeug/debug/console.py | 74 | 5465 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.local... | apache-2.0 |
dcroc16/skunk_works | google_appengine/google/appengine/api/search/stub/tokens.py | 11 | 3103 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
mcanthony/moviepy | setup.py | 11 | 1067 | #!/usr/bin/env python
# This will try to import setuptools. If not here, it will reach for the embedded
# ez_setup (or the ez_setup package). If none, it fails with a message
try:
from setuptools import setup
except ImportError:
try:
import ez_setup
ez_setup.use_setuptools()
except ImportEr... | mit |
technologiescollege/s2a_fr | s2a/Python/Lib/doctest.py | 10 | 104460 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | gpl-3.0 |
2ndQuadrant/ansible | lib/ansible/plugins/callback/profile_tasks.py | 39 | 6614 | # (C) 2016, Joel, https://github.com/jjshoe
# (C) 2015, Tom Paine, <github@aioue.net>
# (C) 2014, Jharrod LaFon, @JharrodLaFon
# (C) 2012-2013, 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)
# Make codin... | gpl-3.0 |
swtp1v07/Savu | savu/plugins/base_recon.py | 1 | 3442 | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | apache-2.0 |
Toshakins/wagtail | wagtail/wagtailimages/fields.py | 9 | 4197 | from __future__ import absolute_import, unicode_literals
import os
from django.conf import settings
from django.core.exceptions import ValidationError
from django.forms.fields import ImageField
from django.template.defaultfilters import filesizeformat
from django.utils.translation import ugettext_lazy as _
from PIL i... | bsd-3-clause |
akumar21NCSU/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | 71218 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
jdelight/django | django/contrib/gis/utils/wkt.py | 589 | 1923 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated t... | bsd-3-clause |
MarkWh1te/xueqiu_predict | p3_env/lib/python3.5/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
bigdatauniversity/edx-platform | common/djangoapps/cors_csrf/authentication.py | 152 | 1357 | """Django Rest Framework Authentication classes for cross-domain end-points."""
from rest_framework import authentication
from cors_csrf.helpers import is_cross_domain_request_allowed, skip_cross_domain_referer_check
class SessionAuthenticationCrossDomainCsrf(authentication.SessionAuthentication):
"""Session auth... | agpl-3.0 |
tastynoodle/django | tests/delete/tests.py | 4 | 13446 | from __future__ import unicode_literals
from django.db import models, IntegrityError, connection
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
from django.utils.six.moves import xrange
from .models import (R, RChild, S, T, U, A, M, MR, MRNull,
create_a, get_default_r, User, Avatar, Hidden... | bsd-3-clause |
ychab/mymoney-server | mymoney/core/tests/utils/test_currencies.py | 1 | 1971 | from decimal import Decimal
from django.test import TestCase, override_settings
from mymoney.core.utils.currencies import (
format_currency, localize_signed_amount, localize_signed_amount_currency,
)
class CurrencyFormatTestCase(TestCase):
@override_settings(LANGUAGE_CODE='en-us')
def test_format_curre... | bsd-3-clause |
suyashphadtare/sajil-final-erp | erpnext/erpnext/accounts/doctype/chart_of_accounts/charts/import_from_openerp.py | 38 | 8787 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
"""
Import chart of accounts from OpenERP sources
"""
from __future__ import unicode_literals
import os, json
import ast
from xml.etree import ElementTree as ET
from frappe.utils.csvutils ... | agpl-3.0 |
wy1iu/sphereface | tools/caffe-sphereface/python/caffe/classifier.py | 22 | 3537 | #!/usr/bin/env python
"""
Classifier is an image classifier specialization of Net.
"""
import numpy as np
import caffe
class Classifier(caffe.Net):
"""
Classifier extends Net for image class prediction
by scaling, center cropping, or oversampling.
Parameters
----------
image_dims : dimensio... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/scons-2.1.0/SCons/Tool/BitKeeper.py | 21 | 2492 | """SCons.Tool.BitKeeper.py
Tool-specific initialization for the BitKeeper source code control
system.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 200... | gpl-2.0 |
fullfanta/mxnet | python/mxnet/contrib/autograd.py | 30 | 7040 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
tinkhaven-organization/odoo | addons/email_template/wizard/email_template_preview.py | 377 | 3851 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
badloop/SickRage | sickbeard/__init__.py | 1 | 114674 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 |
aam-at/tensorflow | tensorflow/python/ops/ragged/ragged_from_sparse_op_test.py | 14 | 4592 | # 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 |
sliceofcode/dogbot | dog/ext/gatekeeper/core.py | 2 | 1390 | __all__ = ["GatekeeperException", "Report", "Bounce", "Ban", "create_embed"]
import datetime
import discord
from lifesaver.utils import human_delta
class GatekeeperException(RuntimeError):
"""An exception thrown during Gatekeeper processes."""
class CheckFailure(GatekeeperException):
"""An exception throw... | mit |
dontnod/weblate | weblate/accounts/tests/test_avatars.py | 1 | 3438 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eith... | gpl-3.0 |
wilebeast/FireFox-OS | B2G/gecko/media/webrtc/trunk/tools/gyp/test/mac/gyptest-archs.py | 96 | 1171 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""
Tests things related to ARCHS.
"""
import TestGyp
import subprocess
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(... | apache-2.0 |
mcus/SickRage | lib/requests/packages/urllib3/fields.py | 1007 | 5833 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... | gpl-3.0 |
wangxiangyu/horizon | openstack_dashboard/test/api_tests/swift_tests.py | 18 | 8954 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
alexlo03/ansible | lib/ansible/modules/network/aci/aci_switch_leaf_selector.py | 7 | 10169 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_... | gpl-3.0 |
richard-willowit/odoo | odoo/__init__.py | 2 | 2935 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" OpenERP core library."""
#----------------------------------------------------------
# odoo must be a namespace package for odoo.addons to become one too
# https://packaging.python.org/guides/packaging-namespace-pac... | gpl-3.0 |
samyoyo/weevely3 | testsuite/test_net_proxy.py | 14 | 3484 | from testsuite.base_test import BaseTest
from testfixtures import log_capture
from testsuite import config
from core.sessions import SessionURL
from core import modules
from core import messages
import subprocess
import logging
import tempfile
import os
import re
class Proxy(BaseTest):
def setUp(self):
se... | gpl-3.0 |
catapult-project/catapult-csm | third_party/gsutil/third_party/pyasn1-modules/pyasn1_modules/rfc4210.py | 37 | 26208 | #
# Certificate Management Protocol structures as per RFC4210
#
# Based on Alex Railean's work
#
from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful
from pyasn1_modules import rfc2459, rfc2511, rfc2314
MAX = 64
class KeyIdentifier(univ.OctetString): pass
class CMPCertificate(rfc2459.Certificat... | bsd-3-clause |
alexhersh/calico-docker | calicoctl/tests/unit/node_test.py | 1 | 30122 | # Copyright 2015 Metaswitch Networks
#
# 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 w... | apache-2.0 |
aprefontaine/TMScheduler | django/utils/synch.py | 376 | 2549 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
try:
import threading
except ImportError:
import dummy_threading as threading
class RWLock:
"""
Classic implementation of reader-writer lock with preference to writers.... | bsd-3-clause |
liangjiaxing/sympy | sympy/solvers/deutils.py | 97 | 10013 | """Utility functions for classifying and solving
ordinary and partial differential equations.
Contains
========
_preprocess
ode_order
_desolve
"""
from __future__ import print_function, division
from sympy.core.function import Derivative, AppliedUndef
from sympy.core.relational import Equality
from sympy.core.symbol... | bsd-3-clause |
HonzaKral/django | tests/utils_tests/test_timesince.py | 44 | 5931 | from __future__ import unicode_literals
import datetime
import unittest
from django.test.utils import requires_tz_support
from django.utils import timezone
from django.utils.timesince import timesince, timeuntil
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, ... | bsd-3-clause |
Endika/hr | hr_payslip_ytd_amount/hr_payslip_line.py | 27 | 1237 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | agpl-3.0 |
VitalPet/odoo | addons/mail/res_partner.py | 52 | 3485 | # -*- 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 |
kavardak/suds | suds/options.py | 32 | 5358 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
traveloka/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py | 12 | 34556 | #!/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 distributed... | gpl-3.0 |
hkariti/ansible | test/units/modules/network/nxos/nxos_module.py | 46 | 3583 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow_LightGBM_Scipy_nightly/source/numpy/distutils/npy_pkg_config.py | 66 | 13243 | from __future__ import division, absolute_import, print_function
import sys
import re
import os
if sys.version_info[0] < 3:
from ConfigParser import RawConfigParser, NoOptionError
else:
from configparser import RawConfigParser, NoOptionError
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSe... | mit |
Lektorium-LLC/edx-platform | lms/djangoapps/instructor/tests/test_enrollment_store_provider.py | 10 | 2740 | """
Exercises tests on the base_store_provider file
"""
from django.test import TestCase
from lms.djangoapps.instructor.enrollment_report import AbstractEnrollmentReportProvider
from lms.djangoapps.instructor.paidcourse_enrollment_report import PaidCourseEnrollmentReportProvider
class BadImplementationAbstractEnrol... | agpl-3.0 |
felixc/transcribe | transcribe.py | 1 | 12620 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2013–2015 Felix Crux <felixc@felixcrux.com>
# Released under the terms of the MIT (Expat) License (see LICENSE for details)
#
"""Generate static HTML from Django templates and YAML content."""
import argparse
import collections
import datetime
import imp
i... | mit |
lucyparsons/OpenOversight | flickrscraper/flickrgroup.py | 1 | 2788 | from __future__ import print_function
from builtins import input
# creates a folder in the current directory and downloads pics and csv into it.
# need to fix last loop so very last entry doesn't generate error
import flickrapi
import wgetter
import time
import io
import os
api_key = ''
secret = ''
flickr = flickrap... | gpl-3.0 |
luckielordie/conan | conans/test/command/package_test.py | 2 | 10927 | import unittest
from conans import tools
from conans.test.utils.tools import TestClient
import os
from conans.paths import CONANFILE
from conans.util.files import load, mkdir
from conans.test.utils.test_files import temp_folder
from parameterized import parameterized
class PackageLocalCommandTest(unittest.TestCase):... | mit |
Yottabits/102shows | server/lightshows/rgbtest.py | 1 | 1053 | # RGBTest
# (c) 2016-2017 Simon Leiner
# licensed under the GNU Public License, version 2
from helpers.color import blend_whole_strip_to_color
from lightshows.templates.base import *
class RGBTest(Lightshow):
"""\
turns on all red, then all green, then all blue leds and then all together
No parameters n... | gpl-2.0 |
cudadog/django-allauth | allauth/socialaccount/providers/edmodo/provider.py | 39 | 1141 | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class EdmodoAccount(ProviderAccount):
def get_profile_url(self):
return self.account.extra_data.get('profile_url')
de... | mit |
Stavitsky/neutron | neutron/policy.py | 4 | 20337 | # 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/LICENSE-2.0
#
# Unless... | apache-2.0 |
sebastien-forestier/explaupoppydiva | explaupoppydiva/config.py | 1 | 6989 | from numpy import array
from explauto.utils.config import make_configuration
from explauto.sensorimotor_model.nearest_neighbor import NearestNeighbor
from explauto.sensorimotor_model.non_parametric import NonParametric
from environment.mathEnv import MathEnvironment, mathEnv_config
from agent.supervisor import... | gpl-3.0 |
vaibhav345/lenskit | lenskit-cli/src/man/filter-manpage.py | 12 | 3152 | #!/usr/bin/env python
# LensKit, an open source recommender systems toolkit.
# Copyright 2010-2014 Regents of the University of Minnesota and contributors
# Work on LensKit has been funded by the National Science Foundation under
# grants IIS 05-34939, 08-08692, 08-12148, and 10-17697.
#
# This program is free softwar... | lgpl-2.1 |
tonycpsu/urwid | urwid/tests/test_escapes.py | 4 | 2944 | #!/usr/bin/python
# -*- coding: utf-8 -*-
""" Tests covering escape sequences processing """
import unittest
import urwid.escape
class InputEscapeSequenceParserTest(unittest.TestCase):
""" Tests for parser of input escape sequences """
def test_bare_escape(self):
codes = [27]
expected = ['... | lgpl-2.1 |
fforres/presentaciones-y-charlas | ProgramadoresIV/una hiJStoria de amor y odio/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
Ifetayo/alt1 | qa/rpc-tests/nodehandling.py | 56 | 3626 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test node handling
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.u... | mit |
rsalmaso/django-cms | cms/management/commands/subcommands/base.py | 1 | 3997 | import os
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandParser
from django.core.management.color import no_style, color_style
from cms.utils.compat import DJANGO_3_0, DJANGO_3_1, DJANGO_3_2
def add_builtin_arguments(parser):
parser.add_argument(
'--noin... | bsd-3-clause |
giliam/sharbrary | library/migrations/0024_auto_20150831_1533.py | 1 | 2955 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('library', '0023_auto_20150820_1615'),
]
operations = [
migrations.AlterModelOptions(
name='author',
... | gpl-2.0 |
PYPIT/PYPIT | pypeit/deprecated/bpmimage.py | 1 | 2693 | # Module for generating the BPM image
from __future__ import absolute_import, division, print_function
import numpy as np
import os
from pypeit import msgs
from pypeit.core import procimg
from pypeit.core import parse
from pypeit.spectrographs.util import load_spectrograph
from pypeit import debugger
class BPMIma... | gpl-3.0 |
luo2chun1lei2/AgileEditor | vx/src/ViewHistoryTextCmd.py | 1 | 6486 | #-*- coding:utf-8 -*-
'''
显示运行的列表。
'''
from gi.repository import Gtk, Gdk, GObject, GLib, Pango
from VxEventPipe import *
from VxSourceCmd import VxSourceCmdMng
from ViewMenu import ViewMenu
class CmdGObject(GObject.GObject):
__gtype_name__ = 'CmdGObject'
def __init__(self, cmd):
GObject.... | gpl-2.0 |
caperren/Archives | OSU Robotics Club/Mars Rover 2013-2014/Control Board Firmware/PrototypeBoardFirmware/PythonTest/JoystickTest.py | 1 | 4956 | #######################################
# Code coded by Mike Doty
#
# If you want trackball checking, you will
# have to code it yourself. Sorry!
#
# Oh, and it just grabs the first joystick.
# Yes, that makes me lazy.
#
# Released February 8, 2008.
#######################################
import pygame
from pygame... | gpl-3.0 |
sconecontainers/sconecontainers.github.io | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
aospx-kitkat/platform_external_chromium_org | tools/telemetry/telemetry/core/chrome/desktop_browser_finder_unittest.py | 29 | 6927 | # 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.
import unittest
from telemetry.core import browser_options
from telemetry.core.chrome import desktop_browser_finder
from telemetry.unittest import system... | bsd-3-clause |
more1/ThinkStats2 | code/chap01soln.py | 67 | 1859 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import numpy as np
import sys
import nsfg
import thinkstats2
def ReadFemResp(... | gpl-3.0 |
YannThorimbert/ThorPy-1.4.1 | thorpy/miscgui/style.py | 3 | 3847 | """
This module stores the variables that define the style of the GUI.
Note that the module "painterstyle" also define the default painters.
Default painters are in a separate module because they need to import painters,
and painters need to import style.
"""
import os
from thorpy import THORPY_PATH
from thorpy.miscg... | mit |
angad/libjingle-mac | scons-2.2.0/build/lib/SCons/Tool/pdf.py | 14 | 3067 | """SCons.Tool.pdf
Common PDF Builder definition for various other Tool modules that use it.
Add an explicit action to run epstopdf to convert .eps files to .pdf
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of ... | bsd-3-clause |
mapsme/omim | tools/python/openlr/quality.py | 7 | 10203 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import operator
import xml.etree.ElementTree as ET
from collections import namedtuple
from itertools import islice
from math import sin, cos, atan2, radians, sqrt
LatLon = namedtuple('LatLon', 'lat, lon')
def distance(x, y):
"""Implements https:/... | apache-2.0 |
gazoo74/linux | tools/perf/scripts/python/exported-sql-viewer.py | 22 | 107457 | #!/usr/bin/env python2
# SPDX-License-Identifier: GPL-2.0
# exported-sql-viewer.py: view data from sql database
# Copyright (c) 2014-2018, Intel Corporation.
# To use this script you will need to have exported data using either the
# export-to-sqlite.py or the export-to-postgresql.py script. Refer to those
# scripts ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.