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 |
|---|---|---|---|---|---|
dgdell/enigma2 | lib/python/Screens/InputBox.py | 9 | 5125 | from enigma import eRCInput, getPrevAsciiCode
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.Input import Input
from Tools.BoundFunction import boundFunction
from Tools.Notifications import A... | gpl-2.0 |
bricky/xbmc-addon-tvtumbler | resources/lib/unidecode/x066.py | 252 | 4677 | data = (
'Yun ', # 0x00
'Bei ', # 0x01
'Ang ', # 0x02
'Ze ', # 0x03
'Ban ', # 0x04
'Jie ', # 0x05
'Kun ', # 0x06
'Sheng ', # 0x07
'Hu ', # 0x08
'Fang ', # 0x09
'Hao ', # 0x0a
'Gui ', # 0x0b
'Chang ', # 0x0c
'Xuan ', # 0x0d
'Ming ', # 0x0e
'Hun ', # 0x0f
'Fen ', # 0x10
... | gpl-3.0 |
Adilmar/DancePython | src/Scene.py | 2 | 9600 | # -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Sánchez
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 ... | bsd-3-clause |
paulondc/gaffer | python/GafferTest/CompoundPathFilterTest.py | 5 | 4377 | ##########################################################################
#
# Copyright (c) 2012, Image Engine Design 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:
#
# * Red... | bsd-3-clause |
ernstbaslerpartner/send2geoadmin | env/Lib/encodings/iso8859_9.py | 593 | 13412 | """ Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | apache-2.0 |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/commands/wheel.py | 328 | 7320 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sys
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirement... | lgpl-3.0 |
michaelkuty/django-oscar | src/oscar/test/factories/offer.py | 15 | 1429 | import factory
from oscar.core.loading import get_model
__all__ = [
'RangeFactory', 'ConditionFactory', 'BenefitFactory',
'ConditionalOfferFactory',
]
class RangeFactory(factory.DjangoModelFactory):
name = factory.Sequence(lambda n: 'Range %d' % n)
slug = factory.Sequence(lambda n: 'range-%d' % n)
... | bsd-3-clause |
asmmhossain/pyCOMET | pyCOMET_subtype.py | 1 | 12896 | #!/usr/bin/env python3
'''
pyCOMET_subtype.py
a python3 based program to use PPMD models for subtype classification
The program takes as input the following:
- a model description file in msgpack format
- a fixed context size
This model gives log likelihoods of the probablities of se... | mit |
randynobx/ansible | lib/ansible/modules/cloud/rackspace/rax_cdb_database.py | 70 | 5029 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
jslhs/keras | keras/layers/recurrent.py | 1 | 14146 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
from .. import activations, initializations
from ..utils.theano_utils import shared_zeros, alloc_zeros_matrix
from ..layers.core import Layer
from six.moves import range
class SimpleRNN(Layer):
... | mit |
alilotfi/django | tests/prefetch_related/test_uuid.py | 291 | 4347 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Flea, House, Person, Pet, Room
class UUIDPrefetchRelated(TestCase):
def test_prefetch_related_from_uuid_model(self):
Pet.objects.create(name='Fifi').people.add(
Person.objects.create(name='Ellen'),
... | bsd-3-clause |
nicksergeant/snipt | accounts/models.py | 2 | 5034 | from annoying.functions import get_object_or_None
from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from itertools import chain
from snipts.models import Snipt
from teams.models import Team
class UserProfile(models.Model):
LIST_VIEW_CHOICES = (
('N', '... | mit |
yfdyh000/olympia | apps/landfill/tests/test_collections.py | 15 | 1570 | # -*- coding: utf-8 -*-
from nose.tools import eq_, ok_
import amo
import amo.tests
from addons.models import Addon
from bandwagon.models import Collection, CollectionAddon, FeaturedCollection
from constants.applications import APPS
from landfill.collection import generate_collection
class CollectionsTests(amo.tests... | bsd-3-clause |
jschuecker/nest-simulator | topology/testsuite/mpitests/speed.py | 3 | 2396 | # -*- coding: utf-8 -*-
#
# speed.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, or
# (at... | gpl-2.0 |
schaubl/libcloud | libcloud/dns/base.py | 11 | 14802 | # 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 use ... | apache-2.0 |
iot-factory/synapse | tests/rest/client/v1/utils.py | 1 | 4744 | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket 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 la... | apache-2.0 |
flyher/pymo | android/pgs4a-0.9.6/python-install/lib/python2.7/distutils/tests/test_text_file.py | 141 | 3441 | """Tests for distutils.text_file."""
import os
import unittest
from distutils.text_file import TextFile
from distutils.tests import support
from test.test_support import run_unittest
TEST_DATA = """# test file
line 3 \\
# intervening comment
continues on next line
"""
class TextFileTestCase(support.TempdirManager,... | mit |
willametteuniversity/webcirc2 | website/views/itemAPIViews.py | 1 | 3272 | from rest_framework.decorators import api_view
from rest_framework.response import Response
from website.serializers import *
from rest_framework import status
from django.http import HttpResponse
@api_view([u'GET'])
def actionInventoryItems(request, pk):
try:
return Response(InventoryItemSerializer(Actio... | apache-2.0 |
rmboggs/django | tests/many_to_one_null/tests.py | 30 | 6470 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Car, Driver, Reporter
class ManyToOneNullTests(TestCase):
def setUp(self):
# Create a Reporter.
self.r = Reporter(name='John Smith')
self.r.save()
# Create an Article.
se... | bsd-3-clause |
libcrosswind/libcrosswind | platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/distutils/command/build.py | 250 | 5437 | """distutils.command.build
Implements the Distutils 'build' command."""
__revision__ = "$Id$"
import sys, os
from distutils.util import get_platform
from distutils.core import Command
from distutils.errors import DistutilsOptionError
def show_compilers():
from distutils.ccompiler import show_compilers
show... | gpl-3.0 |
roadmapper/ansible | lib/ansible/modules/network/cloudengine/ce_vlan.py | 2 | 21464 | #!/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 |
Oxygem/canaryd | canaryd_packages/importlib.py | 456 | 1327 | """Backport of importlib.import_module from 3.x."""
# While not critical (and in no way guaranteed!), it would be nice to keep this
# code compatible with Python 2.3.
import sys
def _resolve_name(name, package, level):
"""Return the absolute name of the module to be imported."""
if not hasattr(package, 'rindex... | mit |
yantrabuddhi/FreeCAD | src/Mod/Arch/importIFC.py | 3 | 54490 | #***************************************************************************
#* *
#* Copyright (c) 2014 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
wooey/Wooey | wooey/tests/scripts/translate.py | 2 | 3183 | #!/usr/bin/env python
__author__ = 'chris'
import argparse
import sys
BASE_PAIR_COMPLEMENTS = {'a': 't', 't': 'a', 'c': 'g', 'g': 'c', 'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C', 'n': 'n', 'N': 'N'}
CODON_TABLE = {'AAA': 'K', 'AAC': 'N', 'AAG': 'K', 'AAT': 'N', 'ACA': 'T', 'ACC': 'T', 'ACG': 'T', 'ACT': 'T',
... | bsd-3-clause |
lixiangning888/whole_project | modules/signatures_orignal/antiav_detectreg.py | 1 | 5572 | # Copyright (C) 2015 Accuvant, Inc. (bspengler@accuvant.com)
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class AntiAVDetectReg(Signature):
name = "antiav_detectreg"
description = "A... | lgpl-3.0 |
varunarya10/python-novaclient | novaclient/tests/fixture_data/quotas.py | 4 | 3106 | # 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
# distributed under t... | apache-2.0 |
realpython/flask-jwt-auth | project/server/auth/views.py | 2 | 6758 | # project/server/auth/views.py
from flask import Blueprint, request, make_response, jsonify
from flask.views import MethodView
from project.server import bcrypt, db
from project.server.models import User, BlacklistToken
auth_blueprint = Blueprint('auth', __name__)
class RegisterAPI(MethodView):
"""
User R... | mit |
ojengwa/nose2 | nose2/session.py | 4 | 6647 | import logging
import os
import argparse
from six.moves import configparser
from nose2 import config, events, util
log = logging.getLogger(__name__)
__unittest = True
class Session(object):
"""Configuration session.
Encapsulates all configuration for a given test run.
.. attribute :: argparse
... | bsd-2-clause |
Linkid/numpy | numpy/testing/tests/test_doctesting.py | 224 | 1322 | """ Doctests for NumPy-specific nose/doctest modifications
"""
from __future__ import division, absolute_import, print_function
# try the #random directive on the output line
def check_random_directive():
'''
>>> 2+2
<BadExample object at 0x084D05AC> #random: may vary on your system
'''
# check the ... | bsd-3-clause |
a-parhom/edx-platform | common/test/acceptance/tests/studio/test_studio_settings.py | 4 | 49072 | # coding: utf-8
"""
Acceptance tests for Studio's Setting pages
"""
from __future__ import unicode_literals
import os
import random
import string
import json
from textwrap import dedent
from bok_choy.promise import EmptyPromise
from mock import patch
from common.test.acceptance.tests.studio.base_studio_test import S... | agpl-3.0 |
SFTtech/sftmake | conf/config.py | 1 | 2196 | from util.datatypes import EnumVal, OrderedSet
from conf import configs
from logger.levels import *
class Config:
"""
other than the name might suggest, this class holds no actual config data.
it merely manages metadata for configurations such as their name, and their parent configurations.
actual config data is ... | gpl-3.0 |
xyrnwbtj/dockerAutomatedBuild | pyspider/database/sqlite/resultdb.py | 6 | 2837 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-10-13 17:08:43
import re
import time
import json
from .sqlitebase import SQLiteMixin, SplitTableMixin
from pyspider.database.base.resultdb import Res... | apache-2.0 |
saez0pub/ansible-modules-extras | system/at.py | 146 | 6419 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2014, Richard Isaacson <richard.c.isaacson@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... | gpl-3.0 |
thinkwhale/MyTakeOnQuotes | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexer.py | 265 | 26921 | # -*- coding: utf-8 -*-
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re, itertools
from pygments.filter import apply_filters, Filter
from pygments.filters import get_filt... | mit |
dalegregory/odoo | addons/stock/wizard/stock_move.py | 242 | 4332 | # -*- 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 |
mikeboers/PyHAML | haml/parse.py | 1 | 12986 | import itertools
import re
import tokenize
from six import string_types, next
from . import nodes
def split_balanced_parens(line, depth=0):
# Too bad I can't do this with a regex... *sigh*.
deltas = {'(': 1, ')': -1}
pos = None
for pos, char in enumerate(line):
depth += deltas.get(char, 0)
... | bsd-3-clause |
jinzekid/codehub | python/dev_Spiders/spider_taisha_hsbc/spider_taisha_hsbc/settings.py | 1 | 3197 | # -*- coding: utf-8 -*-
# Scrapy settings for spider_taisha_hsbc project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/l... | gpl-3.0 |
jammerful/buildbot | master/buildbot/test/unit/test_www_config.py | 10 | 4535 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
RalphBariz/RalphsDotNet | Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/scipy/ndimage/measurements.py | 55 | 37680 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | gpl-3.0 |
intermezzo-fr/onedrive-d | onedrive_d/tests/api/test_personal_account.py | 2 | 7019 | import json
import re
import time
import unittest
import requests
import requests_mock
from onedrive_d.api import accounts
from onedrive_d.api import errors
from onedrive_d.api import resources
from onedrive_d.tests import get_data
from onedrive_d.tests.api.account_factory import PERSONAL_ACCOUNT_DATA
fr... | gpl-3.0 |
danielpronych/python-twitter | simplejson/decoder.py | 135 | 12032 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from simplejson.scanner import make_scanner
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconst... | apache-2.0 |
FedoraScientific/salome-geom | src/GEOM_SWIG/GEOM_example4.py | 1 | 2786 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | lgpl-2.1 |
mbiciunas/libnix | test/libnix/config/test_config_scripts.py | 1 | 3772 | """
LibNix
Copyright (C) 2017 Mark Biciunas
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 later version.
This program is distributed in th... | gpl-3.0 |
MartinEnder/erpnext-de | erpnext/hr/report/employee_leave_balance/employee_leave_balance.py | 19 | 1735 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.hr.doctype.leave_application.leave_application \
import get_leave_allocation_records, get_leave_balance... | agpl-3.0 |
lghamie/cabot | cabot/cabotapp/migrations/0006_auto__chg_field_statuscheck_created_by.py | 14 | 12556 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'StatusCheck.created_by'
db.alter_column('cabotapp_statuscheck', 'created_by_id', self.gf(... | mit |
encorehu/django-issues | issues/forms.py | 1 | 5085 | from django import forms
from django.contrib.auth.models import User
from django.forms.fields import IntegerField
from django.forms.models import modelformset_factory, BaseModelFormSet
from django.contrib.auth.models import User
from issues.models import Project
from issues.models import Milestone
from issues.models i... | mit |
matthiasdiener/spack | var/spack/repos/builtin/packages/bc/package.py | 3 | 1732 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
teslaji/homebase | venv/HomeBase/lib/python3.5/site-packages/pip/utils/ui.py | 316 | 6774 | from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip._vendor import six
from pip._vendor.progress... | gpl-3.0 |
whtsky/Dash.py | dash_py/utils.py | 1 | 5645 | import os
import sys
import time
import logging
import tempfile
import zipfile
import tarfile
import requests
import subprocess
try:
import curses
assert curses
except ImportError:
curses = None
# Fake unicode literal support: Python 3.2 doesn't have the u'' marker for
# literal strings, and alternative ... | mit |
memtoko/django | django/db/models/expressions.py | 1 | 31461 | import copy
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import Q, refs_aggregate
from django.u... | bsd-3-clause |
berrange/nova | nova/tests/keymgr/test_mock_key_mgr.py | 18 | 3610 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
yaukwankiu/armor | tests/imageToDataTest9.py | 1 | 3447 | # imageToDataTest9.py
# local-to-global
#################################
# imports
import os
import time
import pickle
from armor import pattern
dbz = pattern.DBZ
dp = pattern.dp
plt = pattern.plt
np = pattern.np
###############################
# setting up the parameters
inputFolder = dp.root + 'labLogs2/charts... | cc0-1.0 |
iocoop/beancount | src/python/beancount/scripts/setup_test.py | 1 | 4758 | """A test for setup.py.
"""
__author__ = "Martin Blais <blais@furius.ca>"
import os
import shutil
import sys
import tempfile
import subprocess
from os import path
from beancount.utils import test_utils
class TestSetup(test_utils.TestCase):
def setUp(self):
self.installdir = tempfile.mkdtemp(prefix='bea... | gpl-2.0 |
lepy/phuzzy | phuzzy/approx/model.py | 1 | 14732 | # -*- coding: utf-8 -*-
import collections
import logging
import numpy as np
import pandas as pd
from sklearn.model_selection import GridSearchCV
from sklearn.neighbors import KNeighborsRegressor
from sklearn.svm import SVR
import phuzzy
import phuzzy.contrib.pydoe as pydoe
class Expression(object):
"""Approxim... | mit |
karthikvadla16/spark-tk | regression-tests/sparktkregtests/testcases/scoretests/pipeline_funcs.py | 9 | 1154 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | apache-2.0 |
seiferma/encviewfuse_decryptorui | encviewfuse_decryptorui/decryptorui/SegmentedVirtualFile.py | 1 | 2647 | from deterministic_encryption_utils.encryption.VirtualFile import VirtualFile
import os
from encviewfuse_decryptorui.decryptorui.FilenameUtils import FilenameUtils
class SegmentedVirtualFile(VirtualFile):
def __init__(self, absRootPathNotSegmented):
super(SegmentedVirtualFile, self).__init__(absRootPathNo... | mit |
MatthewWilkes/django-oscar | src/oscar/apps/catalogue/migrations/0003_data_migration_slugs.py | 62 | 1457 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from oscar.core.loading import get_model
# Django database migrations require us to fetch the category model
# via apps.get_model to get an instance of the model at this point
# in time of migrations. That snapsh... | bsd-3-clause |
amasiero/approach_control | approach_control_head/nodes/approach_control_head/MoveHead.py | 1 | 2249 | #!/usr/bin/env python
import rospy
import smach
import numpy as np
from std_msgs.msg import String, Float64
from dynamixel_msgs.msg import JointState
from dynamixel_controllers.srv import SetSpeed
class MoveHead(smach.State):
def __init__(self, pan='', tilt=''):
smach.State.__init__(self, outcomes=['succe... | gpl-2.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/mx/DateTime/mxDateTime/testpydatetime.py | 1 | 2058 | from mx.DateTime import *
# Check compatibility with Python's datetime
try:
import datetime
except ImportError:
pass
else:
class GMT1(datetime.tzinfo):
def utcoffset(self, dt):
return datetime.timedelta(hours=1)
# Test values
pydt1 = datetime.datetime(2007, 1, 1, 12, 30, 13)
... | gpl-3.0 |
Pathoschild/stewbot | stewbot/components/modules/mechanize/_opener.py | 133 | 14763 | """URL opener.
Copyright 2004-2006 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import os, urllib2, bisect, httplib, types, tempfile
try:
import thread... | isc |
WhireCrow/openwrt-mt7620 | staging_dir/host/lib/python2.7/decimal.py | 31 | 220812 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module is currently Py2.3 compatibl... | gpl-2.0 |
adammenges/statsmodels | statsmodels/sandbox/examples/try_smoothers.py | 39 | 2655 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 01 15:17:52 2011
Author: Mike
Author: Josef
mainly script for checking Kernel Regression
"""
import numpy as np
if __name__ == "__main__":
#from statsmodels.sandbox.nonparametric import smoothers as s
from statsmodels.sandbox.nonparametric import smoothers, kern... | bsd-3-clause |
frankrousseau/weboob | modules/cragr/mobile/browser.py | 7 | 11260 | # -*- coding: utf-8 -*-
# Copyright(C) 2009-2013 Romain Bignon, Xavier Guerrin
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | agpl-3.0 |
RyanChinSang/ECNG3020-ORSS4SCVI | Stable/v01/utils/label_map_util.py | 5 | 4738 | # Copyright 2017 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... | gpl-3.0 |
TheTypoMaster/chromium-crosswalk | tools/telemetry/telemetry/core/platform/process_statistic_timeline_data_unittest.py | 52 | 1662 | # 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 unittest
from telemetry.core.platform import process_statistic_timeline_data
class ProcessStatisticTimelineDataTest(unittest.TestCase):
def test... | bsd-3-clause |
ccortezb/troposphere | tests/test_asg.py | 20 | 1318 | import unittest
from troposphere.autoscaling import AutoScalingGroup
class TestAutoScalingGroup(unittest.TestCase):
def test_exclusive(self):
group = AutoScalingGroup(
'mygroup',
InstanceId="i-1234",
LaunchConfigurationName="I'm a test",
MaxSize="1",
... | bsd-2-clause |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/pip/commands/check.py | 336 | 1382 | import logging
from pip.basecommand import Command
from pip.operations.check import check_requirements
from pip.utils import get_installed_distributions
logger = logging.getLogger(__name__)
class CheckCommand(Command):
"""Verify installed packages have compatible dependencies."""
name = 'check'
usage =... | gpl-3.0 |
joseph-roque/advent-of-code | day_05/nicestrings.py | 1 | 1038 | ##############################
# #
# Instructions #
# #
##############################
# To run, use the following command:
# $ python nicestrings.py <input_file>
# where <input_file> is the filename with the question's input
import sys
import re
# ... | mit |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/twisted/web/resource.py | 15 | 13108 | # -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the lowest-level Resource class.
"""
from __future__ import division, absolute_import
__all__ = [
'IResource', 'getChildForRequest',
'Resource', 'ErrorPage', 'NoRe... | gpl-2.0 |
varses/awsch | lantz/drivers/legacy/ni/daqmx/base.py | 3 | 67061 | # -*- coding: utf-8 -*-
"""
lantz.drivers.legacy.ni.daqmx.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implementation of base classes for Channels, Tasks and Devices
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from lantz import Fe... | bsd-3-clause |
LinuxChristian/home-assistant | homeassistant/components/sensor/comfoconnect.py | 7 | 4183 | """
Platform to control a Zehnder ComfoAir Q350/450/600 ventilation unit.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.comfoconnect/
"""
import logging
from homeassistant.components.comfoconnect import (
DOMAIN, ComfoConnectBridge, ATTR_CU... | apache-2.0 |
bullah300/angular1 | bower_components/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | apache-2.0 |
shrimpboyho/git.js | emscript/python/2.7.5.1_32bit/Lib/xmllib.py | 227 | 34865 | """A parser for XML, using the derived class as static DTD."""
# Author: Sjoerd Mullender.
import re
import string
import warnings
warnings.warn("The xmllib module is obsolete. Use xml.sax instead.",
DeprecationWarning, 2)
del warnings
version = '0.3'
class Error(RuntimeError):
pass
# Regular e... | gpl-2.0 |
gameduell/duell | bin/win/python2.7.9/Lib/encodings/aliases.py | 418 | 14848 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... | bsd-2-clause |
Plexxi/st2 | st2common/st2common/script_setup.py | 3 | 3916 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
broferek/ansible | lib/ansible/modules/network/fortios/fortios_router_ospf6.py | 14 | 32590 | #!/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 |
fqul/scrapy | extras/qps-bench-server.py | 178 | 1640 | #!/usr/bin/env python
from __future__ import print_function
from time import time
from collections import deque
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
def __init__(self):
Resource.__init__(self... | bsd-3-clause |
Edraak/circleci-edx-platform | openedx/core/djangoapps/content/course_overviews/migrations/0007_courseoverviewimageconfig.py | 70 | 1394 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('course_o... | agpl-3.0 |
danielreed/python-hpOneView | examples/storage_volume_attachments.py | 2 | 4904 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | mit |
nesdis/djongo | tests/django_tests/tests/v21/tests/postgres_tests/test_signals.py | 26 | 1177 | from django.db import connection
from . import PostgreSQLTestCase
try:
from django.contrib.postgres.signals import (
get_citext_oids, get_hstore_oids, register_type_handlers,
)
except ImportError:
pass # pyscogp2 isn't installed.
class OIDTests(PostgreSQLTestCase):
def assertOIDs(self, oid... | agpl-3.0 |
adoosii/edx-platform | common/djangoapps/xblock_django/migrations/0001_initial.py | 79 | 4946 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'XBlockDisableConfig'
db.create_table('xblock_django_xbloc... | agpl-3.0 |
newswangerd/ansible | test/units/plugins/become/test_sudo.py | 36 | 1841 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2020 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from an... | gpl-3.0 |
fenglu-g/incubator-airflow | airflow/www/gunicorn_config.py | 14 | 1034 | #!/usr/bin/env python
# -*- 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 Licen... | apache-2.0 |
akiss77/servo | tests/wpt/css-tests/tools/py/py/_code/_py2traceback.py | 275 | 2765 | # copied from python-2.7.3's traceback.py
# CHANGES:
# - some_str is replaced, trying to create unicode strings
#
import types
def format_exception_only(etype, value):
"""Format the exception part of a traceback.
The arguments are the exception type and value such as given by
sys.last_type and sys.last_va... | mpl-2.0 |
mo-g/iris | lib/iris/analysis/interpolate.py | 5 | 30766 | # (C) British Crown Copyright 2010 - 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 l... | gpl-3.0 |
kifcaliph/odoo | addons/website_project/controllers/main.py | 373 | 1513 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
jlmucb/cloudproxy | src/third_party/googlemock/scripts/generator/cpp/gmock_class.py | 268 | 8241 | #!/usr/bin/env python
#
# Copyright 2008 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 requi... | apache-2.0 |
HKuz/PythonChallenge | Challenges/chall_32.py | 1 | 2864 | #!/usr/local/bin/python3
# Python Challenge - 32
# http://www.pythonchallenge.com/pc/rock/arecibo.html
# http://www.pythonchallenge.com/pc/rock/warmup.txt
# http://www.pythonchallenge.com/pc/rock/up.html
# http://www.pythonchallenge.com/pc/rock/up.txt
# Username: kohsamui; Password: thailand
# Keyword: up, python, beer... | mit |
kirca/OpenUpgrade | addons/project/report/__init__.py | 444 | 1069 | # -*- 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 |
mic4ael/indico | indico/modules/events/util.py | 1 | 29523 | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import json
import os
import random
import warnings
from collecti... | mit |
RaoUmer/django | django/contrib/gis/tests/relatedapp/tests.py | 198 | 14731 | from __future__ import absolute_import
from datetime import date
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, orac... | bsd-3-clause |
mfalesni/cfme_tests | cfme/tests/containers/test_search_bar.py | 5 | 2214 | from random import choice
import pytest
from cfme.containers.provider import ContainersProvider
from cfme.utils.appliance.implementations.ui import navigate_to
pytestmark = [
pytest.mark.usefixtures('setup_provider'),
pytest.mark.tier(3),
pytest.mark.provider([ContainersProvider], scope='function')
]
C... | gpl-2.0 |
cf593796769/celery-doc_zh | conf.py | 2 | 4227 | # -*- coding: utf-8 -*-
import sys
import os
this = os.path.dirname(os.path.abspath(__file__))
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
sys.path.insert(0, os.path.join(this, os.par... | mit |
queenp/wakatime | wakatime/packages/pygments_py3/pygments/filters/__init__.py | 76 | 11573 | # -*- coding: utf-8 -*-
"""
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.token import String, Comment, Ke... | bsd-3-clause |
rtfd/readthedocs.org | readthedocs/builds/models.py | 1 | 41331 | """Models for the builds app."""
import datetime
import logging
import os.path
import re
from shutil import rmtree
import regex
from django.conf import settings
from django.db import models
from django.db.models import F
from django.urls import reverse
from django.utils import timezone
from django.utils.translation i... | mit |
alphafoobar/intellij-community | python/lib/Lib/site-packages/django/core/management/commands/syncdb.py | 89 | 7835 | from optparse import make_option
import sys
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
from django.db import connections, router, transaction,... | apache-2.0 |
TomasTriska/Robbie | robbie/src/programy/utils/classes/loader.py | 5 | 1706 | """
Copyright (c) 2016 Keith Sterling
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,... | lgpl-3.0 |
sorig/shogun | applications/easysvm/esvm/parse.py | 7 | 7029 | """
This module contains code to parse the input arguments to the command line:
- easysvm.py
- datagen.py
"""
# This software is distributed under BSD 3-clause license (see LICENSE file).
#
# Authors: Soeren Sonnenburg
import datafuncs
import sys
######################################################################... | bsd-3-clause |
raildo/nova | nova/api/openstack/compute/block_device_mapping.py | 20 | 2868 | # Copyright 2013 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 requ... | apache-2.0 |
UniversalMasterEgg8679/ansible | lib/ansible/utils/module_docs_fragments/azure_tags.py | 138 | 1470 | # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@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, eit... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.