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 |
|---|---|---|---|---|---|
hajuuk/asuswrt | release/src/router/samba-3.5.8/source4/lib/ldb/tests/python/sec_descriptor.py | 22 | 74313 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import getopt
import optparse
import sys
import os
import base64
import re
import random
sys.path.append("bin/python")
sys.path.append("../lib/subunit/python")
import samba.getopt as options
# Some error messages that are being tested
from ldb import SCOPE_SUBTREE, SCOPE_ON... | gpl-2.0 |
10clouds/edx-platform | common/test/acceptance/pages/lms/login.py | 205 | 1412 | """
Login page for the LMS.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from . import BASE_URL
from .dashboard import DashboardPage
class LoginPage(PageObject):
"""
Login page for the LMS.
"""
url = BASE_URL + "/login"
def is_browser_on_page(self):
... | agpl-3.0 |
Thraxis/pymedusa | lib/pyasn1/type/base.py | 86 | 10706 | # Base classes for ASN.1 types
import sys
from pyasn1.type import constraint, tagmap, tag
from pyasn1 import error
class Asn1Item: pass
class Asn1ItemBase(Asn1Item):
# Set of tags for this ASN.1 type
tagSet = tag.TagSet()
# A list of constraint.Constraint instances for checking values
subtypeSpec... | gpl-3.0 |
podhmo/boto | boto/glacier/concurrent.py | 153 | 17241 | # 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 without restriction, including
# without limitation the rights ... | mit |
gencer/python-phonenumbers | python/phonenumbers/data/region_GD.py | 1 | 1328 | """Auto-generated file, do not edit by hand. GD metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GD = PhoneMetadata(id='GD', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='[4589]\\d{9}', possible_length=(10,), pos... | apache-2.0 |
Nethermaker/school-projects | intro/intro_challenge.py | 1 | 3681 | # Problem 1
# Write a function called switch_ends() that takes a string
# and returns the string with the front and back letter switched
# Ex: switch_ends('part') -> 'tarp'
# switch_ends('abcdefg') -> 'gbcdefa'
# switch_ends('dog') -> 'god'
def switch_ends(string):
first = string[0]
last = string[-1]
... | mit |
acfogarty/espressopp | contrib/mpi4py/mpi4py-2.0.0/src/__main__.py | 9 | 5800 | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""
Run some benchmarks and tests
"""
import sys as _sys
def helloworld(comm, args=None, verbose=True):
"""
Hello, World! using MPI
"""
from . import MPI
from optparse import OptionParser
parser = OptionParser(prog="mpi4py helloworld")
... | gpl-3.0 |
harsimrans/word-treasure | word_treasure/wordnik/AccountApi.py | 2 | 8113 | #!/usr/bin/env python
"""
WordAPI.py
Copyright 2012 Wordnik, 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 a... | gpl-3.0 |
MagicSolutions/django-cms | cms/migrations/0017_author_removed.py | 525 | 20033 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
napsternxg/gensim | gensim/test/test_ldamallet_wrapper.py | 4 | 8613 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import o... | gpl-3.0 |
Simage/shinken | shinken/db_sqlite.py | 19 | 1556 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you c... | agpl-3.0 |
chentianma/mine | migrations/versions/0b6f90cadb82_add_category_id_foreignkey_in_topic.py | 1 | 1369 | """add category_id foreignkey in Topic
Revision ID: 0b6f90cadb82
Revises: a06c8b2e1c5e
Create Date: 2017-05-27 13:52:21.541292
"""
# revision identifiers, used by Alembic.
revision = '0b6f90cadb82'
down_revision = 'a06c8b2e1c5e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
d... | gpl-3.0 |
adwaitjog/mafia | aerialvision/variableclasses.py | 2 | 8381 | #!/usr/bin/env python
# Copyright (C) 2009 by Aaron Ariel
# and the University of British Columbia, Vancouver,
# BC V6T 1Z4, All Rights Reserved.
#
# THIS IS A LEGAL DOCUMENT BY DOWNLOADING GPGPU-SIM, YOU ARE AGREEING TO THESE
# TERMS AND CONDITIONS.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRI... | gpl-3.0 |
Omegaphora/external_chromium_org | tools/telemetry/third_party/pyserial/serial/win32.py | 155 | 10120 | from ctypes import *
from ctypes.wintypes import HANDLE
from ctypes.wintypes import BOOL
from ctypes.wintypes import LPCWSTR
_stdcall_libraries = {}
_stdcall_libraries['kernel32'] = WinDLL('kernel32')
from ctypes.wintypes import DWORD
from ctypes.wintypes import WORD
from ctypes.wintypes import BYTE
INVALID_HANDLE_VAL... | bsd-3-clause |
GaZ3ll3/numba | numba/cuda/cudadrv/devicearray.py | 5 | 13811 | """
A CUDA ND Array is recognized by checking the __cuda_memory__ attribute
on the object. If it exists and evaluate to True, it must define shape,
strides, dtype and size attributes similar to a NumPy ndarray.
"""
from __future__ import print_function, absolute_import, division
import warnings
import math
import copy... | bsd-2-clause |
anhaidgroup/py_entitymatching | py_entitymatching/tests/test_matcherselector_mlmatcherselection.py | 1 | 27721 | import os
from nose.tools import *
import unittest
import pandas as pd
import numpy as np
import six
from py_entitymatching.utils.generic_helper import get_install_path, list_diff
from py_entitymatching.io.parsers import read_csv_metadata
from py_entitymatching.matcherselector.mlmatcherselection import select_matcher
... | bsd-3-clause |
ppyordanov/HCI_4_Future_Cities | Server/src/virtualenv/Lib/encodings/quopri_codec.py | 1 | 2161 | """Codec for quoted-printable encoding.
Like base64 and rot13, this returns Python strings, not Unicode.
"""
import codecs, quopri
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
def quopri_encode(input, errors='strict'):
"""Encode the input, returning a tuple (out... | mit |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/boto-2.27.0-py2.7.egg/boto/handler.py | 18 | 2373 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | gpl-3.0 |
damoguyan8844/fabric-bolt | fabric_bolt/web_hooks/views.py | 10 | 2284 | import datetime
from django.http import HttpResponseRedirect
from django.db.models.aggregates import Count
from django.contrib import messages
from django.views.generic import CreateView, UpdateView, DetailView, DeleteView
from django.core.urlresolvers import reverse_lazy, reverse
from django_tables2 import Request... | mit |
mrphrazer/miasm | test/arch/mep/asm/test_major_opcode_4.py | 5 | 6004 | # Toshiba MeP-c4 - Major Opcode #4 unit tests
# Guillaume Valadon <guillaume@valadon.net>
from ut_helpers_asm import check_instruction
class TestMajor4(object):
def test_ADD3(self):
"""Test the ADD3 instruction"""
# Top instructions
check_instruction("ADD3 $2, $SP, 0x20", "4220", multi=... | gpl-2.0 |
vit2/vit-e2 | lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py | 13 | 12896 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.Console import Console
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.Sources.StaticText import StaticText
from Components.MenuLis... | gpl-2.0 |
jtorrents/networkx | networkx/algorithms/matching.py | 22 | 32910 | """
********
Matching
********
"""
# Copyright (C) 2004-2008 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# Copyright (C) 2011 by
# Nicholas Mancuso <nick.mancuso@gmail.com>
# All rights reserved.
# ... | bsd-3-clause |
TalShafir/ansible | lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup.py | 17 | 18284 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2017-2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ... | gpl-3.0 |
mitocw/edx-platform | openedx/core/djangoapps/config_model_utils/admin.py | 4 | 3196 | """
Convenience classes for defining StackedConfigModel Admin pages.
"""
from config_models.admin import ConfigurationModelAdmin
from django import forms
from django.utils.translation import ugettext_lazy as _
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangolib.markup import HTML, Text
class Cour... | agpl-3.0 |
google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/ttLib/tables/_g_v_a_r.py | 4 | 7809 | from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import array
import itertools
import logging
import struct
import sys
import fontTools.ttLib.tables.TupleVariation as tv
log = logging.getLogger(__name__)
TupleVariation = tv.TupleVariation
# https://www.micr... | apache-2.0 |
srznew/heat | heat_integrationtests/functional/test_encrypted_parameter.py | 12 | 2139 | # 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 |
azjps/bokeh | bokeh/server/protocol/messages/tests/test_pull_doc.py | 14 | 1167 | from __future__ import absolute_import, print_function
import unittest
import bokeh.document as document
from bokeh.model import Model
from bokeh.core.properties import Int, Instance
from bokeh.server.protocol import Protocol
class AnotherModelInTestPullDoc(Model):
bar = Int(1)
class SomeModelInTestPullDoc(Mode... | bsd-3-clause |
mavit/ansible | lib/ansible/modules/cloud/amazon/redshift_subnet_group.py | 50 | 5877 | #!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'stat... | gpl-3.0 |
dfci/pancanmet_analysis | oldcode/pancan/covariation_onemetabolite.py | 1 | 4702 | # A script to examine the co-variation of one metabolite in particular in the pancan metabolomics data.
import os, sys, pandas as pd, numpy as np, scipy as sp, csv, scipy.stats as st, matplotlib.pyplot as plt, matplotlib.cm as cm, itertools as it, pdb
sys.path.append('..')
import reportertools as rt
plt.close('all')... | lgpl-3.0 |
goddardl/cortex | python/IECoreMaya/FnConverterHolder.py | 12 | 3543 | ##########################################################################
#
# Copyright (c) 2007-2008, 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:
#
# * Redis... | bsd-3-clause |
yufish/youtube-dl | youtube_dl/extractor/newgrounds.py | 150 | 1261 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/audio/listen/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.newgrounds.com/audio/listen/549479',
'md5': 'fe6033d2... | unlicense |
blitzagency/django-chatterbox | chatterbox/api/__init__.py | 1 | 4200 | import logging
import calendar
import pytz
from datetime import (datetime, timedelta)
from requests_oauthlib import OAuth2Session, OAuth1Session
log = logging.getLogger(__name__)
class SimpleProfile(object):
"""SimpleProfile is an object whose purpose is to normalize the
various possible responses from N se... | mit |
calfonso/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_load_balancer_facts.py | 15 | 3299 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ = ty... | gpl-3.0 |
ligature/ansible-modules-extras | windows/win_iis_virtualdirectory.py | 64 | 1762 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
jsteemann/cxx-test | tests/googletest/googletest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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... | apache-2.0 |
krisys/django | tests/gis_tests/layermap/models.py | 34 | 2488 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
class Meta:
abstract = True
required_db_features = ['gis_enabled']
def __str__(self):
ret... | bsd-3-clause |
stanmoore1/lammps | lib/Install.py | 10 | 3030 | #!/usr/bin/env python
"""
Install.py tool to do a generic build of a library
soft linked to by many of the lib/Install.py files
used to automate the steps described in the corresponding lib/README
"""
from __future__ import print_function
import sys, os, subprocess
from argparse import ArgumentParser
sys.path.append... | gpl-2.0 |
altermarkive/Coding-Interviews | algorithm-design/hackerrank/sherlock_and_array/sherlockand_array.py | 1 | 1280 | #!/usr/bin/env python3
# https://www.hackerrank.com/challenges/sherlock-and-array
import os
import unittest
from typing import List
def balanced_sums(arr: List[int]) -> str:
left = [0] * len(arr)
right = [0] * len(arr)
for i in range(1, len(arr)):
left[i] = left[i - 1] + arr[i - 1]
right... | mit |
mujiansu/arangodb | 3rdParty/V8-4.3.61/build/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | apache-2.0 |
StephenKing/summerschool-2015-ryu | ryu/services/protocols/bgp/bgpspeaker.py | 2 | 27190 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
Sofcom/treeio | treeio/core/models.py | 1 | 55568 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Treeio Core system objects
"""
from django.contrib import messages
from django.http import HttpRequest
from django.contrib.messages.storage import default_storage
from django.contrib.messages.storage.ba... | mit |
petteyg/intellij-community | python/testData/MockSdk2.7/python_stubs/exceptions.py | 44 | 22999 | # encoding: utf-8
# module exceptions
# from (built-in)
# by generator 1.124
"""
Python's standard exception class hierarchy.
Exceptions found here are defined both in the exceptions module and the
built-in namespace. It is recommended that user-defined exceptions
inherit from Exception. See the documentation for th... | apache-2.0 |
pshen/ansible | lib/ansible/modules/packaging/os/package.py | 56 | 2229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Ansible, 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 o... | gpl-3.0 |
Meninblack007/android_kernel_cyanogen_msm8916 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
fnordahl/nova | nova/tests/unit/api/openstack/compute/test_microversions.py | 17 | 15831 | # Copyright 2014 IBM Corp.
#
# 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 |
ramcn/demo3 | venv/lib/python3.4/site-packages/django/conf/locale/tr/formats.py | 115 | 1141 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETI... | mit |
chokribr/invenio | invenio/ext/script/__init__.py | 5 | 7056 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your optio... | gpl-2.0 |
lduarte1991/edx-platform | lms/djangoapps/instructor_task/tests/test_tasks_helper.py | 1 | 109430 | # -*- coding: utf-8 -*-
"""
Unit tests for LMS instructor-initiated background tasks helper functions.
- Tests that CSV grade report generation works with unicode emails.
- Tests all of the existing reports.
"""
import os
import shutil
import tempfile
import urllib
from datetime import datetime
import ddt
import u... | agpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/google/resumable_media/__init__.py | 1 | 20693 | # Copyright 2017 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 or agreed to in writing, ... | mit |
total-impact/biomed | test/test_biblio.py | 2 | 2948 | # import unittest
# from nose.tools import nottest
# from nose.tools import assert_equals
# from nose.tools import assert_not_equals
# from nose.tools import assert_true
# from nose.tools import assert_items_equal
# from nose.tools import assert_in
# from nose.tools import assert_not_in
# from test.utils import setup_r... | mit |
athompso/ansible | lib/ansible/inventory/expand_hosts.py | 43 | 4399 | # (c) 2012, Zettar Inc.
# Written by Chin Fang <fangchin@zettar.com>
#
# This file is part of Ansible
#
# This module 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 y... | gpl-3.0 |
scs/uclinux | user/python/python-2.4.4/Tools/pynche/pyColorChooser.py | 101 | 3768 | """Color chooser implementing (almost) the tkColorColor interface
"""
import os
import Main
import ColorDB
class Chooser:
"""Ask for a color"""
def __init__(self,
master = None,
databasefile = None,
initfile = None,
ignore = None,
... | gpl-2.0 |
FrancescoGuarneri/PythonBird | pythonbird.py | 2 | 5259 | #!/usr/bin/env python
'''
author: Daniele Faugiana
last update: October the 20th 2012
version: 0.1
'''
import tweepy
from time import sleep
from auth import startAuth
from os import path
#Authorize this application
api = startAuth()
#Get yourself's object
myself = api.me()
#This function gets the last 1000 tweets... | gpl-3.0 |
apieum/inxpect | inxpect/tests/testProperty.py | 1 | 3623 | # -*- coding: utf8 -*-
from . import TestCase, Mock
from inxpect.expect.property import DefaultProperty
from inxpect import getters
class DefaultPropertyTest(TestCase):
def setUp(self):
class Expect(object):
attribute = DefaultProperty(getters.AttrByName('attribute'))
class Tested(obj... | lgpl-3.0 |
waldyrious/GraphUI | livec/codegui/BlockWidget.py | 3 | 4827 | # Copyright (c) 2007 Enough Project.
# See LICENSE for details.
import nodes
import pygame
from gui import Keymap
from gui.Box import VBox, HBox
from gui.ProxyWidget import ProxyWidget
from gui.TextEdit import make_label
from widget_for import indented, NormalWidgetMaker
from InfoShower import InfoShower
from lib.obs... | gpl-3.0 |
vineodd/PIMSim | GEM5Simulation/gem5/src/mem/slicc/ast/ActionDeclAST.py | 31 | 3447 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | gpl-3.0 |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/asyncio/windows_utils.py | 64 | 6066 | """
Various Windows specific bits and pieces
"""
import sys
if sys.platform != 'win32': # pragma: no cover
raise ImportError('win32 only')
import socket
import itertools
import msvcrt
import os
import subprocess
import tempfile
import _winapi
__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle']
#... | lgpl-3.0 |
Sylrob434/CouchPotatoServer | libs/apscheduler/scheduler.py | 87 | 23350 | """
This module is the main part of the library. It houses the Scheduler class
and related exceptions.
"""
from threading import Thread, Event, Lock
from datetime import datetime, timedelta
from logging import getLogger
import os
import sys
from apscheduler.util import *
from apscheduler.triggers import SimpleTrigger... | gpl-3.0 |
abramhindle/WebSocketsExamples | chat.py | 1 | 2279 | #!/usr/bin/env python
# Copyright 2013 Abram Hindle
#
# 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 |
javachengwc/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/contenttypes/tests.py | 113 | 11127 | from __future__ import unicode_literals
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.models import Site, get_current_site
from django.http import HttpRequest, Http404
from django.test import Test... | apache-2.0 |
ludolatin/ludolatin | app/models/comments.py | 3 | 1546 | from datetime import datetime
import bleach
from markdown import markdown
from markdown_nofollow import NofollowExtension
from flask import url_for
from app import db
from ._base_model import BaseModel
class Comment(db.Model, BaseModel):
__tablename__ = 'comment'
id = db.Column(db.Integer, primary_key=True)... | mit |
eneldoserrata/marcos_openerp | addons/hr_payroll_account/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
alvaroaleman/ansible | lib/ansible/modules/cloud/openstack/os_ironic.py | 29 | 12830 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2014, Hewlett-Packard Development Company, L.P.
#
# This module 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 optio... | gpl-3.0 |
vrillusions/rss2twitter | src/rss2twitter.py | 1 | 3969 | #!/usr/bin/env python
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
"""Checks rss feed and posts to twitter.
Check an rss feed and if the latest entry is different than post it to twitter.
"""
import sys
import os
import traceback
import cPickle
from ConfigParser import SafeConfigParser
from optparse import OptionPa... | mit |
maxsocl/django-wowstat | wowstat/views.py | 1 | 6521 | # -*- coding: utf-8 -*-
import httplib2
import ConfigParser
import xml.etree.ElementTree as etree
from django.template.response import TemplateResponse
from django.views.generic import View
from datetime import datetime, date, timedelta
from forms import DateChoices
from models import WowzaConnections
from django... | mit |
cgwalters/pykickstart | pykickstart/commands/__init__.py | 8 | 1604 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2009, 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will b... | gpl-2.0 |
amorilia/blender_nif_plugin | testframework/test/collisions/test_collision.py | 2 | 11000 | """Import and export collision data"""
import bpy
import nose.tools
from test.geometry.test_geometry import TestBaseGeometry
from pyffi.formats.nif import NifFormat
class TestBhkCollision():
''' Helper class with common features of Collision Tree'''
def n_check_bsxflags_property(self, n_data):
#We c... | bsd-3-clause |
Ivoz/pip | pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
wsmith323/django | django/contrib/staticfiles/utils.py | 335 | 1976 | import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... | bsd-3-clause |
SlimRemix/android_external_chromium_org | remoting/tools/zip2msi.py | 89 | 8691 | #!/usr/bin/env python
# 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.
"""Generates .msi from a .zip archive or an unpacked directory.
The structure of the input archive or directory should look like t... | bsd-3-clause |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/regex_syntax.py | 17 | 1893 | """Constants for selecting regexp syntaxes for the obsolete regex module.
This module is only for backward compatibility. "regex" has now
been replaced by the new regular expression module, "re".
These bits are passed to regex.set_syntax() to choose among
alternative regexp syntaxes.
"""
# 1 means plain parentheses... | gpl-2.0 |
kvar/ansible | lib/ansible/modules/storage/netapp/na_elementsw_snapshot_schedule.py | 21 | 22392 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Element SW Software Snapshot Schedule"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
zwChan/VATEC | ~/eb-virt/Lib/site-packages/setuptools/command/sdist.py | 29 | 8011 | from glob import glob
from distutils import log
import distutils.command.sdist as orig
import os
import sys
import io
import contextlib
from setuptools.extern import six
from setuptools.utils import cs_path_exists
import pkg_resources
READMES = 'README', 'README.rst', 'README.txt'
_default_revctrl = list
def wal... | apache-2.0 |
elssar/calibre | src/calibre/gui2/tweak_book/editor/image.py | 10 | 11219 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import sys
from functools import partial
from PyQt5.Qt import (
QMainWi... | gpl-3.0 |
cyng93/chewing-editor | gmock/gtest/test/gtest_output_test.py | 1733 | 12005 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-2.0 |
pyecs/servo | tests/wpt/web-platform-tests/subresource-integrity/tools/generate_javascript.py | 210 | 1297 | from os import path, listdir
from hashlib import sha512, sha256, md5
from base64 import b64encode
import re
JS_DIR = path.normpath(path.join(__file__, "..", ".."))
'''
Yield each file in the javascript directory
'''
def js_files():
for f in listdir(JS_DIR):
if path.isfile(f) and f.endswith(".js"):
yield f... | mpl-2.0 |
lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py | 624 | 1426 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
d... | gpl-3.0 |
donkirkby/django | tests/invalid_models_tests/test_ordinary_fields.py | 60 | 21814 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import decimal
import unittest
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.timezone import no... | bsd-3-clause |
shivam1111/odoo | addons/account/report/account_treasury_report.py | 385 | 3872 | # -*- 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 |
danielru/pySDC | projects/node_failure/hard_faults_test.py | 1 | 7309 | import numpy as np
from pySDC.implementations.problem_classes.HeatEquation_1D_FD_forced import heat1d_forced
from pySDC.implementations.problem_classes.AdvectionEquation_1D_FD import advection1d
from pySDC.implementations.transfer_classes.TransferMesh import mesh_to_mesh
from pySDC.implementations.datatype_classes.mes... | bsd-2-clause |
Dangetsu/vnr | Frameworks/Sakura/py/apps/reader/views/topicsview.py | 1 | 14325 | # coding: utf8
# topicsview.py
# 8/27/2014 jichi
if __name__ == '__main__':
import sys
sys.path.append('..')
import debug
debug.initenv()
import json
from functools import partial
from PySide.QtCore import Qt, QObject
from Qt5 import QtWidgets
from sakurakit import skevents, skqss
from sakurakit.skclass impor... | gpl-3.0 |
francisco-dlp/hyperspy | hyperspy/tests/samfire/test_red_chisq_weight.py | 5 | 1541 | # Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 ve... | gpl-3.0 |
superjamie/snippets | cache_affinity.py | 1 | 1320 | #!/usr/bin/python
# cache_affinity.py
#
# This script walks sysfs and determines the level, type, and size of
# each processor cache. It then reports which processor cores each
# cache level is shared with.
#
import glob, os, re
nr_cpus = 0
for line in open("/proc/cpuinfo"):
if re.search("processor", line):
... | gpl-2.0 |
pthien92/sdn | pox/lib/pxpcap/parser.py | 47 | 2775 | # Copyright 2012 James McCauley
#
# 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 writi... | apache-2.0 |
nervenXC/gensim | gensim/models/ldamodel.py | 16 | 37653 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
#
# Parts of the LDA inference code come from Dr. Hoffman's `onlineldavb.py` script,
# (C) 2010 Matthew D. Hoffman, GNU GPL 3.0
"""
**... | gpl-3.0 |
passByReference/webcrawler | proj2/proj2/settings.py | 1 | 3117 | # -*- coding: utf-8 -*-
# Scrapy settings for proj2 project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | apache-2.0 |
schuelaw/EngineeringMathPython | FiniteDifferences/CrankNicolsonAnim.py | 1 | 1836 | # -*- coding: utf-8 -*-
"""
Created on Tue May 5 18:40:07 2015
@author: Albert
"""
""" Solve the 1D heat equation using a Crank-Nicolson scheme. """
""" Assuming fixed, homog, BC's """
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.linalg import solveh_banded
import matplot... | gpl-2.0 |
south-coast-science/scs_dfe_eng | src/scs_dfe/interface/component/io.py | 1 | 4689 | """
Created on 6 Feb 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_dfe.interface.component.pca8574 import PCA8574
from scs_host.lock.lock import Lock
from scs_host.sys.host import Host
# -------------------------------------------------------------------------------------------------... | mit |
jing-bao/pa-chromium | third_party/closure_linter/closure_linter/ecmametadatapass.py | 155 | 18062 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Linter 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
#... | bsd-3-clause |
FrankBian/kuma | vendor/packages/Werkzeug/werkzeug/debug/repr.py | 7 | 8275 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | mpl-2.0 |
hectord/lettuce | tests/integration/lib/Django-1.3/django/forms/formsets.py | 151 | 14871 | from forms import Form
from django.core.exceptions import ValidationError
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput
from util import... | gpl-3.0 |
jneves/python-social-auth | social/apps/django_app/middleware.py | 70 | 2285 | # -*- coding: utf-8 -*-
import six
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.api import MessageFailure
from django.shortcuts import redirect
from django.utils.http import urlquote
from social.exceptions import SocialAuthBaseException
from social.utils import soc... | bsd-3-clause |
gisce/OCB | addons/product_expiry/__openerp__.py | 59 | 1729 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
anweshknayak/sunflower-fm | application/gui/preferences/item_list.py | 7 | 28297 | import gtk
from common import AccessModeFormat
from gui.input_dialog import InputDialog
from widgets.breadcrumbs import Breadcrumbs
from widgets.settings_page import SettingsPage
class Column:
NAME = 0
SIZE = 1
VISIBLE = 2
FONT_SIZE = 3
class ExtensionColumn:
NAME = 0
CLASS_NAME = 1
class DirectoryColumn:
... | gpl-3.0 |
Suwmlee/XX-Net | Python3/lib/distutils/tests/test_version.py | 6 | 2685 | """Tests for distutils.version."""
import unittest
from distutils.version import LooseVersion
from distutils.version import StrictVersion
from test.support import run_unittest
class VersionTestCase(unittest.TestCase):
def test_prerelease(self):
version = StrictVersion('1.2.3a1')
self.ass... | bsd-2-clause |
larry-cherry/buzzbus-presentation | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | 1748 | #!/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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
ntiufalara/openerp7 | openerp/addons/stock/report/lot_overview_all.py | 57 | 2318 | # -*- 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... | mit |
rsalmaso/python-social-auth | social/tests/backends/test_utils.py | 80 | 1776 | import unittest2 as unittest
from social.tests.models import TestStorage
from social.tests.strategy import TestStrategy
from social.backends.utils import load_backends, get_backend
from social.backends.github import GithubOAuth2
from social.exceptions import MissingBackend
class BaseBackendUtilsTest(unittest.TestCas... | bsd-3-clause |
davidmarin/msd | msd/url.py | 2 | 1516 | # Copyright 2014-2015 SpendRight, 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 in wri... | apache-2.0 |
idncom/odoo | addons/website_sale_options/models/sale_order.py | 237 | 2831 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.tools.translate import _
class sale_order_line(osv.Model):
_inherit = "sale.order.line"
_columns = {
'linked_line_id': fields.many2one('sale.order.line', 'Linked Order Line', domain="[('orde... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.