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 |
|---|---|---|---|---|---|
fengbaicanhe/intellij-community | python/helpers/profiler/thrift/server/THttpServer.py | 164 | 3145 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
nitzmahone/ansible | lib/ansible/plugins/action/cli_config.py | 27 | 1190 | #
# Copyright 2018 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansibl... | gpl-3.0 |
jiwanlimbu/aura | keystone/conf/default.py | 3 | 9568 | # 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 |
dagwieers/ansible | hacking/aws_config/build_iam_policy_framework.py | 25 | 11861 | # Requires pandas, bs4, html5lib, and lxml
#
# Call script with the output from aws_resource_actions callback, e.g.
# python build_iam_policy_framework.py ['ec2:AuthorizeSecurityGroupEgress', 'ec2:AuthorizeSecurityGroupIngress', 'sts:GetCallerIdentity']
#
# The sample output:
# {
# "Version": "2012-10-17",
# "S... | gpl-3.0 |
QijunPan/ansible | lib/ansible/utils/color.py | 12 | 3194 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 version 3 of the License, or
# (at your option) an... | gpl-3.0 |
suhe/odoo | addons/stock_calendar/__openerp__.py | 18 | 3140 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Calendars on Orderpoints',
'version': '1.0',
'summary': 'Calendars ',
'description': """
The stock_calendar module handles minimum stock rules (=orderpoints / reordering rules) differen... | gpl-3.0 |
redhat-openstack/swift | test/unit/common/middleware/test_cname_lookup.py | 33 | 9172 | # Copyright (c) 2010-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 agree... | apache-2.0 |
openhatch/new-mini-tasks | vendor/packages/requests/requests/packages/charade/gb2312prober.py | 231 | 1722 | ######################## 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.
... | apache-2.0 |
infinnovation/mbed-os | tools/export/embitz/__init__.py | 21 | 2880 | """
mbed SDK
Copyright (c) 2014-2016 ARM Limited
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 wr... | apache-2.0 |
Android-L-Porting-Team/android_kernel_mako | scripts/build-all.py | 1182 | 9486 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# ... | gpl-2.0 |
RosiePy/pychess | lib/pychess/compat.py | 20 | 1082 | """ Some Python2/Python3 compatibility support helpers """
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
basestring = str
cmp = lambda x, y: (x > y) - (x < y)
memoryview = memoryview
open = open
unichr = chr
unicode = lambda x: x
raw_input = input
i... | gpl-3.0 |
ekamioka/gp-structure-search | source/datasets/methane.py | 7 | 1272 | import datetime
import numpy as np
nax = np.newaxis
"""Methane data from the NOAA. See ftp://ftp.cmdl.noaa.gov/ccg/ch4/flask/README_surface_flask_ch4.html"""
def datafile():
return '../data/ch4_brw_surface-flask_1_ccgg_event.txt'
def read_data(fname=None):
"""Returns a Tx1 array X which gives time (in secon... | mit |
marco-lancini/Showcase | social_auth/backends/contrib/evernote.py | 10 | 3381 | """
EverNote OAuth support
No extra configurations are needed to make this work.
"""
from urllib2 import HTTPError
try:
from urlparse import parse_qs
parse_qs # placate pyflakes
except ImportError:
# fall back for Python 2.5
from cgi import parse_qs
from oauth2 import Token
from social_auth.utils imp... | mit |
talk-to/PjSip-Repo | pjsip-apps/src/pygui/account.py | 27 | 6912 | # $Id$
#
# pjsua Python GUI Demo
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) ... | gpl-2.0 |
joelpinheiro/safebox-smartcard-auth | Client/veclient/lib/lib/python2.7/site-packages/setuptools/command/easy_install.py | 109 | 74243 | #!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://pythonhosted.org/setuptools/easy_install.html
"""
impo... | gpl-2.0 |
horance-liu/tensorflow | tensorflow/examples/adding_an_op/zero_out_grad_2.py | 184 | 1662 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
huggingface/transformers | src/transformers/models/longformer/modeling_tf_longformer.py | 2 | 127235 | # coding=utf-8
# Copyright 2020 The Allen Institute for AI team and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | apache-2.0 |
project-ncl/pnc-cli | test/integration/test_buildconfigurationsets_api.py | 2 | 5971 | import pytest
from test.integration.conftest import new_config
from pnc_cli import buildconfigurationsets
from pnc_cli import utils
from test import testutils
from pnc_cli.swagger_client.apis.buildconfigurationsets_api import BuildconfigurationsetsApi
import pnc_cli.user_config as uc
__author__ = 'thauser'
@pytest... | apache-2.0 |
codeforeurope/TagCheckScore | TagCheckScore/wsgi.py | 1 | 1440 | """
WSGI config for TagCheckScore project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICAT... | agpl-3.0 |
tedlaz/pyted | tests/teddypy/teddypy/qt_about.py | 2 | 2835 | # -*- coding: utf-8 -*-
'''
Created on ${date}
@author: ${user}
'''
from PyQt4 import QtGui,QtCore,Qt
import sys, os
class WigglyWidget(QtGui.QWidget):
def __init__(self, txt,parent=None):
super(WigglyWidget, self).__init__(parent)
self.setAttribute(Qt.Qt.WA_DeleteOnClose)
self.se... | gpl-3.0 |
slarosa/QGIS | python/plugins/sextante/gui/ResultsDialog.py | 4 | 2399 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ResultsDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
Distrotech/scons | src/engine/SCons/ExecutorTests.py | 3 | 16209 | #
# __COPYRIGHT__
#
# 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, sublicen... | mit |
smjhnits/Praktikum_TU_D_16-17 | Anfängerpraktikum/Protokolle/V302_Brückenschaltungen/Auswertung/Auswertung.py | 1 | 4533 | import numpy as np
from scipy.stats import sem
from uncertainties import ufloat
import uncertainties.unumpy as unp
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
def Mean_Std(Werte):
s = 1/np.sqrt(len(Werte))
return ufloat(np.mean(Werte), s * np.std(Werte, ddof = 1))
# Wheatstone
Messun... | mit |
anandology/pyjamas | examples/mail/MailItems.py | 7 | 13333 | #import java.util.Vector;
from MailItem import MailItem
class MailItems:
NUM_ITEMS = 37
FRAGMENTS_PER_EMAIL = 10
senders = ["markboland05", "Hollie Voss", "boticario", "Emerson Milton", "Healy Colette", "Brigitte Cobb", "Elba Lockhart", "Claudio Engle", "Dena Pacheco", "Brasil s.pr", "Parker", "derbvktqsr... | apache-2.0 |
spennihana/h2o-3 | h2o-py/h2o/model/word_embedding.py | 4 | 2163 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict
from h2o.utils.compatibility import * # NOQA
from .model_base import ModelBase
from .metrics_base import * # NOQA
import h2o
from h2o.expr import ExprNode
class H2OWordEm... | apache-2.0 |
acsone/odoo | addons/crm_claim/report/__init__.py | 446 | 1080 | # -*- 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... | agpl-3.0 |
mckerrj/ansible | contrib/inventory/proxmox.py | 107 | 7764 | #!/usr/bin/env python
# Copyright (C) 2014 Mathieu GAUTHIER-LAFAYE <gauthierl@lapth.cnrs.fr>
#
# 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 op... | gpl-3.0 |
Fil0x/PyQt-Widgets | Widgets/Taskbar-popup.py | 1 | 9654 | import sys
from util import shorten_str
from PyQt4 import QtGui
from PyQt4 import QtCore
'''
ISSUE: if the list gets updated while the mouse is over an element,
it will be moved down but the click will still copy the share of that element.
'''
class ListViewModel(QtCore.QAbstractListModel):
def __init__(self, d... | mit |
tafaRU/odoo | addons/mail/wizard/mail_compose_message.py | 43 | 20065 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
DHSDevelopersClub/TutorialApp | server/libs/bs4/builder/_lxml.py | 446 | 8661 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
Parse... | gpl-2.0 |
codelikeagirlcny/python-lessons-cny | code-exercises-etc/playtime/lesson02_movies.py | 1 | 1950 | # Difficulty level: Advanced
# Goal #1: Create a program that will print out a list of movie titles and a set of ratings defined below into a particular format.
# First, choose any five movies you want.
# Next, look each movie up manually to find out four pieces of information:
# Their parental guidance rating (G, ... | mit |
dezynetechnologies/odoo | addons/event_sale/event_sale.py | 154 | 13721 | # -*- 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 |
HGladiator/MyCodes | Scrapy/douban/douban/spiders/doumailspider.py | 1 | 3557 | # -*- coding:utf-8 -*-
'''by sudo rm -rf http://imchenkun.com'''
import scrapy
from douban.items import DoubanMailItem
import urlparse
import requests
import time
import random
class MailSpider(scrapy.Spider):
name = 'doubanmail'
allowed_domains = ['accounts.douban.com', 'douban.com']
start_urls = [
... | mit |
Tuxdude/repobuddy | repobuddy/tests/main.py | 1 | 2091 | #
# Copyright (C) 2013 Ash (Tuxdude) <tuxdude.github@gmail.com>
#
# This file is part of repobuddy.
#
# 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/l... | apache-2.0 |
vismartltd/edx-platform | lms/djangoapps/open_ended_grading/tests.py | 1 | 21057 | """
Tests for open ended grading interfaces
./manage.py lms --settings test test lms/djangoapps/open_ended_grading
"""
import json
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import RequestFactory
from edxma... | agpl-3.0 |
ghackebeil/PyORAM | src/pyoram/encrypted_storage/encrypted_block_storage.py | 1 | 10855 | __all__ = ('EncryptedBlockStorage',)
import struct
import hmac
import hashlib
from pyoram.storage.block_storage import (BlockStorageInterface,
BlockStorageTypeFactory)
from pyoram.crypto.aes import AES
import six
class EncryptedBlockStorageInterface(BlockStorageInterface):
... | mit |
wcooley/neomodel | neomodel/index.py | 6 | 2160 | from .properties import AliasProperty
from .core import db
from .util import deprecated
class NodeIndexManager(object):
def __init__(self, node_class, index_name):
self.node_class = node_class
self.name = index_name
def _check_params(self, params):
"""checked args are indexed and conv... | mit |
swtp1v07/Savu | savu/test_runner.py | 2 | 2706 | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
frreiss/tensorflow-fred | tensorflow/python/ops/tensor_forest_ops.py | 29 | 3838 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
foodszhang/kbengine | kbe/res/scripts/common/Lib/lib2to3/fixes/fix_xrange.py | 198 | 2694 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes xrange(...) into range(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name, Call, consuming_calls
from .. import patcomp
class FixXrange(fixer_base.BaseFix):
BM_... | lgpl-3.0 |
cloudant/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Warnings.py | 61 | 6806 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | apache-2.0 |
sestrella/ansible | lib/ansible/plugins/terminal/junos.py | 38 | 1787 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/test/test_normalization.py | 1 | 3378 | from test.test_support import run_unittest, open_urlresource, TestSkipped
import unittest
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest" + os.extsep + "txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
... | mit |
rkmaddox/expyfun | examples/experiments/drawing_methods.py | 4 | 1662 | """
==========================
Experiment drawing methods
==========================
expyfun provides multiple methods for drawing simple screen objects.
"""
# Author: Eric Larson <larsoner@uw.edu>
#
# License: BSD (3-clause)
import numpy as np
from expyfun import visual, ExperimentController
import expyfun.analyze ... | bsd-3-clause |
glovebx/odoo | addons/mail/mail_message_subtype.py | 387 | 3094 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
nitzmahone/ansible | lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py | 16 | 11269 | #!/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 |
ryepdx/shipping_api | purchase.py | 1 | 1462 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is f... | agpl-3.0 |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/subprocess.py | 67 | 63971 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | lgpl-3.0 |
AlexOugh/horizon | openstack_dashboard/dashboards/project/data_processing/utils/neutron_support.py | 55 | 1192 | # Copyright (c) 2013 Mirantis 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 writ... | apache-2.0 |
ondra-novak/chromium.src | third_party/android_testrunner/errors.py | 171 | 1340 | #!/usr/bin/python2.4
#
#
# Copyright 2008, The Android Open Source Project
#
# 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 requir... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/django/db/backends/oracle/features.py | 47 | 2326 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.utils import InterfaceError
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
interprets_empty_strings_as_nulls = True
uses_savepoints = True
has_select_for_update = True
has_select_for_update_n... | gpl-3.0 |
siddhartharay007/buck | py/buck/zip/test_munger.py | 47 | 3242 | # Copyright 2015-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 |
aman-iitj/scipy | scipy/integrate/odepack.py | 47 | 7285 | # Author: Travis Oliphant
from __future__ import division, print_function, absolute_import
__all__ = ['odeint']
from . import _odepack
from copy import copy
import warnings
class ODEintWarning(Warning):
pass
_msgs = {2: "Integration successful.",
1: "Nothing was done; the integration time was 0.",
... | bsd-3-clause |
stefanw/django-cms | cms/south_migrations/0061_revers_id_unique.py | 63 | 17555 | # -*- 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 unique constraint on 'Page', fields ['reverse_id', 'site', 'publisher_is... | bsd-3-clause |
play113/swer | opencamlib-read-only/scripts/clsurf_1.py | 7 | 2482 | import ocl
import camvtk
import time
import vtk
import datetime
import math
import random
def drawVertex(myscreen, p, vertexColor, rad=0.1):
myscreen.addActor( camvtk.Sphere( center=(p.x,p.y,p.z), radius=rad, color=vertexColor ) )
def drawEdge(myscreen, e, edgeColor=camvtk.yellow):
p1 = e[0]
p2 = e[1]
... | mit |
mgrady3/pLEASE | source/experiment.py | 1 | 7036 | """
PLEASE - The Python Low-energy Electron Analysis SuitE.
Author: Maxwell Grady
Affiliation: University of New Hampshire Department of Physics Pohl group
Version 1.0.0
Date: May, 2017
Generic LEEM / LEED experiment object
Used for serializing experiment configuration data
"""
import os
import yaml
import pprint
pp =... | gpl-3.0 |
idekerlab/ci-service-template | ciservice/apiv1/queue/util_task.py | 1 | 1434 | # -*- coding: utf-8 -*-
import redis
import logging
import requests
from . import TAG_JOB_ID, TAG_STATUS
logging.basicConfig(level=logging.DEBUG)
class TaskUtil():
def __init__(self):
self.__redis_connection = redis.Redis('redis', 6379)
def delete_job(self, job_id):
"""Delete both job and i... | mit |
uukuguy/everdata | share/mmseg/script/char_table_build.py | 8 | 4727 | #/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import unicodedata
import re
import codecs
import os
# tag set
#tag-set:
#m: number
#e: non CJK char, e.g. English pinyin
#[unuse] t: time. 年号 干支等(此处识别出后,仅加入 oov ,不参与实际分词)
#c: CJK char.
#s: Symbol e.g. @
#w: Sentence seperator.
#x: unknown char.
... | mit |
chekunkov/scrapy | scrapy/utils/python.py | 14 | 8909 | """
This module contains essential stuff that should've come with Python itself ;)
It also contains functions (or functionality) which is in Python versions
higher than 2.5 which used to be the lowest version supported by Scrapy.
"""
import os
import re
import inspect
import weakref
import errno
import six
from funct... | bsd-3-clause |
bjoernricks/phell | phell/gpt.py | 1 | 7424 | # -*- coding: utf-8 -*-
#
# (c) 2016 Björn Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'phell' for details.
#
import uuid
from phell.utils import to_int, from_hex
class Gpt(object):
SIZE = 512
EFI_SIGNATURE = from_hex("4546492050415254")
EFI_REVISION = from_hex("00000100")... | mit |
dreamhost/os-maintenance-tools | bin/neutron_akanda_router_rebooter.py | 2 | 2611 | #!/usr/bin/env python
import ConfigParser
import os
import sys
config = ConfigParser.ConfigParser()
config.read(['os.cfg',
os.path.expanduser('~/.os.cfg'),
'/etc/os-maint/os.cfg'])
os_user_name = config.get('OPENSTACK', 'os_user_name')
os_password = config.get('OPENSTACK', 'os_password')
os_tenant_name = con... | apache-2.0 |
hengfanz/franztao.Algorithm.io | pythonLearn/designPattern/compositeEntityPattern.py | 1 | 1387 | '''
Created on Dec 2, 2017
@author: Taoheng
'''
class DependentObject1(object):
def setData(self,data):
self.__data=data
def getData(self):
return self.__data
class DependentObject2(object):
def setData(self,data):
self.__data=data
def getData(self):
... | lgpl-2.1 |
qilicun/python | python2/diveintopythonzh-cn-5.4b/roman/stage6/roman62.py | 8 | 2025 | """Convert to and from Roman numerals
This program is part of "Dive Into Python", a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
"""
__author__ = "Mark Pilgrim (mark@diveintopython.org)"
__version__ = "$Revision: 1.3 $"
__date__ = "$Date: 2004/05/05 21:57:20 ... | gpl-3.0 |
doganov/edx-platform | openedx/core/djangoapps/credentials/tests/mixins.py | 13 | 5825 | """Mixins for use during testing."""
import json
import httpretty
from openedx.core.djangoapps.credentials.models import CredentialsApiConfig
class CredentialsApiConfigMixin(object):
""" Utilities for working with Credentials configuration during testing."""
CREDENTIALS_DEFAULTS = {
'enabled': True... | agpl-3.0 |
jantman/awslimitchecker | awslimitchecker/tests/metrics/__init__.py | 1 | 1856 | """
awslimitchecker/tests/metrics/__init__.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
################################################################################
Copyright 2015-2019 Jason Antman <jason@jasonantman.com>
This file is part of awslimitche... | agpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/mako/codegen.py | 3 | 48874 | # mako/codegen.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module
source code."""
impo... | agpl-3.0 |
fbossy/SickRage | lib/hachoir_parser/audio/midi.py | 84 | 9168 | """
Musical Instrument Digital Interface (MIDI) audio file parser.
Documentation:
- Standard MIDI File Format, Dustin Caldwell (downloaded on wotsit.org)
Author: Victor Stinner
Creation: 27 december 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, Bits, ParserError,
String, U... | gpl-3.0 |
aleGpereira/libcloud | libcloud/test/storage/test_s3.py | 31 | 38702 | # 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 |
jboeuf/grpc | src/python/grpcio_tests/tests_aio/unit/_metadata_test.py | 1 | 4476 | # Copyright 2020 gRPC authors.
#
# 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... | apache-2.0 |
aclifton/cpeg853-gem5 | src/dev/BadDevice.py | 69 | 1789 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
dairiki/js.deform | js/deform/__init__.py | 1 | 4495 | # -*- coding: utf-8 -*-
from deform import Form, ValidationFailure
from fanstatic import Group
from fanstatic import Library
from fanstatic import Resource
from js.jquery import jquery
from js.jquery_form import jquery_form
from js.jquery_maskedinput import jquery_maskedinput
from js.jquery_maskmoney import jquery_mas... | bsd-3-clause |
thomasrogers03/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py | 118 | 7201 | # Copyright (C) 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 of conditions and the ... | bsd-3-clause |
4144414D/pytruecrypt | examples/dump.py | 1 | 1851 | # Truecrypt parsing library for Python by Gareth Owen
# https://github.com/drgowen/pytruecrypt/
# See LICENCE for licence details
# PyTruecrypt 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... | gpl-3.0 |
jscott1989/happening | src/members/migrations/0001_initial.py | 2 | 2599 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-02 18:36
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_pgjson.fields
class Migration(migrations.Migration):
initial = True
depende... | mit |
kanarelo/reportlab | src/reportlab/pdfgen/pdfimages.py | 31 | 8498 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/pdfimages.py
__version__=''' $Id$ '''
__doc__="""
Image functionality sliced out of canvas.py for generalization
"""
import os
import reportlab... | bsd-3-clause |
alangwansui/mtl_ordercenter | openerp/addons/purchase_requisition/wizard/__init__.py | 65 | 1092 | # -*- 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... | agpl-3.0 |
MwanzanFelipe/rockletonfortune | lib/django/contrib/contenttypes/management.py | 476 | 2521 | from django.apps import apps
from django.db import DEFAULT_DB_ALIAS, router
from django.utils import six
from django.utils.six.moves import input
def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs):
"""
Creates content types for models in the given app, removin... | bsd-3-clause |
nburn42/tensorflow | tensorflow/tools/common/public_api_test.py | 177 | 2636 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
abtreece/ansible | contrib/vault/vault-keyring.py | 35 | 2367 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>
#
# 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 Licens... | mit |
pombredanne/bitcurator | tools/py3fpdf/attic/Bookmark.py | 26 | 2017 | from FPDF import *
class Bookmark(FPDF):
def __init__(this,orientation='P',unit='mm',format='A4'):
FPDF.__init__(this,orientation,unit,format)
this.outlines=[]
this.OutlineRoot=None
def Bookmark(this,txt,level=0,y=0):
if(y==-1):
y=this.GetY()
this.outlines+=[{'t':txt,'l':level,'y':y,'p':this.PageNo()}]... | gpl-3.0 |
eawag-rdm/ckanapi | ckanapi/remoteckan.py | 3 | 4616 | try:
from urllib2 import Request, urlopen, HTTPError
from urlparse import urlparse
except ImportError:
from urllib.request import Request, urlopen, HTTPError
from urllib.parse import urlparse
from ckanapi.errors import CKANAPIError
from ckanapi.common import (ActionShortcut, prepare_action,
reverse... | mit |
neo4j/neo4j-python-driver | tests/unit/test_api.py | 1 | 15866 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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
#... | apache-2.0 |
wfxiang08/django178 | tests/reverse_single_related/tests.py | 34 | 1810 | from django.test import TestCase
from .models import Source, Item
class ReverseSingleRelatedTests(TestCase):
"""
Regression tests for an object that cannot access a single related
object due to a restrictive default manager.
"""
def test_reverse_single_related(self):
public_source = Sou... | bsd-3-clause |
jeenalee/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/base.py | 293 | 1831 | import base64
import logging
import os
import unittest
import urllib
import urllib2
import urlparse
import wptserve
logging.basicConfig()
here = os.path.split(__file__)[0]
doc_root = os.path.join(here, "docroot")
class Request(urllib2.Request):
def __init__(self, *args, **kwargs):
urllib2.Request.__init... | mpl-2.0 |
kartikp1995/gnuradio | grc/gui/Utils.py | 13 | 4400 | """
Copyright 2008-2011,2015 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) ... | gpl-3.0 |
LePastis/pyload | module/plugins/internal/XFSCrypter.py | 5 | 1939 | # -*- coding: utf-8 -*-
from module.plugins.internal.Plugin import set_cookie
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class XFSCrypter(SimpleCrypter):
__name__ = "XFSCrypter"
__type__ = "crypter"
__version__ = "0.13"
__status__ = "testing"
__pattern... | gpl-3.0 |
totorigolo/WiiQuizz | helpers/example_template.py | 1 | 2030 | # coding: utf8
from Dialog import Dialog
from WindowHelper import WindowHelper
win = WindowHelper.Instance()
dialog = Dialog.Instance()
dialog.new_message('success', "Hé salut toi ! :)")
win.new_page('Test fichier template', 960, 600, 'page_1', bg='white')
win.go_to('page_1')
# Font importantes
win.new_font('Arial... | gpl-2.0 |
kralf/morsel | python/lib/morsel/nodes/actuator.py | 1 | 2867 | from morsel.math import *
from object import Object
#-------------------------------------------------------------------------------
class Actuator(Object):
def __init__(self, actuated = None, limits = [], **kargs):
self._actuated = None
super(Actuator, self).__init__(**kargs)
self.actuated ... | gpl-2.0 |
seewindcn/tortoisehg | src/ext/dulwich/index.py | 8 | 17794 | # index.py -- File parser/writer for the git index file
# Copyright (C) 2008-2013 Jelmer Vernooij <jelmer@samba.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License ... | gpl-2.0 |
EnviroCentre/jython-upgrade | jython/lib/distutils/dep_util.py | 177 | 3509 | """distutils.dep_util
Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""
__revision__ = "$Id$"
import os
from stat import ST_MTIME
from distutils.errors import DistutilsFileError
def newer(source, target):
... | mit |
Changaco/oh-mainline | vendor/packages/mechanize/mechanize/_mozillacookiejar.py | 149 | 6321 | """Mozilla / Netscape cookie loading / saving.
Copyright 2002-2006 John J Lee <jjl@pobox.com>
Copyright 1997-1999 Gisle Aas (original libwww-perl code)
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 distri... | agpl-3.0 |
tersmitten/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_certificate_facts.py | 29 | 3228 | #!/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 |
yonglehou/git | git-p4.py | 124 | 125138 | #!/usr/bin/env python
#
# git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
#
# Author: Simon Hausmann <simon@lst.de>
# Copyright: 2007 Simon Hausmann <simon@lst.de>
# 2007 Trolltech ASA
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
#
import sys
if sys.he... | gpl-2.0 |
jirojo2/tuenti2014 | src/ch5.py | 1 | 3329 | #!/usr/bin/env python
# Tuenti Challenge 2014
# Jose Ignacio Rojo -josi-
# Fuente: http://en.wikipedia.org/wiki/Conway's_Game_of_Life
import fileinput
import copy
class Grid:
def __init__(self):
self.width = 8
self.height = 8
self.gen = 0
self.gens = []
self.v = [False] *... | mit |
TheWardoctor/Wardoctors-repo | plugin.video.saltsrd.lite/salts_lib/gui_utils.py | 7 | 9300 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | apache-2.0 |
abeikverdi/Bitcoin_2FA | Client/bitcoin/py3specials.py | 28 | 3448 | import sys, os
import binascii
import hashlib
if sys.version_info.major == 3:
string_types = (str)
string_or_bytes_types = (str, bytes)
int_types = (int, float)
# Base switching
code_strings = {
2: '01',
10: '0123456789',
16: '0123456789abcdef',
32: 'abcdefghijklmno... | mit |
rbalda/neural_ocr | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 1724 | 14031 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | mit |
Urvik08/ns3-gpcr | examples/wireless/examples-to-run.py | 99 | 1794 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... | gpl-2.0 |
AndreasWilliams/BotGravindo | src/scons-local-2.0.1/SCons/Node/Python.py | 61 | 4219 | """scons.Node.Python
Python nodes.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 w... | gpl-2.0 |
hbp-sanncs/pynnless | pynnless/pynnless.py | 1 | 53519 | # -*- coding: utf-8 -*-
# PyNNLess -- Yet Another PyNN Abstraction Layer
# Copyright (C) 2015 Andreas Stöckel
#
# 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... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.