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 |
|---|---|---|---|---|---|
pauldamian/-casa | acasa/scripts/scheduler.py | 1 | 7848 | #!/usr/bin/python
import sys
import getopt
from datetime import datetime as dt
from datetime import timedelta
from croniter import croniter
from utility import util
from lib import command
from utility.todo import Todo
from utility import constants
USERS = util.get_conf_value(constants.KEY_USERS)
d... | apache-2.0 |
sadaf2605/django | tests/model_regress/tests.py | 35 | 8981 | from __future__ import unicode_literals
import datetime
from operator import attrgetter
from django.core.exceptions import ValidationError
from django.db import router
from django.db.models.sql import InsertQuery
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.time... | bsd-3-clause |
theo-l/django | django/core/checks/registry.py | 5 | 2981 | from itertools import chain
from django.utils.itercompat import is_iterable
class Tags:
"""
Built-in tags for internal checks.
"""
admin = 'admin'
async_support = 'async_support'
caches = 'caches'
compatibility = 'compatibility'
database = 'database'
models = 'models'
security... | bsd-3-clause |
TheWardoctor/Wardoctors-repo | script.module.nanscrapers/lib/nanscrapers/modules/js2py/prototypes/jsstring.py | 71 | 9689 | # -*- coding: utf-8 -*-
from .jsregexp import Exec
import re
DIGS = set('0123456789')
WHITE = u"\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"
def replacement_template(rep, source, span, npar):
"""Takes t... | apache-2.0 |
KrzyHonk/bpmn-python | bpmn_python/graph/classes/lane_type.py | 2 | 2845 | # coding=utf-8
"""
Class used for representing tLane of BPMN 2.0 graph
"""
import graph.classes.base_element_type as base_element
import graph.classes.lane_set_type as lane_set
class Lane(base_element.BaseElement):
"""
Class used for representing tLane of BPMN 2.0 graph.
Fields (except inherited):
- n... | gpl-3.0 |
apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/ctsnews.py | 19 | 3644 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_iso8601, ExtractorError
class CtsNewsIE(InfoExtractor):
# https connection failed (Connection reset)
_VALID_URL = r'http://news\.cts\.com\.tw/[a-z]+/[a-z]+/\d+/(?P<id>\d+)\.html'
_T... | unlicense |
easyfmxu/zulip | zerver/tests.py | 113 | 57617 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.test import TestCase
from zerver.lib.test_helpers import (
queries_captured, simulated_empty_cache,
simulated_queue_client, tornado_redirected_to_list, AuthedTestCase,
most_recent_usermessage, most_recent_message,
)
from zerver.mo... | apache-2.0 |
jshiv/turntable | test/lib/python2.7/site-packages/numpy/polynomial/polynomial.py | 126 | 48268 | """
Objects for dealing with polynomials.
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with polynomial objects is in
the do... | mit |
qianpaladin/CS807 | The Comparison/src/c-obj-np.py | 1 | 7537 | #!/usr/bin/python
# import necessary library.
import threading
import sys
import rados
import socket
import time
import os
import getopt
# create an interface class.
class multithread (threading.Thread):
# define init process.
def __init__(self, threadID, name, size, number):
threading.Thread.__init__(self)
# ... | gpl-2.0 |
williamdev/RatticWeb | cred/tasks.py | 8 | 1121 | from __future__ import absolute_import
from .models import CredChangeQ
from ratticweb.celery import app
from django.core.mail import send_mail
from django.template import Context
from django.template.loader import render_to_string
from django.conf import settings
@app.task
def change_queue_emails():
# Get everyt... | gpl-2.0 |
minhphung171093/GreenERP_V7 | openerp/addons/account_voucher/invoice.py | 49 | 2506 | # -*- 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 |
manassolanki/erpnext | erpnext/config/crm.py | 6 | 3615 | from frappe import _
def get_data():
return [
{
"label": _("Sales Pipeline"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Lead",
"description": _("Database of potential customers."),
},
{
"type": "doctype",
"name": "Opportunity",
"description": _... | gpl-3.0 |
cameronlai/ml-class-python | skeletons/ex7/ex7_sklearn.py | 1 | 4158 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.cm as cm
import scipy.io as sio
from sklearn.cluster import KMeans
from ex7 import findClosestCentroids, computeCentroids
from ex7_utility import plotProgresskMeans
## Machine Learning Online Class - Exercise 7: Princ... | mit |
bottompawn/kbengine | kbe/src/lib/python/Lib/netrc.py | 108 | 5748 | """An object-oriented interface to .netrc files."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
import os, shlex, stat
__all__ = ["netrc", "NetrcParseError"]
class NetrcParseError(Exception):
"""Exception raised on syntax errors in the .netrc file."""
def __init__(self, msg, filename=None, l... | lgpl-3.0 |
seblat/coala-bears | bears/go/GoVetBear.py | 24 | 1051 | from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.GoRequirement import GoRequirement
@linter(executable='go',
use_stdout=False,
use_stderr=True,
output_format='regex',
output_regex=r'.+:(?P<line>\d+): (?P<message>.*)')
class GoVetBear:
""... | agpl-3.0 |
40423146/2017springcd_hw | pelicanconf.py | 1 | 1920 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = '40423146'
SITENAME = '2017Spring 協同產品設計實習'
# 不要用文章所在目錄作為類別
USE_FOLDER_AS_CATEGORY = False
#PATH = 'content'
#OUTPUT_PATH = 'output'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
# Feed generation is usually not desire... | gpl-3.0 |
blademainer/intellij-community | python/lib/Lib/compiler/future.py | 93 | 1839 | """Parser for future statements
"""
from compiler import ast, walk
def is_future(stmt):
"""Return true if statement is a well-formed future statement"""
if not isinstance(stmt, ast.From):
return 0
if stmt.modname == "__future__":
return 1
else:
return 0
class FutureParser:
... | apache-2.0 |
kostyll/python-spidermonkey | setup.py | 5 | 3547 | import os
import sys
import glob
from distutils.core import setup, Extension
from distutils.command.clean import clean
from distutils.command.install import install
from distutils.file_util import copy_file
try:
# For some reason, importing Pyrex appears to change the value of
# the MACOSX_DEPLOYMENT_TARGET to... | gpl-2.0 |
samliu/servo | tests/wpt/web-platform-tests/tools/html5lib/parse.py | 420 | 8783 | #!/usr/bin/env python
"""usage: %prog [options] filename
Parse a document to a tree, with optional profiling
"""
import sys
import os
import traceback
from optparse import OptionParser
from html5lib import html5parser, sanitizer
from html5lib.tokenizer import HTMLTokenizer
from html5lib import treebuilders, serializ... | mpl-2.0 |
lechat/CouchPotato | cherrypy/lib/static.py | 83 | 14710 | try:
from io import UnsupportedOperation
except ImportError:
UnsupportedOperation = object()
import logging
import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg']='image/x-dwg'
mimetypes.types_map['.ico']='image/x-icon'
mimetypes.types_map['.bz2']='application/x-bzip2'
mimetypes.types_map['.gz']='applica... | gpl-3.0 |
DANCEcollaborative/forum-xblock | XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/utils/itercompat.py | 80 | 1374 | """
Providing iterator functions that are not in all version of Python we support.
Where possible, we try to use the system-native version and only fall back to
these implementations if necessary.
"""
import __builtin__
import itertools
import warnings
# Fallback for Python 2.5
def product(*args, **kwds):
"""
... | mit |
google-code-export/pyafipws | wsaa.py | 3 | 14571 | #!/usr/bin/python
# -*- coding: latin-1 -*-
# 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, or (at your option) any later
# version.
#
# This program is distributed in the hope... | gpl-3.0 |
kyubifire/softlayer-python | tests/managers/file_tests.py | 1 | 30244 | """
SoftLayer.tests.managers.file_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import copy
import SoftLayer
from SoftLayer import exceptions
from SoftLayer import fixtures
from SoftLayer import testing
class FileTests(testing.TestCase):
def set_up(self):
... | mit |
BeDjango/intef-openedx | common/djangoapps/terrain/stubs/tests/test_http.py | 172 | 3969 | """
Unit tests for stub HTTP server base class.
"""
import unittest
import requests
import json
from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params
class StubHttpServiceTest(unittest.TestCase):
def setUp(self):
super(StubHttpServiceTest, self).setUp()
self.serv... | agpl-3.0 |
tajkhan/pluto-osl | annotations/module/loop/loop.py | 4 | 1592 | #
# The class for various loop optimization module
#
import sys
import module.module, parser, transformator
#-----------------------------------------
class Loop(module.module.Module):
def __init__(self):
'''To instantiate a loop optimization module'''
module.module.Module.__init__(self)
... | gpl-3.0 |
tswast/google-cloud-python | securitycenter/google/cloud/securitycenter_v1beta1/gapic/enums.py | 2 | 3693 | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
astocko/statsmodels | statsmodels/datasets/macrodata/data.py | 25 | 3184 | """United States Macroeconomic data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
Compiled by Skipper Seabold. All data are from the Federal Reserve Bank of St.
Louis [1] except the unemployment rate which was taken from the National
Bureau of... | bsd-3-clause |
mitocw/edx-platform | openedx/core/djangolib/tests/test_markup.py | 3 | 6662 | # -*- coding: utf-8 -*-
"""
Tests for openedx.core.djangolib.markup
"""
import unittest
import ddt
import six
from bs4 import BeautifulSoup
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from mako.template import Template
from openedx.core.djangolib.markup import H... | agpl-3.0 |
paurosello/frappe | frappe/desk/doctype/event/test_event.py | 2 | 4034 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""Use blog post test to test user permissions logic"""
import frappe
import frappe.defaults
import unittest
import json
from frappe.desk.doctype.event.event import get_events
f... | mit |
scivey/mner | external/gmock-1.7.0/gtest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | mit |
rhyolight/nupic.son | app/mapreduce/lib/pipeline/simplejson/encoder.py | 43 | 18276 | #!/usr/bin/env python
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from mapreduce.lib.simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_ba... | apache-2.0 |
belevtsoff/luigi | test/customized_run_test.py | 29 | 3975 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
brynamo/app | tests/test_login.py | 4 | 1434 | import unittest
from app import app
from app.auth.views import load_user
class TestLogin(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.r = self.app.get('/login')
def tearDown(self):
pass
def login(self, username, password):
return self.app.post(... | mit |
yesudeep/cmc | app/console/app/pygments/scanner.py | 27 | 3093 | # -*- coding: utf-8 -*-
"""
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like ... | mit |
Traiver/FBI | servefiles/servefiles.py | 1 | 4890 | #!/usr/bin/env python
# coding: utf-8 -*-
import os
import socket
import struct
import sys
import threading
import time
import urllib
try:
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SocketServer import TCPServer
from urllib import quote
input = raw_input
except ImportError:
from ht... | mit |
Chancoin-core/CHANCOIN | test/functional/test_framework/socks5.py | 56 | 5713 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Dummy Socks5 server for testing."""
import socket, threading, queue
import logging
logger = logging.g... | mit |
rizumu/django-user-accounts | account/migrations/0001_initial.py | 12 | 31316 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
import account.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depen... | mit |
SNoiraud/gramps | gramps/gui/editors/editcitation.py | 4 | 16699 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2009 Gary Burton
# Copyright (C) 2011 Tim G L Lyons
# Copyright (C) 2011,2014 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-2.0 |
tebeka/pythonwise | pandas-validation/populate.py | 1 | 1289 | #!/usr/bin/env python
'''Populate with dummy data.'''
from pull import cursor
from random import randint, random
from collections import namedtuple
sql = '''
INSERT INTO points (
x
, y
, z
, value
) VALUES (
%s
, %s
, %s
, %s
)'''
Point = namedtuple('Point', ['x', 'y', 'z'])
def rand_coord():
... | bsd-3-clause |
nemesisdesign/django | tests/foreign_object/test_empty_join.py | 232 | 1498 | from django.test import TestCase
from .models import SlugPage
class RestrictedConditionsTests(TestCase):
def setUp(self):
slugs = [
'a',
'a/a',
'a/b',
'a/b/a',
'x',
'x/y/z',
]
SlugPage.objects.bulk_create([SlugPage(sl... | bsd-3-clause |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_Suite.py | 82 | 7785 | """Suite Standard Suite: Common terms for most applications
Level 1, version 1
Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'CoRe'
from StdSu... | gpl-2.0 |
yangming85/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/tests/relatedapp/models.py | 274 | 1686 | from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... | gpl-3.0 |
grumpyjames/buck | programs/file_locks.py | 5 | 2895 | # Copyright 2016-present Facebook, 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 or agreed to i... | apache-2.0 |
ericmckean/syzygy | third_party/numpy/files/numpy/oldnumeric/matrix.py | 88 | 1604 | # This module is for compatibility only.
__all__ = ['UserArray', 'squeeze', 'Matrix', 'asarray', 'dot', 'k', 'Numeric', 'LinearAlgebra', 'identity', 'multiply', 'types', 'string']
import types
from user_array import UserArray, asarray
import numpy.oldnumeric as Numeric
from numpy.oldnumeric import dot, identity, mult... | apache-2.0 |
jakejhansen/minesweeper_solver | minesweeper_basic.py | 1 | 7139 | import pygame
import math
import numpy as np
import random
import time
def checkpattern(col, row):
if row % 2:
if col % 2: #If unequal
return True
else: #if equal
return False
else:
if col % 2: #If unequal
return False
else: #if equal
... | mit |
alsoicode/django-medusa | django_medusa/renderers/disk.py | 1 | 2634 | from __future__ import print_function
from django.conf import settings
from django.test.client import Client
import mimetypes
import os
from .base import COMMON_MIME_MAPS, BaseStaticSiteRenderer
__all__ = ('DiskStaticSiteRenderer', )
# Unfortunately split out from the class at the moment to allow rendering with
# se... | mit |
bollu/sagenb | sagenb/notebook/user_manager.py | 4 | 22205 | import user
import crypt
import hashlib
SALT = 'aa'
class UserManager(object):
def __init__(self, accounts=False):
"""
EXAMPLES:
sage: from sagenb.notebook.user_manager import SimpleUserManager
sage: U = SimpleUserManager()
sage: U == loads(dumps(U))
... | gpl-3.0 |
akash1808/nova_test_latest | nova/api/openstack/compute/plugins/v3/flavor_manage.py | 33 | 3947 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
synweap15/pyload | module/plugins/hoster/MegaCoNz.py | 14 | 8273 | # -*- coding: utf-8 -*-
import array
import os
# import pycurl
import random
import re
from base64 import standard_b64decode
from Crypto.Cipher import AES
from Crypto.Util import Counter
from module.common.json_layer import json_loads, json_dumps
from module.plugins.internal.Hoster import Hoster
from module.utils i... | gpl-3.0 |
otron/zenodo | zenodo/modules/deposit/fields/related_identifiers_field.py | 2 | 2539 | # -*- coding: utf-8 -*-
#
## This file is part of Zenodo.
## Copyright (C) 2012, 2013 CERN.
##
## Zenodo 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... | gpl-3.0 |
tuhangdi/django | tests/many_to_one/tests.py | 88 | 30333 | import datetime
from copy import deepcopy
from django.core.exceptions import FieldError, MultipleObjectsReturned
from django.db import models, transaction
from django.test import TestCase
from django.utils import six
from django.utils.translation import ugettext_lazy
from .models import (
Article, Category, Child... | bsd-3-clause |
ging/keystone | keystone/auth/routers.py | 3 | 2360 | # Copyright 2012 OpenStack Foundation
#
# 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 |
robbiet480/home-assistant | homeassistant/components/toon/climate.py | 7 | 4864 | """Support for Toon thermostat."""
import logging
from typing import Any, Dict, List, Optional
from toonapi import (
ACTIVE_STATE_AWAY,
ACTIVE_STATE_COMFORT,
ACTIVE_STATE_HOME,
ACTIVE_STATE_SLEEP,
)
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const ... | apache-2.0 |
TouK/vumi | vumi/application/tests/test_http_relay.py | 1 | 5384 | from base64 import b64decode
from twisted.internet.defer import inlineCallbacks
from twisted.web import http
from vumi.tests.utils import MockHttpServer
from vumi.application.http_relay import HTTPRelayApplication
from vumi.message import TransportEvent
from vumi.application.tests.helpers import ApplicationHelper
fr... | bsd-3-clause |
pschella/scipy | scipy/misc/tests/test_doccer.py | 126 | 3146 | ''' Some tests for the documenting decorator and support functions '''
from __future__ import division, print_function, absolute_import
import sys
from numpy.testing import assert_equal, dec
from scipy.misc import doccer
# python -OO strips docstrings
DOCSTRINGS_STRIPPED = sys.flags.optimize > 1
docstring = \
"""D... | bsd-3-clause |
fevxie/sale-workflow | sale_order_type/models/sale_order.py | 6 | 2083 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import api, fields, models
class SaleOrde... | agpl-3.0 |
edevil/django | django/contrib/auth/tests/test_forms.py | 8 | 21136 | from __future__ import unicode_literals
import re
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm,
ReadOnlyPasswordHashField, ReadOnlyPasswor... | bsd-3-clause |
puneetgkaur/sugar | src/jarabe/model/buddy.py | 13 | 6496 | # Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# 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
# ... | gpl-2.0 |
clld/clldutils | src/clldutils/declenum.py | 1 | 2072 | """
From zzzeek's "The Enum Recipe".
.. seealso:: `<http://techspot.zzzeek.org/2011/01/14/the-enum-recipe/>`_
"""
import functools
@functools.total_ordering
class EnumSymbol(object):
"""Define a fixed symbol tied to a parent class."""
def __init__(self, cls_, name, value, description, *args):
self.... | apache-2.0 |
pythonpro-dev/pp-latchpony | spikes/pygraph_tst.py | 1 | 2135 | # pygraph_tst.py
#!/usr/bin/env python
# Copyright (c) 2007-2008 Pedro Matiello <pmatiello@gmail.com>
# License: MIT (see COPYING file)
# Import graphviz
import sys
sys.path.append('..')
sys.path.append('/usr/lib/graphviz/python/')
sys.path.append('/usr/lib64/graphviz/python/')
import gv
# Import pygraph
from pygra... | bsd-3-clause |
android-ia/platform_external_chromium_org | tools/usb_gadget/hid_constants.py | 101 | 3407 | # 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.
"""HID constant definitions.
"""
import usb_constants
class DescriptorType(object):
"""Class descriptors.
See Device Class Definition for Human Inter... | bsd-3-clause |
riklaunim/django-custom-multisite | django/conf/locale/ru/formats.py | 86 | 1348 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j E Y г. G:i:s'
YEAR_M... | bsd-3-clause |
wskplho/support-tools | wiki_to_md/wiki2gfm.py | 126 | 4696 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
drunknbass/plexpy | lib/yaml/resolver.py | 474 | 8972 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... | gpl-3.0 |
chatcannon/scipy | scipy/optimize/slsqp.py | 67 | 17862 | """
This module implements the Sequential Least SQuares Programming optimization
algorithm (SLSQP), originally developed by Dieter Kraft.
See http://www.netlib.org/toms/733
Functions
---------
.. autosummary::
:toctree: generated/
approx_jacobian
fmin_slsqp
"""
from __future__ import division, print_func... | bsd-3-clause |
Som-Energia/invoice-janitor | invoicing/measurefixing/Validacio3_sobre_estimacions.py | 1 | 12179 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from validacio_eines import (
es_cefaco,
validar_canvis,
buscar_errors_lot_ids,
copiar_lectures,
lazyOOOP,
)
O = lazyOOOP()
#Objectes
pol_obj = O.GiscedataPolissa
clot_obj = O.GiscedataFacturacioContracte_lot
comp_obj = O.GiscedataLecturesComptado... | agpl-3.0 |
LaurentClaessens/mazhe | src_yanntricks/yanntricksChiSquaresQuantile.py | 1 | 1043 | from sage.all import RealDistribution
from yanntricks import *
def ChiSquaresQuantile():
pspict,fig = SinglePicture("ChiSquaresQuantile")
pspict.dilatation_X(0.3)
pspict.dilatation_Y(50)
mx=0
Mx=30
f=phyFunction(RealDistribution("chisquared",10).distribution_function).graph(mx,Mx)
f.linear_... | gpl-3.0 |
Sing-Li/go-buildpack | builds/runtimes/python-2.7.6/lib/python2.7/test/test_aepack.py | 91 | 2594 | # Copyright (C) 2003 Python Software Foundation
import unittest
import os
from test import test_support
aetypes = test_support.import_module('aetypes')
aepack = test_support.import_module('aepack')
class TestAepack(unittest.TestCase):
OBJECTS = [
aetypes.Enum('enum'),
aetypes.Type('type'),
... | mit |
ttreeagency/PootleTypo3Org | pootle/apps/pootle_app/views/language/view.py | 1 | 4566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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 |
AlexLisovoy/aiohttp | aiohttp/protocol.py | 4 | 27686 | """Http related parsers and protocol."""
import collections
import functools
import http.server
import itertools
import re
import string
import sys
import zlib
from wsgiref.handlers import format_date_time
import aiohttp
from . import errors, hdrs
from .multidict import CIMultiDict
from .log import internal_logger
_... | apache-2.0 |
syci/partner-contact | __unported__/account_partner_merge/partner_merge.py | 37 | 1703 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 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
# pub... | agpl-3.0 |
systers/mailman | src/mailman/app/tests/test_membership.py | 7 | 10736 | # Copyright (C) 2011-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/setuptools/ssl_support.py | 332 | 7663 | import os
import socket
import atexit
import re
import pkg_resources
from pkg_resources import ResolutionError, ExtractionError
from setuptools.compat import urllib2
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_available', 'cert_paths',
'op... | gpl-3.0 |
msebire/intellij-community | python/lib/Lib/site-packages/django/db/models/fields/files.py | 73 | 16847 | import datetime
import os
import django.utils.copycompat as copy
from django.conf import settings
from django.db.models.fields import Field
from django.core.files.base import File, ContentFile
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile, get_image_dimensions
fr... | apache-2.0 |
tesb/flask-crystal | venv/Lib/encodings/cp857.py | 593 | 34164 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.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'):
... | apache-2.0 |
awatts/boto | tests/unit/cloudfront/test_signed_urls.py | 114 | 16806 | import tempfile
import unittest
from boto.compat import StringIO, six, json
from textwrap import dedent
from boto.cloudfront.distribution import Distribution
class CloudfrontSignedUrlsTest(unittest.TestCase):
cloudfront = True
notdefault = True
def setUp(self):
self.pk_str = dedent("""
... | mit |
pgmillon/ansible | lib/ansible/modules/network/cloudengine/ce_vrf.py | 6 | 10784 | #!/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 |
windskyer/k_nova | paxes_nova/virt/ibmpowervm/common/config_iso.py | 1 | 2893 | #
#
# All Rights Reserved.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this f... | apache-2.0 |
dato-code/SFrame | oss_src/unity/python/sframe/test/test_sframe.py | 5 | 134915 | '''
Copyright (C) 2016 Turi
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
# from nose import with_setup
from ..data_structures.sframe import SFrame
from ..data_structures.sarray import SArray
from ..data_structures.image imp... | bsd-3-clause |
Lektorium-LLC/edx-platform | common/test/acceptance/tests/studio/test_studio_asset.py | 6 | 1906 | """
Acceptance tests for Studio related to the asset index page.
"""
from common.test.acceptance.fixtures.base import StudioApiLoginError
from common.test.acceptance.pages.studio.asset_index import AssetIndexPage
from common.test.acceptance.tests.helpers import skip_if_browser
from common.test.acceptance.tests.studio.... | agpl-3.0 |
apparentlymart/python-camlistore | tests/test_search_client.py | 1 | 5935 |
import unittest
from mock import MagicMock
from camlistore.searchclient import (
SearchClient,
ClaimMeta,
SearchResult,
BlobDescription,
)
class TestSearchClient(unittest.TestCase):
def test_query(self):
http_session = MagicMock()
http_session.post = MagicMock()
respons... | mit |
Pexego/odoo | addons/share/ir_model.py | 439 | 2272 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
htwenhe/DJOA | env/Lib/site-packages/pip/_vendor/distlib/version.py | 335 | 23711 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Implementation of a flexible versioning scheme providing support for PEP-440,
setuptools-compatible and semantic versioning.
"""
import logging
import re
from .compat import string_types
... | mit |
bbc/kamaelia | Code/Python/Kamaelia/Examples/OpenGL/MiniExamples/SimpleRotationInteractor.py | 6 | 1666 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
Lessig2016/pledgeservice | testlib/setuptools/tests/test_test.py | 124 | 3712 | # -*- coding: UTF-8 -*-
"""develop tests
"""
import os
import shutil
import site
import sys
import tempfile
import unittest
from distutils.errors import DistutilsError
from setuptools.compat import StringIO
from setuptools.command.test import test
from setuptools.command import easy_install as easy_install_pkg
from s... | agpl-3.0 |
sbalde/edxplatform | common/djangoapps/terrain/course_helpers.py | 116 | 2521 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
import urllib
from lettuce import world
from django.contrib.auth.models import User
from student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore, clear_existing_modulestores
from xmodule.contentstore.django imp... | agpl-3.0 |
boumenot/azure-linux-extensions | VMEncryption/main/patch/debianPatching.py | 2 | 1691 | #!/usr/bin/python
#
# Copyright 2015 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... | apache-2.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/unidecode/x0c4.py | 253 | 5024 | data = (
'sswals', # 0x00
'sswalt', # 0x01
'sswalp', # 0x02
'sswalh', # 0x03
'sswam', # 0x04
'sswab', # 0x05
'sswabs', # 0x06
'sswas', # 0x07
'sswass', # 0x08
'sswang', # 0x09
'sswaj', # 0x0a
'sswac', # 0x0b
'sswak', # 0x0c
'sswat', # 0x0d
'sswap', # 0x0e
'sswah', # 0x0f
... | apache-2.0 |
acourtney2015/boto | boto/ec2/elb/listener.py | 152 | 3377 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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 wi... | mit |
yjmade/odoo | addons/bus/bus.py | 325 | 7324 | # -*- coding: utf-8 -*-
import datetime
import json
import logging
import select
import threading
import time
import random
import simplejson
import openerp
from openerp.osv import osv, fields
from openerp.http import request
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
_logger = logging.getLogger(__... | agpl-3.0 |
spbguru/repo1 | nupic/regions/TPRegion.py | 6 | 29274 | # ----------------------------------------------------------------------
# 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... | gpl-3.0 |
codecakes/random_games | weird.py | 1 | 1601 | # -*- coding: utf-8 -*-
"""
An IT company organized a referral point game for their employees.
Let us say number of employees in the group are n (n>0) and maximum points in
the game are 20. Each employee has a unique identification number.
The employee’s points are sorted according to their identification numbers... | mit |
jart/tensorflow | tensorflow/contrib/kernel_methods/python/losses.py | 30 | 5622 | # 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 |
nitzmahone/ansible | lib/ansible/galaxy/token.py | 38 | 2077 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.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 Fo... | gpl-3.0 |
abpai/mailin-test | python/dkim/crypto.py | 10 | 7289 | # This software is provided 'as-is', without any express or implied
# warranty. In no event will the author be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistri... | mit |
cchurch/ansible | lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py | 42 | 11408 | #!/usr/bin/python
#
# Copyright (c) 2018 Yunge Zhu, <yungez@microsoft.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_version': '1.1',
... | gpl-3.0 |
fast90/youtube-dl | youtube_dl/extractor/fivetv.py | 139 | 2959 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class FiveTVIE(InfoExtractor):
_VALID_URL = r'''(?x)
http://
(?:www\.)?5-tv\.ru/
(?:
... | unlicense |
ranog/simplemooc | simplemooc/accounts/urls.py | 1 | 1332 | """simplemooc URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | gpl-3.0 |
rooshilp/CMPUT410Lab4 | env-lab4/lib/python2.7/site-packages/jinja2/debug.py | 620 | 10980 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | apache-2.0 |
caot/intellij-community | python/lib/Lib/site-packages/django/contrib/messages/tests/base.py | 73 | 17612 | import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import Messag... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.